def get_reports_by_consumer(self, consumer_id, accept, content_type):
        """Does a GET request to /decisioning/v1/consumers/{consumerId}/reports.

        Get a list of reports that have been generated for the given
        consumer.
        The status fields in the returned list will contain inProgress,
        failure, or success. If a status shows inProgress, wait 20 seconds and
        then call again.

        Args:
            consumer_id (string): Finicity’s ID of the consumer (UUID with max
                length 32 characters)
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred

        Returns:
            ReportSummaries: Response from the API. OK

        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.

        """

        # Validate required parameters
        self.validate_parameters(consumer_id=consumer_id,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v1/consumers/{consumerId}/reports'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'consumerId': consumer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body,
                                          ReportSummaries.from_dictionary)
コード例 #2
0
    def get_consumer(self, consumer_id, accept, content_type):
        """Does a GET request to /decisioning/v1/consumers/{consumerId}.

        Get the details of a consumer record. If the service successfully
        retrieves the consumer record, HTTP 200 will be returned. If the
        consumer does not exist, the service will return HTTP 404.

        Args:
            consumer_id (string): Finicity’s ID of the consumer (UUID with max
                length 32 characters)
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred

        Returns:
            Consumer: Response from the API. Success

        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.

        """

        # Validate required parameters
        self.validate_parameters(consumer_id=consumer_id,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v1/consumers/{consumerId}'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'consumerId': consumer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 404:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body,
                                          Consumer.from_dictionary)
コード例 #3
0
    def refresh_voie_payroll_report(self,
                                    customer_id,
                                    accept,
                                    content_type,
                                    body,
                                    callback_url=None):
        """Does a POST request to /decisioning/v2/customers/{customerId}/voiePayrollProvider.

        The VOIE – Payroll report generates when the customer completes
        Connect. Lenders, who commonly use this report for pre-close
        verification employment check, can refresh this report by passing the
        consumer’s SSN, DOB, and the `reportId` from the first VOIE – Payroll
        report they received.
         
        We’ll refresh this report and update any new pay histories since the
        first report generated, including borrower’s employment status as
        active or not.
         
        Note: Lenders can only refresh this report one time in a 60-day period
        starting from the date of the first report. Any further report
        refreshes will incur additional charges.
         
        The service immediately returns the status HTTP 202 (accepted). A
        notification gets sent to the report callback URL, if specified.
         
        After the call is made, the client’s application can wait for a
        notification sent by the Report Listener Service. Or it may enter a
        loop, which waits about 20 seconds and then calls the service, Get
        Report to check if the report is finished.
         
        While the report’s generating, Get Report returns a minimal report
        with a status of InProgress.  The loop repeats every 20 seconds until
        Get Report returns a different status.

        Args:
            customer_id (long|int): Finicity ID for the customer
            accept (string): application/json
            content_type (string): application/json
            body (VOIEPayrollReportRefreshConstraints): TODO: type description
                here. Example: 
            callback_url (string, optional): The Report Listener URL to
                receive notifications (optional, must be URL-encoded).

        Returns:
            RefreshVOIEPayrollReportResponse: Response from the API. Accepted

        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.

        """

        # Validate required parameters
        self.validate_parameters(customer_id=customer_id,
                                 accept=accept,
                                 content_type=content_type,
                                 body=body)

        # Prepare query URL
        _url_path = '/decisioning/v2/customers/{customerId}/voiePayrollProvider'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'customerId': customer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'callbackUrl': callback_url}
        _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 = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            RefreshVOIEPayrollReportResponse.from_dictionary)
