def update_savings_goal_data(self) -> None:
        """Get the latest savings goal information for the account."""
        response = get(
            _url(
                "/account/{0}/savings-goals".format(self._account_uid),
                self._sandbox
            ),
            headers=self._auth_headers
        )
        response.raise_for_status()

        response = response.json()
        response_savings_goals = response.get('savingsGoalList', {})

        returned_uids = []

        # New / Update
        for goal in response_savings_goals:
            uid = goal.get('savingsGoalUid')
            returned_uids.append(uid)

            # Intiialise new _SavingsGoal object if new
            if uid not in self.savings_goals:
                self.savings_goals[uid] = SavingsGoal(
                    self._auth_headers,
                    self._sandbox,
                    self._account_uid
                )

            self.savings_goals[uid].update(goal)

        # Forget about savings goals if the UID isn't returned by Starling
        for uid in list(self.savings_goals):
            if uid not in returned_uids:
                self.savings_goals.pop(uid)
def update_savings_goal_data ( self ) -> None : response = get ( _url ( "/account/{0}/savings-goals" . format ( self . _account_uid ) , self . _sandbox ) , headers = self . _auth_headers ) response . raise_for_status ( ) response = response . json ( ) response_savings_goals = response . get ( 'savingsGoalList' , { } ) returned_uids = [ ] for goal in response_savings_goals : uid = goal . get ( 'savingsGoalUid' ) returned_uids . append ( uid ) if uid not in self . savings_goals : self . savings_goals [ uid ] = SavingsGoal ( self . _auth_headers , self . _sandbox , self . _account_uid ) self . savings_goals [ uid ] . update ( goal ) for uid in list ( self . savings_goals ) : if uid not in returned_uids : self . savings_goals . pop ( uid )
Get the latest savings goal information for the account.