from __future__ import annotations # Required for self reference # Auto generated API client for FlyingFleet using the REST interface # Usage: # a = FlyingFleetApi() # a.Auth.Login("your@email.com", "your_password") # print( a.Articles.GetArticles() ) import requests # type: ignore # Used to do the HTTP calls import json # Used to encode / decode the complex objects import urllib.parse # Used to encode query parameters import datetime # Used to encode / decode dates from typing import List, Optional from dataclasses import dataclass # Helper function to URL encode a value def urlEncode(val): if val is None: return "" return urllib.parse.quote_plus(val) # Helper function to transform an object into a JSON string def FFJsonDump(obj): if type(obj) is list: result = "[" first = True for i in obj: if first == False: result = result + ", " result = result + FFJsonDump(i) first = False return result + "]" if type(obj).__name__.startswith("DTO_"): return json.dumps(obj.__dict__) return json.dumps(obj) ##################################################### # Enumerations used by the API # ##################################################### class DTO_BillStatus: Open = 1 Paid = 2 Canceled = 3 Replaced = 4 Current = 5 Draft = 10 class DTO_AircraftType: Glider = 1 PoweredGlider = 2 Airplane = 3 Balloon = 4 Helicopter = 5 Gyrocopter = 6 Airship = 7 class DTO_FlightLogTypes: Departure = 1 Arrival = 2 Circuits = 3 ExternalArrival = 4 ExternalDeparture = 5 class DTO_UnitTypes: Single = 1 Minutes = 2 Litters = 3 class DTO_ArticleType: Membership = 1 FuelSale = 2 Instruction = 3 AircraftRentPricing = 4 AircraftLandingPricing = 5 AircraftStartPricing = 6 FuelReimbursement = 7 Towing = 8 Facility = 9 PaperBill = 10 TrialFlight = 11 FirstReminder = 51 SecondReminder = 52 ThirdReminder = 53 Rounding = 80 Other = 100 class DTO_AccountType: Debitor = 1 Account = 2 MeansOfPayment = 3 TransferAccount = 4 RoundingDifference = 5 class DTO_InstructionState: Filled = 1 Accepted = 2 Refused = 3 class DTO_NewsVisibility: Outside = 1 Inside = 2 Both = 3 Calendar = 4 WelcomeEmail = 5 Home = 6 OPS = 7 Events = 8 Billing = 9 AircraftCategory = 10 Aircraft = 11 class DTO_TechLogStatus: Close = 1 CRS = 2 CRS_Check = 3 DD_NotFlightRelevant = 4 DD_Restriction = 5 ForInformationOnly = 6 NotAirworthy = 7 NotFlightRelevant = 8 FlightRelevant_AOG = 9 ARC = 10 class DTO_ExternalTool: NoExternalTool = 1 Vereinsflieger = 2 class DTO_Recuring: NotRecuring = 0 Annually = 1 Monthly = 2 Weekly = 3 class DTO_ComponentCycle: Hours = 1 Date = 2 class DTO_ActionType: Register = 0 Login = 1 Logout = 2 InvalidCaptcha = 3 AdminResetPassword = 4 AdminSetPassword = 5 AdminModifyProfile = 6 AdminCreateReservationType = 7 AdminDeleteReservationType = 8 AdminEditReservationType = 9 AdminDeleteAircraft = 10 AdminDeleteMember = 11 AdminCreateAircraft = 12 AdminEditAircraft = 13 AdminCreateNews = 14 AdminEditNews = 15 AdminDeleteNews = 16 AdminDeleteArticle = 17 AdminCreateArticle = 18 AdminEditArticle = 19 AdminCreateAircraftArticle = 20 AdminEditAircraftArticle = 21 AdminDeleteAircraftArticle = 22 AdminDeleteTechlog = 23 AdminCreateTechlog = 24 AdminUpdateTechlog = 25 CreateReservation = 26 UpdateReservation = 27 DeleteReservation = 28 CreateMovement = 29 AdminCreateAircraftModel = 30 AdminEditAircraftModel = 31 AdminDeleteAircraftModel = 32 AdminRemoveMembership = 33 AdminAddMembership = 34 AdminRefuseCounterCorrection = 35 CreateInstruction = 36 InstructionAccepted = 37 InstructionRefused = 38 MinutesFlown = 39 InstructionTime = 40 Landing = 41 GoArround = 42 AdminAddMember = 43 AdminEditMember = 44 UpdateInstruction = 45 ChangedPassword = 46 EditProfile = 47 AdminDeleteVatAccount = 48 AdminCreateVatAccount = 49 AdminEditVatAccount = 50 AdminDeleteVatType = 51 AdminCreateVatType = 52 AdminEditVatType = 53 AdminDeleteAccountPlan = 54 AdminCreateAccountPlan = 55 AdminEditAccountPlan = 56 AdminDeleteCatalog = 57 AdminEditCatalog = 58 AdminCreateCatalog = 59 AdminDeleteFlightActivityType = 60 AdminCreateFlightActivityType = 61 AdminEditFlightActivityType = 62 AdminDeleteInstructionType = 63 AdminCreateInstructionType = 64 AdminEditInstructionType = 65 AdminAddRole = 66 AdminRemoveRole = 67 AdminDeleteRoleType = 68 AdminCreateRoleType = 69 AdminEditRoleType = 70 AdminCreateMembershipType = 71 AdminEditMembershipType = 72 AdminDeleteMembershipType = 73 AdminDeleteAllMemberships = 74 AdminCreateTransaction = 75 AdminAddFlightActivityTypeAccountPlan = 76 AdminDeleteFlightActivityTypeAccountPlan = 77 AdminCopyFlightActivityTypeAccountPlan = 78 AdminAddFlightActivityAircraftType = 79 AdminDeleteFlightActivityAircraftType = 80 AdminAddFlightActivityRole = 81 AdminDeleteFlightActivityRole = 82 AdminAddAircraftActivityType = 83 AdminDeleteAircraftActivityType = 84 AdminCreateShopArticle = 85 AdminEditShopArticle = 86 AdminDeleteShopArticle = 87 AdminRemoveShopArticleRequirement = 88 AdminAddShopArticleRequirement = 89 AdminDeleteAircraftCategory = 90 AdminCreateAircraftCategory = 91 AdminEditAircraftCategory = 92 AdminRemoveUserAircraftCategory = 93 AdminAddUserAircraftCategory = 94 AdminCreateMember = 95 AcceptPrivacy = 96 AdminCreateLink = 97 AdminEditLink = 98 AdminDeleteLink = 99 AdminRemoveAttachementsNews = 100 AdminDeleteCompany = 101 AdminCreateCompany = 102 AdminEditCompany = 103 AdminDeleteStockItem = 104 AdminCreateStockItem = 105 AdminEditStockItem = 106 AdminImportStockItems = 107 CamoAddAircraftComponent = 108 EditNotifications = 109 CreateAircraftLog = 110 CreateTechlog = 111 AdminDeleteCostUnit = 112 AdminCreateCostUnit = 113 AdminEditCostUnit = 114 AdminDeleteCostCenter = 115 AdminCreateCostCenter = 116 AdminEditCostCenter = 117 AdminCopyFromFlightActivityTypeAccountPlan = 118 AdminDeleteBill = 119 AdminCreateBill = 120 AdminAddTransaction = 121 AdminRemoveTransaction = 122 AdminBillMarkedAsPaid = 123 AdminBillMarkedCanceled = 124 AdminBillReplaced = 125 AdminBillFinalized = 126 AdminBillSent = 127 AdminBillingSent = 128 AdminRemindersSent = 129 AdminImportFinancialConfig = 130 AdminDeletePriceValidity = 131 AdminCreatePriceValidity = 132 AdminEditPriceValidity = 133 ModifyMovement = 134 AdminDeleteRunway = 135 AdminCreateRunway = 136 AdminEditRunway = 137 AdminDeleteArrivalSector = 138 AdminCreateArrivalSector = 139 AdminEditArrivalSector = 140 AdminDeleteDepartureRoute = 141 AdminCreateDepartureRoute = 142 AdminEditDepartureRoute = 143 AdminDeleteHoliday = 144 AdminCreateHoliday = 145 AdminEditHoliday = 146 AdminDeleteRegistrationRequest = 147 AdminCreateRegistrationRequest = 148 AdminEditRegistrationRequest = 149 AddMemberCredits = 150 AdminBillReOpened = 151 OnlinePurchase = 152 DeleteMovement = 153 AdminAddMemberVatAccountLink = 154 AdminRemoveMemberVatAccountLink = 155 AdminAddAircraftModel = 156 AdminAddAircraft = 157 AdminSetGlobalCss = 158 AdminSetPrivateCss = 159 AdminRemovedGlobalCss = 160 AdminRemovedPrivateCss = 161 AdminAddArticleAircraftType = 162 AdminRemoveArticleAircraftType = 163 AdminAddArticleAircraftCategory = 164 AdminRemoveArticleAircraftCategory = 165 class DTO_MemberDefaultType: ReservationType = 1 InstructorId = 2 LastMovementCallSign = 3 ReservationInstructor = 4 LastInstructionType = 5 LastFlightActivityType = 6 CalendarReminder = 7 ExportRoles = 8 ExportMemberships = 9 PlannedTime = 10 class DTO_NotificationCategory: System = 0 ChangeReservation = 1 NewBilling = 2 NewInstruction = 3 Newsletter = 4 NewReservation = 5 CancelReservation = 6 Maintenance = 7 Instructors = 8 Accounting = 9 class DTO_MembershipValidity: Forever = 1 Yearly = 2 Monthly = 3 CalendarYear = 4 TillSpecified = 5 class DTO_MembershipType: Generic = 1 Aircraft = 2 class DTO_AccountType: Debtor = 1 Creditor = 2 MeansOfPayment = 3 TransferAccount = 4 RoundingDifference = 5 class DTO_PreferredForAircraftType: All = 0 Motor = 1 Glider = 2 class DTO_DocumentFor: FlightLogCounterCorrection = 1 FlightLogFuel = 2 News = 3 ##################################################### # DTOs used by the API # ##################################################### @dataclass class DTO_VisitedPage: url:str = None title:str = None when:datetime.datetime = None nbMinutes:int = None details:str = None @dataclass class DTO_AircraftLog: id:int = None flightActivityTypeId:int = None aircraftId:int = None startCounter:Optional[int] = None endCounter:Optional[int] = None memberId:int = None instructorId:Optional[int] = None departureTime:Optional[datetime.datetime] = None startPlace:str = None arrivalTime:Optional[datetime.datetime] = None landingPlace:str = None nbLandings:Optional[int] = None fuelLitters:Optional[float] = None callSign:str = None flightActivityType:str = None member:str = None @dataclass class DTO_AircraftModel: id:int = None icaoType:str = None manufacturer:str = None modelType:str = None marketingDesignation:str = None @dataclass class DTO_AircraftCAMO: callSign:str = None timeCounter:Optional[int] = None remaining:str = None landingCounter:Optional[int] = None nextControl:Optional[int] = None nextControlTimer:Optional[int] = None nextAnnual:Optional[datetime.datetime] = None nextArcReview:Optional[datetime.datetime] = None nextArcExtension:Optional[datetime.datetime] = None @dataclass class DTO_AircraftCategory: id:int = None name:str = None description:str = None nbPlaces:Optional[int] = None isActive:Optional[bool] = None @dataclass class DTO_IdName: id:int = None name:str = None @dataclass class DTO_Airport: icao:str = None name:str = None display:str = None @dataclass class DTO_ArticlePrice: id:int = None articleId:int = None pricePerUnit:float = None aircraftCategoryId:Optional[int] = None membershipId:Optional[int] = None aircraftWeightCategoryId:Optional[int] = None aircraftNoiseCategoryId:Optional[int] = None priceValidityId:Optional[int] = None @dataclass class DTO_DocumentInfo: name:str = None size:str = None date:str = None @dataclass class DTO_Catalog: id:int = None name:str = None validFrom:Optional[datetime.datetime] = None validTo:Optional[datetime.datetime] = None isActive:Optional[bool] = None @dataclass class DTO_Currency: shortName:str = None name:str = None display:str = None @dataclass class DTO_DiagnosticInfo: cpuLoad:float = None swapLoad:float = None memoryLoad:float = None @dataclass class DTO_Document: filename:str = None path:str = None @dataclass class DTO_VatAccount: id:int = None company:str = None title:str = None firstName:str = None lastName:str = None address:str = None zipCode:str = None city:str = None country:str = None accountNumber:str = None referenceNumber:str = None vatNumber:str = None email:str = None phoneNumber:str = None bankName:str = None bankLocation:str = None importId:Optional[int] = None validFrom:Optional[datetime.datetime] = None validTill:Optional[datetime.datetime] = None mainDebtorId:Optional[int] = None paymentTerms:Optional[int] = None @dataclass class DTO_VatType: id:int = None shortName:str = None name:str = None accountNumber:str = None amount:float = None vatAccountId:int = None importId:Optional[int] = None @dataclass class DTO_FlightActivityType: id:int = None name:str = None requiresInstructor:Optional[bool] = None isTowing:Optional[bool] = None @dataclass class DTO_TableStat: lastEntry:datetime.datetime = None lastEntryId:int = None nbEntries:int = None @dataclass class DTO_HomeLink: id:int = None name:str = None displayOrder:int = None url:str = None @dataclass class DTO_MemberMembership: memberId:int = None membershipId:int = None createdOn:datetime.datetime = None validTill:datetime.datetime = None @dataclass class DTO_Member: id:int = None company:str = None title:str = None fullName:str = None email:str = None display:str = None firstName:str = None lastName:str = None password:str = None address:str = None phone:str = None importFrom:str = None importId:str = None emergencyContact:str = None birthday:Optional[datetime.datetime] = None lastBooking:Optional[datetime.datetime] = None zipCode:str = None city:str = None country:str = None caution:Optional[int] = None canLog:bool = None verified:Optional[bool] = None licenseNumber:str = None ratingValidTill:Optional[datetime.datetime] = None medicalValidTill:Optional[datetime.datetime] = None languageValidTill:Optional[datetime.datetime] = None fiCriValidTill:Optional[datetime.datetime] = None refreshFlightDue:Optional[datetime.datetime] = None tmgValidTill:Optional[datetime.datetime] = None @dataclass class DTO_MemberHistory: id:int = None memberId:int = None writtenById:int = None writtenBy:str = None storedWhen:datetime.datetime = None content:str = None @dataclass class DTO_Reservation: id:int = None start:datetime.datetime = None end:datetime.datetime = None aircraftId:int = None isStandby:Optional[bool] = None isProvisory:Optional[bool] = None isDeleted:Optional[bool] = None reservationTypeId:int = None memberId:int = None instructorId:Optional[int] = None comment:str = None plannedTime:Optional[int] = None aircraftAcceptedOn:Optional[datetime.datetime] = None aircraftReturnedOn:Optional[datetime.datetime] = None @dataclass class DTO_ReservationType: id:int = None name:str = None priority:int = None canDoubleBook:Optional[bool] = None requiresInstructor:Optional[bool] = None requiredRightTypeId:Optional[int] = None cssColor:str = None @dataclass class DTO_SearchResult: url:str = None category:str = None description:str = None @dataclass class DTO_Transaction: id:int = None createdWhen:datetime.datetime = None registeredById:Optional[int] = None memberId:int = None articleId:Optional[int] = None aircraftId:Optional[int] = None price:float = None quantity:float = None flightLogId:Optional[int] = None instructionId:Optional[int] = None articlePriceId:Optional[int] = None accountPlanId:Optional[int] = None vatTypeId:Optional[int] = None vatAmount:Optional[float] = None billId:Optional[int] = None shouldBeBilled:Optional[bool] = None importId:str = None customDescription:str = None description:str = None @dataclass class DTO_CalendarReservation: id:int = None start:datetime.datetime = None end:datetime.datetime = None callSign:str = None isStandby:bool = None isProvisory:bool = None cssColor:str = None reservationTypeId:int = None reservationType:str = None priority:int = None member:str = None lastName:str = None phone:str = None memberId:int = None instructor:str = None instructorId:int = None ownReservation:bool = None canAcceptAircraft:bool = None canReturnAircraft:bool = None aircraftAccepted:bool = None aircraftReturned:bool = None @dataclass class DTO_WeatherForecast: date:str = None forecast:str = None icon:str = None @dataclass class DTO_DisplayTechlogEntry: reportedMember:str = None entryReport:str = None entryDate:datetime.datetime = None resolutionTime:Optional[datetime.datetime] = None status:str = None @dataclass class DTO_RegistrationRequest: id:int = None name:str = None @dataclass class DTO_MemberBookmark: memberId:int = None url:str = None @dataclass class DTO_Catalog: id:int = None name:str = None validFrom:Optional[datetime.datetime] = None validTo:Optional[datetime.datetime] = None isActive:Optional[bool] = None @dataclass class DTO_PriceValidity: id:int = None name:str = None validFrom:datetime.datetime = None validTo:Optional[datetime.datetime] = None @dataclass class DTO_AircraftWeightCategory: id:int = None name:str = None mtow:int = None forFurtherWeightBlocks:Optional[bool] = None @dataclass class DTO_AircraftNoiseCategory: id:int = None noiseCategories:str = None @dataclass class DTO_RightType: id:int = None name:str = None @dataclass class DTO_DisplayTechlog: nextControl:Optional[int] = None hoursRemaining:str = None entries:List[DTO_DisplayTechlogEntry] = None nextControlTimer:Optional[int] = None timeCounter:Optional[int] = None @dataclass class DTO_AircraftModel: id:int = None icaoType:str = None manufacturer:str = None modelType:str = None marketingDesignation:str = None aircrafts:List[DTO_Aircraft] = None displayName:str = None @dataclass class DTO_Aircraft: id:int = None callSign:str = None display:str = None visible:bool = None order:int = None aircraftType:DTO_AircraftType = None inCAMO:Optional[bool] = None canBeBooked:Optional[bool] = None timeCounter:str = None modelId:Optional[int] = None nextControl:Optional[int] = None nextControlTimer:str = None homeBase:Optional[bool] = None landingCounter:Optional[int] = None mainOwner:str = None mainMemberId:Optional[int] = None nextAnnual:Optional[datetime.datetime] = None nextArcReview:Optional[datetime.datetime] = None nextArcExtension:Optional[datetime.datetime] = None aircraftCategoryId:Optional[int] = None lastLogType:Optional[DTO_FlightLogTypes] = None lastAirport:str = None allowedActivities:List[DTO_FlightActivityType] = None expectedDestination:str = None isValid:Optional[bool] = None @dataclass class DTO_Article: id:int = None catalogId:int = None description:str = None display:str = None pricePerUnit:float = None unit:DTO_UnitTypes = None isValid:Optional[bool] = None articleType:DTO_ArticleType = None aircraftCategoryId:Optional[int] = None membershipId:Optional[int] = None requiredAdditionalMembershipId:Optional[int] = None supersedeId:Optional[int] = None accountPlanId:Optional[int] = None vatTypeId:Optional[int] = None fuelCardArticleId:Optional[int] = None costCenterId:Optional[int] = None costUnitId:Optional[int] = None importId:str = None @dataclass class DTO_CalendarData: aircrafts:List[DTO_Aircraft] = None reservations:List[DTO_CalendarReservation] = None start:datetime.datetime = None end:datetime.datetime = None reservationTypes:List[DTO_ReservationType] = None weekNumber:int = None ownEntries:List[DTO_CalendarReservation] = None weather:List[DTO_WeatherForecast] = None sunRise:int = None sunSet:int = None aircraftLogs:List[DTO_AircraftLog] = None holidays:List[DTO_CalendarHoliday] = None @dataclass class DTO_AccountPlan: id:int = None name:str = None accountNumber:str = None accountType:DTO_AccountType = None importId:Optional[int] = None vatAccountId:int = None @dataclass class DTO_Instruction: id:int = None instructorId:int = None studentId:int = None startDate:datetime.datetime = None endDate:datetime.datetime = None nbMinutes:int = None state:DTO_InstructionState = None comment:str = None instructionTypeId:int = None @dataclass class DTO_FlightLog: id:int = None logType:DTO_FlightLogTypes = None flightActivityTypeId:int = None callSign:str = None aircraftId:Optional[int] = None guestPilot:str = None memberId:Optional[int] = None instructorId:Optional[int] = None departureTime:Optional[datetime.datetime] = None startPlace:str = None arrivalTime:Optional[datetime.datetime] = None landingPlace:str = None nbLandings:Optional[int] = None goArrounds:Optional[int] = None runwayId:Optional[int] = None arrivalSectorId:Optional[int] = None departureRouteId:Optional[int] = None requestedTowingJob:str = None hiddenTowingJob:str = None externalTowingPaid:Optional[bool] = None pilot:str = None @dataclass class DTO_News: id:int = None title:str = None content:str = None postedOn:datetime.datetime = None postedById:Optional[int] = None visibility:DTO_NewsVisibility = None @dataclass class DTO_TechLog: id:int = None responseToId:Optional[int] = None responseById:Optional[int] = None aircraftId:int = None flightLogId:Optional[int] = None reportedMemberId:Optional[int] = None entryReport:str = None entryDate:datetime.datetime = None duplicateOfId:Optional[int] = None status:DTO_TechLogStatus = None importId:Optional[int] = None @dataclass class DTO_Bill: id:int = None referenceNumber:str = None memberId:int = None vatAccountId:int = None total:float = None newBillId:Optional[int] = None createdOn:datetime.datetime = None dueOn:datetime.datetime = None paidOn:Optional[datetime.datetime] = None status:DTO_BillStatus = None importId:Optional[int] = None @dataclass class DTO_Aircraft: id:int = None callSign:str = None aircraftType:DTO_AircraftType = None aircraftTypeGroup:str = None canBeBooked:Optional[bool] = None inCAMO:Optional[bool] = None modelId:Optional[int] = None model:DTO_AircraftModel = None isValid:Optional[bool] = None noiseClass:str = None mTow:int = None canTow:Optional[bool] = None verified:Optional[bool] = None homeBase:Optional[bool] = None mainOwner:str = None billingAddress:str = None fromOfficialDb:Optional[bool] = None timeCounter:Optional[int] = None landingCounter:Optional[int] = None nextControl:Optional[int] = None nextControlTimer:Optional[int] = None nextAnnual:Optional[datetime.datetime] = None nextArcReview:Optional[datetime.datetime] = None nextArcExtension:Optional[datetime.datetime] = None mainMemberId:Optional[int] = None lastLogType:Optional[DTO_FlightLogTypes] = None lastAirport:str = None mainMember:DTO_Member = None fuelArticleId:Optional[int] = None fuelArticle:DTO_Article = None costUnitId:Optional[int] = None costUnit:DTO_CostUnit = None techLogs:List[DTO_TechLog] = None aircraftCategoryId:Optional[int] = None category:DTO_AircraftCategory = None allowedFlightActivityTypes:List[DTO_AllowedFlightActivityType] = None components:List[DTO_AircraftComponent] = None facilityPrice:Optional[float] = None externalTool:DTO_ExternalTool = None externalUrl:str = None externalUsername:str = None externalPassword:str = None lastExternalUpdate:Optional[datetime.datetime] = None @dataclass class DTO_CalendarHoliday: id:int = None name:str = None date:datetime.datetime = None recuring:DTO_Recuring = None @dataclass class DTO_Member: id:int = None company:str = None title:str = None email:str = None firstName:str = None lastName:str = None address:str = None password:str = None salt:str = None roles:List[DTO_MemberRole] = None isActive:Optional[bool] = None invalidEmail:Optional[bool] = None lastLogin:Optional[datetime.datetime] = None importFrom:str = None importId:str = None emergencyContact:str = None birthday:Optional[datetime.datetime] = None lastBooking:Optional[datetime.datetime] = None zipCode:str = None city:str = None country:str = None caution:Optional[int] = None canLog:bool = None registrationRequestId:Optional[int] = None registrationRequest:DTO_RegistrationRequest = None licenseNumber:str = None ratingValidTill:Optional[datetime.datetime] = None medicalValidTill:Optional[datetime.datetime] = None languageValidTill:Optional[datetime.datetime] = None fiCriValidTill:Optional[datetime.datetime] = None refreshFlightDue:Optional[datetime.datetime] = None tmgValidTill:Optional[datetime.datetime] = None verified:Optional[bool] = None privacyAccepted:Optional[bool] = None paperBill:Optional[bool] = None language:str = None actions:List[DTO_MemberAction] = None reservations:List[DTO_Reservation] = None instructions:List[DTO_Reservation] = None defaults:List[DTO_MemberDefault] = None flightLogs:List[DTO_FlightLog] = None flightLogsFor:List[DTO_FlightLog] = None memberOf:List[DTO_MemberMembership] = None calendarAicrafts:List[DTO_MemberCalendarAircraft] = None histories:List[DTO_MemberHistory] = None aircraftCategories:List[DTO_MemberAircraftCategory] = None webPushes:List[DTO_MemberWebPush] = None bookmarks:List[DTO_MemberBookmark] = None notifications:List[DTO_MemberNotification] = None fullName:str = None fullNameId:str = None information:str = None memberVatAccountLinks:List[DTO_MemberVatAccountLink] = None phone:str = None allowEmailNotifications:Optional[bool] = None accountCreation:datetime.datetime = None blockStart:int = None blockEnd:int = None capzlogToken:str = None @dataclass class DTO_Article: id:int = None catalogId:int = None catalog:DTO_Catalog = None description:str = None display:str = None pricePerUnit:float = None unit:DTO_UnitTypes = None isValid:Optional[bool] = None articleType:DTO_ArticleType = None aircraftCategoryId:Optional[int] = None aircraftCategory:DTO_AircraftCategory = None membershipId:Optional[int] = None membership:DTO_Membership = None requiredAdditionalMembershipId:Optional[int] = None requiredAdditionalMembership:DTO_Membership = None aircraftHomebase:Optional[bool] = None supersedeId:Optional[int] = None supersede:DTO_Article = None accountPlanId:Optional[int] = None accountPlan:DTO_AccountPlan = None vatTypeId:Optional[int] = None vatType:DTO_VatType = None fuelCardArticleId:Optional[int] = None costCenterId:Optional[int] = None costCenter:DTO_CostCenter = None costUnitId:Optional[int] = None costUnit:DTO_CostUnit = None importId:str = None forInstruction:Optional[bool] = None articleOfMembership:List[DTO_Membership] = None articlePrices:List[DTO_ArticlePrice] = None requiredAircraftTypes:List[DTO_ArticleRequiredAircraftType] = None requiredAircraftCategories:List[DTO_ArticleRequiredAircraftCategory] = None @dataclass class DTO_CostUnit: id:int = None accountNumber:str = None name:str = None appliesToVatAccountId:Optional[int] = None appliesToVatAccount:DTO_VatAccount = None @dataclass class DTO_TechLog: id:int = None responseToId:Optional[int] = None responseTo:DTO_TechLog = None responseById:Optional[int] = None responseBy:DTO_TechLog = None aircraftId:int = None aircraft:DTO_Aircraft = None flightLogId:Optional[int] = None flightLog:DTO_FlightLog = None reportedMemberId:Optional[int] = None reportedMember:DTO_Member = None entryReport:str = None entryDate:datetime.datetime = None duplicateOfId:Optional[int] = None duplicateOf:DTO_TechLog = None status:DTO_TechLogStatus = None importId:Optional[int] = None @dataclass class DTO_AircraftCategory: id:int = None name:str = None description:str = None nbPlaces:Optional[int] = None isActive:Optional[bool] = None appliesToVatAccountId:Optional[int] = None appliesToVatAccount:DTO_VatAccount = None aircrafts:List[DTO_Aircraft] = None @dataclass class DTO_AllowedFlightActivityType: aicraftId:int = None aircraft:DTO_Aircraft = None flightActivityTypeId:int = None flightActivityType:DTO_FlightActivityType = None @dataclass class DTO_AircraftComponent: id:int = None aircraftId:int = None aircraft:DTO_Aircraft = None name:str = None componentCycle:DTO_ComponentCycle = None current:str = None warning:str = None error:str = None @dataclass class DTO_MemberRole: id:int = None roleId:int = None role:DTO_RoleType = None memberId:int = None member:DTO_Member = None appliesToVatAccountId:Optional[int] = None appliesToVatAccount:DTO_VatAccount = None allowedExport:str = None allowedReport:str = None @dataclass class DTO_MemberAction: id:int = None memberId:Optional[int] = None member:DTO_Member = None ip:str = None when:datetime.datetime = None action:DTO_ActionType = None parameters:str = None @dataclass class DTO_Reservation: id:int = None aircraftId:int = None aircraft:DTO_Aircraft = None reservationTypeId:int = None reservationType:DTO_ReservationType = None memberId:int = None member:DTO_Member = None start:datetime.datetime = None end:datetime.datetime = None lastEdit:datetime.datetime = None isProvisory:Optional[bool] = None isStandby:Optional[bool] = None isDeleted:Optional[bool] = None instructorId:Optional[int] = None instructor:DTO_Member = None comment:str = None aircraftAcceptedOn:Optional[datetime.datetime] = None aircraftReturnedOn:Optional[datetime.datetime] = None plannedTime:Optional[int] = None sequence:int = None firstOfSequenceId:Optional[int] = None firstOfSequence:DTO_Reservation = None @dataclass class DTO_MemberDefault: memberId:int = None member:DTO_Member = None defaultType:DTO_MemberDefaultType = None value:str = None @dataclass class DTO_FlightLog: id:int = None callSign:str = None aircraftId:Optional[int] = None aircraft:DTO_Aircraft = None logMonth:int = None guestPilot:str = None guestInstructor:str = None memberId:Optional[int] = None member:DTO_Member = None byMemberId:int = None byMember:DTO_Member = None logType:DTO_FlightLogTypes = None flightActivityTypeId:int = None flightActivityType:DTO_FlightActivityType = None instructorId:Optional[int] = None instructor:DTO_Member = None departureTime:Optional[datetime.datetime] = None startPlace:str = None arrivalTime:Optional[datetime.datetime] = None landingPlace:str = None nbLandings:Optional[int] = None goArrounds:Optional[int] = None runwayId:Optional[int] = None runway:DTO_Runway = None arrivalSectorId:Optional[int] = None arrivalSector:DTO_ArrivalSector = None departureRouteId:Optional[int] = None departureRoute:DTO_DepartureRoute = None importFrom:str = None importId:str = None mustBeVerified:Optional[bool] = None fueled:Optional[bool] = None fuelCosts:Optional[float] = None fuelLitters:Optional[float] = None fuelDocumentId:Optional[int] = None fuelDocument:DTO_AttachedDocument = None currency:str = None startCounter:Optional[int] = None previousCounter:Optional[int] = None startCounterCorrectionId:Optional[int] = None startCounterCorrection:DTO_AttachedDocument = None towedWithId:Optional[int] = None towedWith:DTO_FlightLog = None requestedTowingJob:str = None hiddenTowingJob:str = None externalTowingPaid:Optional[bool] = None @dataclass class DTO_MemberMembership: memberId:int = None member:DTO_Member = None membershipId:int = None membership:DTO_Membership = None createdOn:datetime.datetime = None validTill:datetime.datetime = None @dataclass class DTO_MemberCalendarAircraft: memberId:int = None member:DTO_Member = None aircraftId:int = None aircraft:DTO_Aircraft = None isVisible:Optional[bool] = None order:Optional[int] = None @dataclass class DTO_MemberHistory: id:int = None memberId:int = None member:DTO_Member = None writtenById:int = None writtenBy:DTO_Member = None storedWhen:datetime.datetime = None content:str = None @dataclass class DTO_MemberAircraftCategory: memberId:int = None member:DTO_Member = None aircraftCategoryId:int = None aircraftCategory:DTO_AircraftCategory = None @dataclass class DTO_MemberWebPush: id:int = None memberId:int = None member:DTO_Member = None endPoint:str = None p256DH:str = None auth:str = None @dataclass class DTO_MemberNotification: memberId:int = None member:DTO_Member = None category:DTO_NotificationCategory = None @dataclass class DTO_MemberVatAccountLink: memberId:int = None member:DTO_Member = None vatAccountId:int = None vatAccount:DTO_VatAccount = None @dataclass class DTO_Membership: id:int = None name:str = None validity:DTO_MembershipValidity = None membershipType:DTO_MembershipType = None articleId:Optional[int] = None article:DTO_Article = None requiredBy:List[DTO_Article] = None requiredAdditionallyBy:List[DTO_Article] = None @dataclass class DTO_AccountPlan: id:int = None vatAccountId:int = None vatAccount:DTO_VatAccount = None name:str = None accountNumber:str = None accountType:DTO_AccountType = None iban:str = None importId:Optional[int] = None @dataclass class DTO_VatType: id:int = None shortName:str = None name:str = None accountNumber:str = None amount:float = None vatAccountId:int = None vatAccount:DTO_VatAccount = None importId:Optional[int] = None @dataclass class DTO_CostCenter: id:int = None accountNumber:str = None name:str = None appliesToVatAccountId:Optional[int] = None appliesToVatAccount:DTO_VatAccount = None @dataclass class DTO_ArticlePrice: id:int = None articleId:int = None article:DTO_Article = None priceValidityId:Optional[int] = None priceValidity:DTO_PriceValidity = None pricePerUnit:float = None aircraftCategoryId:Optional[int] = None aircraftCategory:DTO_AircraftCategory = None membershipId:Optional[int] = None membership:DTO_Membership = None aircraftWeightCategoryId:Optional[int] = None weightCategory:DTO_AircraftWeightCategory = None aircraftNoiseCategoryId:Optional[int] = None noiseCategory:DTO_AircraftNoiseCategory = None @dataclass class DTO_ArticleRequiredAircraftType: articleId:int = None article:DTO_Article = None aircraftType:DTO_AircraftType = None @dataclass class DTO_ArticleRequiredAircraftCategory: articleId:int = None article:DTO_Article = None aircraftCategoryId:int = None aircraftCategory:DTO_AircraftCategory = None @dataclass class DTO_VatAccount: id:int = None company:str = None title:str = None firstName:str = None lastName:str = None address:str = None zipCode:str = None city:str = None country:str = None accountNumber:str = None referenceNumber:str = None vatNumber:str = None email:str = None phoneNumber:str = None bankName:str = None bankLocation:str = None importId:Optional[int] = None validFrom:Optional[datetime.datetime] = None validTill:Optional[datetime.datetime] = None mainDebtorId:Optional[int] = None mainDebtor:DTO_AccountPlan = None paymentTerms:Optional[int] = None @dataclass class DTO_FlightActivityType: id:int = None name:str = None requiresInstructor:Optional[bool] = None isTowing:Optional[bool] = None requiredRoles:List[DTO_FlightTypeRequiredRole] = None requiredAircraftTypes:List[DTO_FlightTypeRequiredAircraftType] = None articleAccountPlans:List[DTO_FlightTypeArticleAccountPlan] = None overrideMemberId:Optional[int] = None overrideMember:DTO_Member = None @dataclass class DTO_RoleType: id:int = None name:str = None maxNumberReservations:Optional[int] = None rights:List[DTO_RoleRight] = None @dataclass class DTO_ReservationType: id:int = None name:str = None priority:int = None canDoubleBook:Optional[bool] = None requiresInstructor:Optional[bool] = None requiredRightTypeId:Optional[int] = None requireRightType:DTO_RightType = None cssColor:str = None flightActivityTypeId:Optional[int] = None flightActivityType:DTO_FlightActivityType = None @dataclass class DTO_Runway: id:int = None name:str = None preferredFor:DTO_PreferredForAircraftType = None runwayType:str = None @dataclass class DTO_ArrivalSector: id:int = None name:str = None preferredFor:DTO_PreferredForAircraftType = None @dataclass class DTO_DepartureRoute: id:int = None name:str = None preferredFor:DTO_PreferredForAircraftType = None @dataclass class DTO_AttachedDocument: id:int = None documentFor:DTO_DocumentFor = None attachedTo:Optional[int] = None documentName:str = None documentType:str = None documentData:bytes = None @dataclass class DTO_FlightTypeRequiredRole: flightActivityTypeId:int = None flightActivityType:DTO_FlightActivityType = None roleTypeId:int = None roleType:DTO_RoleType = None @dataclass class DTO_FlightTypeRequiredAircraftType: flightActivityTypeId:int = None flightActivityType:DTO_FlightActivityType = None aircraftType:DTO_AircraftType = None @dataclass class DTO_FlightTypeArticleAccountPlan: accountPlanId:int = None accountPlan:DTO_AccountPlan = None flightActivityTypeId:int = None flightActivityType:DTO_FlightActivityType = None articleId:int = None article:DTO_Article = None vatTypeId:int = None vatType:DTO_VatType = None @dataclass class DTO_RoleRight: roleTypeId:int = None roleType:DTO_RoleType = None rightTypeId:int = None rightType:DTO_RightType = None ##################################################### # Main API class # ##################################################### class FlyingFleetApi: """ FlyingFleet API. Each API class is accessible via the appropriate fields. Before calling most API calls, a call to the Auth.Login is required. """ url = "https://demo.flying-fleet.com/" # URL of the API to use token = None class FlyingFleet_ActionHistory: """ API For the Action History Menu """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetHistory(self, q:str = None) -> List[DTO_VisitedPage]: response = requests.get(self.parent.url + "api/ActionHistory/" + urlEncode(q)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_AircraftLogs: """ API For the Aircraft Log """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetLogs(self, start:str = None, end:str = None) -> List[DTO_AircraftLog]: """ Returns the list of the last 100 movements. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/AircraftLogs?token=" + urlEncode(self.parent.token) + "&start=" + urlEncode(start) + "&end=" + urlEncode(end) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddAircraftLog(self, aircraftLog:DTO_AircraftLog) -> DTO_AircraftLog: """ Insert a new aircraft log. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/AircraftLogs?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(aircraftLog))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddAircraftLogs(self, aircraftLogs:List[DTO_AircraftLog]) -> List[DTO_AircraftLog]: """ Insert new aircraft logs. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/AircraftLogs/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(aircraftLogs))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_AircraftModels: """ API For the Aircraft Models """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetAircraftModels(self, q:str = None) -> List[DTO_AircraftModel]: """ Get the list of all the aircraft models known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/AircraftModels/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftModelsCount(self, q:str = None) -> int: """ Counts the number of aircraft given the optional search parameter """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/AircraftModels/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftModel(self, id:int) -> DTO_AircraftModel: """ Get the model information based on the provided id """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/AircraftModels/ById/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddModel(self, model:DTO_AircraftModel) -> DTO_AircraftModel: """ Insert a new aircraft model """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/AircraftModels?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(model))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Aircrafts: """ API For the Aircrafts """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetAircrafts(self, q:str = None, onlyCharter:bool = False) -> List[DTO_Aircraft]: """ Get the list of all the aircrafts known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&onlyCharter=" + urlEncode(FFJsonDump(onlyCharter)) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftsCount(self, q:str = None, onlyCharter:bool = False) -> int: """ Returns the number of aircrafts given the optional search parameter """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&onlyCharter=" + urlEncode(FFJsonDump(onlyCharter))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftCamos(self): """ Get all the aircraft CAMO information """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/CAMO?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftCamo(self, callsign:str) -> DTO_AircraftCAMO: """ Get the aircraft CAMO information based on the provided callsign """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/CAMO/" + urlEncode(callsign) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftByCallSign(self, callsign:str) -> DTO_Aircraft: """ Get the aircraft information based on the provided callsign """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/ByCallSign/" + urlEncode(callsign) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftById(self, id:int) -> DTO_Aircraft: """ Get the aircraft information based on the provided id """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/ById/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateAircraft(self, aircraft:DTO_Aircraft) -> DTO_Aircraft: """ Add a new aircraft """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Aircrafts?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(aircraft))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftsToRent(self) -> List[DTO_Aircraft]: """ Retrieves the list of the aircrafts that can be rented """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/ToRent?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftsCategories(self) -> List[DTO_AircraftCategory]: """ Retrieves the list of the id / names of the aircrafts categories """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/Categories?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftsMemberships(self) -> List[DTO_IdName]: """ Retrieves the list of the id / names of the aircrafts memberships """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/Memberships?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftsWeightCategories(self) -> List[DTO_IdName]: """ Retrieves the list of the id / names of the aircrafts weight categories """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/WeightCategories?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAircraftsNoiseCategories(self) -> List[DTO_IdName]: """ Retrieves the list of the id / names of the aircrafts noise categories """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Aircrafts/NoiseCategories?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def SetAllowedFlightActivityTypes(self, allowedActivities:List[int], aircraftId:int) -> bool: """ Set the allowed flight activity types for an aircraft """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Aircrafts/AllowedFlightActivityTypes?token=" + urlEncode(self.parent.token) + "&aircraftId=" + urlEncode(FFJsonDump(aircraftId)), json = json.loads(FFJsonDump(allowedActivities))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddAircraft(self, aircraft:DTO_Aircraft) -> DTO_Aircraft: """ Insert a new aircraft """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Aircrafts?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(aircraft))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Airports: """ API For the Airports """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetAirports(self, q:str = None) -> List[DTO_Airport]: """ Get the list of all the airports known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Airports/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAirportsCount(self, q:str = None) -> int: """ Returns the number of airports known. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Airports/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def RefreshAirports(self) -> bool: """ Refreshes the airports list. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.post(self.parent.url + "api/Airports/Refresh?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Articles: """ API For the Articles """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetArticles(self, q:str = None, vatAccount:Optional[int] = None) -> List[DTO_Article]: """ Returns the list of articles. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Articles/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&vatAccount=" + urlEncode(FFJsonDump(vatAccount)) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetArticlesCount(self, q:str = None) -> int: """ Returns the number of articles. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Articles/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetArticleById(self, id:int) -> DTO_Article: """ Get the article information based on the provided id """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Articles/ById/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddArticle(self, article:DTO_Article) -> DTO_Article: """ Insert a new article """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Articles?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(article))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddArticles(self, articles:List[DTO_Article]) -> List[DTO_Article]: """ Insert a batch of new articles """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Articles/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(articles))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateArticle(self, article:DTO_Article) -> DTO_Article: """ Update an article """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Articles?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(article))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetArticleForAircraftCategory(self) -> List[DTO_Article]: """ Returns all the articles which are used by the fleet pricing. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Articles/AircraftCategory?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetArticleForAircraftNoiseWeight(self) -> List[DTO_Article]: """ Returns all the articles which are used by the fleet pricing. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Articles/AircraftNoiseWeight?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetArticleRentingPrices(self) -> List[DTO_ArticlePrice]: """ Returns all the articles which are used by the fleet pricing. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Articles/ArticlePrices/Renting?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetArticleLandingPrices(self) -> List[DTO_ArticlePrice]: """ Returns all the articles which are used by the fleet pricing. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Articles/ArticlePrices/Landing?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Auth: """ API For the Authorization """ parent = None def __init__(self, apiObject): self.parent = apiObject def Login(self, email:str, password:str) -> str: """ Tries to log in a user. """ response = requests.post(self.parent.url + "api/Auth?email=" + urlEncode(email) + "&password=" + urlEncode(password)) if response.ok and response.status_code == 200: self.parent.token = response.content.decode() return self.parent.token else: self.parent.token = None raise Exception("Not authorized") def Logout(self) -> bool: """ Logout a user. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Auth?token=" + urlEncode(self.parent.token)) self.parent.token = None return None def Refresh(self) -> bool: """ Refresh a token (to avoid a timeout). """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Auth?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Backups: """ API to access the backups """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetList(self) -> List[DTO_DocumentInfo]: """ Returns the list of files in the backup folder """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Backups?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetFile(self, filename:str): """ Returns the file from the backup folder as binary content """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Backups/" + urlEncode(filename) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetPowershell(self): response = requests.get(self.parent.url + "api/Backups/Powershell") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Bill: """ API For the bills """ parent = None def __init__(self, apiObject): self.parent = apiObject def Status(self) -> str: """ API to check the status of the billing """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Bill/Status?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ReCalc(self, billId:int) -> bool: """ API to recalculate the bill total """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Bill/ReCalc/" + urlEncode(billId) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ReCalcLast(self, nbMonths:int) -> bool: """ API to recalculate the bill total """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Bill/ReCalcLast/" + urlEncode(nbMonths) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Calendar: """ API For the Calendar """ parent = None def __init__(self, apiObject): self.parent = apiObject def ReadCalendarWeb(self, startDate:str = None) -> DTO_CalendarData: """ Get the calendar data for a given week. Authentification through the session (used by the web interface). """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Calendar/" + urlEncode(startDate) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ChangeColor(self, resType:int, color:str): """ Set the user preference for a given reservation type. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.post(self.parent.url + "api/Calendar/ChangeColor/" + urlEncode(resType) + "?token=" + urlEncode(self.parent.token) + "&color=" + urlEncode(color)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ChangeVisibilityWeb(self, callSign:str): """ Toggle the visibility of a given aircraft from the calendar. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Calendar/ChangeVisibility/" + urlEncode(callSign) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ChangeOrder(self, order:str): if self.parent.token is None: raise Exception("Not authorized") response = requests.post(self.parent.url + "api/Calendar/ChangeOrder?token=" + urlEncode(self.parent.token) + "&order=" + urlEncode(order)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def CheckDate(self, c:str, s:str, e:str, id:Optional[int]) -> bool: """ Checks if a reservation exists for a given date range. """ response = requests.get(self.parent.url + "api/Calendar/CheckDate?c=" + urlEncode(c) + "&s=" + urlEncode(s) + "&e=" + urlEncode(e) + "&id=" + urlEncode(FFJsonDump(id))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Catalogs: """ API For the Catalogs """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetCatalogs(self, q:str = None) -> List[DTO_Catalog]: """ Return the list of catalogs """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Catalogs?token=" + urlEncode(self.parent.token) + "&q=" + urlEncode(q) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Currencies: """ API For the Currencies """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetCurrencies(self, q:str = None) -> List[DTO_Currency]: """ Returns the list of currencies. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Currencies/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetCurrenciesCount(self, q:str = None) -> int: """ Returns the count of currencies. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Currencies/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Diagnostic: """ API For diagnostic purpose """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetSystemInformation(self) -> DTO_DiagnosticInfo: """ Returns system information like CPU, Memory, or Swap usage. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Diagnostic?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ResetCache(self) -> bool: """ Reset the caches. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Diagnostic/ResetCache?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Documents: """ API For the Documents """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetDocuments(self, q:str = None) -> List[DTO_Document]: """ Get the list of all the documents known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Documents/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def CreateDocument(self, data:bytes, path:str, filename:str) -> bool: """ Create a document & its path """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Documents?token=" + urlEncode(self.parent.token) + "&path=" + urlEncode(path) + "&filename=" + urlEncode(filename), json = json.loads(FFJsonDump(data))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Finances: """ API For the Finances account """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetVatAccounts(self) -> List[DTO_VatAccount]: """ Returns the list of all the VAT Accounts. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Finances/VatAccounts?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteVatAccount(self, id:int) -> bool: """ Delete a VAT Account. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Finances/VatAccount?token=" + urlEncode(self.parent.token) + "&id=" + urlEncode(FFJsonDump(id))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddVatAccount(self, account:DTO_VatAccount) -> DTO_VatAccount: """ Add a VAT Account. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Finances/VatAccount?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(account))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateVatAccount(self, account:DTO_VatAccount) -> DTO_VatAccount: """ Update a VAT Account. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Finances/VatAccount?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(account))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetAccounts(self, vatId:int) -> List[DTO_AccountPlan]: """ Returns the list of all the Accounts Plan. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Finances/Accounts/" + urlEncode(vatId) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteAccount(self, id:int) -> bool: """ Delete an Account Plan. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Finances/Account?token=" + urlEncode(self.parent.token) + "&id=" + urlEncode(FFJsonDump(id))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddAccount(self, account:DTO_AccountPlan) -> DTO_AccountPlan: """ Add an Account Plan. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Finances/Account?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(account))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ChangeAccount(self, account:DTO_AccountPlan) -> DTO_AccountPlan: """ Update an Account Plan. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Finances/Account?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(account))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetVatTypes(self) -> List[DTO_VatType]: """ Get all VAT Account Types """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Finances/VatTypes?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetVatTypesById(self, vatId:int) -> List[DTO_VatType]: """ Get all VAT Account Types for a given VAT """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Finances/VatTypes/" + urlEncode(vatId) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteVatType(self, id:int) -> bool: """ Delete a VAT Account Type. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Finances/VatType?token=" + urlEncode(self.parent.token) + "&id=" + urlEncode(FFJsonDump(id))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddVatType(self, vatType:DTO_VatType) -> DTO_VatType: """ Add a VAT Account Type. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Finances/VatType?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(vatType))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ChangeVatType(self, vatType:DTO_VatType) -> DTO_VatType: """ Update a VAT Account Type. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Finances/VatType?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(vatType))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_FlightActivityTypes: """ API For the FlightActivityTypes """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetFlightActivityType(self, q:str = None) -> List[DTO_FlightActivityType]: """ Get the list of all the reservation types known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/FlightActivityTypes/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Instructions: """ API For the Instructions """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetStats(self) -> DTO_TableStat: """ Return the statistics about the instructions """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Instructions/Stats?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetInstructions(self, start:str, end:str) -> List[DTO_Instruction]: """ Returns the list of instructions between two dates. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Instructions?token=" + urlEncode(self.parent.token) + "&start=" + urlEncode(start) + "&end=" + urlEncode(end)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetInstructionTypes(self) -> List[DTO_IdName]: """ Returns the list of instruction types. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Instructions/Types?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddInstruction(self, instruction:DTO_Instruction) -> DTO_Instruction: """ Insert a new instruction """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Instructions?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(instruction))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddInstructions(self, instructions:List[DTO_Instruction]) -> List[DTO_Instruction]: """ Insert a new instructions """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Instructions/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(instructions))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateInstruction(self, instruction:DTO_Instruction) -> DTO_Instruction: """ Update an instruction """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Instructions?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(instruction))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteInstruction(self, id:int) -> bool: """ Delete completely an instruction """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Instructions?token=" + urlEncode(self.parent.token) + "&id=" + urlEncode(FFJsonDump(id))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteInstructions(self, ids:List[int]) -> bool: """ Delete a bunch of instructions """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Instructions/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(ids))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def HasInstructions(self) -> bool: """ Checks if the current user has instructions """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Instructions/Check?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_InstructionTypes: """ API For the Instructions Types """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetInstructionTypes(self, q:str = None) -> List[DTO_IdName]: """ Returns the list of instruction types. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/InstructionTypes/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetInstructionType(self, id:int) -> DTO_IdName: """ Get the instruction type information based on the provided id """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/InstructionTypes/ById/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Links: """ API For the home Links """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetLinks(self, q:str = None) -> List[DTO_HomeLink]: """ Get the list of all the links known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Links/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddLink(self, link:DTO_HomeLink) -> DTO_HomeLink: """ Add a new home link """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Links?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(link))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_MemberMemberships: """ API For the MemberMembership """ parent = None def __init__(self, apiObject): self.parent = apiObject def AddMemberMembership(self, memberMembership:DTO_MemberMembership) -> DTO_MemberMembership: """ Add a membership to a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.post(self.parent.url + "api/MemberMemberships?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(memberMembership))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def RemoveMemberMembership(self, memberId:int, membershipId:int) -> bool: """ Remove a membership from a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/MemberMemberships/" + urlEncode(memberId) + "?token=" + urlEncode(self.parent.token) + "&membershipId=" + urlEncode(FFJsonDump(membershipId))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteMemberMemberships(self, memberId:int) -> bool: """ Delete all memberships of a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/MemberMemberships/AllMembershipsOf?token=" + urlEncode(self.parent.token) + "&memberId=" + urlEncode(FFJsonDump(memberId))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Members: """ API For the Members """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetMembers(self, q:str = None) -> List[DTO_Member]: """ Returns the list of members. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Members/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetInstructors(self, q:str = None) -> List[DTO_Member]: """ Returns the list of members. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Members/Instructors/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetMembersCount(self, q:str = None) -> int: """ Returns the count of members. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Members/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetMemberById(self, id:int) -> DTO_Member: """ Get the member information based on the provided id """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Members/ById/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetMemberHistoryId(self, id:int) -> List[DTO_MemberHistory]: """ Get the member history """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Members/History/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddMemberHistory(self, history:DTO_MemberHistory) -> DTO_MemberHistory: """ Add one history entry to a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Members/History?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(history))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddMemberHistories(self, histories:List[DTO_MemberHistory]) -> List[DTO_MemberHistory]: """ Add multiple histories """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Members/History/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(histories))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddMember(self, member:DTO_Member) -> DTO_Member: """ Insert a new member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Members?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(member))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddMembers(self, members:List[DTO_Member]) -> List[DTO_Member]: """ Insert a batch of new members """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Members/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(members))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateMember(self, member:DTO_Member) -> DTO_Member: """ Update a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Members?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(member))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddRoles(self, roles:List[int], memberId:int) -> bool: """ Add roles to a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Members/" + urlEncode(memberId) + "/Roles?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(roles))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def RemoveRoles(self, roles:List[int], memberId:int) -> bool: """ Remove roles from a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Members/" + urlEncode(memberId) + "/Roles?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(roles))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def SetCategories(self, aircraftCategories:List[int], memberId:int) -> bool: """ Set the allowed aircraft categories for a given user """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Members/" + urlEncode(memberId) + "/AllowedCategories?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(aircraftCategories))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteMember(self, id:int) -> bool: """ Delete a member """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Members?token=" + urlEncode(self.parent.token) + "&id=" + urlEncode(FFJsonDump(id))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def CleanCache(self) -> bool: """ Clean cache and wait for rebuild """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Members/CleanCache?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Memberships: """ API For the Membership """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetMemberships(self, q:str = None) -> List[DTO_IdName]: """ Returns the list of memberships. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Memberships/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetMembershipCount(self, q:str = None) -> int: """ Returns the number of memberships known. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Memberships/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetMembershipById(self, id:int) -> DTO_IdName: """ Get the membership information based on the provided id. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Memberships/ById/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Movements: """ API For the Aircraft Movements """ parent = None def __init__(self, apiObject): self.parent = apiObject def Lasts(self) -> List[DTO_FlightLog]: """ Returns the list of the last 100 movements. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Movements/Lasts?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def ArrivalSectors(self) -> List[DTO_IdName]: """ Returns the list of the arrival sectors. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Movements/ArrivalSectors?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DepartureRoutes(self) -> List[DTO_IdName]: """ Returns the list of the departure sectors. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Movements/DepartureRoutes?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def Runways(self) -> List[DTO_IdName]: """ Returns the list of the runways. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Movements/Runways?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetStats(self) -> DTO_TableStat: """ Return the statistics about the movements """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Movements/Stats?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetMovements(self, start:str = None, end:str = None) -> List[DTO_FlightLog]: """ Returns the list of the last 100 movements. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Movements?token=" + urlEncode(self.parent.token) + "&start=" + urlEncode(start) + "&end=" + urlEncode(end) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddMovement(self, movement:DTO_FlightLog) -> DTO_FlightLog: """ Insert a new movement """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Movements?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(movement))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteMovements(self, movementIds:List[int]) -> bool: if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Movements/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(movementIds))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddMovements(self, movements:List[DTO_FlightLog]) -> List[DTO_FlightLog]: """ Insert new movements """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Movements/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(movements))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def CleanCache(self) -> bool: """ Clean cache and wait for rebuild """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Movements/CleanCache?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_News: """ API For the News """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetNews(self, q:str = None) -> List[DTO_News]: """ Get the list of all the news known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/News/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddNews(self, news:DTO_News) -> DTO_News: """ Inserts a news """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/News?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(news))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddNewsAttachement(self, newsId:int, filename:str, data:bytes) -> bool: """ Attaches a document to a news """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/News/Attachement?token=" + urlEncode(self.parent.token) + "&newsId=" + urlEncode(FFJsonDump(newsId)) + "&filename=" + urlEncode(filename) + "&data=" + urlEncode(FFJsonDump(data))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Reservations: """ API For the Reservations (not directly used by the Calendar UI) """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetStats(self) -> DTO_TableStat: """ Return the statistics about the reservations """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Reservations/Stats?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetReservations(self, start:str, end:str) -> List[DTO_Reservation]: """ Returns the list of reservations between two dates. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Reservations?token=" + urlEncode(self.parent.token) + "&start=" + urlEncode(start) + "&end=" + urlEncode(end)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddReservation(self, reservation:DTO_Reservation) -> DTO_Reservation: """ Insert a new reservation """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Reservations?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(reservation))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddReservations(self, reservations:List[DTO_Reservation]) -> List[DTO_Reservation]: """ Insert a new batch of reservations """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Reservations/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(reservations))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateReservation(self, reservation:DTO_Reservation) -> DTO_Reservation: """ Update a reservation """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/Reservations?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(reservation))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteReservation(self, id:int) -> bool: """ Delete a reservation """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Reservations?token=" + urlEncode(self.parent.token) + "&id=" + urlEncode(FFJsonDump(id))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def DeleteReservations(self, ids:List[int], completely:bool = False) -> bool: """ Delete a batch of reservations """ if self.parent.token is None: raise Exception("Not authorized") response = requests.delete(self.parent.url + "api/Reservations/Batch?token=" + urlEncode(self.parent.token) + "&completely=" + urlEncode(FFJsonDump(completely)), json = json.loads(FFJsonDump(ids))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_ReservationTypes: """ API For the Reservation Types """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetReservationTypes(self, q:str = None) -> List[DTO_ReservationType]: """ Get the list of all the reservation types known """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/ReservationTypes/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_RightTypes: """ API For the Right Types """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetRightTypes(self) -> List[DTO_IdName]: """ Returns the list of right types. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/RightTypes?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_RoleTypes: """ API For the Role Types """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetRolesTypes(self, q:str = None) -> List[DTO_IdName]: """ Returns the list of right types. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/RoleTypes/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetRoleTypeCount(self, q:str = None) -> int: """ Returns the count of right types. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/RoleTypes/No/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetRoleType(self, id:int) -> DTO_IdName: """ Get the role type information based on the provided id """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/RoleTypes/ById/" + urlEncode(id) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddRoleType(self, role:DTO_IdName) -> DTO_IdName: """ Insert a new role type """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/RoleTypes?token=" + urlEncode(self.parent.token) + "&role=" + urlEncode(FFJsonDump(role))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddRoleTypes(self, roles:List[DTO_IdName]) -> List[DTO_IdName]: """ Insert a batch of new members """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/RoleTypes/Batch?token=" + urlEncode(self.parent.token) + "&roles=" + urlEncode(FFJsonDump(roles))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def SetRoleRight(self, rights:List[int], roleId:int) -> bool: """ Set the rights for a given role """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/RoleTypes/Rights?token=" + urlEncode(self.parent.token) + "&roleId=" + urlEncode(FFJsonDump(roleId)), json = json.loads(FFJsonDump(rights))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Search: """ API For the Global Search """ parent = None def __init__(self, apiObject): self.parent = apiObject def Search(self, q:str) -> List[DTO_SearchResult]: """ Returns all the possible match for a given string. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Search/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_TechLog: """ API For the TechLog """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetStats(self) -> DTO_TableStat: """ Return the statistics about the techlogs """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/TechLog/Stats?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetTechLogsByCallSign(self, callsign:str) -> DTO_DisplayTechlog: """ Returns the techlog for a given aircraft. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/TechLog/ByCallSign/" + urlEncode(callsign) + "?token=" + urlEncode(self.parent.token)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetLogs(self, start:str = None, end:str = None) -> List[DTO_TechLog]: """ Returns the list of the entries. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/TechLog?token=" + urlEncode(self.parent.token) + "&start=" + urlEncode(start) + "&end=" + urlEncode(end) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddEntry(self, log:DTO_TechLog) -> DTO_TechLog: """ Insert a new Techlog """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/TechLog?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(log))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddEntries(self, logs:List[DTO_TechLog]) -> List[DTO_TechLog]: """ Insert a new techlogs """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/TechLog/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(logs))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateEntry(self, log:DTO_TechLog) -> bool: """ Update an existing techlog """ if self.parent.token is None: raise Exception("Not authorized") response = requests.patch(self.parent.url + "api/TechLog?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(log))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None class FlyingFleet_Transactions: """ API For the Transactions """ parent = None def __init__(self, apiObject): self.parent = apiObject def GetTransactions(self, vatAccountId:Optional[int], q:str = None) -> List[DTO_Transaction]: """ Returns the list of transactions. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Transactions/" + urlEncode(q) + "?token=" + urlEncode(self.parent.token) + "&vatAccountId=" + urlEncode(FFJsonDump(vatAccountId)) + "&limit=-1") if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddTransaction(self, transaction:DTO_Transaction) -> DTO_FlightLog: """ Insert a new transaction. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Transactions?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(transaction))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def AddTransactions(self, transactions:List[DTO_Transaction]) -> List[DTO_Transaction]: """ Insert new transactions. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.put(self.parent.url + "api/Transactions/Batch?token=" + urlEncode(self.parent.token), json = json.loads(FFJsonDump(transactions))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def GetBills(self, vatAccountId:Optional[int] = None) -> List[DTO_Bill]: """ Get the list of bills. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.get(self.parent.url + "api/Transactions/Bills?token=" + urlEncode(self.parent.token) + "&vatAccountId=" + urlEncode(FFJsonDump(vatAccountId))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def CreateFromTransactions(self, transactions:List[int], creationDate:str, status:DTO_BillStatus, paidOn:str, importId:Optional[int] = None) -> DTO_Bill: """ Create a bill from transactions. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.post(self.parent.url + "api/Transactions/Bill/CreateFrom?token=" + urlEncode(self.parent.token) + "&creationDate=" + urlEncode(creationDate) + "&status=" + urlEncode(FFJsonDump(status)) + "&paidOn=" + urlEncode(paidOn) + "&importId=" + urlEncode(FFJsonDump(importId)), json = json.loads(FFJsonDump(transactions))) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None def UpdateBill(self, billId:int, status:DTO_BillStatus, paidOn:str) -> bool: """ Update the status of a bill. """ if self.parent.token is None: raise Exception("Not authorized") response = requests.post(self.parent.url + "api/Transactions/Bill/UpdateStatus?token=" + urlEncode(self.parent.token) + "&billId=" + urlEncode(FFJsonDump(billId)) + "&status=" + urlEncode(FFJsonDump(status)) + "&paidOn=" + urlEncode(paidOn)) if response.ok and response.status_code == 200: return json.loads(response.content.decode()) else: return None ActionHistory:FlyingFleet_ActionHistory = None """ API For the Action History Menu """ AircraftLogs:FlyingFleet_AircraftLogs = None """ API For the Aircraft Log """ AircraftModels:FlyingFleet_AircraftModels = None """ API For the Aircraft Models """ Aircrafts:FlyingFleet_Aircrafts = None """ API For the Aircrafts """ Airports:FlyingFleet_Airports = None """ API For the Airports """ Articles:FlyingFleet_Articles = None """ API For the Articles """ Auth:FlyingFleet_Auth = None """ API For the Authorization """ Backups:FlyingFleet_Backups = None """ API to access the backups """ Bill:FlyingFleet_Bill = None """ API For the bills """ Calendar:FlyingFleet_Calendar = None """ API For the Calendar """ Catalogs:FlyingFleet_Catalogs = None """ API For the Catalogs """ Currencies:FlyingFleet_Currencies = None """ API For the Currencies """ Diagnostic:FlyingFleet_Diagnostic = None """ API For diagnostic purpose """ Documents:FlyingFleet_Documents = None """ API For the Documents """ Finances:FlyingFleet_Finances = None """ API For the Finances account """ FlightActivityTypes:FlyingFleet_FlightActivityTypes = None """ API For the FlightActivityTypes """ Instructions:FlyingFleet_Instructions = None """ API For the Instructions """ InstructionTypes:FlyingFleet_InstructionTypes = None """ API For the Instructions Types """ Links:FlyingFleet_Links = None """ API For the home Links """ MemberMemberships:FlyingFleet_MemberMemberships = None """ API For the MemberMembership """ Members:FlyingFleet_Members = None """ API For the Members """ Memberships:FlyingFleet_Memberships = None """ API For the Membership """ Movements:FlyingFleet_Movements = None """ API For the Aircraft Movements """ News:FlyingFleet_News = None """ API For the News """ Reservations:FlyingFleet_Reservations = None """ API For the Reservations (not directly used by the Calendar UI) """ ReservationTypes:FlyingFleet_ReservationTypes = None """ API For the Reservation Types """ RightTypes:FlyingFleet_RightTypes = None """ API For the Right Types """ RoleTypes:FlyingFleet_RoleTypes = None """ API For the Role Types """ Search:FlyingFleet_Search = None """ API For the Global Search """ TechLog:FlyingFleet_TechLog = None """ API For the TechLog """ Transactions:FlyingFleet_Transactions = None """ API For the Transactions """ def __init__(self): self.ActionHistory = self.FlyingFleet_ActionHistory(self) self.AircraftLogs = self.FlyingFleet_AircraftLogs(self) self.AircraftModels = self.FlyingFleet_AircraftModels(self) self.Aircrafts = self.FlyingFleet_Aircrafts(self) self.Airports = self.FlyingFleet_Airports(self) self.Articles = self.FlyingFleet_Articles(self) self.Auth = self.FlyingFleet_Auth(self) self.Backups = self.FlyingFleet_Backups(self) self.Bill = self.FlyingFleet_Bill(self) self.Calendar = self.FlyingFleet_Calendar(self) self.Catalogs = self.FlyingFleet_Catalogs(self) self.Currencies = self.FlyingFleet_Currencies(self) self.Diagnostic = self.FlyingFleet_Diagnostic(self) self.Documents = self.FlyingFleet_Documents(self) self.Finances = self.FlyingFleet_Finances(self) self.FlightActivityTypes = self.FlyingFleet_FlightActivityTypes(self) self.Instructions = self.FlyingFleet_Instructions(self) self.InstructionTypes = self.FlyingFleet_InstructionTypes(self) self.Links = self.FlyingFleet_Links(self) self.MemberMemberships = self.FlyingFleet_MemberMemberships(self) self.Members = self.FlyingFleet_Members(self) self.Memberships = self.FlyingFleet_Memberships(self) self.Movements = self.FlyingFleet_Movements(self) self.News = self.FlyingFleet_News(self) self.Reservations = self.FlyingFleet_Reservations(self) self.ReservationTypes = self.FlyingFleet_ReservationTypes(self) self.RightTypes = self.FlyingFleet_RightTypes(self) self.RoleTypes = self.FlyingFleet_RoleTypes(self) self.Search = self.FlyingFleet_Search(self) self.TechLog = self.FlyingFleet_TechLog(self) self.Transactions = self.FlyingFleet_Transactions(self)