def execute(self):
        """Execute the command."""
        try:
            if self.upstream:
                if self.options['listings'] is True:
                    listing.upload(self.client, self.source_directory)
                    self.client.commit()
                if self.options['images'] is True:
                    image.upload(self.client, self.source_directory)
                    self.client.commit()
                if self.options['inapp'] is True:
                    inapp_product.upload(self.client, self.source_directory)
            else:
                if self.options['listings'] is True:
                    listing.download(self.client, self.source_directory)
                if self.options['images'] is True:
                    image.download(self.client, self.source_directory)
                if self.options['inapp'] is True:
                    inapp_product.download(self.client, self.source_directory)

        except client.AccessTokenRefreshError:
            print(
                'The credentials have been revoked or expired, please re-run'
                'the application to re-authorize')