From 4a18b41d70a8a8d8fc6996e2eba48d93ec7c5459 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 19 Feb 2021 18:40:57 -0600 Subject: [PATCH] Add and use documented parameters Add and use additional_owners, file, filename, and media_category documented parameters --- docs/api.rst | 39 ++++++++++----------------------------- docs/parameters.rst | 4 ++++ 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index e2a4810..542ae0a 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -217,8 +217,7 @@ Status methods user's status. Statuses that are duplicates or too long will be silently ignored. - :param filename: The filename of the image to upload. This will - automatically be opened unless `file` is specified + :param filename: |filename| :param status: The text of your status update. :param in_reply_to_status_id: The ID of an existing status that the update is in reply to. @@ -230,9 +229,7 @@ Status methods ignores this parameter. :param place_id: Twitter ID of location which is listed in the Tweet if geolocation is enabled for the user. - :param file: A file object, which will be used instead of opening - `filename`. `filename` is still required, for MIME type - detection and to use as a form field in the POST data + :param file: |file| :rtype: :class:`Status` object @@ -1327,21 +1324,13 @@ Media methods Use this endpoint to upload images to Twitter. This automatically uses the chunked upload endpoint for videos. - :param filename: The filename of the image to upload. This will - automatically be opened unless ``file`` is specified. - :param file: A file object, which will be used instead of opening - ``filename``. ``filename`` is still required, for MIME type - detection and to use as a form field in the POST data. + :param filename: |filename| + :param file: |file| :param chunked: Whether or not to use chunked media upload. Videos use chunked upload regardless of this parameter. Defaults to False. - :param media_category: The category that represents how the media will be - used. This field is required when using the media - with the Ads API. - :param additional_owners: A list of user IDs to set as additional owners - allowed to use the returned ``media_id`` in Tweet - or Cards. Up to 100 additional owners may be - specified. + :param media_category: |media_category| + :param additional_owners: |additional_owners| :rtype: :class:`Media` object @@ -1352,18 +1341,10 @@ Media methods Use this endpoint to upload images to Twitter. This does not use the chunked upload endpoint. - :param filename: The filename of the image to upload. This will - automatically be opened unless ``file`` is specified. - :param file: A file object, which will be used instead of opening - ``filename``. ``filename`` is still required, for MIME type - detection and to use as a form field in the POST data. - :param media_category: The category that represents how the media will be - used. This field is required when using the media - with the Ads API. - :param additional_owners: A list of user IDs to set as additional owners - allowed to use the returned ``media_id`` in Tweet - or Cards. Up to 100 additional owners may be - specified. + :param filename: |filename| + :param file: |file| + :param media_category: |media_category| + :param additional_owners: |additional_owners| :rtype: :class:`Media` object diff --git a/docs/parameters.rst b/docs/parameters.rst index 2b36f14..6240053 100644 --- a/docs/parameters.rst +++ b/docs/parameters.rst @@ -1,10 +1,13 @@ .. API parameters: +.. |additional_owners| replace:: A list of user IDs to set as additional owners allowed to use the returned ``media_id`` in Tweet or Cards. Up to 100 additional owners may be specified. .. |count| replace:: The number of results to try and retrieve per page. .. |cursor| replace:: Breaks the results into pages. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. .. |date| replace:: Permits specifying a start date for the report. The date should be formatted YYYY-MM-DD. .. |exclude| replace:: Setting this equal to hashtags will remove all hashtags from the trends list. .. |exclude_replies| replace:: This parameter will prevent replies from appearing in the returned timeline. Using ``exclude_replies`` with the ``count`` parameter will mean you will receive up-to count Tweets — this is because the ``count`` parameter retrieves that many Tweets before filtering out retweets and replies. +.. |file| replace:: A file object, which will be used instead of opening ``filename``. ``filename`` is still required, for MIME type detection and to use as a form field in the POST data. +.. |filename| replace:: The filename of the image to upload. This will automatically be opened unless ``file`` is specified. .. |full_text| replace:: A boolean indicating whether or not the full text of a message should be returned. If False the message text returned will be truncated to 140 chars. Defaults to False. .. |include_card_uri| replace:: A boolean indicating if the retrieved Tweet should include a card_uri attribute when there is an ads card attached to the Tweet and when that card was attached using the card_uri value. .. |include_entities| replace:: The entities node will not be included when set to false. Defaults to true. @@ -13,6 +16,7 @@ .. |list_id| replace:: The numerical id of the list. .. |list_mode| replace:: Whether your list is public or private. Values can be public or private. Lists are public by default if no mode is specified. .. |list_owner| replace:: the screen name of the owner of the list +.. |media_category| replace:: The category that represents how the media will be used. This field is required when using the media with the Ads API. .. |max_id| replace:: Returns only statuses with an ID less than (that is, older than) or equal to the specified ID. .. |owner_id| replace:: The user ID of the user who owns the list being requested by a slug. .. |owner_screen_name| replace:: The screen name of the user who owns the list being requested by a slug. -- 2.25.1