Ponytech / appstoreconnectapi

Python wrapper around Apple App Store Api
https://ponytech.net/projects/app-store-connect
MIT License
159 stars 74 forks source link

Error when using APP api #20

Open SebaRossi94 opened 4 years ago

SebaRossi94 commented 4 years ago

Helllo i've been trying to create a template with some info for all my published apps. I wanted to include:

So i coded the following:

ios_api = Api(key_id = KEY_ID, key_file = APPSTORECONNECT_KEY_PATH, issuer_id = ISSUER_ID)
apps = ios_api.list_apps(sort = "name")
for app in apps:
    print(app.appStoreVersions())
    for version in app.appStoreVersions():
        print(version)

which returns the following output

Iterator over Resource resource
Traceback (most recent call last):
  File "appstoreconnect-test.py", line 23, in <module>
    for version in app.appStoreVersions():
  File "C:\Users\Seba\.virtualenvs\google-console-api-CfTql0CN\lib\site-packages\appstoreconnect\api.py", line 161, in __next__
    return Resource(data, self.api)
TypeError: Can't instantiate abstract class Resource with abstract methods endpoint

It seems that the Build class doesn't have the atribute added, and so it happens with several other classes, am i correct? or is it that i'm doing something wrong?

Thanks in advance

ppawlak commented 4 years ago

It seems that the Build class doesn't have the atribute added, and so it happens with several other classes, am i correct? or is it that i'm doing something wrong?

You're right. I'll try to fix this as soon as possible.

ppawlak commented 4 years ago

Hello,

I have been investigating this error more carefully and actually it happens because the AppStoreVersion resource you want to access is new (in App Store Connect API 1.2) and not yet supported by this library.

cf: https://developer.apple.com/documentation/appstoreconnectapi/appstoreversion

Sorry for the rather long delay getting into this and I'll try to add all the 1.2 changes as soon as I can but there are a few of them : https://developer.apple.com/documentation/appstoreconnectapi?changes=latest_major