Skip to content

Commit

Permalink
update creator, group, and user docs
Browse files Browse the repository at this point in the history
  • Loading branch information
treeben77 committed Jul 20, 2023
1 parent 928e373 commit 2f904fb
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 64 deletions.
52 changes: 33 additions & 19 deletions docs/source/creator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Creator

.. class:: Creator()

Class for interacting with the API to upload assets to a user or group.
Represents an object that can upload assets, usually a user or a group.

.. versionadded:: 1.1

Expand All @@ -21,7 +21,20 @@ Creator

.. method:: upload_asset(file, asset_type, name, description, expected_robux_price=0)

Uploads an asset onto Roblox.
Uploads the file onto roblox as an asset with the provided name and description. It will return :class:`rblx-open-cloud.Asset` if the asset is processed instantly, otherwise it will return :class:`rblx-open-cloud.PendingAsset`. The following asset types and file formats are accepted:

.. list-table::
:widths: 50 50
:header-rows: 1

* - Asset Type
- File Formats
* - :attr:`rblx-open-cloud.AssetType.Decal`
- ``.png``, ``.jpeg``, ``.bmp``, ``.tga``
* - :attr:`rblx-open-cloud.AssetType.Audio`
- ``.mp3``, ``.ogg``
* - :attr:`rblx-open-cloud.AssetType.Model`
- ``.fbx``

The ``asset:read`` and ``asset:write`` scopes are required if authorized via `OAuth2 </oauth2>`__.

Expand All @@ -32,7 +45,7 @@ Creator
:param rblx-open-cloud.AssetType asset_type: The type of asset you're uploading.
:param str name: The name of your asset.
:param str description: The description of your asset.
:param str expected_robux_price: The amount of robux expected to upload. Fails if lower than actual price.
:param int expected_robux_price: The amount of robux expected to upload. Fails if lower than actual price.

:returns: Union[:class:`rblx-open-cloud.Asset`, :class:`rblx-open-cloud.PendingAsset`]
:raises rblx-open-cloud.InvalidAsset: The file is not a supported, or is corrupted
Expand All @@ -44,17 +57,22 @@ Creator

.. danger::

Assets uploaded with Open Cloud can still get your account banned if they're inappropriate.
Assets uploaded with Open Cloud can still get your account moderated if they break the Terms of Service.

For OAuth2 applications, please read `this post by Hooksmith <https://devforum.roblox.com/t/public-beta-building-your-applications-with-oauth-20/2401354/36>`__.

.. note::

Only ``Decal``, ``Audio``, and ``Model`` (as ``fbx``) are supported right now.

.. method:: update_asset(asset_id, file)

Updates an existing asset on Roblox.
Updates the file for an existing assest on Roblox. It will return :class:`rblx-open-cloud.Asset` if the asset is processed instantly, otherwise it will return :class:`rblx-open-cloud.PendingAsset`. The following asset types and file formats can be updated:

.. list-table::
:widths: 50 50
:header-rows: 1

* - Asset Type
- File Formats
* - :attr:`rblx-open-cloud.AssetType.Model`
- ``.fbx``

The ``asset:read`` and ``asset:write`` scopes are required if authorized via `OAuth2 </oauth2>`__.

Expand All @@ -74,17 +92,13 @@ Creator

.. danger::

Assets uploaded with Open Cloud can still get your account banned if they're inappropriate.
Assets uploaded with Open Cloud can still get your account moderated if they break the Terms of Service.

For OAuth2 applications, please read `this post by Hooksmith <https://devforum.roblox.com/t/public-beta-building-your-applications-with-oauth-20/2401354/36>`__.

.. note::

Only ``Model`` (as ``fbx``) can be updated right now.

.. class:: Asset()

Contains data about an asset, such as it's id, name, and type.
Represents an processed asset uploaded to Roblox.

.. versionadded:: 1.1

Expand Down Expand Up @@ -136,7 +150,7 @@ Creator

.. class:: PendingAsset()

Class for assets which aren't processed yet.
Represents an asset uploaded to Roblox, but hasn't been processed yet.

.. versionadded:: 1.1

Expand All @@ -146,7 +160,7 @@ Creator

.. method:: fetch_operation()

Fetches the asset info, if completed processing.
Checks if the asset has finished proccessing, if so returns the :class:`rblx-open-cloud.Asset` object.