コード例 #4
0
    def generate_pay_statement_report(self,
                                      customer_id,
                                      accept,
                                      content_type,
                                      body,
                                      callback_url=None):
        """Does a POST request to /decisioning/v2/customers/{customerId}/payStatement.

        Generate Pay Statement Extraction Report for the given customer. This
        service accepts asset IDs of the stored pay statements to generate a
        Pay Statement Extraction Report. 
        This is a premium service. The billing rate is the variable rate for
        Pay Statement Extraction Report under the current subscription plan.
        The billable event is the successful generation of a Pay Statement
        Extraction Report.
        The service returns immediately with status HTTP 202 (Accepted) if
        successful. When finished, a notification will be sent to the
        specified report callback URL, if specified.
        After making this call, the client app may wait for a notification to
        be sent to the Report Listener Service, or it may enter a loop, which
        should wait 20 seconds and then call the service Get Report to see if
        the report is finished. While the report is being generated, Get
        Report will return a minimal report including status inProgress. The
        loop should repeat every 20 seconds until Get Report returns a
        different status.
        The service will return HTTP 400 (Bad Request) if the asset ID does
        not exist within Finicity?s system.

        Args:
            customer_id (long|int): Finicity ID of the customer
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred
            body (PayStatementConstraints): TODO: type description here.
                Example: 
            callback_url (string, optional): The Report Listener URL to
                receive notifications (optional, must be URL-encoded).

        Returns:
            GeneratePayStatementReportResponse: Response from the API.
                Accepted

        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.

        """

        # Validate required parameters
        self.validate_parameters(customer_id=customer_id,
                                 accept=accept,
                                 content_type=content_type,
                                 body=body)

        # Prepare query URL
        _url_path = '/decisioning/v2/customers/{customerId}/payStatement'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'customerId': customer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'callbackUrl': callback_url}
        _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 = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            GeneratePayStatementReportResponse.from_dictionary)
コード例 #5
0
    def generate_voi_report(self,
                            customer_id,
                            accept,
                            content_type,
                            callback_url=None,
                            body=None):
        """Does a POST request to /decisioning/v2/customers/{customerId}/voi.

        Generate a Verification of Income (VOI) report for all checking,
        savings, and money market accounts for the given customer. This
        service retrieves up to two years of transaction history for each
        account and uses this information to generate the VOI report.
        This is a premium service. The billing rate is the variable rate for
        Verification of Income under the current subscription plan. The
        billable event is the successful generation of a VOI report.
        HTTP status of 202 (Accepted) means the report is being generated.
        When the report is finished, a notification will be sent to the
        specified report callback URL, if specified.
        If no account of type of checking, savings, or money market is found,
        the service will return HTTP 400 (Bad Request).

        Args:
            customer_id (long|int): Finicity ID for the customer
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred
            callback_url (string, optional): The Report Listener URL to
                receive notifications (optional, must be URL-encoded).
            body (RequestConstraints, optional): TODO: type description here.
                Example: 

        Returns:
            GenerateVOIReportResponse: Response from the API. Accepted

        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.

        """

        # Validate required parameters
        self.validate_parameters(customer_id=customer_id,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v2/customers/{customerId}/voi'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'customerId': customer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'callbackUrl': callback_url}
        _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 = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            GenerateVOIReportResponse.from_dictionary)
コード例 #6
0
    def generate_asset_summary_report(self,
                                      customer_id,
                                      accept,
                                      content_type,
                                      callback_url=None,
                                      body=None):
        """Does a POST request to /decisioning/v2/customers/{customerId}/assetSummary.

        Generate Asset Summary report (assetSummary) for all checking,
        savings, money market, and investment accounts for the given customer.
        This service retrieves account and owner information as well as the
        number of NSFs for any account that is a checking account for the
        customer. 
        This is a premium service. The billing rate is billed per report for
        the Asset Summary report. 
        After making this call, the client app may wait for a notification to
        be sent to the Report Listener Service, or it may enter a loop, which
        should wait 20 seconds and then call the service Get Report to see if
        the report is finished. While the report is being generated, Get
        Report will return a minimal report with status inProgress. The loop
        should repeat every 20 seconds until Get Report returns a different
        status.
        If using the listener service, the following format must be followed
        and the webhook must respond to the Finicity API with a 200 series
        code:
        https://api.finicity.com/decisioning/v2/customers/[customerId]/assetSum
        mary?callbackUrl=[webhookUrl]
        HTTP status of 202 (Accepted) means the report is being generated.
        When the report is finished, a notification will be sent to the
        specified report callback URL, if specified.
        If no account type of checking, savings, money market, or investment
        is found, the service will return HTTP 400 (Bad Request).

        Args:
            customer_id (long|int): Finicity's ID of the customer
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred
            callback_url (string, optional): The Report Listener URL to
                receive notifications (optional, must be URL-encoded).
            body (RequestConstraints, optional): TODO: type description here.
                Example: 

        Returns:
            GenerateAssetSummaryReportResponse: Response from the API.
                Accepted

        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.

        """

        # Validate required parameters
        self.validate_parameters(customer_id=customer_id,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v2/customers/{customerId}/assetSummary'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'customerId': customer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'callbackUrl': callback_url}
        _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 = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            GenerateAssetSummaryReportResponse.from_dictionary)
