[#3] Added generate proto script create container method
Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
This commit is contained in:
parent
19282f13cc
commit
3afa14db95
52 changed files with 1381 additions and 74 deletions
21
frostfs_sdk/models/dto/owner_id.py
Normal file
21
frostfs_sdk/models/dto/owner_id.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from base58 import b58decode
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OwnerId:
|
||||
value: str
|
||||
|
||||
def __post_init__(self):
|
||||
if not self.value or self.value.strip() == "":
|
||||
raise ValueError(f"{self.__class__.__name__} value is not present")
|
||||
|
||||
def to_hash(self) -> bytes:
|
||||
"""Decodes the Base58-encoded value into a byte array."""
|
||||
try:
|
||||
return b58decode(self.value)
|
||||
except Exception as e:
|
||||
raise ValueError(f"Failed to decode Base58 value: {self.value}") from e
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.value
|
Loading…
Add table
Add a link
Reference in a new issue