# 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 TDMs automatically (preferred) or use the [tdms](#tag/tdms/[get]/v1/tdms) endpoint to poll for TDMs.

    The version of the OpenAPI document: 1.3.3750
    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, StrictBool, StrictFloat, StrictInt, StrictStr
from ourskyai_sda_api.models.location import Location
from ourskyai_sda_api.models.mount_type import MountType
from ourskyai_sda_api.models.shutter_type import ShutterType

class V1GroundStationParticipant(BaseModel):
    """
    V1GroundStationParticipant
    """
    node_id: StrictStr = Field(..., alias="nodeId")
    location: Location = Field(...)
    megapixels: Union[StrictFloat, StrictInt] = Field(...)
    shutter_type: ShutterType = Field(..., alias="shutterType")
    pixel_size_microns: Union[StrictFloat, StrictInt] = Field(..., alias="pixelSizeMicrons")
    gps_timestamps: StrictBool = Field(..., alias="gpsTimestamps")
    ota_focal_length_mm: StrictInt = Field(..., alias="otaFocalLengthMm")
    ota_aperture_mm: StrictInt = Field(..., alias="otaApertureMm")
    mount_type: MountType = Field(..., alias="mountType")
    master_flat: Optional[StrictStr] = Field(None, alias="masterFlat")
    master_dark: Optional[StrictStr] = Field(None, alias="masterDark")
    master_bias: Optional[StrictStr] = Field(None, alias="masterBias")
    __properties = ["nodeId", "location", "megapixels", "shutterType", "pixelSizeMicrons", "gpsTimestamps", "otaFocalLengthMm", "otaApertureMm", "mountType", "masterFlat", "masterDark", "masterBias"]

    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) -> V1GroundStationParticipant:
        """Create an instance of V1GroundStationParticipant 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)
        # override the default output from pydantic by calling `to_dict()` of location
        if self.location:
            _dict['location'] = self.location.to_dict()
        return _dict

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

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

        _obj = V1GroundStationParticipant.parse_obj({
            "node_id": obj.get("nodeId"),
            "location": Location.from_dict(obj.get("location")) if obj.get("location") is not None else None,
            "megapixels": obj.get("megapixels"),
            "shutter_type": obj.get("shutterType"),
            "pixel_size_microns": obj.get("pixelSizeMicrons"),
            "gps_timestamps": obj.get("gpsTimestamps"),
            "ota_focal_length_mm": obj.get("otaFocalLengthMm"),
            "ota_aperture_mm": obj.get("otaApertureMm"),
            "mount_type": obj.get("mountType"),
            "master_flat": obj.get("masterFlat"),
            "master_dark": obj.get("masterDark"),
            "master_bias": obj.get("masterBias")
        })
        return _obj


