"""Mithril: Ontario legal operations, cited and signed. A typed client for https://mithril.law/api/v1, generated from https://mithril.law/openapi.json (surface version 1.0.0). One file, the standard library only (Python 3.9 or later). curl -O https://mithril.law/agents/sdk/mithril.py from mithril import Mithril mithril = Mithril() run = mithril.employment_severance_check({"endedHow":"let_go_without_cause","endDate":"2026-09-01","yearsOfService":10,"monthsOfService":11,"age":45,"role":"staff","pay":{"kind":"salary","annualSalary":104000},"payroll":"yes","hasBenefits":True,"terminationClause":"no","exemptions":[],"workingNoticeWeeks":0,"massTermination":"no","businessClosure":"no"}) Every run answers with a summary, cited steps, a boundary (automated, needs_person or needs_lawyer) and a receipt signed with the key at https://mithril.law/.well-known/jwks.json. The software provides legal information and document preparation, sold by Jonathan Kleiman. It is not legal advice. """ import json import uuid from typing import Any, Dict, List, Literal, Optional, TypedDict, Union from urllib.error import HTTPError from urllib.request import Request, urlopen Run = Dict[str, Any] """A run: object, id, operation, result (summary, steps, boundary, output), law and receipt.""" class MithrilError(Exception): """An error answer: its HTTP status, code, message, hint and details.""" def __init__(self, status: int, code: str, message: str, hint: Optional[str] = None, details: Any = None): super().__init__(message) self.status = status self.code = code self.hint = hint self.details = details @property def missing(self) -> List[Dict[str, str]]: """The facts that were missing, when code is invalid_input. Ask the person; never guess.""" return self.details if self.code == "invalid_input" and isinstance(self.details, list) else [] # Required: street, city, postalCode. CorporateAnnualMaintenanceInputCompanyRegisteredOffice = TypedDict("CorporateAnnualMaintenanceInputCompanyRegisteredOffice", { "street": str, "city": str, "province": Literal["Ontario", "Quebec", "British Columbia", "Alberta", "Manitoba", "Saskatchewan", "Nova Scotia", "New Brunswick", "Newfoundland and Labrador", "Prince Edward Island", "Yukon", "Northwest Territories", "Nunavut"], "postalCode": str, }, total=False) # Required: street, city, region, postalCode. CorporateAnnualMaintenanceInputCompanyDirectorsItemAddress = TypedDict("CorporateAnnualMaintenanceInputCompanyDirectorsItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName, address, residentCanadian. CorporateAnnualMaintenanceInputCompanyDirectorsItem = TypedDict("CorporateAnnualMaintenanceInputCompanyDirectorsItem", { "fullName": str, "address": CorporateAnnualMaintenanceInputCompanyDirectorsItemAddress, "residentCanadian": bool, "email": str, }, total=False) # Required: fullName, office. CorporateAnnualMaintenanceInputCompanyOfficersItem = TypedDict("CorporateAnnualMaintenanceInputCompanyOfficersItem", { "fullName": str, "office": Literal["President", "Secretary", "Treasurer", "Chief Executive Officer", "Chief Financial Officer", "Chair", "Vice-President"], }, total=False) # Required: street, city, region, postalCode. CorporateAnnualMaintenanceInputCompanyShareholdersItemAddress = TypedDict("CorporateAnnualMaintenanceInputCompanyShareholdersItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: shares. CorporateAnnualMaintenanceInputCompanyShareholdersItemHoldingsItem = TypedDict("CorporateAnnualMaintenanceInputCompanyShareholdersItemHoldingsItem", { "shareClass": str, "shares": int, }, total=False) # Required: street, city, region, postalCode. CorporateAnnualMaintenanceInputCompanyShareholdersItemDetailsAddressForService = TypedDict("CorporateAnnualMaintenanceInputCompanyShareholdersItemDetailsAddressForService", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) CorporateAnnualMaintenanceInputCompanyShareholdersItemDetails = TypedDict("CorporateAnnualMaintenanceInputCompanyShareholdersItemDetails", { "dateOfBirth": str, "taxResidence": str, "citizenship": str, "addressForService": CorporateAnnualMaintenanceInputCompanyShareholdersItemDetailsAddressForService, }, total=False) # Required: street, city, region, postalCode. CorporateAnnualMaintenanceInputCompanyShareholdersItemControllersItemResidentialAddress = TypedDict("CorporateAnnualMaintenanceInputCompanyShareholdersItemControllersItemResidentialAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName. CorporateAnnualMaintenanceInputCompanyShareholdersItemControllersItem = TypedDict("CorporateAnnualMaintenanceInputCompanyShareholdersItemControllersItem", { "fullName": str, "residentialAddress": CorporateAnnualMaintenanceInputCompanyShareholdersItemControllersItemResidentialAddress, "dateOfBirth": str, "taxResidence": str, "citizenship": str, }, total=False) # Required: fullName, address, holdings. CorporateAnnualMaintenanceInputCompanyShareholdersItem = TypedDict("CorporateAnnualMaintenanceInputCompanyShareholdersItem", { "fullName": str, "kind": Literal["individual", "corporation"], "address": CorporateAnnualMaintenanceInputCompanyShareholdersItemAddress, "holdings": List[CorporateAnnualMaintenanceInputCompanyShareholdersItemHoldingsItem], "email": str, "details": CorporateAnnualMaintenanceInputCompanyShareholdersItemDetails, "controllers": List[CorporateAnnualMaintenanceInputCompanyShareholdersItemControllersItem], }, total=False) # Required: name. CorporateAnnualMaintenanceInputCompanyShareClassesItem = TypedDict("CorporateAnnualMaintenanceInputCompanyShareClassesItem", { "name": str, "votesPerShare": int, "fairMarketValuePerShare": str, }, total=False) # Required: jurisdiction, name, incorporatedOn, registeredOffice, directors, officers, shareholders. CorporateAnnualMaintenanceInputCompany = TypedDict("CorporateAnnualMaintenanceInputCompany", { "jurisdiction": Union[Literal["on"], Literal["ca"]], "name": str, "incorporatedOn": str, "fiscalYearEnd": str, "registeredOffice": CorporateAnnualMaintenanceInputCompanyRegisteredOffice, "directors": List[CorporateAnnualMaintenanceInputCompanyDirectorsItem], "officers": List[CorporateAnnualMaintenanceInputCompanyOfficersItem], "shareholders": List[CorporateAnnualMaintenanceInputCompanyShareholdersItem], "shareClasses": List[CorporateAnnualMaintenanceInputCompanyShareClassesItem], "corporationNumber": str, "lastAnnualMeeting": str, "shareholderAgreementInPlace": bool, "unanimousShareholderAgreement": bool, "articlesGrantPreemptiveRights": bool, }, total=False) # Required: fiscalYearEnded, directorsConfirmedQualified. CorporateAnnualMaintenanceInput = TypedDict("CorporateAnnualMaintenanceInput", { "fiscalYearEnded": str, "companyId": str, "company": CorporateAnnualMaintenanceInputCompany, "allShareholdersAgreeNoAuditor": bool, "directorsToElect": List[str], "directorsConfirmedQualified": bool, }, total=False) # Required: operatesIn, founders, residentCanadianFounders, name. CorporateIncorporationPlanInput = TypedDict("CorporateIncorporationPlanInput", { "operatesIn": Literal["ontario_only", "multiple_provinces", "national_or_international"], "founders": int, "residentCanadianFounders": int, "name": Literal["word_name", "numbered"], "shareStructure": Literal["common_only", "common_and_preferred", "other"], "raisingMoneySoon": bool, "shareholderAgreementInPlace": bool, "startDate": str, }, total=False) # Required: street, city, postalCode. CorporateIncorporationPrepareInputRegisteredOffice = TypedDict("CorporateIncorporationPrepareInputRegisteredOffice", { "street": str, "city": str, "province": Literal["Ontario", "Quebec", "British Columbia", "Alberta", "Manitoba", "Saskatchewan", "Nova Scotia", "New Brunswick", "Newfoundland and Labrador", "Prince Edward Island", "Yukon", "Northwest Territories", "Nunavut"], "postalCode": str, }, total=False) # Required: street, city, region, postalCode. CorporateIncorporationPrepareInputDirectorsItemAddress = TypedDict("CorporateIncorporationPrepareInputDirectorsItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: street, city, region, postalCode. CorporateIncorporationPrepareInputDirectorsItemResidentialAddress = TypedDict("CorporateIncorporationPrepareInputDirectorsItemResidentialAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName, address, residentCanadian, confirmedQualified. CorporateIncorporationPrepareInputDirectorsItem = TypedDict("CorporateIncorporationPrepareInputDirectorsItem", { "fullName": str, "address": CorporateIncorporationPrepareInputDirectorsItemAddress, "residentCanadian": bool, "confirmedQualified": bool, "email": str, "residentialAddress": CorporateIncorporationPrepareInputDirectorsItemResidentialAddress, }, total=False) # Required: fullName, office. CorporateIncorporationPrepareInputOfficersItem = TypedDict("CorporateIncorporationPrepareInputOfficersItem", { "fullName": str, "office": Literal["President", "Secretary", "Treasurer", "Chief Executive Officer", "Chief Financial Officer", "Chair", "Vice-President"], }, total=False) # Required: street, city, region, postalCode. CorporateIncorporationPrepareInputShareholdersItemAddress = TypedDict("CorporateIncorporationPrepareInputShareholdersItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) CorporateIncorporationPrepareInputShareholdersItemDetails = TypedDict("CorporateIncorporationPrepareInputShareholdersItemDetails", { "dateOfBirth": str, "taxResidence": str, "citizenship": str, }, total=False) # Required: street, city, region, postalCode. CorporateIncorporationPrepareInputShareholdersItemControllersItemResidentialAddress = TypedDict("CorporateIncorporationPrepareInputShareholdersItemControllersItemResidentialAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName. CorporateIncorporationPrepareInputShareholdersItemControllersItem = TypedDict("CorporateIncorporationPrepareInputShareholdersItemControllersItem", { "fullName": str, "residentialAddress": CorporateIncorporationPrepareInputShareholdersItemControllersItemResidentialAddress, "dateOfBirth": str, "taxResidence": str, "citizenship": str, }, total=False) # Required: fullName, address, shares, pricePerShare. CorporateIncorporationPrepareInputShareholdersItem = TypedDict("CorporateIncorporationPrepareInputShareholdersItem", { "fullName": str, "kind": Literal["individual", "corporation"], "address": CorporateIncorporationPrepareInputShareholdersItemAddress, "shares": int, "pricePerShare": str, "consideration": Literal["money", "property", "past_services"], "considerationDescription": str, "email": str, "details": CorporateIncorporationPrepareInputShareholdersItemDetails, "controllers": List[CorporateIncorporationPrepareInputShareholdersItemControllersItem], }, total=False) # Required: jurisdiction, nameChoice, registeredOffice, officialEmail, directors, officers, shareholders. CorporateIncorporationPrepareInput = TypedDict("CorporateIncorporationPrepareInput", { "jurisdiction": Union[Literal["on"], Literal["ca"]], "nameChoice": Union[Literal["word_name"], Literal["numbered"]], "corporateName": str, "legalEnding": Literal["Inc.", "Ltd.", "Corp.", "Incorporated", "Limited", "Corporation"], "registeredOffice": CorporateIncorporationPrepareInputRegisteredOffice, "officialEmail": str, "directors": List[CorporateIncorporationPrepareInputDirectorsItem], "officers": List[CorporateIncorporationPrepareInputOfficersItem], "shareholders": List[CorporateIncorporationPrepareInputShareholdersItem], "fiscalYearEnd": str, "businessActivity": str, "nuansReference": str, "nuansDate": str, "effectiveDate": str, "minDirectors": int, "maxDirectors": int, "noAuditorFirstYear": bool, "bank": str, "shareholderAgreementInPlace": bool, }, total=False) # Required: street, city, postalCode. CorporateIscRegisterInputCompanyRegisteredOffice = TypedDict("CorporateIscRegisterInputCompanyRegisteredOffice", { "street": str, "city": str, "province": Literal["Ontario", "Quebec", "British Columbia", "Alberta", "Manitoba", "Saskatchewan", "Nova Scotia", "New Brunswick", "Newfoundland and Labrador", "Prince Edward Island", "Yukon", "Northwest Territories", "Nunavut"], "postalCode": str, }, total=False) # Required: street, city, region, postalCode. CorporateIscRegisterInputCompanyDirectorsItemAddress = TypedDict("CorporateIscRegisterInputCompanyDirectorsItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName, address, residentCanadian. CorporateIscRegisterInputCompanyDirectorsItem = TypedDict("CorporateIscRegisterInputCompanyDirectorsItem", { "fullName": str, "address": CorporateIscRegisterInputCompanyDirectorsItemAddress, "residentCanadian": bool, "email": str, }, total=False) # Required: fullName, office. CorporateIscRegisterInputCompanyOfficersItem = TypedDict("CorporateIscRegisterInputCompanyOfficersItem", { "fullName": str, "office": Literal["President", "Secretary", "Treasurer", "Chief Executive Officer", "Chief Financial Officer", "Chair", "Vice-President"], }, total=False) # Required: street, city, region, postalCode. CorporateIscRegisterInputCompanyShareholdersItemAddress = TypedDict("CorporateIscRegisterInputCompanyShareholdersItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: shares. CorporateIscRegisterInputCompanyShareholdersItemHoldingsItem = TypedDict("CorporateIscRegisterInputCompanyShareholdersItemHoldingsItem", { "shareClass": str, "shares": int, }, total=False) # Required: street, city, region, postalCode. CorporateIscRegisterInputCompanyShareholdersItemDetailsAddressForService = TypedDict("CorporateIscRegisterInputCompanyShareholdersItemDetailsAddressForService", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) CorporateIscRegisterInputCompanyShareholdersItemDetails = TypedDict("CorporateIscRegisterInputCompanyShareholdersItemDetails", { "dateOfBirth": str, "taxResidence": str, "citizenship": str, "addressForService": CorporateIscRegisterInputCompanyShareholdersItemDetailsAddressForService, }, total=False) # Required: street, city, region, postalCode. CorporateIscRegisterInputCompanyShareholdersItemControllersItemResidentialAddress = TypedDict("CorporateIscRegisterInputCompanyShareholdersItemControllersItemResidentialAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName. CorporateIscRegisterInputCompanyShareholdersItemControllersItem = TypedDict("CorporateIscRegisterInputCompanyShareholdersItemControllersItem", { "fullName": str, "residentialAddress": CorporateIscRegisterInputCompanyShareholdersItemControllersItemResidentialAddress, "dateOfBirth": str, "taxResidence": str, "citizenship": str, }, total=False) # Required: fullName, address, holdings. CorporateIscRegisterInputCompanyShareholdersItem = TypedDict("CorporateIscRegisterInputCompanyShareholdersItem", { "fullName": str, "kind": Literal["individual", "corporation"], "address": CorporateIscRegisterInputCompanyShareholdersItemAddress, "holdings": List[CorporateIscRegisterInputCompanyShareholdersItemHoldingsItem], "email": str, "details": CorporateIscRegisterInputCompanyShareholdersItemDetails, "controllers": List[CorporateIscRegisterInputCompanyShareholdersItemControllersItem], }, total=False) # Required: name. CorporateIscRegisterInputCompanyShareClassesItem = TypedDict("CorporateIscRegisterInputCompanyShareClassesItem", { "name": str, "votesPerShare": int, "fairMarketValuePerShare": str, }, total=False) # Required: jurisdiction, name, incorporatedOn, registeredOffice, directors, officers, shareholders. CorporateIscRegisterInputCompany = TypedDict("CorporateIscRegisterInputCompany", { "jurisdiction": Union[Literal["on"], Literal["ca"]], "name": str, "incorporatedOn": str, "fiscalYearEnd": str, "registeredOffice": CorporateIscRegisterInputCompanyRegisteredOffice, "directors": List[CorporateIscRegisterInputCompanyDirectorsItem], "officers": List[CorporateIscRegisterInputCompanyOfficersItem], "shareholders": List[CorporateIscRegisterInputCompanyShareholdersItem], "shareClasses": List[CorporateIscRegisterInputCompanyShareClassesItem], "corporationNumber": str, "lastAnnualMeeting": str, "shareholderAgreementInPlace": bool, "unanimousShareholderAgreement": bool, "articlesGrantPreemptiveRights": bool, }, total=False) # Required: street, city, region, postalCode. CorporateIscRegisterInputControlInFactItemResidentialAddress = TypedDict("CorporateIscRegisterInputControlInFactItemResidentialAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName. CorporateIscRegisterInputControlInFactItem = TypedDict("CorporateIscRegisterInputControlInFactItem", { "fullName": str, "dateOfBirth": str, "residentialAddress": CorporateIscRegisterInputControlInFactItemResidentialAddress, "taxResidence": str, "citizenship": str, }, total=False) # Required: members, basis. CorporateIscRegisterInputActingTogetherItem = TypedDict("CorporateIscRegisterInputActingTogetherItem", { "members": List[str], "basis": Literal["joint", "in_concert", "related"], }, total=False) # Required: fullName, becameOn. CorporateIscRegisterInputPreviousRegisterItem = TypedDict("CorporateIscRegisterInputPreviousRegisterItem", { "fullName": str, "becameOn": str, }, total=False) CorporateIscRegisterInput = TypedDict("CorporateIscRegisterInput", { "companyId": str, "company": CorporateIscRegisterInputCompany, "reviewDate": str, "controlInFact": List[CorporateIscRegisterInputControlInFactItem], "actingTogether": List[CorporateIscRegisterInputActingTogetherItem], "previousRegister": List[CorporateIscRegisterInputPreviousRegisterItem], }, total=False) # Required: street, city, region, postalCode. CorporateShareIssuanceInputSubscribersItemAddress = TypedDict("CorporateShareIssuanceInputSubscribersItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName, address, shares, pricePerShare. CorporateShareIssuanceInputSubscribersItem = TypedDict("CorporateShareIssuanceInputSubscribersItem", { "fullName": str, "kind": Literal["individual", "corporation"], "address": CorporateShareIssuanceInputSubscribersItemAddress, "shareClass": str, "shares": int, "pricePerShare": str, "consideration": Literal["money", "property", "past_services"], "considerationDescription": str, "email": str, }, total=False) # Required: street, city, postalCode. CorporateShareIssuanceInputCompanyRegisteredOffice = TypedDict("CorporateShareIssuanceInputCompanyRegisteredOffice", { "street": str, "city": str, "province": Literal["Ontario", "Quebec", "British Columbia", "Alberta", "Manitoba", "Saskatchewan", "Nova Scotia", "New Brunswick", "Newfoundland and Labrador", "Prince Edward Island", "Yukon", "Northwest Territories", "Nunavut"], "postalCode": str, }, total=False) # Required: street, city, region, postalCode. CorporateShareIssuanceInputCompanyDirectorsItemAddress = TypedDict("CorporateShareIssuanceInputCompanyDirectorsItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName, address, residentCanadian. CorporateShareIssuanceInputCompanyDirectorsItem = TypedDict("CorporateShareIssuanceInputCompanyDirectorsItem", { "fullName": str, "address": CorporateShareIssuanceInputCompanyDirectorsItemAddress, "residentCanadian": bool, "email": str, }, total=False) # Required: fullName, office. CorporateShareIssuanceInputCompanyOfficersItem = TypedDict("CorporateShareIssuanceInputCompanyOfficersItem", { "fullName": str, "office": Literal["President", "Secretary", "Treasurer", "Chief Executive Officer", "Chief Financial Officer", "Chair", "Vice-President"], }, total=False) # Required: street, city, region, postalCode. CorporateShareIssuanceInputCompanyShareholdersItemAddress = TypedDict("CorporateShareIssuanceInputCompanyShareholdersItemAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: shares. CorporateShareIssuanceInputCompanyShareholdersItemHoldingsItem = TypedDict("CorporateShareIssuanceInputCompanyShareholdersItemHoldingsItem", { "shareClass": str, "shares": int, }, total=False) # Required: street, city, region, postalCode. CorporateShareIssuanceInputCompanyShareholdersItemDetailsAddressForService = TypedDict("CorporateShareIssuanceInputCompanyShareholdersItemDetailsAddressForService", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) CorporateShareIssuanceInputCompanyShareholdersItemDetails = TypedDict("CorporateShareIssuanceInputCompanyShareholdersItemDetails", { "dateOfBirth": str, "taxResidence": str, "citizenship": str, "addressForService": CorporateShareIssuanceInputCompanyShareholdersItemDetailsAddressForService, }, total=False) # Required: street, city, region, postalCode. CorporateShareIssuanceInputCompanyShareholdersItemControllersItemResidentialAddress = TypedDict("CorporateShareIssuanceInputCompanyShareholdersItemControllersItemResidentialAddress", { "street": str, "city": str, "region": str, "postalCode": str, "country": str, }, total=False) # Required: fullName. CorporateShareIssuanceInputCompanyShareholdersItemControllersItem = TypedDict("CorporateShareIssuanceInputCompanyShareholdersItemControllersItem", { "fullName": str, "residentialAddress": CorporateShareIssuanceInputCompanyShareholdersItemControllersItemResidentialAddress, "dateOfBirth": str, "taxResidence": str, "citizenship": str, }, total=False) # Required: fullName, address, holdings. CorporateShareIssuanceInputCompanyShareholdersItem = TypedDict("CorporateShareIssuanceInputCompanyShareholdersItem", { "fullName": str, "kind": Literal["individual", "corporation"], "address": CorporateShareIssuanceInputCompanyShareholdersItemAddress, "holdings": List[CorporateShareIssuanceInputCompanyShareholdersItemHoldingsItem], "email": str, "details": CorporateShareIssuanceInputCompanyShareholdersItemDetails, "controllers": List[CorporateShareIssuanceInputCompanyShareholdersItemControllersItem], }, total=False) # Required: name. CorporateShareIssuanceInputCompanyShareClassesItem = TypedDict("CorporateShareIssuanceInputCompanyShareClassesItem", { "name": str, "votesPerShare": int, "fairMarketValuePerShare": str, }, total=False) # Required: jurisdiction, name, incorporatedOn, registeredOffice, directors, officers, shareholders. CorporateShareIssuanceInputCompany = TypedDict("CorporateShareIssuanceInputCompany", { "jurisdiction": Union[Literal["on"], Literal["ca"]], "name": str, "incorporatedOn": str, "fiscalYearEnd": str, "registeredOffice": CorporateShareIssuanceInputCompanyRegisteredOffice, "directors": List[CorporateShareIssuanceInputCompanyDirectorsItem], "officers": List[CorporateShareIssuanceInputCompanyOfficersItem], "shareholders": List[CorporateShareIssuanceInputCompanyShareholdersItem], "shareClasses": List[CorporateShareIssuanceInputCompanyShareClassesItem], "corporationNumber": str, "lastAnnualMeeting": str, "shareholderAgreementInPlace": bool, "unanimousShareholderAgreement": bool, "articlesGrantPreemptiveRights": bool, }, total=False) # Required: subscribers. CorporateShareIssuanceInput = TypedDict("CorporateShareIssuanceInput", { "subscribers": List[CorporateShareIssuanceInputSubscribersItem], "companyId": str, "company": CorporateShareIssuanceInputCompany, }, total=False) # Required: inCustody. CriminalIntakeTriageInput = TypedDict("CriminalIntakeTriageInput", { "inCustody": bool, "bailHearingDate": str, "nextCourtDate": str, "today": str, }, total=False) CriminalLegalAidPathInput = TypedDict("CriminalLegalAidPathInput", { "hasCertificate": bool, "inCustody": bool, "youth": bool, "familySize": int, "familyIncome": float, }, total=False) # Required: stage. CriminalWhatHappensNextInput = TypedDict("CriminalWhatHappensNextInput", { "stage": Union[Literal["arrested_held"], Literal["bail_hearing_scheduled"], Literal["released_with_conditions"], Literal["summons_or_appearance_notice"], Literal["first_appearance_scheduled"], Literal["after_first_appearance"]], "nextCourtDate": str, "youth": bool, "today": str, }, total=False) # Required: amount, period. EmploymentDemandLetterInputPay1Commissions = TypedDict("EmploymentDemandLetterInputPay1Commissions", { "amount": float, "period": Literal["last_12_weeks", "year"], }, total=False) # Required: kind, annualSalary. EmploymentDemandLetterInputPay1 = TypedDict("EmploymentDemandLetterInputPay1", { "kind": Literal["salary"], "annualSalary": float, "commissions": EmploymentDemandLetterInputPay1Commissions, }, total=False) # Required: amount, period. EmploymentDemandLetterInputPay2Commissions = TypedDict("EmploymentDemandLetterInputPay2Commissions", { "amount": float, "period": Literal["last_12_weeks", "year"], }, total=False) # Required: kind, hourlyRate, weeklyHours. EmploymentDemandLetterInputPay2 = TypedDict("EmploymentDemandLetterInputPay2", { "kind": Literal["hourly"], "hourlyRate": float, "weeklyHours": float, "commissions": EmploymentDemandLetterInputPay2Commissions, }, total=False) # Required: kind, averageWeeklyWages. EmploymentDemandLetterInputPay3 = TypedDict("EmploymentDemandLetterInputPay3", { "kind": Literal["varies"], "averageWeeklyWages": float, }, total=False) EmploymentDemandLetterInputOffer = TypedDict("EmploymentDemandLetterInputOffer", { "amount": float, "weeks": float, "releaseRequired": bool, }, total=False) # Required: employeeName, employeeAddress, employerName, employerAddress, endedHow, endDate, age, role, pay, payroll, hasBenefits, terminationClause. EmploymentDemandLetterInput = TypedDict("EmploymentDemandLetterInput", { "employeeName": str, "employeeAddress": str, "employerName": str, "employerAddress": str, "employerAttention": str, "jobTitle": str, "endedHow": Literal["let_go_without_cause", "constructive_dismissal", "laid_off", "fired_for_cause", "other"], "endDate": str, "startDate": str, "yearsOfService": int, "monthsOfService": int, "age": int, "role": Literal["staff", "supervisor", "manager", "executive"], "pay": Union[EmploymentDemandLetterInputPay1, EmploymentDemandLetterInputPay2, EmploymentDemandLetterInputPay3], "payroll": Literal["yes", "no", "unsure"], "hasBenefits": bool, "terminationClause": Literal["yes", "no", "unsure"], "exemptions": List[Literal["federal_employer", "work_outside_ontario", "fixed_term", "temporary_layoff", "wilful_misconduct", "frustration", "refused_alternative_work", "no_return_from_layoff", "strike_or_lockout", "construction", "retirement_age", "unreduced_pension", "shipbuilding", "unsure"]], "offer": EmploymentDemandLetterInputOffer, "workingNoticeWeeks": float, "toldDate": str, "massTermination": Literal["yes", "no", "unsure"], "businessClosure": Literal["yes", "no", "unsure"], "amountDemanded": float, "responseDays": int, "letterDate": str, }, total=False) # Required: endDate. EmploymentLimitationDatesInput = TypedDict("EmploymentLimitationDatesInput", { "endDate": str, "toldDate": str, "endedHow": Literal["let_go_without_cause", "constructive_dismissal", "laid_off", "fired_for_cause", "other"], }, total=False) # Required: amount, period. EmploymentSeveranceCheckInputPay1Commissions = TypedDict("EmploymentSeveranceCheckInputPay1Commissions", { "amount": float, "period": Literal["last_12_weeks", "year"], }, total=False) # Required: kind, annualSalary. EmploymentSeveranceCheckInputPay1 = TypedDict("EmploymentSeveranceCheckInputPay1", { "kind": Literal["salary"], "annualSalary": float, "commissions": EmploymentSeveranceCheckInputPay1Commissions, }, total=False) # Required: amount, period. EmploymentSeveranceCheckInputPay2Commissions = TypedDict("EmploymentSeveranceCheckInputPay2Commissions", { "amount": float, "period": Literal["last_12_weeks", "year"], }, total=False) # Required: kind, hourlyRate, weeklyHours. EmploymentSeveranceCheckInputPay2 = TypedDict("EmploymentSeveranceCheckInputPay2", { "kind": Literal["hourly"], "hourlyRate": float, "weeklyHours": float, "commissions": EmploymentSeveranceCheckInputPay2Commissions, }, total=False) # Required: kind, averageWeeklyWages. EmploymentSeveranceCheckInputPay3 = TypedDict("EmploymentSeveranceCheckInputPay3", { "kind": Literal["varies"], "averageWeeklyWages": float, }, total=False) EmploymentSeveranceCheckInputOffer = TypedDict("EmploymentSeveranceCheckInputOffer", { "amount": float, "weeks": float, "releaseRequired": bool, }, total=False) # Required: endedHow, endDate, age, role, pay, payroll, hasBenefits, terminationClause. EmploymentSeveranceCheckInput = TypedDict("EmploymentSeveranceCheckInput", { "endedHow": Literal["let_go_without_cause", "constructive_dismissal", "laid_off", "fired_for_cause", "other"], "endDate": str, "startDate": str, "yearsOfService": int, "monthsOfService": int, "age": int, "role": Literal["staff", "supervisor", "manager", "executive"], "pay": Union[EmploymentSeveranceCheckInputPay1, EmploymentSeveranceCheckInputPay2, EmploymentSeveranceCheckInputPay3], "payroll": Literal["yes", "no", "unsure"], "hasBenefits": bool, "terminationClause": Literal["yes", "no", "unsure"], "exemptions": List[Literal["federal_employer", "work_outside_ontario", "fixed_term", "temporary_layoff", "wilful_misconduct", "frustration", "refused_alternative_work", "no_return_from_layoff", "strike_or_lockout", "construction", "retirement_age", "unreduced_pension", "shipbuilding", "unsure"]], "offer": EmploymentSeveranceCheckInputOffer, "workingNoticeWeeks": float, "toldDate": str, "massTermination": Literal["yes", "no", "unsure"], "businessClosure": Literal["yes", "no", "unsure"], }, total=False) # Required: clauseText, signedWhen, hadCommissionsOrBonus. EmploymentTerminationClauseCheckInput = TypedDict("EmploymentTerminationClauseCheckInput", { "clauseText": str, "causeClauseText": str, "signedWhen": Literal["before_start", "after_start_terms_agreed_before", "after_start_new_terms", "unsure"], "gotSomethingNewForSigning": Literal["yes", "no", "unsure"], "hadCommissionsOrBonus": Literal["yes", "no", "unsure"], "payroll": Literal["yes", "no", "unsure"], "employerContinuedBenefits": Literal["yes", "no", "unsure"], "dateSigned": str, }, total=False) GeneralLimitationPeriodInput = TypedDict("GeneralLimitationPeriodInput", { "happenedOn": str, "discoveredOn": str, "situations": List[Union[Literal["minor"], Literal["incapable"], Literal["sexual_misconduct_or_assault"], Literal["acknowledged"], Literal["mediation"], Literal["demand_obligation"], Literal["continuing_or_series"], Literal["concealed_or_misled"], Literal["enforce_court_order"], Literal["tribunal_or_other_law"], Literal["agreement_to_extend"], Literal["environmental"]]], "today": str, }, total=False) # Required: category. GeneralTriageInput = TypedDict("GeneralTriageInput", { "category": Union[Literal["arrested_or_charged"], Literal["job_ended"], Literal["owed_money"], Literal["sued_for_money"], Literal["injury_or_damage"], Literal["tenant_problem"], Literal["landlord_problem"], Literal["starting_business"], Literal["other"]], "area": Union[Literal["criminal"], Literal["employment"], Literal["small-claims"], Literal["ltb"], Literal["corporate"], Literal["unknown"]], "inCustody": bool, "nextDate": str, "happenedOn": str, "discoveredOn": str, "situations": List[Union[Literal["minor"], Literal["incapable"], Literal["sexual_misconduct_or_assault"], Literal["acknowledged"], Literal["mediation"], Literal["demand_obligation"], Literal["continuing_or_series"], Literal["concealed_or_misled"], Literal["enforce_court_order"], Literal["tribunal_or_other_law"], Literal["agreement_to_extend"], Literal["environmental"]]], "today": str, }, total=False) # Required: type, firstName, lastName. LtbL1PrepareInputLandlordsItem1 = TypedDict("LtbL1PrepareInputLandlordsItem1", { "type": Literal["person"], "firstName": str, "lastName": str, }, total=False) # Required: type, companyName. LtbL1PrepareInputLandlordsItem2 = TypedDict("LtbL1PrepareInputLandlordsItem2", { "type": Literal["company"], "companyName": str, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbL1PrepareInputLandlordContactAddress = TypedDict("LtbL1PrepareInputLandlordContactAddress", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "province": Literal["ON", "QC", "NS", "NB", "MB", "BC", "PE", "SK", "AB", "NL", "NT", "YT", "NU"], "postalCode": str, }, total=False) # Required: phone, address. LtbL1PrepareInputLandlordContact = TypedDict("LtbL1PrepareInputLandlordContact", { "phone": str, "email": str, "address": LtbL1PrepareInputLandlordContactAddress, "communication": Literal["mail", "email"], }, total=False) # Required: firstName, lastName. LtbL1PrepareInputTenantsItem = TypedDict("LtbL1PrepareInputTenantsItem", { "firstName": str, "lastName": str, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbL1PrepareInputRentalUnit = TypedDict("LtbL1PrepareInputRentalUnit", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "postalCode": str, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbL1PrepareInputTenantMailingAddress = TypedDict("LtbL1PrepareInputTenantMailingAddress", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "province": Literal["ON", "QC", "NS", "NB", "MB", "BC", "PE", "SK", "AB", "NL", "NT", "YT", "NU"], "postalCode": str, }, total=False) # Required: amount. LtbL1PrepareInputRent = TypedDict("LtbL1PrepareInputRent", { "amount": float, "period": Literal["monthly", "weekly", "daily", "yearly"], }, total=False) # Required: method, date. LtbL1PrepareInputN4Service = TypedDict("LtbL1PrepareInputN4Service", { "method": Literal["hand", "adult_in_unit", "mailbox", "under_door", "mail", "xpresspost", "courier", "fax", "email"], "date": str, "emailConsentInWriting": bool, }, total=False) # Required: service, terminationDate. LtbL1PrepareInputN4 = TypedDict("LtbL1PrepareInputN4", { "service": LtbL1PrepareInputN4Service, "terminationDate": str, }, total=False) # Required: from, to, rentCharged. LtbL1PrepareInputPeriodsItem = TypedDict("LtbL1PrepareInputPeriodsItem", { "from": str, "to": str, "rentCharged": float, "rentPaid": float, }, total=False) # Required: chequeAmount, chequeDate, chargeDate, bankCharge. LtbL1PrepareInputNsfChequesItem = TypedDict("LtbL1PrepareInputNsfChequesItem", { "chequeAmount": float, "chequeDate": str, "chargeDate": str, "bankCharge": float, "adminCharge": float, }, total=False) # Required: amount, collectedOn. LtbL1PrepareInputDeposit = TypedDict("LtbL1PrepareInputDeposit", { "amount": float, "collectedOn": str, "interestPaidFrom": str, "interestPaidTo": str, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbL1PrepareInputSignerRepresentativeAddress = TypedDict("LtbL1PrepareInputSignerRepresentativeAddress", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "province": Literal["ON", "QC", "NS", "NB", "MB", "BC", "PE", "SK", "AB", "NL", "NT", "YT", "NU"], "postalCode": str, }, total=False) LtbL1PrepareInputSignerRepresentative = TypedDict("LtbL1PrepareInputSignerRepresentative", { "lsoNumber": str, "companyName": str, "email": str, "address": LtbL1PrepareInputSignerRepresentativeAddress, }, total=False) # Required: firstName, lastName, phone. LtbL1PrepareInputSigner = TypedDict("LtbL1PrepareInputSigner", { "role": Literal["landlord", "representative"], "firstName": str, "lastName": str, "phone": str, "signDate": str, "representative": LtbL1PrepareInputSignerRepresentative, }, total=False) # Required: landlords, landlordContact, tenants, rentalUnit, rent, n4, periods, signer. LtbL1PrepareInput = TypedDict("LtbL1PrepareInput", { "landlords": List[Union[LtbL1PrepareInputLandlordsItem1, LtbL1PrepareInputLandlordsItem2]], "landlordContact": LtbL1PrepareInputLandlordContact, "tenants": List[LtbL1PrepareInputTenantsItem], "rentalUnit": LtbL1PrepareInputRentalUnit, "tenantMailingAddress": LtbL1PrepareInputTenantMailingAddress, "rent": LtbL1PrepareInputRent, "n4": LtbL1PrepareInputN4, "periods": List[LtbL1PrepareInputPeriodsItem], "nsfCheques": List[LtbL1PrepareInputNsfChequesItem], "deposit": LtbL1PrepareInputDeposit, "tenantInPossession": bool, "filingDate": str, "filingMethod": Literal["portal", "mail_or_courier", "service_ontario"], "paymentMethod": Literal["credit_card", "certified_cheque", "money_order"], "language": Literal["english", "french"], "signer": LtbL1PrepareInputSigner, }, total=False) # Required: type, firstName, lastName. LtbN4BulkInputLandlordsItem1 = TypedDict("LtbN4BulkInputLandlordsItem1", { "type": Literal["person"], "firstName": str, "lastName": str, }, total=False) # Required: type, companyName. LtbN4BulkInputLandlordsItem2 = TypedDict("LtbN4BulkInputLandlordsItem2", { "type": Literal["company"], "companyName": str, }, total=False) # Required: method, date. LtbN4BulkInputService = TypedDict("LtbN4BulkInputService", { "method": Literal["hand", "adult_in_unit", "mailbox", "under_door", "mail", "xpresspost", "courier", "fax", "email"], "date": str, "emailConsentInWriting": bool, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbN4BulkInputSignerRepresentativeAddress = TypedDict("LtbN4BulkInputSignerRepresentativeAddress", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "province": Literal["ON", "QC", "NS", "NB", "MB", "BC", "PE", "SK", "AB", "NL", "NT", "YT", "NU"], "postalCode": str, }, total=False) LtbN4BulkInputSignerRepresentative = TypedDict("LtbN4BulkInputSignerRepresentative", { "lsoNumber": str, "companyName": str, "email": str, "address": LtbN4BulkInputSignerRepresentativeAddress, }, total=False) # Required: firstName, lastName, phone. LtbN4BulkInputSigner = TypedDict("LtbN4BulkInputSigner", { "role": Literal["landlord", "representative"], "firstName": str, "lastName": str, "phone": str, "signDate": str, "representative": LtbN4BulkInputSignerRepresentative, }, total=False) # Required: firstName, lastName. LtbN4BulkInputUnitsItemTenantsItem = TypedDict("LtbN4BulkInputUnitsItemTenantsItem", { "firstName": str, "lastName": str, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbN4BulkInputUnitsItemRentalUnit = TypedDict("LtbN4BulkInputUnitsItemRentalUnit", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "postalCode": str, }, total=False) # Required: amount. LtbN4BulkInputUnitsItemRent = TypedDict("LtbN4BulkInputUnitsItemRent", { "amount": float, "period": Literal["monthly", "weekly", "daily", "yearly"], }, total=False) # Required: from, to, rentCharged. LtbN4BulkInputUnitsItemPeriodsItem = TypedDict("LtbN4BulkInputUnitsItemPeriodsItem", { "from": str, "to": str, "rentCharged": float, "rentPaid": float, }, total=False) # Required: reference, tenants, rentalUnit, rent. LtbN4BulkInputUnitsItem = TypedDict("LtbN4BulkInputUnitsItem", { "reference": str, "tenants": List[LtbN4BulkInputUnitsItemTenantsItem], "rentalUnit": LtbN4BulkInputUnitsItemRentalUnit, "rent": LtbN4BulkInputUnitsItemRent, "periods": List[LtbN4BulkInputUnitsItemPeriodsItem], }, total=False) # Required: landlords, service, signer, units. LtbN4BulkInput = TypedDict("LtbN4BulkInput", { "landlords": List[Union[LtbN4BulkInputLandlordsItem1, LtbN4BulkInputLandlordsItem2]], "service": LtbN4BulkInputService, "terminationDate": str, "signer": LtbN4BulkInputSigner, "units": List[LtbN4BulkInputUnitsItem], }, total=False) # Required: type, firstName, lastName. LtbN4PrepareInputLandlordsItem1 = TypedDict("LtbN4PrepareInputLandlordsItem1", { "type": Literal["person"], "firstName": str, "lastName": str, }, total=False) # Required: type, companyName. LtbN4PrepareInputLandlordsItem2 = TypedDict("LtbN4PrepareInputLandlordsItem2", { "type": Literal["company"], "companyName": str, }, total=False) # Required: firstName, lastName. LtbN4PrepareInputTenantsItem = TypedDict("LtbN4PrepareInputTenantsItem", { "firstName": str, "lastName": str, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbN4PrepareInputRentalUnit = TypedDict("LtbN4PrepareInputRentalUnit", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "postalCode": str, }, total=False) # Required: amount. LtbN4PrepareInputRent = TypedDict("LtbN4PrepareInputRent", { "amount": float, "period": Literal["monthly", "weekly", "daily", "yearly"], }, total=False) # Required: from, to, rentCharged. LtbN4PrepareInputPeriodsItem = TypedDict("LtbN4PrepareInputPeriodsItem", { "from": str, "to": str, "rentCharged": float, "rentPaid": float, }, total=False) # Required: method, date. LtbN4PrepareInputService = TypedDict("LtbN4PrepareInputService", { "method": Literal["hand", "adult_in_unit", "mailbox", "under_door", "mail", "xpresspost", "courier", "fax", "email"], "date": str, "emailConsentInWriting": bool, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbN4PrepareInputSignerRepresentativeAddress = TypedDict("LtbN4PrepareInputSignerRepresentativeAddress", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "province": Literal["ON", "QC", "NS", "NB", "MB", "BC", "PE", "SK", "AB", "NL", "NT", "YT", "NU"], "postalCode": str, }, total=False) LtbN4PrepareInputSignerRepresentative = TypedDict("LtbN4PrepareInputSignerRepresentative", { "lsoNumber": str, "companyName": str, "email": str, "address": LtbN4PrepareInputSignerRepresentativeAddress, }, total=False) # Required: firstName, lastName, phone. LtbN4PrepareInputSigner = TypedDict("LtbN4PrepareInputSigner", { "role": Literal["landlord", "representative"], "firstName": str, "lastName": str, "phone": str, "signDate": str, "representative": LtbN4PrepareInputSignerRepresentative, }, total=False) # Required: kind, amount. LtbN4PrepareInputOtherAmountsItem = TypedDict("LtbN4PrepareInputOtherAmountsItem", { "kind": Literal["parking_or_services", "flat_utility_rate", "seasonal_air_conditioner", "utility_share_or_bill", "nsf_bank_charge", "nsf_admin_charge", "rent_deposit", "late_fee", "damage", "other_charge"], "amount": float, "description": str, }, total=False) # Required: landlords, tenants, rentalUnit, rent, periods, service, signer. LtbN4PrepareInput = TypedDict("LtbN4PrepareInput", { "landlords": List[Union[LtbN4PrepareInputLandlordsItem1, LtbN4PrepareInputLandlordsItem2]], "tenants": List[LtbN4PrepareInputTenantsItem], "rentalUnit": LtbN4PrepareInputRentalUnit, "rent": LtbN4PrepareInputRent, "periods": List[LtbN4PrepareInputPeriodsItem], "service": LtbN4PrepareInputService, "terminationDate": str, "signer": LtbN4PrepareInputSigner, "otherAmounts": List[LtbN4PrepareInputOtherAmountsItem], }, total=False) # Required: application. LtbOutcomesInput = TypedDict("LtbOutcomesInput", { "application": Union[Literal["L1"], Literal["L2"], Literal["L3"], Literal["L4"], Literal["L5"], Literal["L6"], Literal["L7"], Literal["L8"], Literal["L9"], Literal["L10"], Literal["T1"], Literal["T2"], Literal["T3"], Literal["T4"], Literal["T5"], Literal["T6"], Literal["T7"], Literal["A1"], Literal["A2"], Literal["A4"]], "alone": bool, "fromMonth": str, "toMonth": str, }, total=False) # Required: method, date. LtbRentIncreaseCheckInputNoticeService = TypedDict("LtbRentIncreaseCheckInputNoticeService", { "method": Literal["hand", "adult_in_unit", "mailbox", "under_door", "mail", "xpresspost", "courier", "fax", "email"], "date": str, "emailConsentInWriting": bool, }, total=False) # Required: kind. LtbRentIncreaseCheckInputNotice = TypedDict("LtbRentIncreaseCheckInputNotice", { "kind": Literal["ltb_form", "other_writing", "none"], "service": LtbRentIncreaseCheckInputNoticeService, }, total=False) # Required: currentRent, newRent, effectiveDate, tenancyStartDate, notice. LtbRentIncreaseCheckInput = TypedDict("LtbRentIncreaseCheckInput", { "currentRent": float, "newRent": float, "effectiveDate": str, "tenancyStartDate": str, "lastIncreaseDate": str, "notice": LtbRentIncreaseCheckInputNotice, "exemption": Literal["none", "new_building", "new_unit_in_house", "unknown"], "tenancyAgreementOnOrBefore20181115": bool, "basis": Literal["none", "ltb_order", "agreement_s121", "added_service_s123"], }, total=False) # Required: kind, date. LtbTenantPathInputIssuesItem = TypedDict("LtbTenantPathInputIssuesItem", { "kind": Literal["repairs_maintenance", "vital_service_withheld", "reasonable_enjoyment", "harassment", "locks_changed", "illegal_entry", "illegal_rent_or_charge", "deposit_not_returned", "compensation_not_paid", "bad_faith_notice", "first_refusal_denied"], "date": str, "ongoing": bool, "description": str, }, total=False) # Required: amount. LtbTenantPathInputRent = TypedDict("LtbTenantPathInputRent", { "amount": float, "period": Literal["monthly", "weekly", "daily", "yearly"], }, total=False) # Required: firstName, lastName. LtbTenantPathInputTenantsItem = TypedDict("LtbTenantPathInputTenantsItem", { "firstName": str, "lastName": str, }, total=False) # Required: type, firstName, lastName. LtbTenantPathInputLandlord1 = TypedDict("LtbTenantPathInputLandlord1", { "type": Literal["person"], "firstName": str, "lastName": str, }, total=False) # Required: type, companyName. LtbTenantPathInputLandlord2 = TypedDict("LtbTenantPathInputLandlord2", { "type": Literal["company"], "companyName": str, }, total=False) # Required: streetNumber, streetName, municipality, postalCode. LtbTenantPathInputRentalUnit = TypedDict("LtbTenantPathInputRentalUnit", { "unit": str, "streetNumber": str, "streetName": str, "municipality": str, "postalCode": str, }, total=False) # Required: issues, stillLivingThere. LtbTenantPathInput = TypedDict("LtbTenantPathInput", { "issues": List[LtbTenantPathInputIssuesItem], "stillLivingThere": bool, "movedOutOn": str, "renovationsCompletedOn": str, "firstToldLandlordOn": str, "compensationSought": float, "rent": LtbTenantPathInputRent, "tenants": List[LtbTenantPathInputTenantsItem], "landlord": Union[LtbTenantPathInputLandlord1, LtbTenantPathInputLandlord2], "rentalUnit": LtbTenantPathInputRentalUnit, "today": str, }, total=False) # Required: method, date. LtbTerminationDateInputService = TypedDict("LtbTerminationDateInputService", { "method": Literal["hand", "adult_in_unit", "mailbox", "under_door", "mail", "xpresspost", "courier", "fax", "email"], "date": str, "emailConsentInWriting": bool, }, total=False) # Required: kind. LtbTerminationDateInputTenancy1 = TypedDict("LtbTerminationDateInputTenancy1", { "kind": Literal["daily"], }, total=False) # Required: kind, rentDueWeekday. LtbTerminationDateInputTenancy2 = TypedDict("LtbTerminationDateInputTenancy2", { "kind": Literal["weekly"], "rentDueWeekday": Literal["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"], }, total=False) # Required: kind. LtbTerminationDateInputTenancy3 = TypedDict("LtbTerminationDateInputTenancy3", { "kind": Literal["monthly"], "rentDueDay": int, }, total=False) # Required: kind, periodStartDate. LtbTerminationDateInputTenancy4 = TypedDict("LtbTerminationDateInputTenancy4", { "kind": Literal["yearly"], "periodStartDate": str, }, total=False) # Required: kind, termEndDate. LtbTerminationDateInputTenancy5 = TypedDict("LtbTerminationDateInputTenancy5", { "kind": Literal["fixed_term"], "termEndDate": str, "rentPaid": Literal["daily", "weekly", "monthly", "yearly"], }, total=False) # Required: notice, service. LtbTerminationDateInput = TypedDict("LtbTerminationDateInput", { "notice": Literal["N4", "N5", "N8", "N12", "N13"], "service": LtbTerminationDateInputService, "tenancy": Union[LtbTerminationDateInputTenancy1, LtbTerminationDateInputTenancy2, LtbTerminationDateInputTenancy3, LtbTerminationDateInputTenancy4, LtbTerminationDateInputTenancy5], "n12Reason": Literal["landlord_or_family", "purchaser"], "terminationDateOnNotice": str, }, total=False) SmallClaimsRouteInput = TypedDict("SmallClaimsRouteInput", { "side": Union[Literal["claimant"], Literal["defendant"]], "amount": float, "category": Union[Literal["invoice"], Literal["deposit"], Literal["loan"], Literal["job"], Literal["damage"], Literal["tenancy"], Literal["other"]], }, total=False) # Required: dueDate. SmallClaimsStartClaimInputInvoice = TypedDict("SmallClaimsStartClaimInputInvoice", { "dueDate": str, "number": str, "date": str, "description": str, }, total=False) # Required: name. SmallClaimsStartClaimInputDebtor = TypedDict("SmallClaimsStartClaimInputDebtor", { "name": str, "kind": Union[Literal["person"], Literal["business"]], "address": str, "email": str, }, total=False) # Required: name, address, email. SmallClaimsStartClaimInputSender = TypedDict("SmallClaimsStartClaimInputSender", { "name": str, "kind": Union[Literal["person"], Literal["business"]], "address": str, "email": str, "phone": str, }, total=False) # Required: amount, invoice, debtor, sender. SmallClaimsStartClaimInput = TypedDict("SmallClaimsStartClaimInput", { "amount": float, "invoice": SmallClaimsStartClaimInputInvoice, "debtor": SmallClaimsStartClaimInputDebtor, "sender": SmallClaimsStartClaimInputSender, }, total=False) class Mithril: """The REST API. Free operations run without a key.""" def __init__(self, api_key: Optional[str] = None, base_url: str = "https://mithril.law", agent: str = "my-agent/1.0", timeout: float = 30.0): self.base_url = base_url.rstrip("/") self.api_key = api_key self.agent = agent self.timeout = timeout def _request(self, method: str, path: str, body: Any = None, idempotency_key: Optional[str] = None) -> Any: headers = {"Accept": "application/json", "Mithril-Agent": self.agent} if self.api_key: headers["Authorization"] = "Bearer " + self.api_key data = None if body is not None: headers["Content-Type"] = "application/json" headers["Idempotency-Key"] = idempotency_key or str(uuid.uuid4()) data = json.dumps(body).encode() req = Request(self.base_url + path, data=data, headers=headers, method=method) try: with urlopen(req, timeout=self.timeout) as res: return json.load(res) except HTTPError as err: try: e = json.load(err).get("error", {}) except Exception: e = {} raise MithrilError(err.code, e.get("code", "http_%d" % err.code), e.get("message", str(err)), e.get("hint"), e.get("details")) from None def run(self, operation_id: str, facts: Any, idempotency_key: Optional[str] = None) -> Run: """Run any operation by id. The typed methods below call this.""" return self._request("POST", "/api/v1/operations/%s/runs" % operation_id, {"input": facts}, idempotency_key) def get_run(self, run_id: str) -> Run: return self._request("GET", "/api/v1/runs/" + run_id) def verify_receipt(self, jws: str) -> Dict[str, Any]: """Ask mithril.law to check a receipt's signature (or check it yourself against /.well-known/jwks.json).""" return self._request("POST", "/api/v1/receipts/verify", {"jws": jws}) def create_handoff(self, request: Dict[str, Any], idempotency_key: Optional[str] = None) -> Dict[str, Any]: """Hand the matter to Jonathan Kleiman, a licensed Ontario lawyer. Give the consentUrl to the person and to no one else.""" return self._request("POST", "/api/v1/handoffs", request, idempotency_key) def get_handoff(self, handoff_id: str) -> Dict[str, Any]: return self._request("GET", "/api/v1/handoffs/" + handoff_id) def corporate_annual_maintenance(self, facts: CorporateAnnualMaintenanceInput, idempotency_key: Optional[str] = None) -> Run: """The year’s resolutions and annual return: For founders on the founder plan: the year’s director and shareholder resolutions, the annual return and its deadline, and the register updates. Price: CAD 299 per company per year plus HST. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/corporate.annual_maintenance/runs. MCP tool corporate_annual_maintenance.""" return self.run("corporate.annual_maintenance", facts, idempotency_key) def corporate_incorporation_plan(self, facts: CorporateIncorporationPlanInput, idempotency_key: Optional[str] = None) -> Run: """Where to incorporate, and what it costs: For founders: Ontario or federal incorporation, the steps in order, and the whole cost, itemized, before you pay anything. Price: Free. Runs without a key. POST /api/v1/operations/corporate.incorporation_plan/runs. MCP tool corporate_incorporation_plan.""" return self.run("corporate.incorporation_plan", facts, idempotency_key) def corporate_incorporation_prepare(self, facts: CorporateIncorporationPrepareInput, idempotency_key: Optional[str] = None) -> Run: """Incorporation package: For founders: every document to incorporate, filled from your answers. The articles data sheet, by-law, organizational resolutions, subscriptions, consents, share certificates, registers and minute book index. Price: CAD 399 plus HST. The government filing fee is extra.. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/corporate.incorporation_prepare/runs. MCP tool corporate_incorporation_prepare.""" return self.run("corporate.incorporation_prepare", facts, idempotency_key) def corporate_isc_register(self, facts: CorporateIscRegisterInput, idempotency_key: Optional[str] = None) -> Run: """Register of individuals with significant control: For founders on the founder plan: who has significant control under the 25% tests, and the register ready to keep. Price: CAD 299 per company per year plus HST. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/corporate.isc_register/runs. MCP tool corporate_isc_register.""" return self.run("corporate.isc_register", facts, idempotency_key) def corporate_share_issuance(self, facts: CorporateShareIssuanceInput, idempotency_key: Optional[str] = None) -> Run: """Issue shares: For founders on the founder plan: the directors’ resolution to issue shares, the subscriptions and certificates, and the updated registers. Anything that needs a lawyer is flagged. Price: CAD 299 per company per year plus HST. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/corporate.share_issuance/runs. MCP tool corporate_share_issuance.""" return self.run("corporate.share_issuance", facts, idempotency_key) def criminal_intake_triage(self, facts: CriminalIntakeTriageInput, idempotency_key: Optional[str] = None) -> Run: """How urgent is a criminal matter: From custody and court dates only: how fast to reach me, and whether to call now or book a consultation. No legal conclusions. Price: Free. Runs without a key. POST /api/v1/operations/criminal.intake_triage/runs. MCP tool criminal_intake_triage.""" return self.run("criminal.intake_triage", facts, idempotency_key) def criminal_legal_aid_path(self, facts: CriminalLegalAidPathInput, idempotency_key: Optional[str] = None) -> Run: """Getting a legal aid lawyer for a criminal charge: How to apply to Legal Aid Ontario for a certificate, what a certificate is, and what to send me once you have one. Legal Aid certificates accepted for criminal defence matters. Price: Free. Runs without a key. POST /api/v1/operations/criminal.legal_aid_path/runs. MCP tool criminal_legal_aid_path.""" return self.run("criminal.legal_aid_path", facts, idempotency_key) def criminal_what_happens_next(self, facts: CriminalWhatHappensNextInput, idempotency_key: Optional[str] = None) -> Run: """Someone was arrested or charged: what happens next: For an accused person or their family: what happens next in order, your rights at this stage, what to do and not do, and how to get a lawyer, every line cited. Price: Free. Runs without a key. POST /api/v1/operations/criminal.what_happens_next/runs. MCP tool criminal_what_happens_next.""" return self.run("criminal.what_happens_next", facts, idempotency_key) def employment_demand_letter(self, facts: EmploymentDemandLetterInput, idempotency_key: Optional[str] = None) -> Run: """Demand letter: A demand letter from an Ontario employee to their former employer, with the ESA sections and the common-law claim, as DOCX and PDF. The person signs and sends it. Price: CAD 149 plus HST. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/employment.demand_letter/runs. MCP tool employment_demand_letter.""" return self.run("employment.demand_letter", facts, idempotency_key) def employment_limitation_dates(self, facts: EmploymentLimitationDatesInput, idempotency_key: Optional[str] = None) -> Run: """Deadlines after a job ends: The last day to sue for wrongful dismissal and the last day to file an ESA complaint in Ontario, with the choice between them. Price: Free. Runs without a key. POST /api/v1/operations/employment.limitation_dates/runs. MCP tool employment_limitation_dates.""" return self.run("employment.limitation_dates", facts, idempotency_key) def employment_severance_check(self, facts: EmploymentSeveranceCheckInput, idempotency_key: Optional[str] = None) -> Run: """Severance check: What an Ontario employee is owed when a job ends: the ESA minimum, an estimate of the common-law range, the employer’s offer against both, and the deadlines. Price: Free. Runs without a key. POST /api/v1/operations/employment.severance_check/runs. MCP tool employment_severance_check.""" return self.run("employment.severance_check", facts, idempotency_key) def employment_termination_clause_check(self, facts: EmploymentTerminationClauseCheckInput, idempotency_key: Optional[str] = None) -> Run: """Termination clause check: Checks the wording of an Ontario employment contract’s termination clause for defects the Court of Appeal has recognized. Price: Free. Runs without a key. POST /api/v1/operations/employment.termination_clause_check/runs. MCP tool employment_termination_clause_check.""" return self.run("employment.termination_clause_check", facts, idempotency_key) def general_limitation_period(self, facts: GeneralLimitationPeriodInput, idempotency_key: Optional[str] = None) -> Run: """How long you have to sue in Ontario: The Limitations Act, 2002 deadlines for a court claim: two years from discovery and 15 years from the day it happened, with the common exceptions flagged for a lawyer. Price: Free. Runs without a key. POST /api/v1/operations/general.limitation_period/runs. MCP tool general_limitation_period.""" return self.run("general.limitation_period", facts, idempotency_key) def general_triage(self, facts: GeneralTriageInput, idempotency_key: Optional[str] = None) -> Run: """Where to start with a legal problem in Ontario: The front door: from what happened and a few dates, which Mithril operations fit, how urgent it is, and the time limit to sue where one may apply. Price: Free. Runs without a key. POST /api/v1/operations/general.triage/runs. MCP tool general_triage.""" return self.run("general.triage", facts, idempotency_key) def ltb_l1_prepare(self, facts: LtbL1PrepareInput, idempotency_key: Optional[str] = None) -> Run: """Prepare an L1 to evict for non-payment of rent: Checks the landlord may file, adds up rent owing to the filing date, NSF charges and the fee, fills the official L1, and explains how to file it. Price: CAD 1 per unit per month, minimum CAD 49, plus HST. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/ltb.l1_prepare/runs. MCP tool ltb_l1_prepare.""" return self.run("ltb.l1_prepare", facts, idempotency_key) def ltb_n4_bulk(self, facts: LtbN4BulkInput, idempotency_key: Optional[str] = None) -> Run: """An N4 for every unit in arrears: One N4 for each unit in arrears across a rent roll, the batch in one table, and what to fix for any unit that needs it. Price: CAD 1 per unit per month, minimum CAD 49, plus HST. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/ltb.n4_bulk/runs. MCP tool ltb_n4_bulk.""" return self.run("ltb.n4_bulk", facts, idempotency_key) def ltb_n4_prepare(self, facts: LtbN4PrepareInput, idempotency_key: Optional[str] = None) -> Run: """Prepare an N4 for non-payment of rent: Checks what the N4 may claim, adds up the rent owing, sets the termination date, and fills the official N4 for the landlord to sign and serve. Price: CAD 1 per unit per month, minimum CAD 49, plus HST. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/ltb.n4_prepare/runs. MCP tool ltb_n4_prepare.""" return self.run("ltb.n4_prepare", facts, idempotency_key) def ltb_outcomes(self, facts: LtbOutcomesInput, idempotency_key: Optional[str] = None) -> Run: """LTB orders by application: How many orders the Board issued for an application, by kind of order, month and filing year, from the LTB’s open data. Price: Free. Runs without a key. POST /api/v1/operations/ltb.outcomes/runs. MCP tool ltb_outcomes.""" return self.run("ltb.outcomes", facts, idempotency_key) def ltb_rent_increase_check(self, facts: LtbRentIncreaseCheckInput, idempotency_key: Optional[str] = None) -> Run: """Is this rent increase lawful?: Checks an increase against the guideline, the 12-month rule, the 90 days’ written notice and the exemption for newer units, then says what each side can do. Price: Free. Runs without a key. POST /api/v1/operations/ltb.rent_increase_check/runs. MCP tool ltb_rent_increase_check.""" return self.run("ltb.rent_increase_check", facts, idempotency_key) def ltb_tenant_path(self, facts: LtbTenantPathInput, idempotency_key: Optional[str] = None) -> Run: """Which LTB application fits a tenant’s problem: Which application fits a tenant’s problem (T1, T2, T5 or T6), the deadline for each, the fee, what to gather and the facts the form asks for. Price: Free. Runs without a key. The facts identify a person: the receipt is private. POST /api/v1/operations/ltb.tenant_path/runs. MCP tool ltb_tenant_path.""" return self.run("ltb.tenant_path", facts, idempotency_key) def ltb_termination_date(self, facts: LtbTerminationDateInput, idempotency_key: Optional[str] = None) -> Run: """Termination date for a notice: The earliest valid termination date for an N4, N5, N8, N12 or N13, when the notice counts as given, and when the landlord can apply. Price: Free. Runs without a key. POST /api/v1/operations/ltb.termination_date/runs. MCP tool ltb_termination_date.""" return self.run("ltb.termination_date", facts, idempotency_key) def small_claims_route(self, facts: SmallClaimsRouteInput, idempotency_key: Optional[str] = None) -> Run: """Small claims: is it the right court, and where to go: Checks whether an amount is within the Small Claims Court’s limit, and links to makethempay.ca, which opens the claim, with the amount filled in. Price: Free. Runs without a key. POST /api/v1/operations/small_claims.route/runs. MCP tool small_claims_route.""" return self.run("small_claims.route", facts, idempotency_key) def small_claims_start_claim(self, facts: SmallClaimsStartClaimInput, idempotency_key: Optional[str] = None) -> Run: """Open a small claims case at makethempay.ca from an invoice: Forwards an unpaid invoice to makethempay.ca’s Claims API, which opens the case and prepares a dated demand letter. Returns makethempay.ca’s own answer. Price: Free. Needs an API key or a token with runs:write. The facts identify a person: the receipt is private. POST /api/v1/operations/small_claims.start_claim/runs. MCP tool small_claims_start_claim.""" return self.run("small_claims.start_claim", facts, idempotency_key)