コード例 #7
0
    def generate_voa_with_income_report(self,
                                        customer_id,
                                        accept,
                                        content_type,
                                        callback_url=None,
                                        from_date=None,
                                        body=None):
        """Does a POST request to /decisioning/v2/customers/{customerId}/voaHistory.

        Generate a Verification of Assets with GSE Income View (VOAHistory)
        report for all checking, savings, money market, and investment
        accounts for the given customer. This service retrieves up to 24
        months of transaction history for each account and uses this
        information to generate the VOAHistory report.
        This is a premium service. The billing rate is the variable rate for
        Verification of Assets under the current subscription plan. The
        billable event is the successful generation of a VOAhistory report.
        A report consumer must be created for the given customer before
        calling Generate VOAHistory Report (see Report Consumers).
        After making this call, the client app may wait for a notification to
        be sent to the Report Listener Service, or it may enter a loop, which
        should wait 20 seconds and then call the service Get Report to see if
        the report is finished. While the report is being generated, Get
        Report will return a minimal report with status inProgress. The loop
        should repeat every 20 seconds until Get Report returns a different
        status.
        If using the listener service, the following format must be followed
        and the webhook must respond to the Finicity API with a 200 series
        code:
        https://api.finicity.com/decisioning/v2/customers/[customerId]/voaHisto
        ry?callbackUrl=[webhookUrl]
        HTTP status of 202 (Accepted) means the report is being generated.
        When the report is finished, a notification will be sent to the
        specified report callback URL, if specified.
        If no account of type of checking, savings, money market, or
        investment is found, the service will return HTTP 400 (Bad Request).

        Args:
            customer_id (long|int): Finicity Id of the customer
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred
            callback_url (string, optional): The Report Listener URL to
                receive notifications (optional, must be URL-encoded).
            from_date (long|int, optional): The fromDate parameter is an Epoch
                Timestamp (in seconds), such as ?1494449017?. Without this
                parameter, the report defaults to 61 days if available. This
                will limit the amount of credit and debit transactions
                included in the report up to the date specified, but will not
                limit the amount of income stream transactions. The income
                stream transactions are all included, up to 24 months, to help
                the lender and GSE's have the full history to validate income.
                Example: ?fromDate={fromDate}If included, the epoch timestamp
                should be 10 digits long and be within two years of the
                present day. Extending the epoch timestamp beyond 10 digits
                will default back to 2 years of data. This query is optional.
            body (RequestConstraints, optional): TODO: type description here.
                Example: 

        Returns:
            GenerateVOAWithIncomeReportResponse: Response from the API.
                Accepted

        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.

        """

        # Validate required parameters
        self.validate_parameters(customer_id=customer_id,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v2/customers/{customerId}/voaHistory'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'customerId': customer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {
            'callbackUrl': callback_url,
            'fromDate': from_date
        }
        _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 = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            GenerateVOAWithIncomeReportResponse.from_dictionary)
    def get_voie_payroll_report_by_consumer(self,
                                            consumer_id,
                                            report_id,
                                            purpose,
                                            accept,
                                            content_type,
                                            on_behalf_of=None):
        """Does a GET request to /decisioning/v3/consumers/{consumerId}/reports/{reportId}.

        Get a report that has been generated by calling one of the Generate
        Report services.
        The report's status field will contain inProgress, failure, or
        success. If the status shows inProgress, the client app should wait 20
        seconds and then call again to see if the report is finished.
        See Permissible Purpose Codes for a list of permissible purposes for
        retrieving a report.

        Args:
            consumer_id (string): Finicity’s ID of the consumer (UUID with max
                length 32 characters)
            report_id (string): Finicity’s ID of the report
            purpose (string): 2-digit code from Permissible Purpose Codes,
                specifying the reason for retrieving this report.
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred
            on_behalf_of (string, optional): The name of the entity you are
                retrieving the report on behalf of.

        Returns:
            VOIEPayrollReportRecord: Response from the API. OK

        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.

        """

        # Validate required parameters
        self.validate_parameters(consumer_id=consumer_id,
                                 report_id=report_id,
                                 purpose=purpose,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v3/consumers/{consumerId}/reports/{reportId}'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {
                'consumerId': consumer_id,
                'reportId': report_id
            })
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_parameters = {'purpose': purpose, 'onBehalfOf': on_behalf_of}
        _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 = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            VOIEPayrollReportRecord.from_dictionary)
