SKU
A stock keeping unit.
Attributes access_type :
What kind of access the stock keeping unit provides for its content.
int
The stock keeping unit's owner application identifier.
None, tuple<SKUFeature>
The features of the stock keeping unit.
The flags of the stock keeping unit.
int
The unique identifier number of the stock keeping unit.
str
The name of the stock keeping unit.
bool
Whether the stock keeping unit is a premium one.
None
, DateTime
When the stock keeping unit has its release. Can be both in the past and in the future as well.
None
, str
System generated url to the stock keeping unit generated based on its name.
The stock keeping unit's type.
Notes
Stock keeping unit instances are weakreferable.
Properties
created_at
When the entity was created.
Returns
created_at : datetime
partial
Returns whether the stock keeping unit is partial.
Returns
partial : bool
Methods
(...)
__new__Creates a new partial stock keeping unit.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
access_type |
| What kind of access the stock keeping unit provides for its content. | ||
features |
| The features of the stock keeping unit. | ||
flags |
| The flags of the stock keeping unit. | ||
name |
| The name of the stock keeping unit. | ||
premium |
| Whether the stock keeping unit is a premium one. | ||
release_at |
| When the stock keeping unit has its release. | ||
sku_type |
| The stock keeping unit's type. |
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
()
copyCopies the stock keeping unit.
Returns
new : instance<type<self>>
(...)
copy_withCopies the stock keeping unit with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
access_type |
| What kind of access the stock keeping unit provides for its content. | ||
features |
| The features of the stock keeping unit. | ||
flags |
| The flags of the stock keeping unit. | ||
name |
| The stock keeping unit's name. | ||
premium |
| Whether the stock keeping unit is a premium one. | ||
release_at |
| When the stock keeping unit has its release. | ||
sku_type |
| The stock keeping unit's type. |
Returns
new : instance<type<self>>
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
(data)
from_dataCreates a new stock keeping unit.
Parameter | Type | Description |
---|---|---|
data |
| Stock keeping unit data. |
Returns
new : instance<cls>
(feature)
has_featureReturns whether the stock keeping unit has the give feature.
Parameter | Type | Description |
---|---|---|
feature | The feature to look for. |
Returns
has_feature : bool
()
iter_featuresIterates over the features of the stock keeping unit.
This method is an iterable generator.
Yields
feature : SKUFeature
(sku_id, ...)
precreateCreates an stock keeping unit instance.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
sku_id |
| The stock keeping unit's identifier. | ||
**keyword_parameters | Keyword parameters | Additional keyword parameters. | ||
access_type |
| What kind of access the stock keeping unit provides for its content. | ||
application |
| Alternative for | ||
application_id |
| The stock keeping unit's owner application identifier. | ||
features |
| The features of the stock keeping unit. | ||
flags |
| The flags of the stock keeping unit. | ||
name |
| The stock keeping unit's name. | ||
premium |
| Whether the stock keeping unit is a premium one. | ||
release_at |
| When the stock keeping unit has its release. | ||
slug |
| System generated url to the stock keeping unit generated based on its name. | ||
sku_type |
| The stock keeping unit's type. |
Returns
self : instance<cls>
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
(...)
to_dataConverts the stock keeping unit into a json serializable object.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| Whether default field values should be included. | ||
include_internals |
|
| Whether internal fields should be included. |
Returns
data : dict
of (str
, object
) items
(sku_id)
_create_emptyCreates a new stock keeping unit instance with it's attribute set to their default values.
Parameter | Type | Description |
---|---|---|
sku_id |
| The stock keeping unit's identifier. |
Returns
self : instance<cls>
()
_get_hash_partialCalculates the stock keeping unit's hash based on their fields.
This method is called by .__hash__
if the channel has no .id
set.
Returns
hash_value : int
(other)
_is_equal_same_typeReturns whether self is equal to other. Other must be same type as self.
Parameter | Type | Description |
---|---|---|
other |
| The other instance. |
Returns
is_equal : bool
(data)
_set_attributesSets the stock keeping unit's attributes. (Except .id
.)
Parameter | Type | Description |
---|---|---|
data |
| Stock keeping unit data. |
()
__eq__Returns whether the two stock keeping units are equal.
()
__ge__Whether this entity's id is greater or equal than the other's.
()
__getattr__Drops a rich attribute error.
()
__gt__Whether this entity's id is greater than the other's.
()
__hash__Returns the hash value of the stock keeping unit.
()
__le__Whether this entity's id is less or equal than the other's.
()
__lt__Whether this entity's id is less than the other's.
()
__ne__Returns whether the two stock keeping units are not equal.
()
__repr__Returns the stock keeping unit's representation.