API Usage Models

pydantic model flight_radar.models.api_usage.ApiUsage

Bases: BaseModel

Show JSON schema
{
   "title": "ApiUsage",
   "type": "object",
   "properties": {
      "endpoint": {
         "description": "Endpoint of the API call",
         "title": "Endpoint",
         "type": "string"
      },
      "request_count": {
         "description": "Number of requests",
         "title": "Request Count",
         "type": "integer"
      },
      "credits": {
         "description": "Number of credits used",
         "title": "Credits",
         "type": "integer"
      }
   },
   "required": [
      "endpoint",
      "request_count",
      "credits"
   ]
}

Fields:
field credits: int [Required]

Number of credits used

field endpoint: str [Required]

Endpoint of the API call

field request_count: int [Required]

Number of requests

static from_dto(dto)
Return type:

ApiUsage

Parameters:

dto (ApiUsageDto)

pydantic model flight_radar.models.api_usage.ApiUsageRequest

Bases: BaseModel

Show JSON schema
{
   "title": "ApiUsageRequest",
   "type": "object",
   "properties": {
      "period": {
         "$ref": "#/$defs/TimePeriod",
         "default": "24h"
      }
   },
   "$defs": {
      "TimePeriod": {
         "enum": [
            "24h",
            "7d",
            "30d",
            "1y"
         ],
         "title": "TimePeriod",
         "type": "string"
      }
   }
}

Fields:
field period: TimePeriod = TimePeriod.DAY
to_dto()
Return type:

ApiUsageBaseRequestDto

class flight_radar.models.api_usage.ApiUsageRequest(**data)
Parameters:

period (TimePeriod)

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class flight_radar.models.api_usage.ApiUsage(**data)
Parameters:
  • endpoint (str)

  • request_count (int)

  • credits (int)

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].