:returns: Optional[:class:`rblx-open-cloud.Asset`]
:raises rblx-open-cloud.InvalidKey: The token is invalid or doesn't have sufficent permissions to read and write assets.
Expand All @@ -166,12 +180,12 @@ Creator

.. attribute:: Decal

An decal asset type
A decal asset type

.. attribute:: Audio

An audio asset type

.. attribute:: Model

An model asset type (fbx)
A model asset type (fbx)
48 changes: 31 additions & 17 deletions docs/source/group.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,41 @@ Group

.. class:: Group()

Class for interacting with the API for a specific group.
Represents a group on Roblox. For now this is only used for uploading assets, but in the future you'll be able to manage other aspects of a group.

.. versionadded:: 1.1

:param int id: A group ID. It appears in the group URL
:param str api_key: An API key created from `Creator Dashboard <https://create.roblox.com/credentials>`__. *this should be kept safe, as anyone with the key can use it!*
:param int id: The group's ID.
:param str api_key: Your API key created from `Creator Dashboard <https://create.roblox.com/credentials>`__ with access to this group.

.. attribute:: id

The group's ID
The Group's ID

:type: int

.. method:: upload_asset(file, asset_type, name, description, expected_robux_price=0)

Uploads an asset onto Roblox.
Uploads the file onto roblox as an asset with the provided name and description. It will return :class:`rblx-open-cloud.Asset` if the asset is processed instantly, otherwise it will return :class:`rblx-open-cloud.PendingAsset`. The following asset types and file formats are accepted:

.. list-table::
:widths: 50 50
:header-rows: 1

* - Asset Type
- File Formats
* - :attr:`rblx-open-cloud.AssetType.Decal`
- ``.png``, ``.jpeg``, ``.bmp``, ``.tga``
* - :attr:`rblx-open-cloud.AssetType.Audio`
- ``.mp3``, ``.ogg``
* - :attr:`rblx-open-cloud.AssetType.Model`
- ``.fbx``

The ``asset:read`` and ``asset:write`` scopes are required if authorized via `OAuth2 </oauth2>`__.

.. versionchanged:: 1.3
It can now raise :class:`rblx-open-cloud.ModeratedText` if the name or description is invalid. It used to raise :class:`rblx-open-cloud.InvalidAsset`.

:param io.BytesIO file: The file opened in bytes to be uploaded.
:param rblx-open-cloud.AssetType asset_type: The type of asset you're uploading.
:param str name: The name of your asset.
Expand All @@ -43,17 +56,22 @@ Group

.. danger::

Assets uploaded with Open Cloud can still get your account banned if they're inappropriate.
Assets uploaded with Open Cloud can still get your account moderated if they break the Terms of Service.

For OAuth2 applications, please read `this post by Hooksmith <https://devforum.roblox.com/t/public-beta-building-your-applications-with-oauth-20/2401354/36>`__.

.. note::

Only ``Decal``, ``Audio``, and ``Model`` (as ``fbx``) are supported right now.

.. method:: update_asset(asset_id, file)

Updates an existing asset on Roblox.
Updates the file for an existing assest on Roblox. It will return :class:`rblx-open-cloud.Asset` if the asset is processed instantly, otherwise it will return :class:`rblx-open-cloud.PendingAsset`. The following asset types and file formats can be updated:

.. list-table::
:widths: 50 50
:header-rows: 1

* - Asset Type
- File Formats
* - :attr:`rblx-open-cloud.AssetType.Model`
- ``.fbx``

The ``asset:read`` and ``asset:write`` scopes are required if authorized via `OAuth2 </oauth2>`__.

Expand All @@ -73,10 +91,6 @@ Group

.. danger::

Assets uploaded with Open Cloud can still get your account banned if they're inappropriate.
Assets uploaded with Open Cloud can still get your account moderated if they break the Terms of Service.

For OAuth2 applications, please read `this post by Hooksmith <https://devforum.roblox.com/t/public-beta-building-your-applications-with-oauth-20/2401354/36>`__.

.. note::

Only ``Model`` (as ``fbx``) can be updated right now.
60 changes: 33 additions & 27 deletions docs/source/user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ User

.. class:: User()

Class for interacting with the API for a specific user.
Represents a user on Roblox. It is used to provide information about a user in :doc:`oauth2`, and to upload assets to a user.

.. versionadded:: 1.1

