Skip to content

Commit

Permalink
version bump to beta + minor change docs and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
treeben77 committed Sep 25, 2024
1 parent c5ae05a commit bda0e09
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 7 deletions.
4 changes: 4 additions & 0 deletions docs/guides/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ Can be shortened to:
asset = creator.upload_asset(...).wait()
```

### `user_id` parameter of [`list_members`][rblxopencloud.Group.list_members] removed

For simplicity, [`list_members`][rblxopencloud.Group.list_members] no longer accepts a `user_id` parameter. To fetch a specific member of a group, use [`fetch_member`][rblxopencloud.Group.fetch_member] instead.

### Exception changes

The following exceptions have been renamed/merged:
Expand Down
2 changes: 1 addition & 1 deletion rblxopencloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import requests

VERSION: str = "2.0.0"
VERSION_INFO: Literal["alpha", "beta", "final"] = "alpha"
VERSION_INFO: Literal["alpha", "beta", "final"] = "beta"

user_agent: str = (
f"rblx-open-cloud/{VERSION} (https://github.com/treeben77/rblx-open-cloud)"
Expand Down
6 changes: 5 additions & 1 deletion rblxopencloud/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ def __init__(self, value, info, *args: object) -> None:


class InvalidCode(HttpException):
pass
"""
The code provided to \
[OAuth2App.exchange_code](rblxopencloud.OAuth2App.exchange_code) was \
invalid.
"""


class InvalidFile(HttpException):
Expand Down
84 changes: 81 additions & 3 deletions rblxopencloud/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,66 @@


class InventoryAssetType(Enum):
"""
Enum representing the type of an \
[InventoryAsset][rblxopencloud.InventoryAsset].
Attributes:
Unknown(0): The asset type is unknown/unsupported.
ClassicTShirt(1):
Audio(2):
Hat(3):
Model(4):
ClassicShirt(5):
ClassicPants(6):
Decal(7):
ClassicHead(8):
Face(9):
Gear(10):
Animation(11):
Torso(12):
RightArm(13):
LeftArm(14):
LeftLeg(15):
RightLeg(16):
Package(17):
Plugin(18):
MeshPart(19):
HairAccessory(20):
FaceAccessory(21):
NeckAccessory(22):
ShoulderAccessory(23):
FrontAccessory(24):
BackAccessory(25):
WaistAccessory(26):
ClimbAnimation(27):
DeathAnimation(28):
FallAnimation(29):
IdleAnimation(30):
JumpAnimation(31):
RunAnimation(32):
SwimAnimation(33):
WalkAnimation(34):
PoseAnimation(35):
EmoteAnimation(36):
Video(37):
TShirtAccessory(38):
ShirtAccessory(39):
PantsAccessory(40):
JacketAccessory(41):
SweaterAccessory(42):
ShortsAccessory(43):
LeftShoeAccessory(44):
RightShoeAccessory(45):
DressSkirtAccessory(46):
EyebrowAccessory(47):
EyelashAccessory(48):
MoodAnimation(49):
DynamicHead(50):
CreatedPlace(51):
PurchasedPlace(52):
"""

Unknown = 0
ClassicTShirt = 1
Audio = 2
Expand Down Expand Up @@ -161,6 +221,17 @@ class InventoryAssetType(Enum):


class InventoryItemState(Enum):
"""
Enum representing whether a collectable \
[InventoryAsset][rblxopencloud.InventoryAsset] can be traded/ sold or is \
currently on hold.
Attributes:
Unknown (0): The status is unknown.
Available (1): The collectable can be traded and sold.
Hold (2): The collectable cannot be traded or sold yet.
"""

Unknown = 0
Available = 1
Hold = 2
Expand All @@ -174,11 +245,18 @@ class InventoryItemState(Enum):


class InventoryItem:
"""
Represents an asset, badge, or gamepass in the user's inventory.
Attributes:
id (int): The ID of the inventory item.
"""

def __init__(self, id) -> None:
self.id: int = id

def __repr__(self) -> str:
return f"rblxopencloud.InventoryItem(id={self.id}"
return f"<rblxopencloud.InventoryItem id={self.id}>"


class InventoryAsset(InventoryItem):
Expand All @@ -187,7 +265,7 @@ class InventoryAsset(InventoryItem):
development items.
Attributes:
id (int): The ID of the inventory item.
id (int): The ID of the asset.
type (InventoryAssetType): The asset's type.
instance_id (int): The unique ID of this asset's instance.
collectable_item_id (Optional[str]): A unique item UUID for \
Expand Down Expand Up @@ -269,7 +347,7 @@ class InventoryPrivateServer(InventoryItem):
Represents a game pass in a user's inventory.
Attributes:
id (int): The ID of the game pass.
id (int): The ID of the private server.
"""

def __init__(self, data) -> None:
Expand Down
6 changes: 5 additions & 1 deletion rblxopencloudasync/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ def __init__(self, value, info, *args: object) -> None:


class InvalidCode(HttpException):
pass
"""
The code provided to \
[OAuth2App.exchange_code](rblxopencloud.OAuth2App.exchange_code) was \
invalid.
"""


class InvalidFile(HttpException):
Expand Down
80 changes: 79 additions & 1 deletion rblxopencloudasync/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,66 @@


class InventoryAssetType(Enum):
"""
Enum representing the type of an \
[InventoryAsset][rblxopencloud.InventoryAsset].
Attributes:
Unknown(0): The asset type is unknown/unsupported.
ClassicTShirt(1):
Audio(2):
Hat(3):
Model(4):
ClassicShirt(5):
ClassicPants(6):
Decal(7):
ClassicHead(8):
Face(9):
Gear(10):
Animation(11):
Torso(12):
RightArm(13):
LeftArm(14):
LeftLeg(15):
RightLeg(16):
Package(17):
Plugin(18):
MeshPart(19):
HairAccessory(20):
FaceAccessory(21):
NeckAccessory(22):
ShoulderAccessory(23):
FrontAccessory(24):
BackAccessory(25):
WaistAccessory(26):
ClimbAnimation(27):
DeathAnimation(28):
FallAnimation(29):
IdleAnimation(30):
JumpAnimation(31):
RunAnimation(32):
SwimAnimation(33):
WalkAnimation(34):
PoseAnimation(35):
EmoteAnimation(36):
Video(37):
TShirtAccessory(38):
ShirtAccessory(39):
PantsAccessory(40):
JacketAccessory(41):
SweaterAccessory(42):
ShortsAccessory(43):
LeftShoeAccessory(44):
RightShoeAccessory(45):
DressSkirtAccessory(46):
EyebrowAccessory(47):
EyelashAccessory(48):
MoodAnimation(49):
DynamicHead(50):
CreatedPlace(51):
PurchasedPlace(52):
"""

Unknown = 0
ClassicTShirt = 1
Audio = 2
Expand Down Expand Up @@ -160,6 +220,17 @@ class InventoryAssetType(Enum):


class InventoryItemState(Enum):
"""
Enum representing whether a collectable \
[InventoryAsset][rblxopencloud.InventoryAsset] can be traded/ sold or is \
currently on hold.
Attributes:
Unknown (0): The status is unknown.
Available (1): The collectable can be traded and sold.
Hold (2): The collectable cannot be traded or sold yet.
"""

Unknown = 0
Available = 1
Hold = 2
Expand All @@ -173,11 +244,18 @@ class InventoryItemState(Enum):


class InventoryItem:
"""
Represents an asset, badge, or gamepass in the user's inventory.
Attributes:
id (int): The ID of the inventory item.
"""

def __init__(self, id) -> None:
self.id: int = id

def __repr__(self) -> str:
return f"rblxopencloud.InventoryItem(id={self.id}"
return f"<rblxopencloud.InventoryItem id={self.id}>"


class InventoryAsset(InventoryItem):
Expand Down

0 comments on commit bda0e09

Please sign in to comment.