-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IWF-397: Add channel sizes data (#66)
* IWF-397: Add channel sizes data * IWF-397: Lint * IWF-397: Add signal_channel_types to Communication
- Loading branch information
1 parent
ec9fa94
commit c3bd12a
Showing
12 changed files
with
692 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from typing import Any, Dict, List, Type, TypeVar, Union | ||
|
||
import attr | ||
|
||
from ..types import UNSET, Unset | ||
|
||
T = TypeVar("T", bound="ChannelInfo") | ||
|
||
|
||
@attr.s(auto_attribs=True) | ||
class ChannelInfo: | ||
""" | ||
Attributes: | ||
size (Union[Unset, int]): | ||
""" | ||
|
||
size: Union[Unset, int] = UNSET | ||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) | ||
|
||
def to_dict(self) -> Dict[str, Any]: | ||
size = self.size | ||
|
||
field_dict: Dict[str, Any] = {} | ||
field_dict.update(self.additional_properties) | ||
field_dict.update({}) | ||
if size is not UNSET: | ||
field_dict["size"] = size | ||
|
||
return field_dict | ||
|
||
@classmethod | ||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: | ||
d = src_dict.copy() | ||
size = d.pop("size", UNSET) | ||
|
||
channel_info = cls( | ||
size=size, | ||
) | ||
|
||
channel_info.additional_properties = d | ||
return channel_info | ||
|
||
@property | ||
def additional_keys(self) -> List[str]: | ||
return list(self.additional_properties.keys()) | ||
|
||
def __getitem__(self, key: str) -> Any: | ||
return self.additional_properties[key] | ||
|
||
def __setitem__(self, key: str, value: Any) -> None: | ||
self.additional_properties[key] = value | ||
|
||
def __delitem__(self, key: str) -> None: | ||
del self.additional_properties[key] | ||
|
||
def __contains__(self, key: str) -> bool: | ||
return key in self.additional_properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
iwf/iwf_api/models/workflow_worker_rpc_request_internal_channel_infos.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar | ||
|
||
import attr | ||
|
||
if TYPE_CHECKING: | ||
from ..models.channel_info import ChannelInfo | ||
|
||
|
||
T = TypeVar("T", bound="WorkflowWorkerRpcRequestInternalChannelInfos") | ||
|
||
|
||
@attr.s(auto_attribs=True) | ||
class WorkflowWorkerRpcRequestInternalChannelInfos: | ||
""" """ | ||
|
||
additional_properties: Dict[str, "ChannelInfo"] = attr.ib(init=False, factory=dict) | ||
|
||
def to_dict(self) -> Dict[str, Any]: | ||
pass | ||
|
||
field_dict: Dict[str, Any] = {} | ||
for prop_name, prop in self.additional_properties.items(): | ||
field_dict[prop_name] = prop.to_dict() | ||
|
||
field_dict.update({}) | ||
|
||
return field_dict | ||
|
||
@classmethod | ||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: | ||
from ..models.channel_info import ChannelInfo | ||
|
||
d = src_dict.copy() | ||
workflow_worker_rpc_request_internal_channel_infos = cls() | ||
|
||
additional_properties = {} | ||
for prop_name, prop_dict in d.items(): | ||
additional_property = ChannelInfo.from_dict(prop_dict) | ||
|
||
additional_properties[prop_name] = additional_property | ||
|
||
workflow_worker_rpc_request_internal_channel_infos.additional_properties = ( | ||
additional_properties | ||
) | ||
return workflow_worker_rpc_request_internal_channel_infos | ||
|
||
@property | ||
def additional_keys(self) -> List[str]: | ||
return list(self.additional_properties.keys()) | ||
|
||
def __getitem__(self, key: str) -> "ChannelInfo": | ||
return self.additional_properties[key] | ||
|
||
def __setitem__(self, key: str, value: "ChannelInfo") -> None: | ||
self.additional_properties[key] = value | ||
|
||
def __delitem__(self, key: str) -> None: | ||
del self.additional_properties[key] | ||
|
||
def __contains__(self, key: str) -> bool: | ||
return key in self.additional_properties |
Oops, something went wrong.