Skip to content

Conversation

juanshishido
Copy link
Contributor

  • change API_VERSION to 2
  • add VideoWebsiteCard class
  • add video_website_cards method under the Account class

"""
return self._load_resource(MediaCreative, id, **kwargs)

def video_website_cards(self, id=None, **kwargs):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is needed because the other card formats also use just the RESOURCE_COLLECTION?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that including this under the Account class let's us retrieve the video website cards that belong to the particular account.

For example:

In [3]: client = Client(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
   ...: account = client.accounts(ACCOUNT_ID)
   ...: 

In [4]: vwcs = account.video_website_cards()

In [5]: type(vwcs)
Out[5]: twitter_ads.cursor.Cursor

In [6]: vwcs.first.id
Out[6]: u'455hx'

In [7]: vwcs.first.card_uri
Out[7]: u'card://860983079292198912'

In [8]: vwcs.first.card_type
Out[8]: u'VIDEO_WEBSITE'

You can do this type of thing for any method (entity) defined under the Account class.

Copy link
Contributor

@tushdante tushdante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@juanshishido juanshishido merged commit 9e3cb9f into xdevplatform:master Nov 14, 2017
@juanshishido juanshishido deleted the v2-add-video_website_card branch November 14, 2017 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants