From 941fbdcbd0cb623cb24cd079daf75e6c0b675786 Mon Sep 17 00:00:00 2001 From: David Graham Date: Wed, 17 Jul 2024 11:03:42 -0400 Subject: [PATCH] clean up and finalize type doc strings --- emanifest-py/src/emanifest/client.py | 10 ++----- emanifest-py/src/emanifest/types.py | 42 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/emanifest-py/src/emanifest/client.py b/emanifest-py/src/emanifest/client.py index 1f4fd121..4ae3404f 100644 --- a/emanifest-py/src/emanifest/client.py +++ b/emanifest-py/src/emanifest/client.py @@ -24,6 +24,7 @@ CorrectionRevertResponse, CorrectionVersionSearchArgs, Manifest, + ManifestExistsResponse, ManifestOperationResponse, ManifestSignatureResponse, MtnSearchArgs, @@ -815,13 +816,8 @@ def save_manifest( multipart=multipart, ) - def check_mtn_exists(self, mtn: str) -> RcrainfoResponse: - """ - Check if Manifest Tracking Number (MTN) exists and return basic details - - Returns: - dict: object containing MTN details and confirmation if site exists - """ + def check_mtn_exists(self, mtn: str) -> RcrainfoResponse[ManifestExistsResponse]: + """Check if Manifest Tracking Number (MTN) exists and return basic details""" endpoint = f"{self.base_url}v1/emanifest/manifest/mtn-exists/{mtn}" return self.__rcra_request("GET", endpoint) diff --git a/emanifest-py/src/emanifest/types.py b/emanifest-py/src/emanifest/types.py index dbf4f819..4fe50fb0 100644 --- a/emanifest-py/src/emanifest/types.py +++ b/emanifest-py/src/emanifest/types.py @@ -19,11 +19,15 @@ class RcraCodeDescription(TypedDict, total=False): class Phone(TypedDict, total=False): + """A RCRAInfo phone number""" + number: Required[str] extension: Optional[str] class Contact(TypedDict, total=False): + """RCRAInfo user contact information""" + firstName: str middleInitial: str lastName: str @@ -33,11 +37,15 @@ class Contact(TypedDict, total=False): class RcraLocality(TypedDict, total=False): + """A RCRAInfo locality (state or country)""" + code: Required[str] name: str class Address(TypedDict, total=False): + """An address in the RCRAInfo system""" + address1: Required[str] address2: str city: str @@ -50,6 +58,8 @@ class Address(TypedDict, total=False): class RcraSite(TypedDict): + """A site in the RCRAInfo system""" + canEsign: bool contact: Contact epaSiteId: str @@ -78,6 +88,8 @@ class SiteExistsResponse(TypedDict): class SiteSearchArgs(TypedDict, total=False): + """Search parameters for site search service""" + epaSiteId: Optional[str] name: Optional[str] streetNumber: Optional[str] @@ -90,6 +102,8 @@ class SiteSearchArgs(TypedDict, total=False): class UserSearchArgs(TypedDict, total=False): + """Search parameters for user search service""" + userId: Optional[str] siteIds: Optional[List[str]] pageNumber: Optional[int] @@ -301,6 +315,8 @@ class UILinkArgs(TypedDict, total=False): class DiscrepancyResidueInfo(TypedDict, total=False): + """Manifest Waste Discrepancy info""" + wasteQuantity: bool wasteType: bool discrepancyComments: Optional[str] @@ -309,11 +325,15 @@ class DiscrepancyResidueInfo(TypedDict, total=False): class DotInformation(TypedDict): + """Waste Line Department of Transportation Information""" + idNumber: RcraCodeDescription printedDotInformation: str class Quantity(TypedDict, total=False): + """Waste Line Quantities""" + containerNumber: int containerType: RcraCodeDescription quantity: int @@ -321,6 +341,8 @@ class Quantity(TypedDict, total=False): class BrInfo(TypedDict, total=False): + """Biennial Report Information that can be added to a manifest""" + density: Optional[float] densityUnitOfMeasurement: Optional[RcraCodeDescription] formCode: Optional[RcraCodeDescription] @@ -330,6 +352,8 @@ class BrInfo(TypedDict, total=False): class HazardousWaste(TypedDict, total=False): + """Key codes that indicate the type of hazardous waste""" + federalWasteCodes: List[RcraCodeDescription] tsdfStateWasteCodes: List[RcraCodeDescription] txWasteCodes: List[str] @@ -337,12 +361,16 @@ class HazardousWaste(TypedDict, total=False): class Comment(TypedDict, total=False): + """A comment on a manifest or waste line""" + label: Optional[str] description: Optional[str] handlerId: Optional[str] class AdditionalInfo(TypedDict, total=False): + """Additional Information structure for use on a manifest or individual waste line""" + originalManifestTrackingNumbers: Optional[List[str]] newManifestDestination: Optional[str] consentNumber: Optional[str] @@ -350,6 +378,8 @@ class AdditionalInfo(TypedDict, total=False): class PcbInfo(TypedDict, total=False): + """Polychlorinated biphenyls information on a manifest waste line""" + loadType: Optional[RcraCodeDescription] articleContainerId: Optional[str] dateOfRemoval: Optional[str] @@ -378,6 +408,8 @@ class Waste(TypedDict, total=False): class __BaseManifest(TypedDict, total=False): + """For Internal Use. The bulk of fields in the manifest except for the 'import' field""" + createdDate: datetime | str updatedDate: datetime | str manifestTrackingNumber: str @@ -406,3 +438,13 @@ class Manifest(__BaseManifest, ImportFieldMixin): """The RCRA uniform hazardous waste manifest""" pass + + +class ManifestExistsResponse(TypedDict): + """manifest exists service response""" + + manifestTrackingNumber: str + result: bool + originType: OriginType + submissionType: SubmissionType + status: Status