# coding: utf-8

"""
    OurSky SDA

    The basic flow for a new organization is as follows: 1. View the available satellite targets with the [satellite targets](#tag/satellite-targets/GET/v1/satellite-targets) endpoint. Copy the id of the target you want to observe. 2. Create an organization target with the [organization target](#tag/organization-targets/GET/v1/organization-targets) endpoint. Use the id copied from above. 3. Create a webhook with the [webhook](#tag/webhooks/POST/v1/communications/webhook) endpoint to receive OSRs automatically (preferred) or use the [OSRs](#tag/observation-sequence-results/GET/v1/observation-sequence-results) endpoint to poll for OSRs.  Check out our [examples](https://github.com/ourskyai/oursky-examples) repository to see usage in each language.

    The version of the OpenAPI document: 1.3.9821
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from datetime import datetime
from typing import Optional, Union
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
from ourskyai_sda_api.models.orbit_type import OrbitType
from ourskyai_sda_api.models.satellite_target_tracking_status import SatelliteTargetTrackingStatus

class V1SatelliteTarget(BaseModel):
    """
    Satellite Target  # noqa: E501
    """
    id: StrictStr = Field(...)
    cospar_id: Optional[StrictStr] = Field(None, alias="cosparId")
    norad_id: Optional[StrictStr] = Field(None, alias="noradId")
    orbit_type: OrbitType = Field(..., alias="orbitType")
    tle_epoch: Optional[datetime] = Field(None, alias="tleEpoch")
    tle_name: Optional[StrictStr] = Field(None, alias="tleName")
    tle_line1: Optional[StrictStr] = Field(None, alias="tleLine1")
    tle_line2: Optional[StrictStr] = Field(None, alias="tleLine2")
    tracking_status: Optional[SatelliteTargetTrackingStatus] = Field(None, alias="trackingStatus")
    classification: Optional[StrictStr] = None
    launch_year: Optional[StrictInt] = Field(None, alias="launchYear")
    epoch_year: Optional[StrictInt] = Field(None, alias="epochYear")
    epoch_day: Optional[StrictInt] = Field(None, alias="epochDay")
    mean_motion_first_derivative: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="meanMotionFirstDerivative")
    mean_motion_second_derivative: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="meanMotionSecondDerivative")
    bstar: Optional[Union[StrictFloat, StrictInt]] = None
    ephemeris_type: Optional[StrictInt] = Field(None, alias="ephemerisType")
    element_number: Optional[StrictInt] = Field(None, alias="elementNumber")
    inclination: Optional[Union[StrictFloat, StrictInt]] = None
    raan: Optional[Union[StrictFloat, StrictInt]] = None
    eccentricity: Optional[Union[StrictFloat, StrictInt]] = None
    perigee_argument: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="perigeeArgument")
    mean_anomaly: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="meanAnomaly")
    mean_motion: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="meanMotion")
    revolution_number_at_epoch: Optional[StrictInt] = Field(None, alias="revolutionNumberAtEpoch")
    organization_id: Optional[StrictStr] = Field(None, alias="organizationId")
    coefficient_of_reflection: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="coefficientOfReflection")
    mass: Optional[Union[StrictFloat, StrictInt]] = None
    area: Optional[Union[StrictFloat, StrictInt]] = None
    linked_satellite_target_id: Optional[StrictStr] = Field(None, alias="linkedSatelliteTargetId", description="Linked satellite target id on our system. See [POST /v1/satellite-target](#tag/satellite-targets/POST/v1/satellite-target)")
    orbit_source_id: Optional[StrictStr] = Field(None, alias="orbitSourceId")
    orbit_source_provider_name: Optional[StrictStr] = Field(None, alias="orbitSourceProviderName")
    __properties = ["id", "cosparId", "noradId", "orbitType", "tleEpoch", "tleName", "tleLine1", "tleLine2", "trackingStatus", "classification", "launchYear", "epochYear", "epochDay", "meanMotionFirstDerivative", "meanMotionSecondDerivative", "bstar", "ephemerisType", "elementNumber", "inclination", "raan", "eccentricity", "perigeeArgument", "meanAnomaly", "meanMotion", "revolutionNumberAtEpoch", "organizationId", "coefficientOfReflection", "mass", "area", "linkedSatelliteTargetId", "orbitSourceId", "orbitSourceProviderName"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> V1SatelliteTarget:
        """Create an instance of V1SatelliteTarget from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> V1SatelliteTarget:
        """Create an instance of V1SatelliteTarget from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return V1SatelliteTarget.parse_obj(obj)

        _obj = V1SatelliteTarget.parse_obj({
            "id": obj.get("id"),
            "cospar_id": obj.get("cosparId"),
            "norad_id": obj.get("noradId"),
            "orbit_type": obj.get("orbitType"),
            "tle_epoch": obj.get("tleEpoch"),
            "tle_name": obj.get("tleName"),
            "tle_line1": obj.get("tleLine1"),
            "tle_line2": obj.get("tleLine2"),
            "tracking_status": obj.get("trackingStatus"),
            "classification": obj.get("classification"),
            "launch_year": obj.get("launchYear"),
            "epoch_year": obj.get("epochYear"),
            "epoch_day": obj.get("epochDay"),
            "mean_motion_first_derivative": obj.get("meanMotionFirstDerivative"),
            "mean_motion_second_derivative": obj.get("meanMotionSecondDerivative"),
            "bstar": obj.get("bstar"),
            "ephemeris_type": obj.get("ephemerisType"),
            "element_number": obj.get("elementNumber"),
            "inclination": obj.get("inclination"),
            "raan": obj.get("raan"),
            "eccentricity": obj.get("eccentricity"),
            "perigee_argument": obj.get("perigeeArgument"),
            "mean_anomaly": obj.get("meanAnomaly"),
            "mean_motion": obj.get("meanMotion"),
            "revolution_number_at_epoch": obj.get("revolutionNumberAtEpoch"),
            "organization_id": obj.get("organizationId"),
            "coefficient_of_reflection": obj.get("coefficientOfReflection"),
            "mass": obj.get("mass"),
            "area": obj.get("area"),
            "linked_satellite_target_id": obj.get("linkedSatelliteTargetId"),
            "orbit_source_id": obj.get("orbitSourceId"),
            "orbit_source_provider_name": obj.get("orbitSourceProviderName")
        })
        return _obj