コード例 #9
0
    def get_portfolio_by_customer(self, customer_id, portfolio_id, accept,
                                  content_type):
        """Does a GET request to /decisioning/v1/customers/{customerId}/portfolios/{portfolioId}.

        Returns a portfolio of most recently generated report for each report
        type for a specified customer. If there are multiple reports that were
        generated for a report type (VOA, VOI, etc), only the most recently
        generated report for the type will be returned.  
         
        HTTP 404 status means that there is no data for the customer or
        portfolio. HTTP 200 (OK) status means that the call was successful. 

        Args:
            customer_id (long|int): Finicity ID of the customer
            portfolio_id (string): Finicity portfolio ID (Max 17 characters)
                with the portfolio version number. Using the portfolio number
                without a version number will return the most recently
                generated reports for the consumer.
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred

        Returns:
            PortfolioSummaryByCustomer: Response from the API. OK

        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.

        """

        # Validate required parameters
        self.validate_parameters(customer_id=customer_id,
                                 portfolio_id=portfolio_id,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v1/customers/{customerId}/portfolios/{portfolioId}'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {
                'customerId': customer_id,
                'portfolioId': portfolio_id
            })
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 400:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            PortfolioSummaryByCustomer.from_dictionary)
コード例 #10
0
    def create_consumer(self, customer_id, body, accept, content_type):
        """Does a POST request to /decisioning/v1/customers/{customerId}/consumer.

        Create a consumer record associated with the given customer. A
        consumer persists as the owner of any reports that are generated, even
        after the original customer is deleted from the system. A consumer
        must be created for the given customer before calling any of the
        Generate Report services.
        If a consumer already exists for this customer, this service will
        return HTTP 409 (Conflict). If the consumer is successfully created,
        the service will return HTTP 201 (Created).

        Args:
            customer_id (long|int): Finicity’s ID for the customer
            body (CreateConsumerRequest): TODO: type description here.
                Example: 
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred

        Returns:
            CreateConsumerResponse: Response from the API. Created

        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.

        """

        # Validate required parameters
        self.validate_parameters(customer_id=customer_id,
                                 body=body,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v1/customers/{customerId}/consumer'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'customerId': customer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 404:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body, CreateConsumerResponse.from_dictionary)
コード例 #11
0
    def modify_consumer(self, consumer_id, body, accept, content_type):
        """Does a PUT request to /decisioning/v1/consumers/{consumerId}.

        Modify the details for an existing consumer. All fields are required
        for a consumer record, but individual fields for this call are
        optional because fields that are not specified will be left
        unchanged.
        If the service is successful, HTTP 204 (No Content) will be returned.
        If the consumer does not exist, the service will return HTTP 404.

        Args:
            consumer_id (string): Finicity ID of the consumer (UUID with max
                length 32 characters)
            body (ModifyConsumerRequest): Consumer details
            accept (string): Replace 'json' with 'xml' if preferred
            content_type (string): Replace 'json' with 'xml' if preferred

        Returns:
            void: Response from the API. No Content

        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.

        """

        # Validate required parameters
        self.validate_parameters(consumer_id=consumer_id,
                                 body=body,
                                 accept=accept,
                                 content_type=content_type)

        # Prepare query URL
        _url_path = '/decisioning/v1/consumers/{consumerId}'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'consumerId': consumer_id})
        _query_builder = Configuration.get_base_uri()
        _query_builder += _url_path
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'Finicity-App-Key': Configuration.finicity_app_key,
            'Accept': accept,
            'Content-Type': content_type
        }

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

        # Endpoint and global error handling using HTTP status codes.
        if _context.response.status_code == 404:
            raise Error1ErrorException('Bad Request', _context)
        self.validate_response(_context)