.. versionchanged:: 1.3
Added ``username``, ``display_name`` and ``created_at`` attributes which default to ``None``, unless it is from :ref:`OAuth2 <oauth2>`. Added ``profile_uri`` attribute which is always avaliable.
Added ``username``, ``display_name`` and ``created_at`` attributes which default to ``None``, unless it is from :doc:`oauth2`. Added ``profile_uri`` attribute which is always avaliable.

:param int id: Your user ID. It appears in your profile URL
:param str api_key: An API key created from `Creator Dashboard <https://create.roblox.com/credentials>`__. *this should be kept safe, as anyone with the key can use it!*
:param int id: The user's ID.
:param str api_key: Your API key created from `Creator Dashboard <https://create.roblox.com/credentials>`__ with access to this user.

.. attribute:: id

Expand All @@ -23,19 +23,19 @@ User

.. attribute:: username

The user's username. This will always be ``None``, unless it is from :ref:`OAuth2 <oauth2>`
The user's username. This will always be ``None``, unless it is from :doc:`oauth2`

:type: Optional[str]

.. attribute:: display_name

The user's display name. This will always be ``None``, unless it is from :ref:`OAuth2 <oauth2>`
The user's display name. This will always be ``None``, unless it is from :doc:`oauth2`

:type: Optional[str]

.. attribute:: created_at

The time when user's account was created. This will always be ``None``, unless it is from :ref:`OAuth2 <oauth2>`
The time when user's account was created. This will always be ``None``, unless it is from :doc:`oauth2`

:type: datetime.datetime

Expand All @@ -47,7 +47,20 @@ User

.. method:: upload_asset(file, asset_type, name, description, expected_robux_price=0)

Uploads an asset onto Roblox.
Uploads the file onto roblox as an asset with the provided name and description. It will return :class:`rblx-open-cloud.Asset` if the asset is processed instantly, otherwise it will return :class:`rblx-open-cloud.PendingAsset`. The following asset types and file formats are accepted:

.. list-table::
:widths: 50 50
:header-rows: 1

* - Asset Type
- File Formats
* - :attr:`rblx-open-cloud.AssetType.Decal`
- ``.png``, ``.jpeg``, ``.bmp``, ``.tga``
* - :attr:`rblx-open-cloud.AssetType.Audio`
- ``.mp3``, ``.ogg``
* - :attr:`rblx-open-cloud.AssetType.Model`
- ``.fbx``

The ``asset:read`` and ``asset:write`` scopes are required if authorized via `OAuth2 </oauth2>`__.

Expand All @@ -70,17 +83,22 @@ User

.. danger::

Assets uploaded with Open Cloud can still get your account banned if they're inappropriate.
Assets uploaded with Open Cloud can still get your account moderated if they break the Terms of Service.

For OAuth2 applications, please read `this post by Hooksmith <https://devforum.roblox.com/t/public-beta-building-your-applications-with-oauth-20/2401354/36>`__.

.. note::

Only ``Decal``, ``Audio``, and ``Model`` (as ``fbx``) are supported right now.

.. method:: update_asset(asset_id, file)

Updates an existing asset on Roblox.
Updates the file for an existing assest on Roblox. It will return :class:`rblx-open-cloud.Asset` if the asset is processed instantly, otherwise it will return :class:`rblx-open-cloud.PendingAsset`. The following asset types and file formats can be updated:

.. list-table::
:widths: 50 50
:header-rows: 1

* - Asset Type
- File Formats
* - :attr:`rblx-open-cloud.AssetType.Model`
- ``.fbx``

The ``asset:read`` and ``asset:write`` scopes are required if authorized via `OAuth2 </oauth2>`__.

Expand All @@ -100,18 +118,6 @@ User

.. danger::

Assets uploaded with Open Cloud can still get your account banned if they're inappropriate.
Assets uploaded with Open Cloud can still get your account moderated if they break the Terms of Service.

For OAuth2 applications, please read `this post by Hooksmith <https://devforum.roblox.com/t/public-beta-building-your-applications-with-oauth-20/2401354/36>`__.

.. note::

Only ``Model`` (as ``fbx``) can be updated right now.

.. danger::

Assets uploaded with Open Cloud can still get your account banned if they're inappropriate.

.. note::

Only ``Model`` (as ``fbx``) can be updated right now.
Loading

0 comments on commit 2f904fb

Please sign in to comment.