Schema for the `InstructionDiscoveryPath` type.
| 10882 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 10883 | @dataclass |
| 10884 | class InstructionDiscoveryPath: |
| 10885 | """Schema for the `InstructionDiscoveryPath` type.""" |
| 10886 | |
| 10887 | kind: InstructionDiscoveryPathKind |
| 10888 | """Whether the target is a single file or a directory of instruction files""" |
| 10889 | |
| 10890 | location: InstructionLocation |
| 10891 | """Which tier this target belongs to""" |
| 10892 | |
| 10893 | path: str |
| 10894 | """Absolute path of the file or directory (may not exist on disk yet)""" |
| 10895 | |
| 10896 | preferred_for_creation: bool |
| 10897 | """Whether this is the canonical target to create new instructions in its tier. At most one |
| 10898 | entry per tier is preferred. |
| 10899 | """ |
| 10900 | project_path: str | None = None |
| 10901 | """The input project path this target was derived from (only for repository targets)""" |
| 10902 | |
| 10903 | @staticmethod |
| 10904 | def from_dict(obj: Any) -> 'InstructionDiscoveryPath': |
| 10905 | assert isinstance(obj, dict) |
| 10906 | kind = InstructionDiscoveryPathKind(obj.get("kind")) |
| 10907 | location = InstructionLocation(obj.get("location")) |
| 10908 | path = from_str(obj.get("path")) |
| 10909 | preferred_for_creation = from_bool(obj.get("preferredForCreation")) |
| 10910 | project_path = from_union([from_str, from_none], obj.get("projectPath")) |
| 10911 | return InstructionDiscoveryPath(kind, location, path, preferred_for_creation, project_path) |
| 10912 | |
| 10913 | def to_dict(self) -> dict: |
| 10914 | result: dict = {} |
| 10915 | result["kind"] = to_enum(InstructionDiscoveryPathKind, self.kind) |
| 10916 | result["location"] = to_enum(InstructionLocation, self.location) |
| 10917 | result["path"] = from_str(self.path) |
| 10918 | result["preferredForCreation"] = from_bool(self.preferred_for_creation) |
| 10919 | if self.project_path is not None: |
| 10920 | result["projectPath"] = from_union([from_str, from_none], self.project_path) |
| 10921 | return result |
| 10922 | |
| 10923 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 10924 | @dataclass |
no outgoing calls
no test coverage detected
searching dependent graphs…