code: def get_service_packages(self):
          
          api = self._get_api(billing.DefaultApi)
          package_response = api.get_service_packages()
          packages = []
          for state in PACKAGE_STATES:
              # iterate states in order
              items = getattr(package_response, state) or []
              for item in ensure_listable(items):
                  params = item.to_dict()
                  params['state'] = state
                  packages.append(ServicePackage(params))
          return packages
docs: Get all service packages