Implement Tweet Preview Support
brndnblck opened this issue · 1 comments
brndnblck commented
Changes Needed:
- Implement TwitterAds::Tweet#preview
- Test Coverage
- Documentation
Related documentation:
https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/tweet/preview
https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/tweet/preview/%3Atweet_id
brndnblck commented
My recommendation is to build this out as:
- Create a new
TwitterAds::Tweet
class. - Add a class method
preview
onTwitterAds::Tweet
that takesstatus
andopts={}
as arguments. The optional params for GET /tweet/preview can be passed via theopts
param. - Add an instance method
preview
onTwitterAds::Tweet
that uses the current instance's@id
and takesopts={}
as optional arguments as well. This can use the GET /tweet/preview/:id version of the tweet preview. - Both versions of
preview
can just return theResponse#body[:data]
contents.
Happy to discuss more and totally open to alternate approaches. I can also point you toward some similar / relevant bits of code in the SDK if you need it.
Feel free to ask questions!