Skip to content

Commit

Permalink
clean up and finalize type doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgraham4401 committed Jul 17, 2024
1 parent 52a5bcc commit 941fbdc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
10 changes: 3 additions & 7 deletions emanifest-py/src/emanifest/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
CorrectionRevertResponse,
CorrectionVersionSearchArgs,
Manifest,
ManifestExistsResponse,
ManifestOperationResponse,
ManifestSignatureResponse,
MtnSearchArgs,
Expand Down Expand Up @@ -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)

Expand Down
42 changes: 42 additions & 0 deletions emanifest-py/src/emanifest/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -50,6 +58,8 @@ class Address(TypedDict, total=False):


class RcraSite(TypedDict):
"""A site in the RCRAInfo system"""

canEsign: bool
contact: Contact
epaSiteId: str
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -309,18 +325,24 @@ 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
unitOfMeasurement: RcraCodeDescription


class BrInfo(TypedDict, total=False):
"""Biennial Report Information that can be added to a manifest"""

density: Optional[float]
densityUnitOfMeasurement: Optional[RcraCodeDescription]
formCode: Optional[RcraCodeDescription]
Expand All @@ -330,26 +352,34 @@ 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]
generatorStateWasteCodes: List[RcraCodeDescription]


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]
comments: Optional[List[Comment]]


class PcbInfo(TypedDict, total=False):
"""Polychlorinated biphenyls information on a manifest waste line"""

loadType: Optional[RcraCodeDescription]
articleContainerId: Optional[str]
dateOfRemoval: Optional[str]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 941fbdc

Please sign in to comment.