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

class ObservationQuality(BaseModel):
    """
    ObservationQuality
    """
    line_fit_offset_std_dev: Union[StrictFloat, StrictInt] = Field(..., alias="lineFitOffsetStdDev", description="Standard deviation for the line fit of the observation positions over time")
    distance_from_prediction_average: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="distanceFromPredictionAverage", description="Average of the distances beween observation and prediction, in arcsec")
    distance_from_prediction_line_fit_slope: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="distanceFromPredictionLineFitSlope", description="Slope of the linear fit of distances, in arcsec per second")
    distance_from_prediction_line_fit_std_dev: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="distanceFromPredictionLineFitStdDev", description="Standard deviation of the offsets of the linear fit")
    __properties = ["lineFitOffsetStdDev", "distanceFromPredictionAverage", "distanceFromPredictionLineFitSlope", "distanceFromPredictionLineFitStdDev"]

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

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

        _obj = ObservationQuality.parse_obj({
            "line_fit_offset_std_dev": obj.get("lineFitOffsetStdDev"),
            "distance_from_prediction_average": obj.get("distanceFromPredictionAverage"),
            "distance_from_prediction_line_fit_slope": obj.get("distanceFromPredictionLineFitSlope"),
            "distance_from_prediction_line_fit_std_dev": obj.get("distanceFromPredictionLineFitStdDev")
        })
        return _obj


