from pydantic import Field from src.converter import CamelCasedModel, DataProductStandard class DimensionsAndWeightsResponse(CamelCasedModel): gross_weight: str = Field(..., title="Gross weight") height: float = Field(..., title="Height") length: float = Field(..., title="Length") net_weight: float = Field(..., title="Net weight") product_description: str = Field(..., title="Product description") product_name: str = Field(..., title="Product name") volume: float = Field(..., title="Volume") width: float = Field(..., title="Width") class DimensionsAndWeightsRequest(CamelCasedModel): product_code: str = Field(..., title="Product code") STANDARD = DataProductStandard( generic_description="Dimensions And Weights", request=DimensionsAndWeightsRequest, response=DimensionsAndWeightsResponse, )
class BasicCompanyInfoRequest(BaseModel): companyId: str = Field( ..., title="Company Id", description="The ID of the company", example="2464491-9", ) class BasicCompanyInfoResponse(BaseModel): name: str = Field( ..., title="Name of the company", example="Digital Living International Oy" ) companyId: str = Field(..., title="ID of the company", example="2464491-9") companyForm: str = Field( ..., title="The company form of the company", example="LLC" ) registrationDate: str = Field( ..., title="Date of registration for the company", example="2012-02-23" ) STANDARD = DataProductStandard( description="Data Product for basic company info", request=BasicCompanyInfoRequest, response=BasicCompanyInfoResponse, route_description="Information about the company", summary="Basic Company Info", )
description="Name of the shareholder", example="Matti Meikäläinen | Oy Company Ltd", ) ownerships: List[Ownerships] = Field(..., title="Ownerships", description="List of Ownerships") class ShareholdersInfoRequest(BaseModel): companyId: str = Field( ..., title="Company Id", description= "The ID of the company, only supports Finnish business ID's", example="2464491-9", ) class ShareholdersInfoResponse(BaseModel): shareSeries: List[ShareSeries] = Field(title="Share series") owners: List[Owners] STANDARD = DataProductStandard( description="Data Product for Basic Shareholders info", request=ShareholdersInfoRequest, response=ShareholdersInfoResponse, route_description="Information about the shareholders of the company", summary="Basic Shareholders Info", )
"101-150 Unhealthy For Sensitive Groups;\n151-200 Unhealthy;\n" "201-300 Very Unhealthy;\n301+ Hazardous"), ge=0, example=30, ) timestamp: str = Field( ..., title="Timestamp", description="Current timestamp in RFC 3339 format", example="2020-04-03T13:00:00Z", ) attribution: List[str] = Field( ..., title="Source Attribution", description="List of text to show required credits to data sources", example=[ "Moscow State environmental monitoring " "(Государственный экологический мониторинг в Москве)", "World Air Quality Index Project", ], ) STANDARD = DataProductStandard( description="Data Product for current air quality index", request=CurrentAirQualityRequest, response=CurrentAirQualityResponse, route_description="Current air quality", summary="Air Quality Index", )
from typing import List from pydantic import BaseModel, Field from src.converter import DataProductStandard class HealthDiagnosesRequest(BaseModel): pass class HealthDiagnosesResponse(BaseModel): diagnoses: List[str] = Field( ..., description="Users diagnoses in ICD10 code", example=["icd10:J45"] ) STANDARD = DataProductStandard( description="Data Product for user's diagnoses with ICD10 codes", request=HealthDiagnosesRequest, response=HealthDiagnosesResponse, route_description="Health diagnoses in ICD codes", summary="Persons Diagnoses", )
title="RSSI", description="Received Signal Strength Indication, in dBm", example=-55, ) class BLEBeaconsRequest(BaseModel): beacons: List[Beacon] class BLEBeaconsResponse(CamelCasedModel): location_id: str = Field( ..., title="Location ID", description="Location ID", example="849cc493-efb7-483f-b634-7a44849270f9", ) location_name: str = Field(..., title="Location name", description="Location name", example="Deck #3") STANDARD = DataProductStandard( description="Data Product for indoor location based on BLE beacons", request=BLEBeaconsRequest, response=BLEBeaconsResponse, route_description="Indoor location based on BLE beacons", summary="BLE Beacons", )
example="Looking for data product companies to invest on", ) class Recommendation(BaseModel): score: int = Field( ..., description="Recommendation score of the company", example=231 ) companyId: str = Field( ..., title="Company ID", description="Company ID", example="2464491-9" ) companyName: str = Field( ..., title="Company name", description="Company name", example="Digital Living Oy", ) class RecommendationResponse(BaseModel): results: List[Recommendation] = Field(..., title="Recommendation results") STANDARD = DataProductStandard( request=RecommendationRequest, response=RecommendationResponse, route_description="Data Product for company recommendations score", description="Data Product for company recommendations score", summary="Company Recommendations Scores", )
beneficiary_name: str = Field(..., title="Beneficiary name") confirmation_instructions: str = Field(..., title="Confirmation instructions") contract_reference: str = Field(..., title="Contract reference") credit_availability: str = Field(..., title="Credit availability") currency_code: str = Field(..., title="Currency code") date_of_expiry: datetime = Field(..., title="Date of expiry") description_of_goods: str = Field(..., title="Description of goods") incoterm: str = Field(..., title="Incoterm") incoterm_place: str = Field(..., title="Incoterm place") issue_date: datetime = Field(..., title="Issue date") issuing_bank_bic: str = Field(..., title="Issuing bank BIC") issuing_bank_name: str = Field(..., title="Issuing bank name") latest_date_of_shipment: datetime = Field(..., title="Latest date of shipment") letter_of_credit_value: int = Field(..., title="Letter of credit value") class ExportInstructionsRequest(CamelCasedModel): letter_of_credit_number: str = Field( ..., alias="letterOfCreditNumber", title="Letter of credit number", example="123", ) STANDARD = DataProductStandard( generic_description="Export Instructions", request=ExportInstructionsRequest, response=ExportInstructionsResponse, )
pressure: float = Field(..., title="Current air pressure in hPa", example=1007) rain: bool = Field(..., title="Rain status", description="If it's currently raining or not.") temp: float = Field(..., title="Current temperature in Celsius", example=17.3, ge=-273.15) windSpeed: float = Field(..., title="Current wind speed in m/s", example=2.1, ge=0) windDirection: float = Field( ..., title="Current wind direction in meteorological wind direction degrees", ge=0, le=360, example=220.0, ) STANDARD = DataProductStandard( description="Data Product for current weather with metric units", request=CurrentWeatherMetricRequest, response=CurrentWeatherMetricResponse, route_description="Current weather in metric units", summary="Current Weather (Metric)", )
from pydantic import Field from src.converter import CamelCasedModel, DataProductStandard class InsuranceCertificateResponse(CamelCasedModel): currency_code: str = Field(..., title="Currency code") description_of_goods: str = Field(..., title="Description of goods") final_destination: str = Field(..., title="Final destination") handling_units: int = Field(..., title="Handling units") institute_clauses: str = Field(..., title="Institute clauses") insurance_value: int = Field(..., title="Insurance value") insurance_value_percentage: float = Field(..., title="Insurance value percentage") insurer_address: str = Field(..., title="Insurer address") insurer_name: str = Field(..., title="Insurer name") mode_of_delivery: str = Field(..., title="Mode of delivery") place_of_receipt: str = Field(..., title="Place of receipt") total_gross_weight: float = Field(..., title="Total gross weight") class InsuranceCertificateRequest(CamelCasedModel): shipment_id: str = Field(..., title="Shipment ID") STANDARD = DataProductStandard( generic_description="Insurance Certificate", request=InsuranceCertificateRequest, response=InsuranceCertificateResponse, )
forwarder_contact_person_name: str = Field( ..., title="Forwarder contact person name" ) forwarder_contact_person_phone: str = Field( ..., title="Forwarder contact person phone" ) forwarder_name: str = Field(..., title="Forwarder name") handling_units: int = Field(..., title="Handling units") importer_name: str = Field(..., title="Importer name") issue_date: datetime = Field(..., title="Issue date") lc_number: str = Field(..., title="LC number") mode_of_delivery: str = Field(..., title="Mode of delivery") place_of_discharge: str = Field(..., title="Place of discharge") place_of_loading: str = Field(..., title="Place of loading") place_of_receipt: str = Field(..., title="Place of receipt") statement: str = Field(..., title="Statement") total_gross_weight: float = Field(..., title="Total gross weight") total_net_weight: float = Field(..., title="Total net weight") total_volume: float = Field(..., title="Total volume") class ForwardersCargoReceiptRequest(CamelCasedModel): shipment_id: str = Field(..., title="Shipment ID") STANDARD = DataProductStandard( generic_description="Cargo Receipt", request=ForwardersCargoReceiptRequest, response=ForwardersCargoReceiptResponse, )
handling_units: int = Field(..., title="Handling units") incoterm: str = Field(..., title="Incoterm") incoterm_place: str = Field(..., title="Incoterm place") invoice_note: str = Field(..., title="Invoice note") invoice_reference: str = Field(..., title="Invoice reference") issue_date: datetime = Field(..., title="Issue date") lc_number: str = Field(..., title="LC number") letter_of_credit_value: int = Field(..., title="Letter of credit value") mode_of_delivery: str = Field(..., title="Mode of delivery") order_reference: str = Field(..., title="Order reference") project_reference: str = Field(..., title="Project reference") seller_contact_person_name: str = Field(..., title="Seller contact person name") seller_name: str = Field(..., title="Seller name") seller_vat_number: str = Field(..., title="Seller VAT number") tax_rate: int = Field(..., title="Tax rate") total_gross_weight: float = Field(..., title="Total gross weight") total_net_weight: float = Field(..., title="Total net weight") total_volume: float = Field(..., title="Total volume") value_of_shipment: float = Field(..., title="Value of shipment") class InvoiceRequest(CamelCasedModel): shipment_id: str = Field(..., title="Shipment ID") STANDARD = DataProductStandard( generic_description="Invoice", request=InvoiceRequest, response=InvoiceResponse, )
product_code: str = Field(..., title="Product code") product_count: int = Field(..., title="Product count") class PackingListResponse(CamelCasedModel): contract_reference: str = Field(..., title="Contract reference") description_of_goods: str = Field(..., title="Description of goods") final_destination: str = Field(..., title="Final destination") handling_units: int = Field(..., title="Handling units") incoterm: str = Field(..., title="Incoterm") incoterm_place: str = Field(..., title="Incoterm place") lc_number: str = Field(..., title="LC number") packing_description: str = Field(..., title="Packing description") packing_reference: str = Field(..., title="Packing reference") place_of_receipt: str = Field(..., title="Place of receipt") product_items: List[ProductItem] = Field(..., title="Product items") total_gross_weight: float = Field(..., title="Total gross weight") total_net_weight: float = Field(..., title="Total net weight") total_volume: float = Field(..., title="Total volume") class PackingListRequest(CamelCasedModel): shipment_id: str = Field(..., title="Shipment ID") STANDARD = DataProductStandard( generic_description="Packing List", request=PackingListRequest, response=PackingListResponse, )