# 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](https://api.prod.oursky.ai/docs/sda#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](https://api.prod.oursky.ai/docs/sda#tag/organization-targets/get/v1/organization-targets) endpoint. Use the id copied from above. 3. Create a webhook with the [webhook](https://api.prod.oursky.ai/docs/sda#tag/webhooks/post/v1/communications/webhook) endpoint to receive TDMs automatically (preferred) or use the [tdms](https://api.prod.oursky.ai/docs/sda#tag/tdms/get/v1/tdms) endpoint to poll for TDMs.  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.5667
    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, StrictStr

class V1PutOrbitProviderTLERequest(BaseModel):
    """
    Upsert (create or update) a satellite target with new a new TLE. If creating a new target, do not enter a `satellite_target_id`.  If updating an existing satellite target, the satellite target id must be one found in the OurSky database using the `/v1/satellite-targets` endpoint.  # noqa: E501
    """
    satellite_target_id: Optional[StrictStr] = Field(None, description="Existing target id of an OurSky target that you are providing a TLE for. Leave null if one does not exist in the database.")
    tle_line_1: StrictStr = Field(...)
    tle_line_2: StrictStr = Field(...)
    tle_name: Optional[StrictStr] = None
    mass: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="mass in kilograms")
    coefficient_of_reflection: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="coefficientOfReflection", description="The Cr value used to calculate acceleration due to solar radiation pressure")
    cross_section: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="crossSection", description="cross sectional area in meters^2")
    __properties = ["satellite_target_id", "tle_line_1", "tle_line_2", "tle_name", "mass", "coefficientOfReflection", "crossSection"]

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

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

        _obj = V1PutOrbitProviderTLERequest.parse_obj({
            "satellite_target_id": obj.get("satellite_target_id"),
            "tle_line_1": obj.get("tle_line_1"),
            "tle_line_2": obj.get("tle_line_2"),
            "tle_name": obj.get("tle_name"),
            "mass": obj.get("mass"),
            "coefficient_of_reflection": obj.get("coefficientOfReflection"),
            "cross_section": obj.get("crossSection")
        })
        return _obj


