# 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 Union
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, validator

class V1StateVector(BaseModel):
    """
    State vector representing a satellite's position and velocity in space.  # noqa: E501
    """
    id: StrictStr = Field(..., description="Unique identifier for the state vector.")
    target_id: StrictStr = Field(..., alias="targetId", description="Identifier of the satellite target this state vector belongs to.")
    pos_x: Union[StrictFloat, StrictInt] = Field(..., alias="posX", description="Position in the X direction in meters.")
    pos_y: Union[StrictFloat, StrictInt] = Field(..., alias="posY", description="Position in the Y direction in meters.")
    pos_z: Union[StrictFloat, StrictInt] = Field(..., alias="posZ", description="Position in the Z direction in meters.")
    vel_x: Union[StrictFloat, StrictInt] = Field(..., alias="velX", description="Velocity in the X direction in meters per second.")
    vel_y: Union[StrictFloat, StrictInt] = Field(..., alias="velY", description="Velocity in the Y direction in meters per second.")
    vel_z: Union[StrictFloat, StrictInt] = Field(..., alias="velZ", description="Velocity in the Z direction in meters per second.")
    epoch: datetime = Field(..., description="UTC epoch of the state vector")
    reference_frame: StrictStr = Field(..., alias="referenceFrame")
    drag_coefficient: Union[StrictFloat, StrictInt] = Field(..., alias="dragCoefficient", description="Drag coefficient of the satellite- normalized to a 1m^2 cross-sectional area and a 1kg mass.")
    srp_coefficient: Union[StrictFloat, StrictInt] = Field(..., alias="srpCoefficient", description="Solar radiation pressure coefficient of the satellite- normalized to a 1m^2 cross-sectional area and a 1kg mass.")
    __properties = ["id", "targetId", "posX", "posY", "posZ", "velX", "velY", "velZ", "epoch", "referenceFrame", "dragCoefficient", "srpCoefficient"]

    @validator('reference_frame')
    def reference_frame_validate_enum(cls, value):
        """Validates the enum"""
        if value not in ('ECI_J2000', 'ECEF'):
            raise ValueError("must be one of enum values ('ECI_J2000', 'ECEF')")
        return value

    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) -> V1StateVector:
        """Create an instance of V1StateVector 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) -> V1StateVector:
        """Create an instance of V1StateVector from a dict"""
        if obj is None:
            return None

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

        _obj = V1StateVector.parse_obj({
            "id": obj.get("id"),
            "target_id": obj.get("targetId"),
            "pos_x": obj.get("posX"),
            "pos_y": obj.get("posY"),
            "pos_z": obj.get("posZ"),
            "vel_x": obj.get("velX"),
            "vel_y": obj.get("velY"),
            "vel_z": obj.get("velZ"),
            "epoch": obj.get("epoch"),
            "reference_frame": obj.get("referenceFrame"),
            "drag_coefficient": obj.get("dragCoefficient"),
            "srp_coefficient": obj.get("srpCoefficient")
        })
        return _obj


