diff --git a/README.md b/README.md
index f103ba9..5f6a3d3 100644
--- a/README.md
+++ b/README.md
@@ -53,9 +53,13 @@ print(angle.to_string()) # 180 °
print(angle.to_string(AngleUnits.Degree)) # 180 °
print(angle.to_string(AngleUnits.Radian)) # 3.141592653589793 rad
+```
+
+## Additional methods
-# Additional methods
+Check, compare, calculate etc. with unitsnet:
+```python
length1 = Length.from_meters(10)
length2 = Length.from_decimeters(100)
length3 = Length.from_meters(3)
@@ -99,6 +103,41 @@ print(np_array_double_length.kilometers) # [[ 4. 8. 12.][14. 16. 18.]]
print(np_array_double_length.meters) # [[ 4000. 8000. 12000.][14000. 16000. 18000.]]
```
+## DTO - Data Transfer Object
+
+As UnitsNet provides a convenient way to work within a running service, there are occasions where the data needs to be exposed outside of the service, typically through an API containing the unit value or consumed from an API.
+
+To support this with a clear API schema and make it easy to convert to and from this schema to the specific format, it's recommended to use DTOs and the UnitsNet flavor converters.
+
+```python
+from unitsnet_py import Length, LengthDto, LengthUnits
+
+ # Create a Length unit object
+length = Length.from_meters(100.01)
+# Obtain the DTO object as json, represented by the default unit - meter
+length_dto_json = length.to_dto_json() # {"value":100.01,"unit":"Meter"}
+# Obtain the same value but represent DTO in KM
+length_dto_represents_in_km_json = length.to_dto_json(LengthUnits.Kilometer) # {'value': 0.10001, 'unit': 'Kilometer'}
+# Load JSON to DTO, and load
+length_from_meters_dto = Length.from_dto_json(length_dto_json)
+# The exact same value as
+length_from_km_dto = Length.from_dto_json(length_dto_represents_in_km_json)
+
+# Also, it supported to create and handle as DTO instance and to create to/from json to it.
+
+# Get a DTO instance from a Length instance
+length_dto: LengthDto = length.to_dto()
+# Get the json representation of the DTO
+length_json = length_dto.to_json() # {"value":100.01,"unit":"Meter"}
+# Obtain DTO instance from a json representation
+length_dto: LengthDto = LengthDto.from_json(length_json)
+# Obtain Length unit from a DTO instance
+length = Length.from_dto(length_dto)
+```
+
+Check out the OpenAPI [unitsnet-openapi-spec](https://haimkastner.github.io/unitsnet-openapi-spec-example/) example schema.
+
+Also, refer to the detailed discussions on GitHub: [haimkastner/unitsnet-js#31](https://github.com/haimkastner/unitsnet-js/issues/31) & [angularsen/UnitsNet#1378](https://github.com/angularsen/UnitsNet/issues/1378).
### Supported units
@@ -487,4 +526,5 @@ Get the same strongly typed units on other platforms, based on the same [unit de
|----------------------------|-------------|---------------------------------------------------|------------------------------------------------------|--------------|
| C# | UnitsNet | [nuget](https://www.nuget.org/packages/UnitsNet/) | [github](https://github.com/angularsen/UnitsNet) | @angularsen |
| JavaScript /
TypeScript | unitsnet-js | [npm](https://www.npmjs.com/package/unitsnet-js) | [github](https://github.com/haimkastner/unitsnet-js) | @haimkastner |
+| Python | unitsnet-py | [pypi](https://pypi.org/project/unitsnet-py) | [github](https://github.com/haimkastner/unitsnet-py) | @haimkastner |
diff --git a/tests/test_unit_dto.py b/tests/test_unit_dto.py
new file mode 100644
index 0000000..e3ce5f8
--- /dev/null
+++ b/tests/test_unit_dto.py
@@ -0,0 +1,121 @@
+import unittest
+from unitsnet_py import Length, LengthUnits, LengthDto
+
+length1 = Length.from_meters(100.01)
+
+class TestUnitDto(unittest.TestCase):
+ def test_create_json_from_default_unit(self):
+ self.assertDictEqual(length1.to_dto().to_json(), {
+ "value":100.01,
+ "unit":"Meter"
+ })
+
+
+ def test_create_json_from_specific_unit(self):
+ self.assertDictEqual(length1.to_dto(LengthUnits.Centimeter).to_json(), {
+ "value":10001,
+ "unit":"Centimeter"
+ })
+
+ def test_directly_create_json_from_unit(self):
+ self.assertDictEqual(length1.to_dto_json(), {
+ "value":100.01,
+ "unit":"Meter"
+ })
+
+ def test_directly_create_json_from_specific_unit(self):
+ self.assertDictEqual(length1.to_dto_json(LengthUnits.Centimeter), {
+ "value":10001,
+ "unit":"Centimeter"
+ })
+
+ def test_create_dto_from_default_unit(self):
+ dto = length1.to_dto()
+ self.assertEqual(dto.value, 100.01)
+ self.assertEqual(dto.unit, LengthUnits.Meter)
+
+
+ def test_create_dto_from_specific_unit(self):
+ dto = length1.to_dto(LengthUnits.Centimeter)
+ self.assertEqual(dto.value, 10001)
+ self.assertEqual(dto.unit, LengthUnits.Centimeter)
+
+
+ def test_load_from_default_unit_json(self):
+ json_dto = length1.to_dto().to_json()
+ new_length = Length.from_dto(LengthDto.from_json(json_dto))
+ self.assertEqual(new_length.meters, 100.01)
+
+
+ def test_load_from_specific_unit_json(self):
+ json_dto = length1.to_dto(LengthUnits.Centimeter).to_json()
+ new_length = Length.from_dto(LengthDto.from_json(json_dto))
+ self.assertEqual(new_length.decimeters, 1000.1)
+
+
+ def test_load_from_default_unit_dto(self):
+ dto = length1.to_dto()
+ new_length = Length.from_dto(dto)
+ self.assertEqual(new_length.meters, 100.01)
+
+
+ def test_load_from_specific_unit_dto(self):
+ dto = length1.to_dto(LengthUnits.Centimeter)
+ new_length = Length.from_dto(dto)
+ self.assertEqual(new_length.decimeters, 1000.1)
+
+ def test_load_from_json(self):
+ json = {
+ "value":100.01,
+ "unit":"Meter"
+ }
+ new_length = Length.from_dto(LengthDto.from_json(json))
+ self.assertEqual(new_length.meters, 100.01)
+
+ def test_load_directly_from_json(self):
+ json = {
+ "value":100.01,
+ "unit":"Meter"
+ }
+ new_length = Length.from_dto_json(json)
+ self.assertEqual(new_length.meters, 100.01)
+
+ def test_load_directly_from_specific_unit_json(self):
+ json = {
+ "value":10001,
+ "unit":"Centimeter"
+ }
+ new_length = Length.from_dto_json(json)
+ self.assertEqual(new_length.meters, 100.01)
+
+ def test_should_be_similar_values_from_two_dto_representations(self):
+ # Create a Length unit object
+ length = Length.from_meters(100.01)
+
+ # Obtain the DTO object as json, represented by the default unit - meter
+ length_dto_json = length.to_dto_json() # {"value":100.01,"unit":"Meter"}
+
+ # Obtain the same value but represent DTO in KM
+ length_dto_represents_in_km_json = length.to_dto_json(LengthUnits.Kilometer) # {'value': 0.10001, 'unit': 'Kilometer'}
+
+ # Load JSON to DTO, and load
+ length_from_meters_dto = Length.from_dto_json(length_dto_json)
+ # The exact same value as
+ length_from_km_dto = Length.from_dto_json(length_dto_represents_in_km_json)
+
+ self.assertEqual(length_from_meters_dto.meters, length_from_km_dto.meters)
+
+ # Get a DTO instance from a Length instance
+ length_dto: LengthDto = length.to_dto()
+ # Get the json representation of the DTO
+ length_json = length_dto.to_json() # {"value":100.01,"unit":"Meter"}
+ # Obtain DTO instance from a json representation
+ length_dto: LengthDto = LengthDto.from_json(length_json)
+ # Obtain Length unit from a DTO instance
+ length = Length.from_dto(length_dto)
+
+ self.assertEqual(length.meters, length_from_meters_dto.meters)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/units_generator/common/fetch_units_definitions.py b/units_generator/common/fetch_units_definitions.py
index d7f5968..18a64bf 100644
--- a/units_generator/common/fetch_units_definitions.py
+++ b/units_generator/common/fetch_units_definitions.py
@@ -16,26 +16,27 @@ def get_definitions(repo_owner_and_name):
definition = get_json_from_cdn(f"{files_url}/{name}")
for unit in definition["Units"]:
- markAsDeprecated = False
- pluralName = unit.get("PluralName")
- obsoleteText = unit.get("ObsoleteText")
- if obsoleteText:
+ mark_as_deprecated = False
+ unit_name = unit.get("Name")
+ plural_name = unit.get("PluralName")
+ obsolete_text = unit.get("ObsoleteText")
+ if obsolete_text:
print(
- f'[get_definitions] Unit {name}.{pluralName} marked as obsolete, message: "{obsoleteText}"'
+ f'[get_definitions] Unit {unit_name}.{plural_name} marked as obsolete, message: "{obsolete_text}"'
)
- markAsDeprecated = True
+ mark_as_deprecated = True
if unit.get("SkipConversionGeneration"):
print(
- f"[get_definitions] Unit {name}.{pluralName} marked to be ignored"
+ f"[get_definitions] Unit {unit_name}.{plural_name} marked to be ignored"
)
- markAsDeprecated = True
+ mark_as_deprecated = True
- unit["Deprecated"] = markAsDeprecated
+ unit["Deprecated"] = mark_as_deprecated
definitions.append(definition)
- print(f"[get_definitions] Unit {name}.{pluralName} successfully fetched")
+ print(f"[get_definitions] Unit {name} successfully fetched")
print("[get_definitions] Fetching units definitions finished successfully")
diff --git a/units_generator/generators/generate_unit_class.py b/units_generator/generators/generate_unit_class.py
index ed33bff..cb5be79 100644
--- a/units_generator/generators/generate_unit_class.py
+++ b/units_generator/generators/generate_unit_class.py
@@ -111,6 +111,7 @@ def unit_class_generator(unit_definition):
template_data = {
"unit": unit_name,
+ "unit_camel_case": camel_to_snake(unit_name),
"base_unit": unit_definition.get("BaseUnit"),
"description": unit_definition.get("XmlDocSummary"),
"methods": template_methods,
diff --git a/units_generator/templates/export_template.jinja2 b/units_generator/templates/export_template.jinja2
index 15fdc60..8b78233 100644
--- a/units_generator/templates/export_template.jinja2
+++ b/units_generator/templates/export_template.jinja2
@@ -1,6 +1,6 @@
-{% for method in methods %}from .units.{{ method.unit }} import {{ method.unit_name }}, {{ method.unit_name }}Units
+{% for method in methods %}from .units.{{ method.unit }} import {{ method.unit_name }}, {{ method.unit_name }}Units, {{ method.unit_name }}Dto
{% endfor %}
__all__ = [
-{% for method in methods %} '{{ method.unit_name }}', '{{ method.unit_name }}Units',
+{% for method in methods %} '{{ method.unit_name }}', '{{ method.unit_name }}Units', '{{ method.unit_name }}Dto',
{% endfor %}]
\ No newline at end of file
diff --git a/units_generator/templates/readme_template.jinja2 b/units_generator/templates/readme_template.jinja2
index 931f314..036c172 100644
--- a/units_generator/templates/readme_template.jinja2
+++ b/units_generator/templates/readme_template.jinja2
@@ -53,9 +53,13 @@ print(angle.to_string()) # 180 °
print(angle.to_string(AngleUnits.Degree)) # 180 °
print(angle.to_string(AngleUnits.Radian)) # 3.141592653589793 rad
+```
+
+## Additional methods
-# Additional methods
+Check, compare, calculate etc. with unitsnet:
+```python
length1 = Length.from_meters(10)
length2 = Length.from_decimeters(100)
length3 = Length.from_meters(3)
@@ -99,6 +103,41 @@ print(np_array_double_length.kilometers) # [[ 4. 8. 12.][14. 16. 18.]]
print(np_array_double_length.meters) # [[ 4000. 8000. 12000.][14000. 16000. 18000.]]
```
+## DTO - Data Transfer Object
+
+As UnitsNet provides a convenient way to work within a running service, there are occasions where the data needs to be exposed outside of the service, typically through an API containing the unit value or consumed from an API.
+
+To support this with a clear API schema and make it easy to convert to and from this schema to the specific format, it's recommended to use DTOs and the UnitsNet flavor converters.
+
+```python
+from unitsnet_py import Length, LengthDto, LengthUnits
+
+ # Create a Length unit object
+length = Length.from_meters(100.01)
+# Obtain the DTO object as json, represented by the default unit - meter
+length_dto_json = length.to_dto_json() # {"value":100.01,"unit":"Meter"}
+# Obtain the same value but represent DTO in KM
+length_dto_represents_in_km_json = length.to_dto_json(LengthUnits.Kilometer) # {'value': 0.10001, 'unit': 'Kilometer'}
+# Load JSON to DTO, and load
+length_from_meters_dto = Length.from_dto_json(length_dto_json)
+# The exact same value as
+length_from_km_dto = Length.from_dto_json(length_dto_represents_in_km_json)
+
+# Also, it supported to create and handle as DTO instance and to create to/from json to it.
+
+# Get a DTO instance from a Length instance
+length_dto: LengthDto = length.to_dto()
+# Get the json representation of the DTO
+length_json = length_dto.to_json() # {"value":100.01,"unit":"Meter"}
+# Obtain DTO instance from a json representation
+length_dto: LengthDto = LengthDto.from_json(length_json)
+# Obtain Length unit from a DTO instance
+length = Length.from_dto(length_dto)
+```
+
+Check out the OpenAPI [unitsnet-openapi-spec](https://haimkastner.github.io/unitsnet-openapi-spec-example/) example schema.
+
+Also, refer to the detailed discussions on GitHub: [haimkastner/unitsnet-js#31](https://github.com/haimkastner/unitsnet-js/issues/31) & [angularsen/UnitsNet#1378](https://github.com/angularsen/UnitsNet/issues/1378).
### Supported units
@@ -118,5 +157,6 @@ Get the same strongly typed units on other platforms, based on the same [unit de
|----------------------------|-------------|---------------------------------------------------|------------------------------------------------------|--------------|
| C# | UnitsNet | [nuget](https://www.nuget.org/packages/UnitsNet/) | [github](https://github.com/angularsen/UnitsNet) | @angularsen |
| JavaScript /
TypeScript | unitsnet-js | [npm](https://www.npmjs.com/package/unitsnet-js) | [github](https://github.com/haimkastner/unitsnet-js) | @haimkastner |
+| Python | unitsnet-py | [pypi](https://pypi.org/project/unitsnet-py) | [github](https://github.com/haimkastner/unitsnet-py) | @haimkastner |
diff --git a/units_generator/templates/unit_template.jinja2 b/units_generator/templates/unit_template.jinja2
index 451a416..021e2f8 100644
--- a/units_generator/templates/unit_template.jinja2
+++ b/units_generator/templates/unit_template.jinja2
@@ -10,11 +10,61 @@ class {{ unit }}Units(Enum):
{{ unit }}Units enumeration
"""
{% for method in methods %}
- {{ method.unit }} = '{{ method.unit_value }}'
+ {{ method.unit }} = '{{ method.unit }}'
"""
{{ method.description }}
"""
{% endfor %}
+
+class {{ unit }}Dto:
+ """
+ A DTO representation of a {{ unit }}
+
+ Attributes:
+ value (float): The value of the {{ unit }}.
+ unit ({{ unit }}Units): The specific unit that the {{ unit }} value is representing.
+ """
+
+ def __init__(self, value: float, unit: {{ unit }}Units):
+ """
+ Create a new DTO representation of a {{ unit }}
+
+ Parameters:
+ value (float): The value of the {{ unit }}.
+ unit ({{ unit }}Units): The specific unit that the {{ unit }} value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the {{ unit }}
+ """
+ self.unit: {{ unit }}Units = unit
+ """
+ The specific unit that the {{ unit }} value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a {{ unit }} DTO JSON object representing the current unit.
+
+ :return: JSON object represents {{ unit }} DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "{{ base_unit }}"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of {{ unit }} DTO from a json representation.
+
+ :param data: The {{ unit }} DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "{{ base_unit }}"}
+ :return: A new instance of {{ unit }}Dto.
+ :rtype: {{ unit }}Dto
+ """
+ return {{ unit }}Dto(value=data["value"], unit={{ unit }}Units(data["unit"]))
+
{% endif %}
class {{ unit }}(AbstractMeasure):
"""
@@ -37,6 +87,54 @@ class {{ unit }}(AbstractMeasure):
def convert(self, unit: {{ unit }}Units) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: {{ unit }}Units = {{ unit }}Units.{{ base_unit }}) -> {{ unit }}Dto:
+ """
+ Get a new instance of {{ unit }} DTO representing the current unit.
+
+ :param hold_in_unit: The specific {{ unit }} unit to store the {{ unit }} value in the DTO representation.
+ :type hold_in_unit: {{ unit }}Units
+ :return: A new instance of {{ unit }}Dto.
+ :rtype: {{ unit }}Dto
+ """
+ return {{ unit }}Dto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: {{ unit }}Units = {{ unit }}Units.{{ base_unit }}):
+ """
+ Get a {{ unit }} DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific {{ unit }} unit to store the {{ unit }} value in the DTO representation.
+ :type hold_in_unit: {{ unit }}Units
+ :return: JSON object represents {{ unit }} DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "{{ base_unit }}"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto({{ unit_camel_case }}_dto: {{ unit }}Dto):
+ """
+ Obtain a new instance of {{ unit }} from a DTO unit object.
+
+ :param {{ unit_camel_case }}_dto: The {{ unit }} DTO representation.
+ :type {{ unit_camel_case }}_dto: {{ unit }}Dto
+ :return: A new instance of {{ unit }}.
+ :rtype: {{ unit }}
+ """
+ return {{ unit }}({{ unit_camel_case }}_dto.value, {{ unit_camel_case }}_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of {{ unit }} from a DTO unit json representation.
+
+ :param data: The {{ unit }} DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "{{ base_unit }}"}
+ :return: A new instance of {{ unit }}.
+ :rtype: {{ unit }}
+ """
+ return {{ unit }}.from_dto({{ unit }}Dto.from_json(data))
+
def __convert_from_base(self, from_unit: {{ unit }}Units) -> float:
value = self._value
{% for method in methods %}
diff --git a/unitsnet_py/__init__.py b/unitsnet_py/__init__.py
index 8d44b65..94767d7 100644
--- a/unitsnet_py/__init__.py
+++ b/unitsnet_py/__init__.py
@@ -1,252 +1,252 @@
-from .units.absorbed_dose_of_ionizing_radiation import AbsorbedDoseOfIonizingRadiation, AbsorbedDoseOfIonizingRadiationUnits
-from .units.acceleration import Acceleration, AccelerationUnits
-from .units.amount_of_substance import AmountOfSubstance, AmountOfSubstanceUnits
-from .units.amplitude_ratio import AmplitudeRatio, AmplitudeRatioUnits
-from .units.angle import Angle, AngleUnits
-from .units.apparent_energy import ApparentEnergy, ApparentEnergyUnits
-from .units.apparent_power import ApparentPower, ApparentPowerUnits
-from .units.area import Area, AreaUnits
-from .units.area_density import AreaDensity, AreaDensityUnits
-from .units.area_moment_of_inertia import AreaMomentOfInertia, AreaMomentOfInertiaUnits
-from .units.bit_rate import BitRate, BitRateUnits
-from .units.brake_specific_fuel_consumption import BrakeSpecificFuelConsumption, BrakeSpecificFuelConsumptionUnits
-from .units.capacitance import Capacitance, CapacitanceUnits
-from .units.coefficient_of_thermal_expansion import CoefficientOfThermalExpansion, CoefficientOfThermalExpansionUnits
-from .units.compressibility import Compressibility, CompressibilityUnits
-from .units.density import Density, DensityUnits
-from .units.duration import Duration, DurationUnits
-from .units.dynamic_viscosity import DynamicViscosity, DynamicViscosityUnits
-from .units.electric_admittance import ElectricAdmittance, ElectricAdmittanceUnits
-from .units.electric_charge import ElectricCharge, ElectricChargeUnits
-from .units.electric_charge_density import ElectricChargeDensity, ElectricChargeDensityUnits
-from .units.electric_conductance import ElectricConductance, ElectricConductanceUnits
-from .units.electric_conductivity import ElectricConductivity, ElectricConductivityUnits
-from .units.electric_current import ElectricCurrent, ElectricCurrentUnits
-from .units.electric_current_density import ElectricCurrentDensity, ElectricCurrentDensityUnits
-from .units.electric_current_gradient import ElectricCurrentGradient, ElectricCurrentGradientUnits
-from .units.electric_field import ElectricField, ElectricFieldUnits
-from .units.electric_inductance import ElectricInductance, ElectricInductanceUnits
-from .units.electric_potential import ElectricPotential, ElectricPotentialUnits
-from .units.electric_potential_ac import ElectricPotentialAc, ElectricPotentialAcUnits
-from .units.electric_potential_change_rate import ElectricPotentialChangeRate, ElectricPotentialChangeRateUnits
-from .units.electric_potential_dc import ElectricPotentialDc, ElectricPotentialDcUnits
-from .units.electric_resistance import ElectricResistance, ElectricResistanceUnits
-from .units.electric_resistivity import ElectricResistivity, ElectricResistivityUnits
-from .units.electric_surface_charge_density import ElectricSurfaceChargeDensity, ElectricSurfaceChargeDensityUnits
-from .units.energy import Energy, EnergyUnits
-from .units.energy_density import EnergyDensity, EnergyDensityUnits
-from .units.entropy import Entropy, EntropyUnits
-from .units.force import Force, ForceUnits
-from .units.force_change_rate import ForceChangeRate, ForceChangeRateUnits
-from .units.force_per_length import ForcePerLength, ForcePerLengthUnits
-from .units.frequency import Frequency, FrequencyUnits
-from .units.fuel_efficiency import FuelEfficiency, FuelEfficiencyUnits
-from .units.heat_flux import HeatFlux, HeatFluxUnits
-from .units.heat_transfer_coefficient import HeatTransferCoefficient, HeatTransferCoefficientUnits
-from .units.illuminance import Illuminance, IlluminanceUnits
-from .units.impulse import Impulse, ImpulseUnits
-from .units.information import Information, InformationUnits
-from .units.irradiance import Irradiance, IrradianceUnits
-from .units.irradiation import Irradiation, IrradiationUnits
-from .units.jerk import Jerk, JerkUnits
-from .units.kinematic_viscosity import KinematicViscosity, KinematicViscosityUnits
-from .units.leak_rate import LeakRate, LeakRateUnits
-from .units.length import Length, LengthUnits
-from .units.level import Level, LevelUnits
-from .units.linear_density import LinearDensity, LinearDensityUnits
-from .units.linear_power_density import LinearPowerDensity, LinearPowerDensityUnits
-from .units.luminance import Luminance, LuminanceUnits
-from .units.luminosity import Luminosity, LuminosityUnits
-from .units.luminous_flux import LuminousFlux, LuminousFluxUnits
-from .units.luminous_intensity import LuminousIntensity, LuminousIntensityUnits
-from .units.magnetic_field import MagneticField, MagneticFieldUnits
-from .units.magnetic_flux import MagneticFlux, MagneticFluxUnits
-from .units.magnetization import Magnetization, MagnetizationUnits
-from .units.mass import Mass, MassUnits
-from .units.mass_concentration import MassConcentration, MassConcentrationUnits
-from .units.mass_flow import MassFlow, MassFlowUnits
-from .units.mass_flux import MassFlux, MassFluxUnits
-from .units.mass_fraction import MassFraction, MassFractionUnits
-from .units.mass_moment_of_inertia import MassMomentOfInertia, MassMomentOfInertiaUnits
-from .units.molality import Molality, MolalityUnits
-from .units.molar_energy import MolarEnergy, MolarEnergyUnits
-from .units.molar_entropy import MolarEntropy, MolarEntropyUnits
-from .units.molar_flow import MolarFlow, MolarFlowUnits
-from .units.molar_mass import MolarMass, MolarMassUnits
-from .units.molarity import Molarity, MolarityUnits
-from .units.permeability import Permeability, PermeabilityUnits
-from .units.permittivity import Permittivity, PermittivityUnits
-from .units.porous_medium_permeability import PorousMediumPermeability, PorousMediumPermeabilityUnits
-from .units.power import Power, PowerUnits
-from .units.power_density import PowerDensity, PowerDensityUnits
-from .units.power_ratio import PowerRatio, PowerRatioUnits
-from .units.pressure import Pressure, PressureUnits
-from .units.pressure_change_rate import PressureChangeRate, PressureChangeRateUnits
-from .units.radiation_equivalent_dose import RadiationEquivalentDose, RadiationEquivalentDoseUnits
-from .units.radiation_exposure import RadiationExposure, RadiationExposureUnits
-from .units.radioactivity import Radioactivity, RadioactivityUnits
-from .units.ratio import Ratio, RatioUnits
-from .units.ratio_change_rate import RatioChangeRate, RatioChangeRateUnits
-from .units.reactive_energy import ReactiveEnergy, ReactiveEnergyUnits
-from .units.reactive_power import ReactivePower, ReactivePowerUnits
-from .units.reciprocal_area import ReciprocalArea, ReciprocalAreaUnits
-from .units.reciprocal_length import ReciprocalLength, ReciprocalLengthUnits
-from .units.relative_humidity import RelativeHumidity, RelativeHumidityUnits
-from .units.rotational_acceleration import RotationalAcceleration, RotationalAccelerationUnits
-from .units.rotational_speed import RotationalSpeed, RotationalSpeedUnits
-from .units.rotational_stiffness import RotationalStiffness, RotationalStiffnessUnits
-from .units.rotational_stiffness_per_length import RotationalStiffnessPerLength, RotationalStiffnessPerLengthUnits
-from .units.scalar import Scalar, ScalarUnits
-from .units.solid_angle import SolidAngle, SolidAngleUnits
-from .units.specific_energy import SpecificEnergy, SpecificEnergyUnits
-from .units.specific_entropy import SpecificEntropy, SpecificEntropyUnits
-from .units.specific_fuel_consumption import SpecificFuelConsumption, SpecificFuelConsumptionUnits
-from .units.specific_volume import SpecificVolume, SpecificVolumeUnits
-from .units.specific_weight import SpecificWeight, SpecificWeightUnits
-from .units.speed import Speed, SpeedUnits
-from .units.standard_volume_flow import StandardVolumeFlow, StandardVolumeFlowUnits
-from .units.temperature import Temperature, TemperatureUnits
-from .units.temperature_change_rate import TemperatureChangeRate, TemperatureChangeRateUnits
-from .units.temperature_delta import TemperatureDelta, TemperatureDeltaUnits
-from .units.temperature_gradient import TemperatureGradient, TemperatureGradientUnits
-from .units.thermal_conductivity import ThermalConductivity, ThermalConductivityUnits
-from .units.thermal_resistance import ThermalResistance, ThermalResistanceUnits
-from .units.torque import Torque, TorqueUnits
-from .units.torque_per_length import TorquePerLength, TorquePerLengthUnits
-from .units.turbidity import Turbidity, TurbidityUnits
-from .units.vitamin_a import VitaminA, VitaminAUnits
-from .units.volume import Volume, VolumeUnits
-from .units.volume_concentration import VolumeConcentration, VolumeConcentrationUnits
-from .units.volume_flow import VolumeFlow, VolumeFlowUnits
-from .units.volume_flow_per_area import VolumeFlowPerArea, VolumeFlowPerAreaUnits
-from .units.volume_per_length import VolumePerLength, VolumePerLengthUnits
-from .units.volumetric_heat_capacity import VolumetricHeatCapacity, VolumetricHeatCapacityUnits
-from .units.warping_moment_of_inertia import WarpingMomentOfInertia, WarpingMomentOfInertiaUnits
+from .units.absorbed_dose_of_ionizing_radiation import AbsorbedDoseOfIonizingRadiation, AbsorbedDoseOfIonizingRadiationUnits, AbsorbedDoseOfIonizingRadiationDto
+from .units.acceleration import Acceleration, AccelerationUnits, AccelerationDto
+from .units.amount_of_substance import AmountOfSubstance, AmountOfSubstanceUnits, AmountOfSubstanceDto
+from .units.amplitude_ratio import AmplitudeRatio, AmplitudeRatioUnits, AmplitudeRatioDto
+from .units.angle import Angle, AngleUnits, AngleDto
+from .units.apparent_energy import ApparentEnergy, ApparentEnergyUnits, ApparentEnergyDto
+from .units.apparent_power import ApparentPower, ApparentPowerUnits, ApparentPowerDto
+from .units.area import Area, AreaUnits, AreaDto
+from .units.area_density import AreaDensity, AreaDensityUnits, AreaDensityDto
+from .units.area_moment_of_inertia import AreaMomentOfInertia, AreaMomentOfInertiaUnits, AreaMomentOfInertiaDto
+from .units.bit_rate import BitRate, BitRateUnits, BitRateDto
+from .units.brake_specific_fuel_consumption import BrakeSpecificFuelConsumption, BrakeSpecificFuelConsumptionUnits, BrakeSpecificFuelConsumptionDto
+from .units.capacitance import Capacitance, CapacitanceUnits, CapacitanceDto
+from .units.coefficient_of_thermal_expansion import CoefficientOfThermalExpansion, CoefficientOfThermalExpansionUnits, CoefficientOfThermalExpansionDto
+from .units.compressibility import Compressibility, CompressibilityUnits, CompressibilityDto
+from .units.density import Density, DensityUnits, DensityDto
+from .units.duration import Duration, DurationUnits, DurationDto
+from .units.dynamic_viscosity import DynamicViscosity, DynamicViscosityUnits, DynamicViscosityDto
+from .units.electric_admittance import ElectricAdmittance, ElectricAdmittanceUnits, ElectricAdmittanceDto
+from .units.electric_charge import ElectricCharge, ElectricChargeUnits, ElectricChargeDto
+from .units.electric_charge_density import ElectricChargeDensity, ElectricChargeDensityUnits, ElectricChargeDensityDto
+from .units.electric_conductance import ElectricConductance, ElectricConductanceUnits, ElectricConductanceDto
+from .units.electric_conductivity import ElectricConductivity, ElectricConductivityUnits, ElectricConductivityDto
+from .units.electric_current import ElectricCurrent, ElectricCurrentUnits, ElectricCurrentDto
+from .units.electric_current_density import ElectricCurrentDensity, ElectricCurrentDensityUnits, ElectricCurrentDensityDto
+from .units.electric_current_gradient import ElectricCurrentGradient, ElectricCurrentGradientUnits, ElectricCurrentGradientDto
+from .units.electric_field import ElectricField, ElectricFieldUnits, ElectricFieldDto
+from .units.electric_inductance import ElectricInductance, ElectricInductanceUnits, ElectricInductanceDto
+from .units.electric_potential import ElectricPotential, ElectricPotentialUnits, ElectricPotentialDto
+from .units.electric_potential_ac import ElectricPotentialAc, ElectricPotentialAcUnits, ElectricPotentialAcDto
+from .units.electric_potential_change_rate import ElectricPotentialChangeRate, ElectricPotentialChangeRateUnits, ElectricPotentialChangeRateDto
+from .units.electric_potential_dc import ElectricPotentialDc, ElectricPotentialDcUnits, ElectricPotentialDcDto
+from .units.electric_resistance import ElectricResistance, ElectricResistanceUnits, ElectricResistanceDto
+from .units.electric_resistivity import ElectricResistivity, ElectricResistivityUnits, ElectricResistivityDto
+from .units.electric_surface_charge_density import ElectricSurfaceChargeDensity, ElectricSurfaceChargeDensityUnits, ElectricSurfaceChargeDensityDto
+from .units.energy import Energy, EnergyUnits, EnergyDto
+from .units.energy_density import EnergyDensity, EnergyDensityUnits, EnergyDensityDto
+from .units.entropy import Entropy, EntropyUnits, EntropyDto
+from .units.force import Force, ForceUnits, ForceDto
+from .units.force_change_rate import ForceChangeRate, ForceChangeRateUnits, ForceChangeRateDto
+from .units.force_per_length import ForcePerLength, ForcePerLengthUnits, ForcePerLengthDto
+from .units.frequency import Frequency, FrequencyUnits, FrequencyDto
+from .units.fuel_efficiency import FuelEfficiency, FuelEfficiencyUnits, FuelEfficiencyDto
+from .units.heat_flux import HeatFlux, HeatFluxUnits, HeatFluxDto
+from .units.heat_transfer_coefficient import HeatTransferCoefficient, HeatTransferCoefficientUnits, HeatTransferCoefficientDto
+from .units.illuminance import Illuminance, IlluminanceUnits, IlluminanceDto
+from .units.impulse import Impulse, ImpulseUnits, ImpulseDto
+from .units.information import Information, InformationUnits, InformationDto
+from .units.irradiance import Irradiance, IrradianceUnits, IrradianceDto
+from .units.irradiation import Irradiation, IrradiationUnits, IrradiationDto
+from .units.jerk import Jerk, JerkUnits, JerkDto
+from .units.kinematic_viscosity import KinematicViscosity, KinematicViscosityUnits, KinematicViscosityDto
+from .units.leak_rate import LeakRate, LeakRateUnits, LeakRateDto
+from .units.length import Length, LengthUnits, LengthDto
+from .units.level import Level, LevelUnits, LevelDto
+from .units.linear_density import LinearDensity, LinearDensityUnits, LinearDensityDto
+from .units.linear_power_density import LinearPowerDensity, LinearPowerDensityUnits, LinearPowerDensityDto
+from .units.luminance import Luminance, LuminanceUnits, LuminanceDto
+from .units.luminosity import Luminosity, LuminosityUnits, LuminosityDto
+from .units.luminous_flux import LuminousFlux, LuminousFluxUnits, LuminousFluxDto
+from .units.luminous_intensity import LuminousIntensity, LuminousIntensityUnits, LuminousIntensityDto
+from .units.magnetic_field import MagneticField, MagneticFieldUnits, MagneticFieldDto
+from .units.magnetic_flux import MagneticFlux, MagneticFluxUnits, MagneticFluxDto
+from .units.magnetization import Magnetization, MagnetizationUnits, MagnetizationDto
+from .units.mass import Mass, MassUnits, MassDto
+from .units.mass_concentration import MassConcentration, MassConcentrationUnits, MassConcentrationDto
+from .units.mass_flow import MassFlow, MassFlowUnits, MassFlowDto
+from .units.mass_flux import MassFlux, MassFluxUnits, MassFluxDto
+from .units.mass_fraction import MassFraction, MassFractionUnits, MassFractionDto
+from .units.mass_moment_of_inertia import MassMomentOfInertia, MassMomentOfInertiaUnits, MassMomentOfInertiaDto
+from .units.molality import Molality, MolalityUnits, MolalityDto
+from .units.molar_energy import MolarEnergy, MolarEnergyUnits, MolarEnergyDto
+from .units.molar_entropy import MolarEntropy, MolarEntropyUnits, MolarEntropyDto
+from .units.molar_flow import MolarFlow, MolarFlowUnits, MolarFlowDto
+from .units.molar_mass import MolarMass, MolarMassUnits, MolarMassDto
+from .units.molarity import Molarity, MolarityUnits, MolarityDto
+from .units.permeability import Permeability, PermeabilityUnits, PermeabilityDto
+from .units.permittivity import Permittivity, PermittivityUnits, PermittivityDto
+from .units.porous_medium_permeability import PorousMediumPermeability, PorousMediumPermeabilityUnits, PorousMediumPermeabilityDto
+from .units.power import Power, PowerUnits, PowerDto
+from .units.power_density import PowerDensity, PowerDensityUnits, PowerDensityDto
+from .units.power_ratio import PowerRatio, PowerRatioUnits, PowerRatioDto
+from .units.pressure import Pressure, PressureUnits, PressureDto
+from .units.pressure_change_rate import PressureChangeRate, PressureChangeRateUnits, PressureChangeRateDto
+from .units.radiation_equivalent_dose import RadiationEquivalentDose, RadiationEquivalentDoseUnits, RadiationEquivalentDoseDto
+from .units.radiation_exposure import RadiationExposure, RadiationExposureUnits, RadiationExposureDto
+from .units.radioactivity import Radioactivity, RadioactivityUnits, RadioactivityDto
+from .units.ratio import Ratio, RatioUnits, RatioDto
+from .units.ratio_change_rate import RatioChangeRate, RatioChangeRateUnits, RatioChangeRateDto
+from .units.reactive_energy import ReactiveEnergy, ReactiveEnergyUnits, ReactiveEnergyDto
+from .units.reactive_power import ReactivePower, ReactivePowerUnits, ReactivePowerDto
+from .units.reciprocal_area import ReciprocalArea, ReciprocalAreaUnits, ReciprocalAreaDto
+from .units.reciprocal_length import ReciprocalLength, ReciprocalLengthUnits, ReciprocalLengthDto
+from .units.relative_humidity import RelativeHumidity, RelativeHumidityUnits, RelativeHumidityDto
+from .units.rotational_acceleration import RotationalAcceleration, RotationalAccelerationUnits, RotationalAccelerationDto
+from .units.rotational_speed import RotationalSpeed, RotationalSpeedUnits, RotationalSpeedDto
+from .units.rotational_stiffness import RotationalStiffness, RotationalStiffnessUnits, RotationalStiffnessDto
+from .units.rotational_stiffness_per_length import RotationalStiffnessPerLength, RotationalStiffnessPerLengthUnits, RotationalStiffnessPerLengthDto
+from .units.scalar import Scalar, ScalarUnits, ScalarDto
+from .units.solid_angle import SolidAngle, SolidAngleUnits, SolidAngleDto
+from .units.specific_energy import SpecificEnergy, SpecificEnergyUnits, SpecificEnergyDto
+from .units.specific_entropy import SpecificEntropy, SpecificEntropyUnits, SpecificEntropyDto
+from .units.specific_fuel_consumption import SpecificFuelConsumption, SpecificFuelConsumptionUnits, SpecificFuelConsumptionDto
+from .units.specific_volume import SpecificVolume, SpecificVolumeUnits, SpecificVolumeDto
+from .units.specific_weight import SpecificWeight, SpecificWeightUnits, SpecificWeightDto
+from .units.speed import Speed, SpeedUnits, SpeedDto
+from .units.standard_volume_flow import StandardVolumeFlow, StandardVolumeFlowUnits, StandardVolumeFlowDto
+from .units.temperature import Temperature, TemperatureUnits, TemperatureDto
+from .units.temperature_change_rate import TemperatureChangeRate, TemperatureChangeRateUnits, TemperatureChangeRateDto
+from .units.temperature_delta import TemperatureDelta, TemperatureDeltaUnits, TemperatureDeltaDto
+from .units.temperature_gradient import TemperatureGradient, TemperatureGradientUnits, TemperatureGradientDto
+from .units.thermal_conductivity import ThermalConductivity, ThermalConductivityUnits, ThermalConductivityDto
+from .units.thermal_resistance import ThermalResistance, ThermalResistanceUnits, ThermalResistanceDto
+from .units.torque import Torque, TorqueUnits, TorqueDto
+from .units.torque_per_length import TorquePerLength, TorquePerLengthUnits, TorquePerLengthDto
+from .units.turbidity import Turbidity, TurbidityUnits, TurbidityDto
+from .units.vitamin_a import VitaminA, VitaminAUnits, VitaminADto
+from .units.volume import Volume, VolumeUnits, VolumeDto
+from .units.volume_concentration import VolumeConcentration, VolumeConcentrationUnits, VolumeConcentrationDto
+from .units.volume_flow import VolumeFlow, VolumeFlowUnits, VolumeFlowDto
+from .units.volume_flow_per_area import VolumeFlowPerArea, VolumeFlowPerAreaUnits, VolumeFlowPerAreaDto
+from .units.volume_per_length import VolumePerLength, VolumePerLengthUnits, VolumePerLengthDto
+from .units.volumetric_heat_capacity import VolumetricHeatCapacity, VolumetricHeatCapacityUnits, VolumetricHeatCapacityDto
+from .units.warping_moment_of_inertia import WarpingMomentOfInertia, WarpingMomentOfInertiaUnits, WarpingMomentOfInertiaDto
__all__ = [
- 'AbsorbedDoseOfIonizingRadiation', 'AbsorbedDoseOfIonizingRadiationUnits',
- 'Acceleration', 'AccelerationUnits',
- 'AmountOfSubstance', 'AmountOfSubstanceUnits',
- 'AmplitudeRatio', 'AmplitudeRatioUnits',
- 'Angle', 'AngleUnits',
- 'ApparentEnergy', 'ApparentEnergyUnits',
- 'ApparentPower', 'ApparentPowerUnits',
- 'Area', 'AreaUnits',
- 'AreaDensity', 'AreaDensityUnits',
- 'AreaMomentOfInertia', 'AreaMomentOfInertiaUnits',
- 'BitRate', 'BitRateUnits',
- 'BrakeSpecificFuelConsumption', 'BrakeSpecificFuelConsumptionUnits',
- 'Capacitance', 'CapacitanceUnits',
- 'CoefficientOfThermalExpansion', 'CoefficientOfThermalExpansionUnits',
- 'Compressibility', 'CompressibilityUnits',
- 'Density', 'DensityUnits',
- 'Duration', 'DurationUnits',
- 'DynamicViscosity', 'DynamicViscosityUnits',
- 'ElectricAdmittance', 'ElectricAdmittanceUnits',
- 'ElectricCharge', 'ElectricChargeUnits',
- 'ElectricChargeDensity', 'ElectricChargeDensityUnits',
- 'ElectricConductance', 'ElectricConductanceUnits',
- 'ElectricConductivity', 'ElectricConductivityUnits',
- 'ElectricCurrent', 'ElectricCurrentUnits',
- 'ElectricCurrentDensity', 'ElectricCurrentDensityUnits',
- 'ElectricCurrentGradient', 'ElectricCurrentGradientUnits',
- 'ElectricField', 'ElectricFieldUnits',
- 'ElectricInductance', 'ElectricInductanceUnits',
- 'ElectricPotential', 'ElectricPotentialUnits',
- 'ElectricPotentialAc', 'ElectricPotentialAcUnits',
- 'ElectricPotentialChangeRate', 'ElectricPotentialChangeRateUnits',
- 'ElectricPotentialDc', 'ElectricPotentialDcUnits',
- 'ElectricResistance', 'ElectricResistanceUnits',
- 'ElectricResistivity', 'ElectricResistivityUnits',
- 'ElectricSurfaceChargeDensity', 'ElectricSurfaceChargeDensityUnits',
- 'Energy', 'EnergyUnits',
- 'EnergyDensity', 'EnergyDensityUnits',
- 'Entropy', 'EntropyUnits',
- 'Force', 'ForceUnits',
- 'ForceChangeRate', 'ForceChangeRateUnits',
- 'ForcePerLength', 'ForcePerLengthUnits',
- 'Frequency', 'FrequencyUnits',
- 'FuelEfficiency', 'FuelEfficiencyUnits',
- 'HeatFlux', 'HeatFluxUnits',
- 'HeatTransferCoefficient', 'HeatTransferCoefficientUnits',
- 'Illuminance', 'IlluminanceUnits',
- 'Impulse', 'ImpulseUnits',
- 'Information', 'InformationUnits',
- 'Irradiance', 'IrradianceUnits',
- 'Irradiation', 'IrradiationUnits',
- 'Jerk', 'JerkUnits',
- 'KinematicViscosity', 'KinematicViscosityUnits',
- 'LeakRate', 'LeakRateUnits',
- 'Length', 'LengthUnits',
- 'Level', 'LevelUnits',
- 'LinearDensity', 'LinearDensityUnits',
- 'LinearPowerDensity', 'LinearPowerDensityUnits',
- 'Luminance', 'LuminanceUnits',
- 'Luminosity', 'LuminosityUnits',
- 'LuminousFlux', 'LuminousFluxUnits',
- 'LuminousIntensity', 'LuminousIntensityUnits',
- 'MagneticField', 'MagneticFieldUnits',
- 'MagneticFlux', 'MagneticFluxUnits',
- 'Magnetization', 'MagnetizationUnits',
- 'Mass', 'MassUnits',
- 'MassConcentration', 'MassConcentrationUnits',
- 'MassFlow', 'MassFlowUnits',
- 'MassFlux', 'MassFluxUnits',
- 'MassFraction', 'MassFractionUnits',
- 'MassMomentOfInertia', 'MassMomentOfInertiaUnits',
- 'Molality', 'MolalityUnits',
- 'MolarEnergy', 'MolarEnergyUnits',
- 'MolarEntropy', 'MolarEntropyUnits',
- 'MolarFlow', 'MolarFlowUnits',
- 'MolarMass', 'MolarMassUnits',
- 'Molarity', 'MolarityUnits',
- 'Permeability', 'PermeabilityUnits',
- 'Permittivity', 'PermittivityUnits',
- 'PorousMediumPermeability', 'PorousMediumPermeabilityUnits',
- 'Power', 'PowerUnits',
- 'PowerDensity', 'PowerDensityUnits',
- 'PowerRatio', 'PowerRatioUnits',
- 'Pressure', 'PressureUnits',
- 'PressureChangeRate', 'PressureChangeRateUnits',
- 'RadiationEquivalentDose', 'RadiationEquivalentDoseUnits',
- 'RadiationExposure', 'RadiationExposureUnits',
- 'Radioactivity', 'RadioactivityUnits',
- 'Ratio', 'RatioUnits',
- 'RatioChangeRate', 'RatioChangeRateUnits',
- 'ReactiveEnergy', 'ReactiveEnergyUnits',
- 'ReactivePower', 'ReactivePowerUnits',
- 'ReciprocalArea', 'ReciprocalAreaUnits',
- 'ReciprocalLength', 'ReciprocalLengthUnits',
- 'RelativeHumidity', 'RelativeHumidityUnits',
- 'RotationalAcceleration', 'RotationalAccelerationUnits',
- 'RotationalSpeed', 'RotationalSpeedUnits',
- 'RotationalStiffness', 'RotationalStiffnessUnits',
- 'RotationalStiffnessPerLength', 'RotationalStiffnessPerLengthUnits',
- 'Scalar', 'ScalarUnits',
- 'SolidAngle', 'SolidAngleUnits',
- 'SpecificEnergy', 'SpecificEnergyUnits',
- 'SpecificEntropy', 'SpecificEntropyUnits',
- 'SpecificFuelConsumption', 'SpecificFuelConsumptionUnits',
- 'SpecificVolume', 'SpecificVolumeUnits',
- 'SpecificWeight', 'SpecificWeightUnits',
- 'Speed', 'SpeedUnits',
- 'StandardVolumeFlow', 'StandardVolumeFlowUnits',
- 'Temperature', 'TemperatureUnits',
- 'TemperatureChangeRate', 'TemperatureChangeRateUnits',
- 'TemperatureDelta', 'TemperatureDeltaUnits',
- 'TemperatureGradient', 'TemperatureGradientUnits',
- 'ThermalConductivity', 'ThermalConductivityUnits',
- 'ThermalResistance', 'ThermalResistanceUnits',
- 'Torque', 'TorqueUnits',
- 'TorquePerLength', 'TorquePerLengthUnits',
- 'Turbidity', 'TurbidityUnits',
- 'VitaminA', 'VitaminAUnits',
- 'Volume', 'VolumeUnits',
- 'VolumeConcentration', 'VolumeConcentrationUnits',
- 'VolumeFlow', 'VolumeFlowUnits',
- 'VolumeFlowPerArea', 'VolumeFlowPerAreaUnits',
- 'VolumePerLength', 'VolumePerLengthUnits',
- 'VolumetricHeatCapacity', 'VolumetricHeatCapacityUnits',
- 'WarpingMomentOfInertia', 'WarpingMomentOfInertiaUnits',
+ 'AbsorbedDoseOfIonizingRadiation', 'AbsorbedDoseOfIonizingRadiationUnits', 'AbsorbedDoseOfIonizingRadiationDto',
+ 'Acceleration', 'AccelerationUnits', 'AccelerationDto',
+ 'AmountOfSubstance', 'AmountOfSubstanceUnits', 'AmountOfSubstanceDto',
+ 'AmplitudeRatio', 'AmplitudeRatioUnits', 'AmplitudeRatioDto',
+ 'Angle', 'AngleUnits', 'AngleDto',
+ 'ApparentEnergy', 'ApparentEnergyUnits', 'ApparentEnergyDto',
+ 'ApparentPower', 'ApparentPowerUnits', 'ApparentPowerDto',
+ 'Area', 'AreaUnits', 'AreaDto',
+ 'AreaDensity', 'AreaDensityUnits', 'AreaDensityDto',
+ 'AreaMomentOfInertia', 'AreaMomentOfInertiaUnits', 'AreaMomentOfInertiaDto',
+ 'BitRate', 'BitRateUnits', 'BitRateDto',
+ 'BrakeSpecificFuelConsumption', 'BrakeSpecificFuelConsumptionUnits', 'BrakeSpecificFuelConsumptionDto',
+ 'Capacitance', 'CapacitanceUnits', 'CapacitanceDto',
+ 'CoefficientOfThermalExpansion', 'CoefficientOfThermalExpansionUnits', 'CoefficientOfThermalExpansionDto',
+ 'Compressibility', 'CompressibilityUnits', 'CompressibilityDto',
+ 'Density', 'DensityUnits', 'DensityDto',
+ 'Duration', 'DurationUnits', 'DurationDto',
+ 'DynamicViscosity', 'DynamicViscosityUnits', 'DynamicViscosityDto',
+ 'ElectricAdmittance', 'ElectricAdmittanceUnits', 'ElectricAdmittanceDto',
+ 'ElectricCharge', 'ElectricChargeUnits', 'ElectricChargeDto',
+ 'ElectricChargeDensity', 'ElectricChargeDensityUnits', 'ElectricChargeDensityDto',
+ 'ElectricConductance', 'ElectricConductanceUnits', 'ElectricConductanceDto',
+ 'ElectricConductivity', 'ElectricConductivityUnits', 'ElectricConductivityDto',
+ 'ElectricCurrent', 'ElectricCurrentUnits', 'ElectricCurrentDto',
+ 'ElectricCurrentDensity', 'ElectricCurrentDensityUnits', 'ElectricCurrentDensityDto',
+ 'ElectricCurrentGradient', 'ElectricCurrentGradientUnits', 'ElectricCurrentGradientDto',
+ 'ElectricField', 'ElectricFieldUnits', 'ElectricFieldDto',
+ 'ElectricInductance', 'ElectricInductanceUnits', 'ElectricInductanceDto',
+ 'ElectricPotential', 'ElectricPotentialUnits', 'ElectricPotentialDto',
+ 'ElectricPotentialAc', 'ElectricPotentialAcUnits', 'ElectricPotentialAcDto',
+ 'ElectricPotentialChangeRate', 'ElectricPotentialChangeRateUnits', 'ElectricPotentialChangeRateDto',
+ 'ElectricPotentialDc', 'ElectricPotentialDcUnits', 'ElectricPotentialDcDto',
+ 'ElectricResistance', 'ElectricResistanceUnits', 'ElectricResistanceDto',
+ 'ElectricResistivity', 'ElectricResistivityUnits', 'ElectricResistivityDto',
+ 'ElectricSurfaceChargeDensity', 'ElectricSurfaceChargeDensityUnits', 'ElectricSurfaceChargeDensityDto',
+ 'Energy', 'EnergyUnits', 'EnergyDto',
+ 'EnergyDensity', 'EnergyDensityUnits', 'EnergyDensityDto',
+ 'Entropy', 'EntropyUnits', 'EntropyDto',
+ 'Force', 'ForceUnits', 'ForceDto',
+ 'ForceChangeRate', 'ForceChangeRateUnits', 'ForceChangeRateDto',
+ 'ForcePerLength', 'ForcePerLengthUnits', 'ForcePerLengthDto',
+ 'Frequency', 'FrequencyUnits', 'FrequencyDto',
+ 'FuelEfficiency', 'FuelEfficiencyUnits', 'FuelEfficiencyDto',
+ 'HeatFlux', 'HeatFluxUnits', 'HeatFluxDto',
+ 'HeatTransferCoefficient', 'HeatTransferCoefficientUnits', 'HeatTransferCoefficientDto',
+ 'Illuminance', 'IlluminanceUnits', 'IlluminanceDto',
+ 'Impulse', 'ImpulseUnits', 'ImpulseDto',
+ 'Information', 'InformationUnits', 'InformationDto',
+ 'Irradiance', 'IrradianceUnits', 'IrradianceDto',
+ 'Irradiation', 'IrradiationUnits', 'IrradiationDto',
+ 'Jerk', 'JerkUnits', 'JerkDto',
+ 'KinematicViscosity', 'KinematicViscosityUnits', 'KinematicViscosityDto',
+ 'LeakRate', 'LeakRateUnits', 'LeakRateDto',
+ 'Length', 'LengthUnits', 'LengthDto',
+ 'Level', 'LevelUnits', 'LevelDto',
+ 'LinearDensity', 'LinearDensityUnits', 'LinearDensityDto',
+ 'LinearPowerDensity', 'LinearPowerDensityUnits', 'LinearPowerDensityDto',
+ 'Luminance', 'LuminanceUnits', 'LuminanceDto',
+ 'Luminosity', 'LuminosityUnits', 'LuminosityDto',
+ 'LuminousFlux', 'LuminousFluxUnits', 'LuminousFluxDto',
+ 'LuminousIntensity', 'LuminousIntensityUnits', 'LuminousIntensityDto',
+ 'MagneticField', 'MagneticFieldUnits', 'MagneticFieldDto',
+ 'MagneticFlux', 'MagneticFluxUnits', 'MagneticFluxDto',
+ 'Magnetization', 'MagnetizationUnits', 'MagnetizationDto',
+ 'Mass', 'MassUnits', 'MassDto',
+ 'MassConcentration', 'MassConcentrationUnits', 'MassConcentrationDto',
+ 'MassFlow', 'MassFlowUnits', 'MassFlowDto',
+ 'MassFlux', 'MassFluxUnits', 'MassFluxDto',
+ 'MassFraction', 'MassFractionUnits', 'MassFractionDto',
+ 'MassMomentOfInertia', 'MassMomentOfInertiaUnits', 'MassMomentOfInertiaDto',
+ 'Molality', 'MolalityUnits', 'MolalityDto',
+ 'MolarEnergy', 'MolarEnergyUnits', 'MolarEnergyDto',
+ 'MolarEntropy', 'MolarEntropyUnits', 'MolarEntropyDto',
+ 'MolarFlow', 'MolarFlowUnits', 'MolarFlowDto',
+ 'MolarMass', 'MolarMassUnits', 'MolarMassDto',
+ 'Molarity', 'MolarityUnits', 'MolarityDto',
+ 'Permeability', 'PermeabilityUnits', 'PermeabilityDto',
+ 'Permittivity', 'PermittivityUnits', 'PermittivityDto',
+ 'PorousMediumPermeability', 'PorousMediumPermeabilityUnits', 'PorousMediumPermeabilityDto',
+ 'Power', 'PowerUnits', 'PowerDto',
+ 'PowerDensity', 'PowerDensityUnits', 'PowerDensityDto',
+ 'PowerRatio', 'PowerRatioUnits', 'PowerRatioDto',
+ 'Pressure', 'PressureUnits', 'PressureDto',
+ 'PressureChangeRate', 'PressureChangeRateUnits', 'PressureChangeRateDto',
+ 'RadiationEquivalentDose', 'RadiationEquivalentDoseUnits', 'RadiationEquivalentDoseDto',
+ 'RadiationExposure', 'RadiationExposureUnits', 'RadiationExposureDto',
+ 'Radioactivity', 'RadioactivityUnits', 'RadioactivityDto',
+ 'Ratio', 'RatioUnits', 'RatioDto',
+ 'RatioChangeRate', 'RatioChangeRateUnits', 'RatioChangeRateDto',
+ 'ReactiveEnergy', 'ReactiveEnergyUnits', 'ReactiveEnergyDto',
+ 'ReactivePower', 'ReactivePowerUnits', 'ReactivePowerDto',
+ 'ReciprocalArea', 'ReciprocalAreaUnits', 'ReciprocalAreaDto',
+ 'ReciprocalLength', 'ReciprocalLengthUnits', 'ReciprocalLengthDto',
+ 'RelativeHumidity', 'RelativeHumidityUnits', 'RelativeHumidityDto',
+ 'RotationalAcceleration', 'RotationalAccelerationUnits', 'RotationalAccelerationDto',
+ 'RotationalSpeed', 'RotationalSpeedUnits', 'RotationalSpeedDto',
+ 'RotationalStiffness', 'RotationalStiffnessUnits', 'RotationalStiffnessDto',
+ 'RotationalStiffnessPerLength', 'RotationalStiffnessPerLengthUnits', 'RotationalStiffnessPerLengthDto',
+ 'Scalar', 'ScalarUnits', 'ScalarDto',
+ 'SolidAngle', 'SolidAngleUnits', 'SolidAngleDto',
+ 'SpecificEnergy', 'SpecificEnergyUnits', 'SpecificEnergyDto',
+ 'SpecificEntropy', 'SpecificEntropyUnits', 'SpecificEntropyDto',
+ 'SpecificFuelConsumption', 'SpecificFuelConsumptionUnits', 'SpecificFuelConsumptionDto',
+ 'SpecificVolume', 'SpecificVolumeUnits', 'SpecificVolumeDto',
+ 'SpecificWeight', 'SpecificWeightUnits', 'SpecificWeightDto',
+ 'Speed', 'SpeedUnits', 'SpeedDto',
+ 'StandardVolumeFlow', 'StandardVolumeFlowUnits', 'StandardVolumeFlowDto',
+ 'Temperature', 'TemperatureUnits', 'TemperatureDto',
+ 'TemperatureChangeRate', 'TemperatureChangeRateUnits', 'TemperatureChangeRateDto',
+ 'TemperatureDelta', 'TemperatureDeltaUnits', 'TemperatureDeltaDto',
+ 'TemperatureGradient', 'TemperatureGradientUnits', 'TemperatureGradientDto',
+ 'ThermalConductivity', 'ThermalConductivityUnits', 'ThermalConductivityDto',
+ 'ThermalResistance', 'ThermalResistanceUnits', 'ThermalResistanceDto',
+ 'Torque', 'TorqueUnits', 'TorqueDto',
+ 'TorquePerLength', 'TorquePerLengthUnits', 'TorquePerLengthDto',
+ 'Turbidity', 'TurbidityUnits', 'TurbidityDto',
+ 'VitaminA', 'VitaminAUnits', 'VitaminADto',
+ 'Volume', 'VolumeUnits', 'VolumeDto',
+ 'VolumeConcentration', 'VolumeConcentrationUnits', 'VolumeConcentrationDto',
+ 'VolumeFlow', 'VolumeFlowUnits', 'VolumeFlowDto',
+ 'VolumeFlowPerArea', 'VolumeFlowPerAreaUnits', 'VolumeFlowPerAreaDto',
+ 'VolumePerLength', 'VolumePerLengthUnits', 'VolumePerLengthDto',
+ 'VolumetricHeatCapacity', 'VolumetricHeatCapacityUnits', 'VolumetricHeatCapacityDto',
+ 'WarpingMomentOfInertia', 'WarpingMomentOfInertiaUnits', 'WarpingMomentOfInertiaDto',
]
\ No newline at end of file
diff --git a/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py b/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py
index 3ea073e..c1f9596 100644
--- a/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py
+++ b/unitsnet_py/units/absorbed_dose_of_ionizing_radiation.py
@@ -10,87 +10,137 @@ class AbsorbedDoseOfIonizingRadiationUnits(Enum):
AbsorbedDoseOfIonizingRadiationUnits enumeration
"""
- Gray = 'gray'
+ Gray = 'Gray'
"""
The gray is the unit of ionizing radiation dose in the SI, defined as the absorption of one joule of radiation energy per kilogram of matter.
"""
- Rad = 'rad'
+ Rad = 'Rad'
"""
The rad is a unit of absorbed radiation dose, defined as 1 rad = 0.01 Gy = 0.01 J/kg.
"""
- Femtogray = 'femtogray'
+ Femtogray = 'Femtogray'
"""
"""
- Picogray = 'picogray'
+ Picogray = 'Picogray'
"""
"""
- Nanogray = 'nanogray'
+ Nanogray = 'Nanogray'
"""
"""
- Microgray = 'microgray'
+ Microgray = 'Microgray'
"""
"""
- Milligray = 'milligray'
+ Milligray = 'Milligray'
"""
"""
- Centigray = 'centigray'
+ Centigray = 'Centigray'
"""
"""
- Kilogray = 'kilogray'
+ Kilogray = 'Kilogray'
"""
"""
- Megagray = 'megagray'
+ Megagray = 'Megagray'
"""
"""
- Gigagray = 'gigagray'
+ Gigagray = 'Gigagray'
"""
"""
- Teragray = 'teragray'
+ Teragray = 'Teragray'
"""
"""
- Petagray = 'petagray'
+ Petagray = 'Petagray'
"""
"""
- Millirad = 'millirad'
+ Millirad = 'Millirad'
"""
"""
- Kilorad = 'kilorad'
+ Kilorad = 'Kilorad'
"""
"""
- Megarad = 'megarad'
+ Megarad = 'Megarad'
"""
"""
+class AbsorbedDoseOfIonizingRadiationDto:
+ """
+ A DTO representation of a AbsorbedDoseOfIonizingRadiation
+
+ Attributes:
+ value (float): The value of the AbsorbedDoseOfIonizingRadiation.
+ unit (AbsorbedDoseOfIonizingRadiationUnits): The specific unit that the AbsorbedDoseOfIonizingRadiation value is representing.
+ """
+
+ def __init__(self, value: float, unit: AbsorbedDoseOfIonizingRadiationUnits):
+ """
+ Create a new DTO representation of a AbsorbedDoseOfIonizingRadiation
+
+ Parameters:
+ value (float): The value of the AbsorbedDoseOfIonizingRadiation.
+ unit (AbsorbedDoseOfIonizingRadiationUnits): The specific unit that the AbsorbedDoseOfIonizingRadiation value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the AbsorbedDoseOfIonizingRadiation
+ """
+ self.unit: AbsorbedDoseOfIonizingRadiationUnits = unit
+ """
+ The specific unit that the AbsorbedDoseOfIonizingRadiation value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a AbsorbedDoseOfIonizingRadiation DTO JSON object representing the current unit.
+
+ :return: JSON object represents AbsorbedDoseOfIonizingRadiation DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Gray"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of AbsorbedDoseOfIonizingRadiation DTO from a json representation.
+
+ :param data: The AbsorbedDoseOfIonizingRadiation DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Gray"}
+ :return: A new instance of AbsorbedDoseOfIonizingRadiationDto.
+ :rtype: AbsorbedDoseOfIonizingRadiationDto
+ """
+ return AbsorbedDoseOfIonizingRadiationDto(value=data["value"], unit=AbsorbedDoseOfIonizingRadiationUnits(data["unit"]))
+
+
class AbsorbedDoseOfIonizingRadiation(AbstractMeasure):
"""
Absorbed dose is a dose quantity which is the measure of the energy deposited in matter by ionizing radiation per unit mass.
@@ -142,6 +192,54 @@ def __init__(self, value: float, from_unit: AbsorbedDoseOfIonizingRadiationUnits
def convert(self, unit: AbsorbedDoseOfIonizingRadiationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AbsorbedDoseOfIonizingRadiationUnits = AbsorbedDoseOfIonizingRadiationUnits.Gray) -> AbsorbedDoseOfIonizingRadiationDto:
+ """
+ Get a new instance of AbsorbedDoseOfIonizingRadiation DTO representing the current unit.
+
+ :param hold_in_unit: The specific AbsorbedDoseOfIonizingRadiation unit to store the AbsorbedDoseOfIonizingRadiation value in the DTO representation.
+ :type hold_in_unit: AbsorbedDoseOfIonizingRadiationUnits
+ :return: A new instance of AbsorbedDoseOfIonizingRadiationDto.
+ :rtype: AbsorbedDoseOfIonizingRadiationDto
+ """
+ return AbsorbedDoseOfIonizingRadiationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AbsorbedDoseOfIonizingRadiationUnits = AbsorbedDoseOfIonizingRadiationUnits.Gray):
+ """
+ Get a AbsorbedDoseOfIonizingRadiation DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific AbsorbedDoseOfIonizingRadiation unit to store the AbsorbedDoseOfIonizingRadiation value in the DTO representation.
+ :type hold_in_unit: AbsorbedDoseOfIonizingRadiationUnits
+ :return: JSON object represents AbsorbedDoseOfIonizingRadiation DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Gray"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(absorbed_dose_of_ionizing_radiation_dto: AbsorbedDoseOfIonizingRadiationDto):
+ """
+ Obtain a new instance of AbsorbedDoseOfIonizingRadiation from a DTO unit object.
+
+ :param absorbed_dose_of_ionizing_radiation_dto: The AbsorbedDoseOfIonizingRadiation DTO representation.
+ :type absorbed_dose_of_ionizing_radiation_dto: AbsorbedDoseOfIonizingRadiationDto
+ :return: A new instance of AbsorbedDoseOfIonizingRadiation.
+ :rtype: AbsorbedDoseOfIonizingRadiation
+ """
+ return AbsorbedDoseOfIonizingRadiation(absorbed_dose_of_ionizing_radiation_dto.value, absorbed_dose_of_ionizing_radiation_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of AbsorbedDoseOfIonizingRadiation from a DTO unit json representation.
+
+ :param data: The AbsorbedDoseOfIonizingRadiation DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Gray"}
+ :return: A new instance of AbsorbedDoseOfIonizingRadiation.
+ :rtype: AbsorbedDoseOfIonizingRadiation
+ """
+ return AbsorbedDoseOfIonizingRadiation.from_dto(AbsorbedDoseOfIonizingRadiationDto.from_json(data))
+
def __convert_from_base(self, from_unit: AbsorbedDoseOfIonizingRadiationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/acceleration.py b/unitsnet_py/units/acceleration.py
index 90cbff1..c1bc2e5 100644
--- a/unitsnet_py/units/acceleration.py
+++ b/unitsnet_py/units/acceleration.py
@@ -10,77 +10,127 @@ class AccelerationUnits(Enum):
AccelerationUnits enumeration
"""
- MeterPerSecondSquared = 'meter_per_second_squared'
+ MeterPerSecondSquared = 'MeterPerSecondSquared'
"""
"""
- InchPerSecondSquared = 'inch_per_second_squared'
+ InchPerSecondSquared = 'InchPerSecondSquared'
"""
"""
- FootPerSecondSquared = 'foot_per_second_squared'
+ FootPerSecondSquared = 'FootPerSecondSquared'
"""
"""
- KnotPerSecond = 'knot_per_second'
+ KnotPerSecond = 'KnotPerSecond'
"""
"""
- KnotPerMinute = 'knot_per_minute'
+ KnotPerMinute = 'KnotPerMinute'
"""
"""
- KnotPerHour = 'knot_per_hour'
+ KnotPerHour = 'KnotPerHour'
"""
"""
- StandardGravity = 'standard_gravity'
+ StandardGravity = 'StandardGravity'
"""
"""
- NanometerPerSecondSquared = 'nanometer_per_second_squared'
+ NanometerPerSecondSquared = 'NanometerPerSecondSquared'
"""
"""
- MicrometerPerSecondSquared = 'micrometer_per_second_squared'
+ MicrometerPerSecondSquared = 'MicrometerPerSecondSquared'
"""
"""
- MillimeterPerSecondSquared = 'millimeter_per_second_squared'
+ MillimeterPerSecondSquared = 'MillimeterPerSecondSquared'
"""
"""
- CentimeterPerSecondSquared = 'centimeter_per_second_squared'
+ CentimeterPerSecondSquared = 'CentimeterPerSecondSquared'
"""
"""
- DecimeterPerSecondSquared = 'decimeter_per_second_squared'
+ DecimeterPerSecondSquared = 'DecimeterPerSecondSquared'
"""
"""
- KilometerPerSecondSquared = 'kilometer_per_second_squared'
+ KilometerPerSecondSquared = 'KilometerPerSecondSquared'
"""
"""
- MillistandardGravity = 'millistandard_gravity'
+ MillistandardGravity = 'MillistandardGravity'
"""
"""
+class AccelerationDto:
+ """
+ A DTO representation of a Acceleration
+
+ Attributes:
+ value (float): The value of the Acceleration.
+ unit (AccelerationUnits): The specific unit that the Acceleration value is representing.
+ """
+
+ def __init__(self, value: float, unit: AccelerationUnits):
+ """
+ Create a new DTO representation of a Acceleration
+
+ Parameters:
+ value (float): The value of the Acceleration.
+ unit (AccelerationUnits): The specific unit that the Acceleration value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Acceleration
+ """
+ self.unit: AccelerationUnits = unit
+ """
+ The specific unit that the Acceleration value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Acceleration DTO JSON object representing the current unit.
+
+ :return: JSON object represents Acceleration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterPerSecondSquared"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Acceleration DTO from a json representation.
+
+ :param data: The Acceleration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterPerSecondSquared"}
+ :return: A new instance of AccelerationDto.
+ :rtype: AccelerationDto
+ """
+ return AccelerationDto(value=data["value"], unit=AccelerationUnits(data["unit"]))
+
+
class Acceleration(AbstractMeasure):
"""
Acceleration, in physics, is the rate at which the velocity of an object changes over time. An object's acceleration is the net result of any and all forces acting on the object, as described by Newton's Second Law. The SI unit for acceleration is the Meter per second squared (m/s²). Accelerations are vector quantities (they have magnitude and direction) and add according to the parallelogram law. As a vector, the calculated net force is equal to the product of the object's mass (a scalar quantity) and the acceleration.
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: AccelerationUnits = AccelerationUnit
def convert(self, unit: AccelerationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AccelerationUnits = AccelerationUnits.MeterPerSecondSquared) -> AccelerationDto:
+ """
+ Get a new instance of Acceleration DTO representing the current unit.
+
+ :param hold_in_unit: The specific Acceleration unit to store the Acceleration value in the DTO representation.
+ :type hold_in_unit: AccelerationUnits
+ :return: A new instance of AccelerationDto.
+ :rtype: AccelerationDto
+ """
+ return AccelerationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AccelerationUnits = AccelerationUnits.MeterPerSecondSquared):
+ """
+ Get a Acceleration DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Acceleration unit to store the Acceleration value in the DTO representation.
+ :type hold_in_unit: AccelerationUnits
+ :return: JSON object represents Acceleration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterPerSecondSquared"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(acceleration_dto: AccelerationDto):
+ """
+ Obtain a new instance of Acceleration from a DTO unit object.
+
+ :param acceleration_dto: The Acceleration DTO representation.
+ :type acceleration_dto: AccelerationDto
+ :return: A new instance of Acceleration.
+ :rtype: Acceleration
+ """
+ return Acceleration(acceleration_dto.value, acceleration_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Acceleration from a DTO unit json representation.
+
+ :param data: The Acceleration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterPerSecondSquared"}
+ :return: A new instance of Acceleration.
+ :rtype: Acceleration
+ """
+ return Acceleration.from_dto(AccelerationDto.from_json(data))
+
def __convert_from_base(self, from_unit: AccelerationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/amount_of_substance.py b/unitsnet_py/units/amount_of_substance.py
index b727c00..45d7449 100644
--- a/unitsnet_py/units/amount_of_substance.py
+++ b/unitsnet_py/units/amount_of_substance.py
@@ -10,92 +10,142 @@ class AmountOfSubstanceUnits(Enum):
AmountOfSubstanceUnits enumeration
"""
- Mole = 'mole'
+ Mole = 'Mole'
"""
"""
- PoundMole = 'pound_mole'
+ PoundMole = 'PoundMole'
"""
"""
- Femtomole = 'femtomole'
+ Femtomole = 'Femtomole'
"""
"""
- Picomole = 'picomole'
+ Picomole = 'Picomole'
"""
"""
- Nanomole = 'nanomole'
+ Nanomole = 'Nanomole'
"""
"""
- Micromole = 'micromole'
+ Micromole = 'Micromole'
"""
"""
- Millimole = 'millimole'
+ Millimole = 'Millimole'
"""
"""
- Centimole = 'centimole'
+ Centimole = 'Centimole'
"""
"""
- Decimole = 'decimole'
+ Decimole = 'Decimole'
"""
"""
- Kilomole = 'kilomole'
+ Kilomole = 'Kilomole'
"""
"""
- Megamole = 'megamole'
+ Megamole = 'Megamole'
"""
"""
- NanopoundMole = 'nanopound_mole'
+ NanopoundMole = 'NanopoundMole'
"""
"""
- MicropoundMole = 'micropound_mole'
+ MicropoundMole = 'MicropoundMole'
"""
"""
- MillipoundMole = 'millipound_mole'
+ MillipoundMole = 'MillipoundMole'
"""
"""
- CentipoundMole = 'centipound_mole'
+ CentipoundMole = 'CentipoundMole'
"""
"""
- DecipoundMole = 'decipound_mole'
+ DecipoundMole = 'DecipoundMole'
"""
"""
- KilopoundMole = 'kilopound_mole'
+ KilopoundMole = 'KilopoundMole'
"""
"""
+class AmountOfSubstanceDto:
+ """
+ A DTO representation of a AmountOfSubstance
+
+ Attributes:
+ value (float): The value of the AmountOfSubstance.
+ unit (AmountOfSubstanceUnits): The specific unit that the AmountOfSubstance value is representing.
+ """
+
+ def __init__(self, value: float, unit: AmountOfSubstanceUnits):
+ """
+ Create a new DTO representation of a AmountOfSubstance
+
+ Parameters:
+ value (float): The value of the AmountOfSubstance.
+ unit (AmountOfSubstanceUnits): The specific unit that the AmountOfSubstance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the AmountOfSubstance
+ """
+ self.unit: AmountOfSubstanceUnits = unit
+ """
+ The specific unit that the AmountOfSubstance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a AmountOfSubstance DTO JSON object representing the current unit.
+
+ :return: JSON object represents AmountOfSubstance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Mole"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of AmountOfSubstance DTO from a json representation.
+
+ :param data: The AmountOfSubstance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Mole"}
+ :return: A new instance of AmountOfSubstanceDto.
+ :rtype: AmountOfSubstanceDto
+ """
+ return AmountOfSubstanceDto(value=data["value"], unit=AmountOfSubstanceUnits(data["unit"]))
+
+
class AmountOfSubstance(AbstractMeasure):
"""
Mole is the amount of substance containing Avagadro's Number (6.02 x 10 ^ 23) of real particles such as molecules,atoms, ions or radicals.
@@ -149,6 +199,54 @@ def __init__(self, value: float, from_unit: AmountOfSubstanceUnits = AmountOfSub
def convert(self, unit: AmountOfSubstanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AmountOfSubstanceUnits = AmountOfSubstanceUnits.Mole) -> AmountOfSubstanceDto:
+ """
+ Get a new instance of AmountOfSubstance DTO representing the current unit.
+
+ :param hold_in_unit: The specific AmountOfSubstance unit to store the AmountOfSubstance value in the DTO representation.
+ :type hold_in_unit: AmountOfSubstanceUnits
+ :return: A new instance of AmountOfSubstanceDto.
+ :rtype: AmountOfSubstanceDto
+ """
+ return AmountOfSubstanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AmountOfSubstanceUnits = AmountOfSubstanceUnits.Mole):
+ """
+ Get a AmountOfSubstance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific AmountOfSubstance unit to store the AmountOfSubstance value in the DTO representation.
+ :type hold_in_unit: AmountOfSubstanceUnits
+ :return: JSON object represents AmountOfSubstance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Mole"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(amount_of_substance_dto: AmountOfSubstanceDto):
+ """
+ Obtain a new instance of AmountOfSubstance from a DTO unit object.
+
+ :param amount_of_substance_dto: The AmountOfSubstance DTO representation.
+ :type amount_of_substance_dto: AmountOfSubstanceDto
+ :return: A new instance of AmountOfSubstance.
+ :rtype: AmountOfSubstance
+ """
+ return AmountOfSubstance(amount_of_substance_dto.value, amount_of_substance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of AmountOfSubstance from a DTO unit json representation.
+
+ :param data: The AmountOfSubstance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Mole"}
+ :return: A new instance of AmountOfSubstance.
+ :rtype: AmountOfSubstance
+ """
+ return AmountOfSubstance.from_dto(AmountOfSubstanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: AmountOfSubstanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/amplitude_ratio.py b/unitsnet_py/units/amplitude_ratio.py
index e3ed6a1..37f080c 100644
--- a/unitsnet_py/units/amplitude_ratio.py
+++ b/unitsnet_py/units/amplitude_ratio.py
@@ -10,27 +10,77 @@ class AmplitudeRatioUnits(Enum):
AmplitudeRatioUnits enumeration
"""
- DecibelVolt = 'decibel_volt'
+ DecibelVolt = 'DecibelVolt'
"""
"""
- DecibelMicrovolt = 'decibel_microvolt'
+ DecibelMicrovolt = 'DecibelMicrovolt'
"""
"""
- DecibelMillivolt = 'decibel_millivolt'
+ DecibelMillivolt = 'DecibelMillivolt'
"""
"""
- DecibelUnloaded = 'decibel_unloaded'
+ DecibelUnloaded = 'DecibelUnloaded'
"""
"""
+class AmplitudeRatioDto:
+ """
+ A DTO representation of a AmplitudeRatio
+
+ Attributes:
+ value (float): The value of the AmplitudeRatio.
+ unit (AmplitudeRatioUnits): The specific unit that the AmplitudeRatio value is representing.
+ """
+
+ def __init__(self, value: float, unit: AmplitudeRatioUnits):
+ """
+ Create a new DTO representation of a AmplitudeRatio
+
+ Parameters:
+ value (float): The value of the AmplitudeRatio.
+ unit (AmplitudeRatioUnits): The specific unit that the AmplitudeRatio value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the AmplitudeRatio
+ """
+ self.unit: AmplitudeRatioUnits = unit
+ """
+ The specific unit that the AmplitudeRatio value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a AmplitudeRatio DTO JSON object representing the current unit.
+
+ :return: JSON object represents AmplitudeRatio DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecibelVolt"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of AmplitudeRatio DTO from a json representation.
+
+ :param data: The AmplitudeRatio DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecibelVolt"}
+ :return: A new instance of AmplitudeRatioDto.
+ :rtype: AmplitudeRatioDto
+ """
+ return AmplitudeRatioDto(value=data["value"], unit=AmplitudeRatioUnits(data["unit"]))
+
+
class AmplitudeRatio(AbstractMeasure):
"""
The strength of a signal expressed in decibels (dB) relative to one volt RMS.
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: AmplitudeRatioUnits = AmplitudeRatio
def convert(self, unit: AmplitudeRatioUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AmplitudeRatioUnits = AmplitudeRatioUnits.DecibelVolt) -> AmplitudeRatioDto:
+ """
+ Get a new instance of AmplitudeRatio DTO representing the current unit.
+
+ :param hold_in_unit: The specific AmplitudeRatio unit to store the AmplitudeRatio value in the DTO representation.
+ :type hold_in_unit: AmplitudeRatioUnits
+ :return: A new instance of AmplitudeRatioDto.
+ :rtype: AmplitudeRatioDto
+ """
+ return AmplitudeRatioDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AmplitudeRatioUnits = AmplitudeRatioUnits.DecibelVolt):
+ """
+ Get a AmplitudeRatio DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific AmplitudeRatio unit to store the AmplitudeRatio value in the DTO representation.
+ :type hold_in_unit: AmplitudeRatioUnits
+ :return: JSON object represents AmplitudeRatio DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecibelVolt"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(amplitude_ratio_dto: AmplitudeRatioDto):
+ """
+ Obtain a new instance of AmplitudeRatio from a DTO unit object.
+
+ :param amplitude_ratio_dto: The AmplitudeRatio DTO representation.
+ :type amplitude_ratio_dto: AmplitudeRatioDto
+ :return: A new instance of AmplitudeRatio.
+ :rtype: AmplitudeRatio
+ """
+ return AmplitudeRatio(amplitude_ratio_dto.value, amplitude_ratio_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of AmplitudeRatio from a DTO unit json representation.
+
+ :param data: The AmplitudeRatio DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecibelVolt"}
+ :return: A new instance of AmplitudeRatio.
+ :rtype: AmplitudeRatio
+ """
+ return AmplitudeRatio.from_dto(AmplitudeRatioDto.from_json(data))
+
def __convert_from_base(self, from_unit: AmplitudeRatioUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/angle.py b/unitsnet_py/units/angle.py
index 58171ee..00ebc52 100644
--- a/unitsnet_py/units/angle.py
+++ b/unitsnet_py/units/angle.py
@@ -10,87 +10,137 @@ class AngleUnits(Enum):
AngleUnits enumeration
"""
- Radian = 'radian'
+ Radian = 'Radian'
"""
"""
- Degree = 'degree'
+ Degree = 'Degree'
"""
"""
- Arcminute = 'arcminute'
+ Arcminute = 'Arcminute'
"""
"""
- Arcsecond = 'arcsecond'
+ Arcsecond = 'Arcsecond'
"""
"""
- Gradian = 'gradian'
+ Gradian = 'Gradian'
"""
"""
- NatoMil = 'nato_mil'
+ NatoMil = 'NatoMil'
"""
"""
- Revolution = 'revolution'
+ Revolution = 'Revolution'
"""
"""
- Tilt = 'tilt'
+ Tilt = 'Tilt'
"""
"""
- Nanoradian = 'nanoradian'
+ Nanoradian = 'Nanoradian'
"""
"""
- Microradian = 'microradian'
+ Microradian = 'Microradian'
"""
"""
- Milliradian = 'milliradian'
+ Milliradian = 'Milliradian'
"""
"""
- Centiradian = 'centiradian'
+ Centiradian = 'Centiradian'
"""
"""
- Deciradian = 'deciradian'
+ Deciradian = 'Deciradian'
"""
"""
- Nanodegree = 'nanodegree'
+ Nanodegree = 'Nanodegree'
"""
"""
- Microdegree = 'microdegree'
+ Microdegree = 'Microdegree'
"""
"""
- Millidegree = 'millidegree'
+ Millidegree = 'Millidegree'
"""
"""
+class AngleDto:
+ """
+ A DTO representation of a Angle
+
+ Attributes:
+ value (float): The value of the Angle.
+ unit (AngleUnits): The specific unit that the Angle value is representing.
+ """
+
+ def __init__(self, value: float, unit: AngleUnits):
+ """
+ Create a new DTO representation of a Angle
+
+ Parameters:
+ value (float): The value of the Angle.
+ unit (AngleUnits): The specific unit that the Angle value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Angle
+ """
+ self.unit: AngleUnits = unit
+ """
+ The specific unit that the Angle value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Angle DTO JSON object representing the current unit.
+
+ :return: JSON object represents Angle DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Degree"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Angle DTO from a json representation.
+
+ :param data: The Angle DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Degree"}
+ :return: A new instance of AngleDto.
+ :rtype: AngleDto
+ """
+ return AngleDto(value=data["value"], unit=AngleUnits(data["unit"]))
+
+
class Angle(AbstractMeasure):
"""
In geometry, an angle is the figure formed by two rays, called the sides of the angle, sharing a common endpoint, called the vertex of the angle.
@@ -142,6 +192,54 @@ def __init__(self, value: float, from_unit: AngleUnits = AngleUnits.Degree):
def convert(self, unit: AngleUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AngleUnits = AngleUnits.Degree) -> AngleDto:
+ """
+ Get a new instance of Angle DTO representing the current unit.
+
+ :param hold_in_unit: The specific Angle unit to store the Angle value in the DTO representation.
+ :type hold_in_unit: AngleUnits
+ :return: A new instance of AngleDto.
+ :rtype: AngleDto
+ """
+ return AngleDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AngleUnits = AngleUnits.Degree):
+ """
+ Get a Angle DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Angle unit to store the Angle value in the DTO representation.
+ :type hold_in_unit: AngleUnits
+ :return: JSON object represents Angle DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Degree"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(angle_dto: AngleDto):
+ """
+ Obtain a new instance of Angle from a DTO unit object.
+
+ :param angle_dto: The Angle DTO representation.
+ :type angle_dto: AngleDto
+ :return: A new instance of Angle.
+ :rtype: Angle
+ """
+ return Angle(angle_dto.value, angle_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Angle from a DTO unit json representation.
+
+ :param data: The Angle DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Degree"}
+ :return: A new instance of Angle.
+ :rtype: Angle
+ """
+ return Angle.from_dto(AngleDto.from_json(data))
+
def __convert_from_base(self, from_unit: AngleUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/apparent_energy.py b/unitsnet_py/units/apparent_energy.py
index 7d72cc8..7407f6e 100644
--- a/unitsnet_py/units/apparent_energy.py
+++ b/unitsnet_py/units/apparent_energy.py
@@ -10,22 +10,72 @@ class ApparentEnergyUnits(Enum):
ApparentEnergyUnits enumeration
"""
- VoltampereHour = 'voltampere_hour'
+ VoltampereHour = 'VoltampereHour'
"""
"""
- KilovoltampereHour = 'kilovoltampere_hour'
+ KilovoltampereHour = 'KilovoltampereHour'
"""
"""
- MegavoltampereHour = 'megavoltampere_hour'
+ MegavoltampereHour = 'MegavoltampereHour'
"""
"""
+class ApparentEnergyDto:
+ """
+ A DTO representation of a ApparentEnergy
+
+ Attributes:
+ value (float): The value of the ApparentEnergy.
+ unit (ApparentEnergyUnits): The specific unit that the ApparentEnergy value is representing.
+ """
+
+ def __init__(self, value: float, unit: ApparentEnergyUnits):
+ """
+ Create a new DTO representation of a ApparentEnergy
+
+ Parameters:
+ value (float): The value of the ApparentEnergy.
+ unit (ApparentEnergyUnits): The specific unit that the ApparentEnergy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ApparentEnergy
+ """
+ self.unit: ApparentEnergyUnits = unit
+ """
+ The specific unit that the ApparentEnergy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ApparentEnergy DTO JSON object representing the current unit.
+
+ :return: JSON object represents ApparentEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltampereHour"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ApparentEnergy DTO from a json representation.
+
+ :param data: The ApparentEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltampereHour"}
+ :return: A new instance of ApparentEnergyDto.
+ :rtype: ApparentEnergyDto
+ """
+ return ApparentEnergyDto(value=data["value"], unit=ApparentEnergyUnits(data["unit"]))
+
+
class ApparentEnergy(AbstractMeasure):
"""
A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: ApparentEnergyUnits = ApparentEnergy
def convert(self, unit: ApparentEnergyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ApparentEnergyUnits = ApparentEnergyUnits.VoltampereHour) -> ApparentEnergyDto:
+ """
+ Get a new instance of ApparentEnergy DTO representing the current unit.
+
+ :param hold_in_unit: The specific ApparentEnergy unit to store the ApparentEnergy value in the DTO representation.
+ :type hold_in_unit: ApparentEnergyUnits
+ :return: A new instance of ApparentEnergyDto.
+ :rtype: ApparentEnergyDto
+ """
+ return ApparentEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ApparentEnergyUnits = ApparentEnergyUnits.VoltampereHour):
+ """
+ Get a ApparentEnergy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ApparentEnergy unit to store the ApparentEnergy value in the DTO representation.
+ :type hold_in_unit: ApparentEnergyUnits
+ :return: JSON object represents ApparentEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltampereHour"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(apparent_energy_dto: ApparentEnergyDto):
+ """
+ Obtain a new instance of ApparentEnergy from a DTO unit object.
+
+ :param apparent_energy_dto: The ApparentEnergy DTO representation.
+ :type apparent_energy_dto: ApparentEnergyDto
+ :return: A new instance of ApparentEnergy.
+ :rtype: ApparentEnergy
+ """
+ return ApparentEnergy(apparent_energy_dto.value, apparent_energy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ApparentEnergy from a DTO unit json representation.
+
+ :param data: The ApparentEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltampereHour"}
+ :return: A new instance of ApparentEnergy.
+ :rtype: ApparentEnergy
+ """
+ return ApparentEnergy.from_dto(ApparentEnergyDto.from_json(data))
+
def __convert_from_base(self, from_unit: ApparentEnergyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/apparent_power.py b/unitsnet_py/units/apparent_power.py
index 954a5ba..88ed61d 100644
--- a/unitsnet_py/units/apparent_power.py
+++ b/unitsnet_py/units/apparent_power.py
@@ -10,37 +10,87 @@ class ApparentPowerUnits(Enum):
ApparentPowerUnits enumeration
"""
- Voltampere = 'voltampere'
+ Voltampere = 'Voltampere'
"""
"""
- Microvoltampere = 'microvoltampere'
+ Microvoltampere = 'Microvoltampere'
"""
"""
- Millivoltampere = 'millivoltampere'
+ Millivoltampere = 'Millivoltampere'
"""
"""
- Kilovoltampere = 'kilovoltampere'
+ Kilovoltampere = 'Kilovoltampere'
"""
"""
- Megavoltampere = 'megavoltampere'
+ Megavoltampere = 'Megavoltampere'
"""
"""
- Gigavoltampere = 'gigavoltampere'
+ Gigavoltampere = 'Gigavoltampere'
"""
"""
+class ApparentPowerDto:
+ """
+ A DTO representation of a ApparentPower
+
+ Attributes:
+ value (float): The value of the ApparentPower.
+ unit (ApparentPowerUnits): The specific unit that the ApparentPower value is representing.
+ """
+
+ def __init__(self, value: float, unit: ApparentPowerUnits):
+ """
+ Create a new DTO representation of a ApparentPower
+
+ Parameters:
+ value (float): The value of the ApparentPower.
+ unit (ApparentPowerUnits): The specific unit that the ApparentPower value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ApparentPower
+ """
+ self.unit: ApparentPowerUnits = unit
+ """
+ The specific unit that the ApparentPower value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ApparentPower DTO JSON object representing the current unit.
+
+ :return: JSON object represents ApparentPower DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Voltampere"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ApparentPower DTO from a json representation.
+
+ :param data: The ApparentPower DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Voltampere"}
+ :return: A new instance of ApparentPowerDto.
+ :rtype: ApparentPowerDto
+ """
+ return ApparentPowerDto(value=data["value"], unit=ApparentPowerUnits(data["unit"]))
+
+
class ApparentPower(AbstractMeasure):
"""
Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. Apparent power is the product of the root-mean-square of voltage and current.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: ApparentPowerUnits = ApparentPowerUn
def convert(self, unit: ApparentPowerUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ApparentPowerUnits = ApparentPowerUnits.Voltampere) -> ApparentPowerDto:
+ """
+ Get a new instance of ApparentPower DTO representing the current unit.
+
+ :param hold_in_unit: The specific ApparentPower unit to store the ApparentPower value in the DTO representation.
+ :type hold_in_unit: ApparentPowerUnits
+ :return: A new instance of ApparentPowerDto.
+ :rtype: ApparentPowerDto
+ """
+ return ApparentPowerDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ApparentPowerUnits = ApparentPowerUnits.Voltampere):
+ """
+ Get a ApparentPower DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ApparentPower unit to store the ApparentPower value in the DTO representation.
+ :type hold_in_unit: ApparentPowerUnits
+ :return: JSON object represents ApparentPower DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Voltampere"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(apparent_power_dto: ApparentPowerDto):
+ """
+ Obtain a new instance of ApparentPower from a DTO unit object.
+
+ :param apparent_power_dto: The ApparentPower DTO representation.
+ :type apparent_power_dto: ApparentPowerDto
+ :return: A new instance of ApparentPower.
+ :rtype: ApparentPower
+ """
+ return ApparentPower(apparent_power_dto.value, apparent_power_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ApparentPower from a DTO unit json representation.
+
+ :param data: The ApparentPower DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Voltampere"}
+ :return: A new instance of ApparentPower.
+ :rtype: ApparentPower
+ """
+ return ApparentPower.from_dto(ApparentPowerDto.from_json(data))
+
def __convert_from_base(self, from_unit: ApparentPowerUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/area.py b/unitsnet_py/units/area.py
index 0033a19..8479b95 100644
--- a/unitsnet_py/units/area.py
+++ b/unitsnet_py/units/area.py
@@ -10,77 +10,127 @@ class AreaUnits(Enum):
AreaUnits enumeration
"""
- SquareKilometer = 'square_kilometer'
+ SquareKilometer = 'SquareKilometer'
"""
"""
- SquareMeter = 'square_meter'
+ SquareMeter = 'SquareMeter'
"""
"""
- SquareDecimeter = 'square_decimeter'
+ SquareDecimeter = 'SquareDecimeter'
"""
"""
- SquareCentimeter = 'square_centimeter'
+ SquareCentimeter = 'SquareCentimeter'
"""
"""
- SquareMillimeter = 'square_millimeter'
+ SquareMillimeter = 'SquareMillimeter'
"""
"""
- SquareMicrometer = 'square_micrometer'
+ SquareMicrometer = 'SquareMicrometer'
"""
"""
- SquareMile = 'square_mile'
+ SquareMile = 'SquareMile'
"""
The statute mile was standardised between the British Commonwealth and the United States by an international agreement in 1959, when it was formally redefined with respect to SI units as exactly 1,609.344 metres.
"""
- SquareYard = 'square_yard'
+ SquareYard = 'SquareYard'
"""
The yard (symbol: yd) is an English unit of length in both the British imperial and US customary systems of measurement equalling 3 feet (or 36 inches). Since 1959 the yard has been by international agreement standardized as exactly 0.9144 meter. A distance of 1,760 yards is equal to 1 mile.
"""
- SquareFoot = 'square_foot'
+ SquareFoot = 'SquareFoot'
"""
"""
- UsSurveySquareFoot = 'us_survey_square_foot'
+ UsSurveySquareFoot = 'UsSurveySquareFoot'
"""
In the United States, the foot was defined as 12 inches, with the inch being defined by the Mendenhall Order of 1893 as 39.37 inches = 1 m. This makes a U.S. survey foot exactly 1200/3937 meters.
"""
- SquareInch = 'square_inch'
+ SquareInch = 'SquareInch'
"""
"""
- Acre = 'acre'
+ Acre = 'Acre'
"""
Based upon the international yard and pound agreement of 1959, an acre may be declared as exactly 4,046.8564224 square metres.
"""
- Hectare = 'hectare'
+ Hectare = 'Hectare'
"""
"""
- SquareNauticalMile = 'square_nautical_mile'
+ SquareNauticalMile = 'SquareNauticalMile'
"""
"""
+class AreaDto:
+ """
+ A DTO representation of a Area
+
+ Attributes:
+ value (float): The value of the Area.
+ unit (AreaUnits): The specific unit that the Area value is representing.
+ """
+
+ def __init__(self, value: float, unit: AreaUnits):
+ """
+ Create a new DTO representation of a Area
+
+ Parameters:
+ value (float): The value of the Area.
+ unit (AreaUnits): The specific unit that the Area value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Area
+ """
+ self.unit: AreaUnits = unit
+ """
+ The specific unit that the Area value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Area DTO JSON object representing the current unit.
+
+ :return: JSON object represents Area DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Area DTO from a json representation.
+
+ :param data: The Area DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeter"}
+ :return: A new instance of AreaDto.
+ :rtype: AreaDto
+ """
+ return AreaDto(value=data["value"], unit=AreaUnits(data["unit"]))
+
+
class Area(AbstractMeasure):
"""
Area is a quantity that expresses the extent of a two-dimensional surface or shape, or planar lamina, in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat.[1] It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept).
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: AreaUnits = AreaUnits.SquareMeter):
def convert(self, unit: AreaUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AreaUnits = AreaUnits.SquareMeter) -> AreaDto:
+ """
+ Get a new instance of Area DTO representing the current unit.
+
+ :param hold_in_unit: The specific Area unit to store the Area value in the DTO representation.
+ :type hold_in_unit: AreaUnits
+ :return: A new instance of AreaDto.
+ :rtype: AreaDto
+ """
+ return AreaDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AreaUnits = AreaUnits.SquareMeter):
+ """
+ Get a Area DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Area unit to store the Area value in the DTO representation.
+ :type hold_in_unit: AreaUnits
+ :return: JSON object represents Area DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(area_dto: AreaDto):
+ """
+ Obtain a new instance of Area from a DTO unit object.
+
+ :param area_dto: The Area DTO representation.
+ :type area_dto: AreaDto
+ :return: A new instance of Area.
+ :rtype: Area
+ """
+ return Area(area_dto.value, area_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Area from a DTO unit json representation.
+
+ :param data: The Area DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeter"}
+ :return: A new instance of Area.
+ :rtype: Area
+ """
+ return Area.from_dto(AreaDto.from_json(data))
+
def __convert_from_base(self, from_unit: AreaUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/area_density.py b/unitsnet_py/units/area_density.py
index 50a4dbf..25a49a1 100644
--- a/unitsnet_py/units/area_density.py
+++ b/unitsnet_py/units/area_density.py
@@ -10,22 +10,72 @@ class AreaDensityUnits(Enum):
AreaDensityUnits enumeration
"""
- KilogramPerSquareMeter = 'kilogram_per_square_meter'
+ KilogramPerSquareMeter = 'KilogramPerSquareMeter'
"""
"""
- GramPerSquareMeter = 'gram_per_square_meter'
+ GramPerSquareMeter = 'GramPerSquareMeter'
"""
Also known as grammage for paper industry. In fiber industry used with abbreviation 'gsm'.
"""
- MilligramPerSquareMeter = 'milligram_per_square_meter'
+ MilligramPerSquareMeter = 'MilligramPerSquareMeter'
"""
"""
+class AreaDensityDto:
+ """
+ A DTO representation of a AreaDensity
+
+ Attributes:
+ value (float): The value of the AreaDensity.
+ unit (AreaDensityUnits): The specific unit that the AreaDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: AreaDensityUnits):
+ """
+ Create a new DTO representation of a AreaDensity
+
+ Parameters:
+ value (float): The value of the AreaDensity.
+ unit (AreaDensityUnits): The specific unit that the AreaDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the AreaDensity
+ """
+ self.unit: AreaDensityUnits = unit
+ """
+ The specific unit that the AreaDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a AreaDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents AreaDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of AreaDensity DTO from a json representation.
+
+ :param data: The AreaDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerSquareMeter"}
+ :return: A new instance of AreaDensityDto.
+ :rtype: AreaDensityDto
+ """
+ return AreaDensityDto(value=data["value"], unit=AreaDensityUnits(data["unit"]))
+
+
class AreaDensity(AbstractMeasure):
"""
The area density of a two-dimensional object is calculated as the mass per unit area. For paper this is also called grammage.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: AreaDensityUnits = AreaDensityUnits.
def convert(self, unit: AreaDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AreaDensityUnits = AreaDensityUnits.KilogramPerSquareMeter) -> AreaDensityDto:
+ """
+ Get a new instance of AreaDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific AreaDensity unit to store the AreaDensity value in the DTO representation.
+ :type hold_in_unit: AreaDensityUnits
+ :return: A new instance of AreaDensityDto.
+ :rtype: AreaDensityDto
+ """
+ return AreaDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AreaDensityUnits = AreaDensityUnits.KilogramPerSquareMeter):
+ """
+ Get a AreaDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific AreaDensity unit to store the AreaDensity value in the DTO representation.
+ :type hold_in_unit: AreaDensityUnits
+ :return: JSON object represents AreaDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(area_density_dto: AreaDensityDto):
+ """
+ Obtain a new instance of AreaDensity from a DTO unit object.
+
+ :param area_density_dto: The AreaDensity DTO representation.
+ :type area_density_dto: AreaDensityDto
+ :return: A new instance of AreaDensity.
+ :rtype: AreaDensity
+ """
+ return AreaDensity(area_density_dto.value, area_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of AreaDensity from a DTO unit json representation.
+
+ :param data: The AreaDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerSquareMeter"}
+ :return: A new instance of AreaDensity.
+ :rtype: AreaDensity
+ """
+ return AreaDensity.from_dto(AreaDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: AreaDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/area_moment_of_inertia.py b/unitsnet_py/units/area_moment_of_inertia.py
index 1d43cd4..57360b9 100644
--- a/unitsnet_py/units/area_moment_of_inertia.py
+++ b/unitsnet_py/units/area_moment_of_inertia.py
@@ -10,37 +10,87 @@ class AreaMomentOfInertiaUnits(Enum):
AreaMomentOfInertiaUnits enumeration
"""
- MeterToTheFourth = 'meter_to_the_fourth'
+ MeterToTheFourth = 'MeterToTheFourth'
"""
"""
- DecimeterToTheFourth = 'decimeter_to_the_fourth'
+ DecimeterToTheFourth = 'DecimeterToTheFourth'
"""
"""
- CentimeterToTheFourth = 'centimeter_to_the_fourth'
+ CentimeterToTheFourth = 'CentimeterToTheFourth'
"""
"""
- MillimeterToTheFourth = 'millimeter_to_the_fourth'
+ MillimeterToTheFourth = 'MillimeterToTheFourth'
"""
"""
- FootToTheFourth = 'foot_to_the_fourth'
+ FootToTheFourth = 'FootToTheFourth'
"""
"""
- InchToTheFourth = 'inch_to_the_fourth'
+ InchToTheFourth = 'InchToTheFourth'
"""
"""
+class AreaMomentOfInertiaDto:
+ """
+ A DTO representation of a AreaMomentOfInertia
+
+ Attributes:
+ value (float): The value of the AreaMomentOfInertia.
+ unit (AreaMomentOfInertiaUnits): The specific unit that the AreaMomentOfInertia value is representing.
+ """
+
+ def __init__(self, value: float, unit: AreaMomentOfInertiaUnits):
+ """
+ Create a new DTO representation of a AreaMomentOfInertia
+
+ Parameters:
+ value (float): The value of the AreaMomentOfInertia.
+ unit (AreaMomentOfInertiaUnits): The specific unit that the AreaMomentOfInertia value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the AreaMomentOfInertia
+ """
+ self.unit: AreaMomentOfInertiaUnits = unit
+ """
+ The specific unit that the AreaMomentOfInertia value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a AreaMomentOfInertia DTO JSON object representing the current unit.
+
+ :return: JSON object represents AreaMomentOfInertia DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterToTheFourth"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of AreaMomentOfInertia DTO from a json representation.
+
+ :param data: The AreaMomentOfInertia DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterToTheFourth"}
+ :return: A new instance of AreaMomentOfInertiaDto.
+ :rtype: AreaMomentOfInertiaDto
+ """
+ return AreaMomentOfInertiaDto(value=data["value"], unit=AreaMomentOfInertiaUnits(data["unit"]))
+
+
class AreaMomentOfInertia(AbstractMeasure):
"""
A geometric property of an area that reflects how its points are distributed with regard to an axis.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: AreaMomentOfInertiaUnits = AreaMomen
def convert(self, unit: AreaMomentOfInertiaUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: AreaMomentOfInertiaUnits = AreaMomentOfInertiaUnits.MeterToTheFourth) -> AreaMomentOfInertiaDto:
+ """
+ Get a new instance of AreaMomentOfInertia DTO representing the current unit.
+
+ :param hold_in_unit: The specific AreaMomentOfInertia unit to store the AreaMomentOfInertia value in the DTO representation.
+ :type hold_in_unit: AreaMomentOfInertiaUnits
+ :return: A new instance of AreaMomentOfInertiaDto.
+ :rtype: AreaMomentOfInertiaDto
+ """
+ return AreaMomentOfInertiaDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: AreaMomentOfInertiaUnits = AreaMomentOfInertiaUnits.MeterToTheFourth):
+ """
+ Get a AreaMomentOfInertia DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific AreaMomentOfInertia unit to store the AreaMomentOfInertia value in the DTO representation.
+ :type hold_in_unit: AreaMomentOfInertiaUnits
+ :return: JSON object represents AreaMomentOfInertia DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterToTheFourth"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(area_moment_of_inertia_dto: AreaMomentOfInertiaDto):
+ """
+ Obtain a new instance of AreaMomentOfInertia from a DTO unit object.
+
+ :param area_moment_of_inertia_dto: The AreaMomentOfInertia DTO representation.
+ :type area_moment_of_inertia_dto: AreaMomentOfInertiaDto
+ :return: A new instance of AreaMomentOfInertia.
+ :rtype: AreaMomentOfInertia
+ """
+ return AreaMomentOfInertia(area_moment_of_inertia_dto.value, area_moment_of_inertia_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of AreaMomentOfInertia from a DTO unit json representation.
+
+ :param data: The AreaMomentOfInertia DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterToTheFourth"}
+ :return: A new instance of AreaMomentOfInertia.
+ :rtype: AreaMomentOfInertia
+ """
+ return AreaMomentOfInertia.from_dto(AreaMomentOfInertiaDto.from_json(data))
+
def __convert_from_base(self, from_unit: AreaMomentOfInertiaUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/bit_rate.py b/unitsnet_py/units/bit_rate.py
index a0faf51..41ba6cb 100644
--- a/unitsnet_py/units/bit_rate.py
+++ b/unitsnet_py/units/bit_rate.py
@@ -10,77 +10,127 @@ class BitRateUnits(Enum):
BitRateUnits enumeration
"""
- BitPerSecond = 'bit_per_second'
+ BitPerSecond = 'BitPerSecond'
"""
"""
- BytePerSecond = 'byte_per_second'
+ BytePerSecond = 'BytePerSecond'
"""
"""
- KilobitPerSecond = 'kilobit_per_second'
+ KilobitPerSecond = 'KilobitPerSecond'
"""
"""
- MegabitPerSecond = 'megabit_per_second'
+ MegabitPerSecond = 'MegabitPerSecond'
"""
"""
- GigabitPerSecond = 'gigabit_per_second'
+ GigabitPerSecond = 'GigabitPerSecond'
"""
"""
- TerabitPerSecond = 'terabit_per_second'
+ TerabitPerSecond = 'TerabitPerSecond'
"""
"""
- PetabitPerSecond = 'petabit_per_second'
+ PetabitPerSecond = 'PetabitPerSecond'
"""
"""
- ExabitPerSecond = 'exabit_per_second'
+ ExabitPerSecond = 'ExabitPerSecond'
"""
"""
- KilobytePerSecond = 'kilobyte_per_second'
+ KilobytePerSecond = 'KilobytePerSecond'
"""
"""
- MegabytePerSecond = 'megabyte_per_second'
+ MegabytePerSecond = 'MegabytePerSecond'
"""
"""
- GigabytePerSecond = 'gigabyte_per_second'
+ GigabytePerSecond = 'GigabytePerSecond'
"""
"""
- TerabytePerSecond = 'terabyte_per_second'
+ TerabytePerSecond = 'TerabytePerSecond'
"""
"""
- PetabytePerSecond = 'petabyte_per_second'
+ PetabytePerSecond = 'PetabytePerSecond'
"""
"""
- ExabytePerSecond = 'exabyte_per_second'
+ ExabytePerSecond = 'ExabytePerSecond'
"""
"""
+class BitRateDto:
+ """
+ A DTO representation of a BitRate
+
+ Attributes:
+ value (float): The value of the BitRate.
+ unit (BitRateUnits): The specific unit that the BitRate value is representing.
+ """
+
+ def __init__(self, value: float, unit: BitRateUnits):
+ """
+ Create a new DTO representation of a BitRate
+
+ Parameters:
+ value (float): The value of the BitRate.
+ unit (BitRateUnits): The specific unit that the BitRate value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the BitRate
+ """
+ self.unit: BitRateUnits = unit
+ """
+ The specific unit that the BitRate value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a BitRate DTO JSON object representing the current unit.
+
+ :return: JSON object represents BitRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "BitPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of BitRate DTO from a json representation.
+
+ :param data: The BitRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "BitPerSecond"}
+ :return: A new instance of BitRateDto.
+ :rtype: BitRateDto
+ """
+ return BitRateDto(value=data["value"], unit=BitRateUnits(data["unit"]))
+
+
class BitRate(AbstractMeasure):
"""
In telecommunications and computing, bit rate is the number of bits that are conveyed or processed per unit of time.
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: BitRateUnits = BitRateUnits.BitPerSe
def convert(self, unit: BitRateUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: BitRateUnits = BitRateUnits.BitPerSecond) -> BitRateDto:
+ """
+ Get a new instance of BitRate DTO representing the current unit.
+
+ :param hold_in_unit: The specific BitRate unit to store the BitRate value in the DTO representation.
+ :type hold_in_unit: BitRateUnits
+ :return: A new instance of BitRateDto.
+ :rtype: BitRateDto
+ """
+ return BitRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: BitRateUnits = BitRateUnits.BitPerSecond):
+ """
+ Get a BitRate DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific BitRate unit to store the BitRate value in the DTO representation.
+ :type hold_in_unit: BitRateUnits
+ :return: JSON object represents BitRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "BitPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(bit_rate_dto: BitRateDto):
+ """
+ Obtain a new instance of BitRate from a DTO unit object.
+
+ :param bit_rate_dto: The BitRate DTO representation.
+ :type bit_rate_dto: BitRateDto
+ :return: A new instance of BitRate.
+ :rtype: BitRate
+ """
+ return BitRate(bit_rate_dto.value, bit_rate_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of BitRate from a DTO unit json representation.
+
+ :param data: The BitRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "BitPerSecond"}
+ :return: A new instance of BitRate.
+ :rtype: BitRate
+ """
+ return BitRate.from_dto(BitRateDto.from_json(data))
+
def __convert_from_base(self, from_unit: BitRateUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/brake_specific_fuel_consumption.py b/unitsnet_py/units/brake_specific_fuel_consumption.py
index 4b8573d..655d4fc 100644
--- a/unitsnet_py/units/brake_specific_fuel_consumption.py
+++ b/unitsnet_py/units/brake_specific_fuel_consumption.py
@@ -10,22 +10,72 @@ class BrakeSpecificFuelConsumptionUnits(Enum):
BrakeSpecificFuelConsumptionUnits enumeration
"""
- GramPerKiloWattHour = 'gram_per_kilo_watt_hour'
+ GramPerKiloWattHour = 'GramPerKiloWattHour'
"""
"""
- KilogramPerJoule = 'kilogram_per_joule'
+ KilogramPerJoule = 'KilogramPerJoule'
"""
"""
- PoundPerMechanicalHorsepowerHour = 'pound_per_mechanical_horsepower_hour'
+ PoundPerMechanicalHorsepowerHour = 'PoundPerMechanicalHorsepowerHour'
"""
The pound per horse power hour uses mechanical horse power and the imperial pound
"""
+class BrakeSpecificFuelConsumptionDto:
+ """
+ A DTO representation of a BrakeSpecificFuelConsumption
+
+ Attributes:
+ value (float): The value of the BrakeSpecificFuelConsumption.
+ unit (BrakeSpecificFuelConsumptionUnits): The specific unit that the BrakeSpecificFuelConsumption value is representing.
+ """
+
+ def __init__(self, value: float, unit: BrakeSpecificFuelConsumptionUnits):
+ """
+ Create a new DTO representation of a BrakeSpecificFuelConsumption
+
+ Parameters:
+ value (float): The value of the BrakeSpecificFuelConsumption.
+ unit (BrakeSpecificFuelConsumptionUnits): The specific unit that the BrakeSpecificFuelConsumption value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the BrakeSpecificFuelConsumption
+ """
+ self.unit: BrakeSpecificFuelConsumptionUnits = unit
+ """
+ The specific unit that the BrakeSpecificFuelConsumption value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a BrakeSpecificFuelConsumption DTO JSON object representing the current unit.
+
+ :return: JSON object represents BrakeSpecificFuelConsumption DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerJoule"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of BrakeSpecificFuelConsumption DTO from a json representation.
+
+ :param data: The BrakeSpecificFuelConsumption DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerJoule"}
+ :return: A new instance of BrakeSpecificFuelConsumptionDto.
+ :rtype: BrakeSpecificFuelConsumptionDto
+ """
+ return BrakeSpecificFuelConsumptionDto(value=data["value"], unit=BrakeSpecificFuelConsumptionUnits(data["unit"]))
+
+
class BrakeSpecificFuelConsumption(AbstractMeasure):
"""
Brake specific fuel consumption (BSFC) is a measure of the fuel efficiency of any prime mover that burns fuel and produces rotational, or shaft, power. It is typically used for comparing the efficiency of internal combustion engines with a shaft output.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: BrakeSpecificFuelConsumptionUnits =
def convert(self, unit: BrakeSpecificFuelConsumptionUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: BrakeSpecificFuelConsumptionUnits = BrakeSpecificFuelConsumptionUnits.KilogramPerJoule) -> BrakeSpecificFuelConsumptionDto:
+ """
+ Get a new instance of BrakeSpecificFuelConsumption DTO representing the current unit.
+
+ :param hold_in_unit: The specific BrakeSpecificFuelConsumption unit to store the BrakeSpecificFuelConsumption value in the DTO representation.
+ :type hold_in_unit: BrakeSpecificFuelConsumptionUnits
+ :return: A new instance of BrakeSpecificFuelConsumptionDto.
+ :rtype: BrakeSpecificFuelConsumptionDto
+ """
+ return BrakeSpecificFuelConsumptionDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: BrakeSpecificFuelConsumptionUnits = BrakeSpecificFuelConsumptionUnits.KilogramPerJoule):
+ """
+ Get a BrakeSpecificFuelConsumption DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific BrakeSpecificFuelConsumption unit to store the BrakeSpecificFuelConsumption value in the DTO representation.
+ :type hold_in_unit: BrakeSpecificFuelConsumptionUnits
+ :return: JSON object represents BrakeSpecificFuelConsumption DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerJoule"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(brake_specific_fuel_consumption_dto: BrakeSpecificFuelConsumptionDto):
+ """
+ Obtain a new instance of BrakeSpecificFuelConsumption from a DTO unit object.
+
+ :param brake_specific_fuel_consumption_dto: The BrakeSpecificFuelConsumption DTO representation.
+ :type brake_specific_fuel_consumption_dto: BrakeSpecificFuelConsumptionDto
+ :return: A new instance of BrakeSpecificFuelConsumption.
+ :rtype: BrakeSpecificFuelConsumption
+ """
+ return BrakeSpecificFuelConsumption(brake_specific_fuel_consumption_dto.value, brake_specific_fuel_consumption_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of BrakeSpecificFuelConsumption from a DTO unit json representation.
+
+ :param data: The BrakeSpecificFuelConsumption DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerJoule"}
+ :return: A new instance of BrakeSpecificFuelConsumption.
+ :rtype: BrakeSpecificFuelConsumption
+ """
+ return BrakeSpecificFuelConsumption.from_dto(BrakeSpecificFuelConsumptionDto.from_json(data))
+
def __convert_from_base(self, from_unit: BrakeSpecificFuelConsumptionUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/capacitance.py b/unitsnet_py/units/capacitance.py
index 98dee45..b2de9fd 100644
--- a/unitsnet_py/units/capacitance.py
+++ b/unitsnet_py/units/capacitance.py
@@ -10,42 +10,92 @@ class CapacitanceUnits(Enum):
CapacitanceUnits enumeration
"""
- Farad = 'farad'
+ Farad = 'Farad'
"""
"""
- Picofarad = 'picofarad'
+ Picofarad = 'Picofarad'
"""
"""
- Nanofarad = 'nanofarad'
+ Nanofarad = 'Nanofarad'
"""
"""
- Microfarad = 'microfarad'
+ Microfarad = 'Microfarad'
"""
"""
- Millifarad = 'millifarad'
+ Millifarad = 'Millifarad'
"""
"""
- Kilofarad = 'kilofarad'
+ Kilofarad = 'Kilofarad'
"""
"""
- Megafarad = 'megafarad'
+ Megafarad = 'Megafarad'
"""
"""
+class CapacitanceDto:
+ """
+ A DTO representation of a Capacitance
+
+ Attributes:
+ value (float): The value of the Capacitance.
+ unit (CapacitanceUnits): The specific unit that the Capacitance value is representing.
+ """
+
+ def __init__(self, value: float, unit: CapacitanceUnits):
+ """
+ Create a new DTO representation of a Capacitance
+
+ Parameters:
+ value (float): The value of the Capacitance.
+ unit (CapacitanceUnits): The specific unit that the Capacitance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Capacitance
+ """
+ self.unit: CapacitanceUnits = unit
+ """
+ The specific unit that the Capacitance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Capacitance DTO JSON object representing the current unit.
+
+ :return: JSON object represents Capacitance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Farad"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Capacitance DTO from a json representation.
+
+ :param data: The Capacitance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Farad"}
+ :return: A new instance of CapacitanceDto.
+ :rtype: CapacitanceDto
+ """
+ return CapacitanceDto(value=data["value"], unit=CapacitanceUnits(data["unit"]))
+
+
class Capacitance(AbstractMeasure):
"""
Capacitance is the ability of a body to store an electric charge.
@@ -79,6 +129,54 @@ def __init__(self, value: float, from_unit: CapacitanceUnits = CapacitanceUnits.
def convert(self, unit: CapacitanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: CapacitanceUnits = CapacitanceUnits.Farad) -> CapacitanceDto:
+ """
+ Get a new instance of Capacitance DTO representing the current unit.
+
+ :param hold_in_unit: The specific Capacitance unit to store the Capacitance value in the DTO representation.
+ :type hold_in_unit: CapacitanceUnits
+ :return: A new instance of CapacitanceDto.
+ :rtype: CapacitanceDto
+ """
+ return CapacitanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: CapacitanceUnits = CapacitanceUnits.Farad):
+ """
+ Get a Capacitance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Capacitance unit to store the Capacitance value in the DTO representation.
+ :type hold_in_unit: CapacitanceUnits
+ :return: JSON object represents Capacitance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Farad"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(capacitance_dto: CapacitanceDto):
+ """
+ Obtain a new instance of Capacitance from a DTO unit object.
+
+ :param capacitance_dto: The Capacitance DTO representation.
+ :type capacitance_dto: CapacitanceDto
+ :return: A new instance of Capacitance.
+ :rtype: Capacitance
+ """
+ return Capacitance(capacitance_dto.value, capacitance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Capacitance from a DTO unit json representation.
+
+ :param data: The Capacitance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Farad"}
+ :return: A new instance of Capacitance.
+ :rtype: Capacitance
+ """
+ return Capacitance.from_dto(CapacitanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: CapacitanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/coefficient_of_thermal_expansion.py b/unitsnet_py/units/coefficient_of_thermal_expansion.py
index 644487d..a34dd2a 100644
--- a/unitsnet_py/units/coefficient_of_thermal_expansion.py
+++ b/unitsnet_py/units/coefficient_of_thermal_expansion.py
@@ -10,37 +10,87 @@ class CoefficientOfThermalExpansionUnits(Enum):
CoefficientOfThermalExpansionUnits enumeration
"""
- PerKelvin = 'per_kelvin'
+ PerKelvin = 'PerKelvin'
"""
"""
- PerDegreeCelsius = 'per_degree_celsius'
+ PerDegreeCelsius = 'PerDegreeCelsius'
"""
"""
- PerDegreeFahrenheit = 'per_degree_fahrenheit'
+ PerDegreeFahrenheit = 'PerDegreeFahrenheit'
"""
"""
- PpmPerKelvin = 'ppm_per_kelvin'
+ PpmPerKelvin = 'PpmPerKelvin'
"""
"""
- PpmPerDegreeCelsius = 'ppm_per_degree_celsius'
+ PpmPerDegreeCelsius = 'PpmPerDegreeCelsius'
"""
"""
- PpmPerDegreeFahrenheit = 'ppm_per_degree_fahrenheit'
+ PpmPerDegreeFahrenheit = 'PpmPerDegreeFahrenheit'
"""
"""
+class CoefficientOfThermalExpansionDto:
+ """
+ A DTO representation of a CoefficientOfThermalExpansion
+
+ Attributes:
+ value (float): The value of the CoefficientOfThermalExpansion.
+ unit (CoefficientOfThermalExpansionUnits): The specific unit that the CoefficientOfThermalExpansion value is representing.
+ """
+
+ def __init__(self, value: float, unit: CoefficientOfThermalExpansionUnits):
+ """
+ Create a new DTO representation of a CoefficientOfThermalExpansion
+
+ Parameters:
+ value (float): The value of the CoefficientOfThermalExpansion.
+ unit (CoefficientOfThermalExpansionUnits): The specific unit that the CoefficientOfThermalExpansion value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the CoefficientOfThermalExpansion
+ """
+ self.unit: CoefficientOfThermalExpansionUnits = unit
+ """
+ The specific unit that the CoefficientOfThermalExpansion value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a CoefficientOfThermalExpansion DTO JSON object representing the current unit.
+
+ :return: JSON object represents CoefficientOfThermalExpansion DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "PerKelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of CoefficientOfThermalExpansion DTO from a json representation.
+
+ :param data: The CoefficientOfThermalExpansion DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "PerKelvin"}
+ :return: A new instance of CoefficientOfThermalExpansionDto.
+ :rtype: CoefficientOfThermalExpansionDto
+ """
+ return CoefficientOfThermalExpansionDto(value=data["value"], unit=CoefficientOfThermalExpansionUnits(data["unit"]))
+
+
class CoefficientOfThermalExpansion(AbstractMeasure):
"""
A unit that represents a fractional change in size in response to a change in temperature.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: CoefficientOfThermalExpansionUnits =
def convert(self, unit: CoefficientOfThermalExpansionUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: CoefficientOfThermalExpansionUnits = CoefficientOfThermalExpansionUnits.PerKelvin) -> CoefficientOfThermalExpansionDto:
+ """
+ Get a new instance of CoefficientOfThermalExpansion DTO representing the current unit.
+
+ :param hold_in_unit: The specific CoefficientOfThermalExpansion unit to store the CoefficientOfThermalExpansion value in the DTO representation.
+ :type hold_in_unit: CoefficientOfThermalExpansionUnits
+ :return: A new instance of CoefficientOfThermalExpansionDto.
+ :rtype: CoefficientOfThermalExpansionDto
+ """
+ return CoefficientOfThermalExpansionDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: CoefficientOfThermalExpansionUnits = CoefficientOfThermalExpansionUnits.PerKelvin):
+ """
+ Get a CoefficientOfThermalExpansion DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific CoefficientOfThermalExpansion unit to store the CoefficientOfThermalExpansion value in the DTO representation.
+ :type hold_in_unit: CoefficientOfThermalExpansionUnits
+ :return: JSON object represents CoefficientOfThermalExpansion DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "PerKelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(coefficient_of_thermal_expansion_dto: CoefficientOfThermalExpansionDto):
+ """
+ Obtain a new instance of CoefficientOfThermalExpansion from a DTO unit object.
+
+ :param coefficient_of_thermal_expansion_dto: The CoefficientOfThermalExpansion DTO representation.
+ :type coefficient_of_thermal_expansion_dto: CoefficientOfThermalExpansionDto
+ :return: A new instance of CoefficientOfThermalExpansion.
+ :rtype: CoefficientOfThermalExpansion
+ """
+ return CoefficientOfThermalExpansion(coefficient_of_thermal_expansion_dto.value, coefficient_of_thermal_expansion_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of CoefficientOfThermalExpansion from a DTO unit json representation.
+
+ :param data: The CoefficientOfThermalExpansion DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "PerKelvin"}
+ :return: A new instance of CoefficientOfThermalExpansion.
+ :rtype: CoefficientOfThermalExpansion
+ """
+ return CoefficientOfThermalExpansion.from_dto(CoefficientOfThermalExpansionDto.from_json(data))
+
def __convert_from_base(self, from_unit: CoefficientOfThermalExpansionUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/compressibility.py b/unitsnet_py/units/compressibility.py
index a0cc6a0..4cdddd9 100644
--- a/unitsnet_py/units/compressibility.py
+++ b/unitsnet_py/units/compressibility.py
@@ -10,42 +10,92 @@ class CompressibilityUnits(Enum):
CompressibilityUnits enumeration
"""
- InversePascal = 'inverse_pascal'
+ InversePascal = 'InversePascal'
"""
"""
- InverseKilopascal = 'inverse_kilopascal'
+ InverseKilopascal = 'InverseKilopascal'
"""
"""
- InverseMegapascal = 'inverse_megapascal'
+ InverseMegapascal = 'InverseMegapascal'
"""
"""
- InverseAtmosphere = 'inverse_atmosphere'
+ InverseAtmosphere = 'InverseAtmosphere'
"""
"""
- InverseMillibar = 'inverse_millibar'
+ InverseMillibar = 'InverseMillibar'
"""
"""
- InverseBar = 'inverse_bar'
+ InverseBar = 'InverseBar'
"""
"""
- InversePoundForcePerSquareInch = 'inverse_pound_force_per_square_inch'
+ InversePoundForcePerSquareInch = 'InversePoundForcePerSquareInch'
"""
"""
+class CompressibilityDto:
+ """
+ A DTO representation of a Compressibility
+
+ Attributes:
+ value (float): The value of the Compressibility.
+ unit (CompressibilityUnits): The specific unit that the Compressibility value is representing.
+ """
+
+ def __init__(self, value: float, unit: CompressibilityUnits):
+ """
+ Create a new DTO representation of a Compressibility
+
+ Parameters:
+ value (float): The value of the Compressibility.
+ unit (CompressibilityUnits): The specific unit that the Compressibility value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Compressibility
+ """
+ self.unit: CompressibilityUnits = unit
+ """
+ The specific unit that the Compressibility value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Compressibility DTO JSON object representing the current unit.
+
+ :return: JSON object represents Compressibility DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InversePascal"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Compressibility DTO from a json representation.
+
+ :param data: The Compressibility DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InversePascal"}
+ :return: A new instance of CompressibilityDto.
+ :rtype: CompressibilityDto
+ """
+ return CompressibilityDto(value=data["value"], unit=CompressibilityUnits(data["unit"]))
+
+
class Compressibility(AbstractMeasure):
"""
None
@@ -79,6 +129,54 @@ def __init__(self, value: float, from_unit: CompressibilityUnits = Compressibili
def convert(self, unit: CompressibilityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: CompressibilityUnits = CompressibilityUnits.InversePascal) -> CompressibilityDto:
+ """
+ Get a new instance of Compressibility DTO representing the current unit.
+
+ :param hold_in_unit: The specific Compressibility unit to store the Compressibility value in the DTO representation.
+ :type hold_in_unit: CompressibilityUnits
+ :return: A new instance of CompressibilityDto.
+ :rtype: CompressibilityDto
+ """
+ return CompressibilityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: CompressibilityUnits = CompressibilityUnits.InversePascal):
+ """
+ Get a Compressibility DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Compressibility unit to store the Compressibility value in the DTO representation.
+ :type hold_in_unit: CompressibilityUnits
+ :return: JSON object represents Compressibility DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InversePascal"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(compressibility_dto: CompressibilityDto):
+ """
+ Obtain a new instance of Compressibility from a DTO unit object.
+
+ :param compressibility_dto: The Compressibility DTO representation.
+ :type compressibility_dto: CompressibilityDto
+ :return: A new instance of Compressibility.
+ :rtype: Compressibility
+ """
+ return Compressibility(compressibility_dto.value, compressibility_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Compressibility from a DTO unit json representation.
+
+ :param data: The Compressibility DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InversePascal"}
+ :return: A new instance of Compressibility.
+ :rtype: Compressibility
+ """
+ return Compressibility.from_dto(CompressibilityDto.from_json(data))
+
def __convert_from_base(self, from_unit: CompressibilityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/density.py b/unitsnet_py/units/density.py
index c0f9d3d..76d0c25 100644
--- a/unitsnet_py/units/density.py
+++ b/unitsnet_py/units/density.py
@@ -10,287 +10,337 @@ class DensityUnits(Enum):
DensityUnits enumeration
"""
- GramPerCubicMillimeter = 'gram_per_cubic_millimeter'
+ GramPerCubicMillimeter = 'GramPerCubicMillimeter'
"""
"""
- GramPerCubicCentimeter = 'gram_per_cubic_centimeter'
+ GramPerCubicCentimeter = 'GramPerCubicCentimeter'
"""
"""
- GramPerCubicMeter = 'gram_per_cubic_meter'
+ GramPerCubicMeter = 'GramPerCubicMeter'
"""
"""
- PoundPerCubicInch = 'pound_per_cubic_inch'
+ PoundPerCubicInch = 'PoundPerCubicInch'
"""
"""
- PoundPerCubicFoot = 'pound_per_cubic_foot'
+ PoundPerCubicFoot = 'PoundPerCubicFoot'
"""
"""
- PoundPerCubicYard = 'pound_per_cubic_yard'
+ PoundPerCubicYard = 'PoundPerCubicYard'
"""
Calculated from the definition of pound and yard compared to metric kilogram and meter.
"""
- TonnePerCubicMillimeter = 'tonne_per_cubic_millimeter'
+ TonnePerCubicMillimeter = 'TonnePerCubicMillimeter'
"""
"""
- TonnePerCubicCentimeter = 'tonne_per_cubic_centimeter'
+ TonnePerCubicCentimeter = 'TonnePerCubicCentimeter'
"""
"""
- TonnePerCubicMeter = 'tonne_per_cubic_meter'
+ TonnePerCubicMeter = 'TonnePerCubicMeter'
"""
"""
- SlugPerCubicFoot = 'slug_per_cubic_foot'
+ SlugPerCubicFoot = 'SlugPerCubicFoot'
"""
"""
- GramPerLiter = 'gram_per_liter'
+ GramPerLiter = 'GramPerLiter'
"""
"""
- GramPerDeciliter = 'gram_per_deciliter'
+ GramPerDeciliter = 'GramPerDeciliter'
"""
"""
- GramPerMilliliter = 'gram_per_milliliter'
+ GramPerMilliliter = 'GramPerMilliliter'
"""
"""
- PoundPerUSGallon = 'pound_per_us_gallon'
+ PoundPerUSGallon = 'PoundPerUSGallon'
"""
"""
- PoundPerImperialGallon = 'pound_per_imperial_gallon'
+ PoundPerImperialGallon = 'PoundPerImperialGallon'
"""
"""
- KilogramPerLiter = 'kilogram_per_liter'
+ KilogramPerLiter = 'KilogramPerLiter'
"""
"""
- TonnePerCubicFoot = 'tonne_per_cubic_foot'
+ TonnePerCubicFoot = 'TonnePerCubicFoot'
"""
"""
- TonnePerCubicInch = 'tonne_per_cubic_inch'
+ TonnePerCubicInch = 'TonnePerCubicInch'
"""
"""
- GramPerCubicFoot = 'gram_per_cubic_foot'
+ GramPerCubicFoot = 'GramPerCubicFoot'
"""
"""
- GramPerCubicInch = 'gram_per_cubic_inch'
+ GramPerCubicInch = 'GramPerCubicInch'
"""
"""
- PoundPerCubicMeter = 'pound_per_cubic_meter'
+ PoundPerCubicMeter = 'PoundPerCubicMeter'
"""
"""
- PoundPerCubicCentimeter = 'pound_per_cubic_centimeter'
+ PoundPerCubicCentimeter = 'PoundPerCubicCentimeter'
"""
"""
- PoundPerCubicMillimeter = 'pound_per_cubic_millimeter'
+ PoundPerCubicMillimeter = 'PoundPerCubicMillimeter'
"""
"""
- SlugPerCubicMeter = 'slug_per_cubic_meter'
+ SlugPerCubicMeter = 'SlugPerCubicMeter'
"""
"""
- SlugPerCubicCentimeter = 'slug_per_cubic_centimeter'
+ SlugPerCubicCentimeter = 'SlugPerCubicCentimeter'
"""
"""
- SlugPerCubicMillimeter = 'slug_per_cubic_millimeter'
+ SlugPerCubicMillimeter = 'SlugPerCubicMillimeter'
"""
"""
- SlugPerCubicInch = 'slug_per_cubic_inch'
+ SlugPerCubicInch = 'SlugPerCubicInch'
"""
"""
- KilogramPerCubicMillimeter = 'kilogram_per_cubic_millimeter'
+ KilogramPerCubicMillimeter = 'KilogramPerCubicMillimeter'
"""
"""
- KilogramPerCubicCentimeter = 'kilogram_per_cubic_centimeter'
+ KilogramPerCubicCentimeter = 'KilogramPerCubicCentimeter'
"""
"""
- KilogramPerCubicMeter = 'kilogram_per_cubic_meter'
+ KilogramPerCubicMeter = 'KilogramPerCubicMeter'
"""
"""
- MilligramPerCubicMeter = 'milligram_per_cubic_meter'
+ MilligramPerCubicMeter = 'MilligramPerCubicMeter'
"""
"""
- MicrogramPerCubicMeter = 'microgram_per_cubic_meter'
+ MicrogramPerCubicMeter = 'MicrogramPerCubicMeter'
"""
"""
- KilopoundPerCubicInch = 'kilopound_per_cubic_inch'
+ KilopoundPerCubicInch = 'KilopoundPerCubicInch'
"""
"""
- KilopoundPerCubicFoot = 'kilopound_per_cubic_foot'
+ KilopoundPerCubicFoot = 'KilopoundPerCubicFoot'
"""
"""
- KilopoundPerCubicYard = 'kilopound_per_cubic_yard'
+ KilopoundPerCubicYard = 'KilopoundPerCubicYard'
"""
"""
- FemtogramPerLiter = 'femtogram_per_liter'
+ FemtogramPerLiter = 'FemtogramPerLiter'
"""
"""
- PicogramPerLiter = 'picogram_per_liter'
+ PicogramPerLiter = 'PicogramPerLiter'
"""
"""
- NanogramPerLiter = 'nanogram_per_liter'
+ NanogramPerLiter = 'NanogramPerLiter'
"""
"""
- MicrogramPerLiter = 'microgram_per_liter'
+ MicrogramPerLiter = 'MicrogramPerLiter'
"""
"""
- MilligramPerLiter = 'milligram_per_liter'
+ MilligramPerLiter = 'MilligramPerLiter'
"""
"""
- CentigramPerLiter = 'centigram_per_liter'
+ CentigramPerLiter = 'CentigramPerLiter'
"""
"""
- DecigramPerLiter = 'decigram_per_liter'
+ DecigramPerLiter = 'DecigramPerLiter'
"""
"""
- FemtogramPerDeciliter = 'femtogram_per_deciliter'
+ FemtogramPerDeciliter = 'FemtogramPerDeciliter'
"""
"""
- PicogramPerDeciliter = 'picogram_per_deciliter'
+ PicogramPerDeciliter = 'PicogramPerDeciliter'
"""
"""
- NanogramPerDeciliter = 'nanogram_per_deciliter'
+ NanogramPerDeciliter = 'NanogramPerDeciliter'
"""
"""
- MicrogramPerDeciliter = 'microgram_per_deciliter'
+ MicrogramPerDeciliter = 'MicrogramPerDeciliter'
"""
"""
- MilligramPerDeciliter = 'milligram_per_deciliter'
+ MilligramPerDeciliter = 'MilligramPerDeciliter'
"""
"""
- CentigramPerDeciliter = 'centigram_per_deciliter'
+ CentigramPerDeciliter = 'CentigramPerDeciliter'
"""
"""
- DecigramPerDeciliter = 'decigram_per_deciliter'
+ DecigramPerDeciliter = 'DecigramPerDeciliter'
"""
"""
- FemtogramPerMilliliter = 'femtogram_per_milliliter'
+ FemtogramPerMilliliter = 'FemtogramPerMilliliter'
"""
"""
- PicogramPerMilliliter = 'picogram_per_milliliter'
+ PicogramPerMilliliter = 'PicogramPerMilliliter'
"""
"""
- NanogramPerMilliliter = 'nanogram_per_milliliter'
+ NanogramPerMilliliter = 'NanogramPerMilliliter'
"""
"""
- MicrogramPerMilliliter = 'microgram_per_milliliter'
+ MicrogramPerMilliliter = 'MicrogramPerMilliliter'
"""
"""
- MilligramPerMilliliter = 'milligram_per_milliliter'
+ MilligramPerMilliliter = 'MilligramPerMilliliter'
"""
"""
- CentigramPerMilliliter = 'centigram_per_milliliter'
+ CentigramPerMilliliter = 'CentigramPerMilliliter'
"""
"""
- DecigramPerMilliliter = 'decigram_per_milliliter'
+ DecigramPerMilliliter = 'DecigramPerMilliliter'
"""
"""
+class DensityDto:
+ """
+ A DTO representation of a Density
+
+ Attributes:
+ value (float): The value of the Density.
+ unit (DensityUnits): The specific unit that the Density value is representing.
+ """
+
+ def __init__(self, value: float, unit: DensityUnits):
+ """
+ Create a new DTO representation of a Density
+
+ Parameters:
+ value (float): The value of the Density.
+ unit (DensityUnits): The specific unit that the Density value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Density
+ """
+ self.unit: DensityUnits = unit
+ """
+ The specific unit that the Density value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Density DTO JSON object representing the current unit.
+
+ :return: JSON object represents Density DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Density DTO from a json representation.
+
+ :param data: The Density DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ :return: A new instance of DensityDto.
+ :rtype: DensityDto
+ """
+ return DensityDto(value=data["value"], unit=DensityUnits(data["unit"]))
+
+
class Density(AbstractMeasure):
"""
The density, or more precisely, the volumetric mass density, of a substance is its mass per unit volume.
@@ -422,6 +472,54 @@ def __init__(self, value: float, from_unit: DensityUnits = DensityUnits.Kilogram
def convert(self, unit: DensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: DensityUnits = DensityUnits.KilogramPerCubicMeter) -> DensityDto:
+ """
+ Get a new instance of Density DTO representing the current unit.
+
+ :param hold_in_unit: The specific Density unit to store the Density value in the DTO representation.
+ :type hold_in_unit: DensityUnits
+ :return: A new instance of DensityDto.
+ :rtype: DensityDto
+ """
+ return DensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: DensityUnits = DensityUnits.KilogramPerCubicMeter):
+ """
+ Get a Density DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Density unit to store the Density value in the DTO representation.
+ :type hold_in_unit: DensityUnits
+ :return: JSON object represents Density DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(density_dto: DensityDto):
+ """
+ Obtain a new instance of Density from a DTO unit object.
+
+ :param density_dto: The Density DTO representation.
+ :type density_dto: DensityDto
+ :return: A new instance of Density.
+ :rtype: Density
+ """
+ return Density(density_dto.value, density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Density from a DTO unit json representation.
+
+ :param data: The Density DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ :return: A new instance of Density.
+ :rtype: Density
+ """
+ return Density.from_dto(DensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: DensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/duration.py b/unitsnet_py/units/duration.py
index a3f35ef..333c631 100644
--- a/unitsnet_py/units/duration.py
+++ b/unitsnet_py/units/duration.py
@@ -10,62 +10,112 @@ class DurationUnits(Enum):
DurationUnits enumeration
"""
- Year365 = 'year365'
+ Year365 = 'Year365'
"""
"""
- Month30 = 'month30'
+ Month30 = 'Month30'
"""
"""
- Week = 'week'
+ Week = 'Week'
"""
"""
- Day = 'day'
+ Day = 'Day'
"""
"""
- Hour = 'hour'
+ Hour = 'Hour'
"""
"""
- Minute = 'minute'
+ Minute = 'Minute'
"""
"""
- Second = 'second'
+ Second = 'Second'
"""
"""
- JulianYear = 'julian_year'
+ JulianYear = 'JulianYear'
"""
"""
- Nanosecond = 'nanosecond'
+ Nanosecond = 'Nanosecond'
"""
"""
- Microsecond = 'microsecond'
+ Microsecond = 'Microsecond'
"""
"""
- Millisecond = 'millisecond'
+ Millisecond = 'Millisecond'
"""
"""
+class DurationDto:
+ """
+ A DTO representation of a Duration
+
+ Attributes:
+ value (float): The value of the Duration.
+ unit (DurationUnits): The specific unit that the Duration value is representing.
+ """
+
+ def __init__(self, value: float, unit: DurationUnits):
+ """
+ Create a new DTO representation of a Duration
+
+ Parameters:
+ value (float): The value of the Duration.
+ unit (DurationUnits): The specific unit that the Duration value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Duration
+ """
+ self.unit: DurationUnits = unit
+ """
+ The specific unit that the Duration value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Duration DTO JSON object representing the current unit.
+
+ :return: JSON object represents Duration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Second"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Duration DTO from a json representation.
+
+ :param data: The Duration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Second"}
+ :return: A new instance of DurationDto.
+ :rtype: DurationDto
+ """
+ return DurationDto(value=data["value"], unit=DurationUnits(data["unit"]))
+
+
class Duration(AbstractMeasure):
"""
Time is a dimension in which events can be ordered from the past through the present into the future, and also the measure of durations of events and the intervals between them.
@@ -107,6 +157,54 @@ def __init__(self, value: float, from_unit: DurationUnits = DurationUnits.Second
def convert(self, unit: DurationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: DurationUnits = DurationUnits.Second) -> DurationDto:
+ """
+ Get a new instance of Duration DTO representing the current unit.
+
+ :param hold_in_unit: The specific Duration unit to store the Duration value in the DTO representation.
+ :type hold_in_unit: DurationUnits
+ :return: A new instance of DurationDto.
+ :rtype: DurationDto
+ """
+ return DurationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: DurationUnits = DurationUnits.Second):
+ """
+ Get a Duration DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Duration unit to store the Duration value in the DTO representation.
+ :type hold_in_unit: DurationUnits
+ :return: JSON object represents Duration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Second"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(duration_dto: DurationDto):
+ """
+ Obtain a new instance of Duration from a DTO unit object.
+
+ :param duration_dto: The Duration DTO representation.
+ :type duration_dto: DurationDto
+ :return: A new instance of Duration.
+ :rtype: Duration
+ """
+ return Duration(duration_dto.value, duration_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Duration from a DTO unit json representation.
+
+ :param data: The Duration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Second"}
+ :return: A new instance of Duration.
+ :rtype: Duration
+ """
+ return Duration.from_dto(DurationDto.from_json(data))
+
def __convert_from_base(self, from_unit: DurationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/dynamic_viscosity.py b/unitsnet_py/units/dynamic_viscosity.py
index cbaa3d5..b9999f1 100644
--- a/unitsnet_py/units/dynamic_viscosity.py
+++ b/unitsnet_py/units/dynamic_viscosity.py
@@ -10,57 +10,107 @@ class DynamicViscosityUnits(Enum):
DynamicViscosityUnits enumeration
"""
- NewtonSecondPerMeterSquared = 'newton_second_per_meter_squared'
+ NewtonSecondPerMeterSquared = 'NewtonSecondPerMeterSquared'
"""
"""
- PascalSecond = 'pascal_second'
+ PascalSecond = 'PascalSecond'
"""
"""
- Poise = 'poise'
+ Poise = 'Poise'
"""
"""
- Reyn = 'reyn'
+ Reyn = 'Reyn'
"""
"""
- PoundForceSecondPerSquareInch = 'pound_force_second_per_square_inch'
+ PoundForceSecondPerSquareInch = 'PoundForceSecondPerSquareInch'
"""
"""
- PoundForceSecondPerSquareFoot = 'pound_force_second_per_square_foot'
+ PoundForceSecondPerSquareFoot = 'PoundForceSecondPerSquareFoot'
"""
"""
- PoundPerFootSecond = 'pound_per_foot_second'
+ PoundPerFootSecond = 'PoundPerFootSecond'
"""
"""
- MillipascalSecond = 'millipascal_second'
+ MillipascalSecond = 'MillipascalSecond'
"""
"""
- MicropascalSecond = 'micropascal_second'
+ MicropascalSecond = 'MicropascalSecond'
"""
"""
- Centipoise = 'centipoise'
+ Centipoise = 'Centipoise'
"""
"""
+class DynamicViscosityDto:
+ """
+ A DTO representation of a DynamicViscosity
+
+ Attributes:
+ value (float): The value of the DynamicViscosity.
+ unit (DynamicViscosityUnits): The specific unit that the DynamicViscosity value is representing.
+ """
+
+ def __init__(self, value: float, unit: DynamicViscosityUnits):
+ """
+ Create a new DTO representation of a DynamicViscosity
+
+ Parameters:
+ value (float): The value of the DynamicViscosity.
+ unit (DynamicViscosityUnits): The specific unit that the DynamicViscosity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the DynamicViscosity
+ """
+ self.unit: DynamicViscosityUnits = unit
+ """
+ The specific unit that the DynamicViscosity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a DynamicViscosity DTO JSON object representing the current unit.
+
+ :return: JSON object represents DynamicViscosity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonSecondPerMeterSquared"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of DynamicViscosity DTO from a json representation.
+
+ :param data: The DynamicViscosity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonSecondPerMeterSquared"}
+ :return: A new instance of DynamicViscosityDto.
+ :rtype: DynamicViscosityDto
+ """
+ return DynamicViscosityDto(value=data["value"], unit=DynamicViscosityUnits(data["unit"]))
+
+
class DynamicViscosity(AbstractMeasure):
"""
The dynamic (shear) viscosity of a fluid expresses its resistance to shearing flows, where adjacent layers move parallel to each other with different speeds
@@ -100,6 +150,54 @@ def __init__(self, value: float, from_unit: DynamicViscosityUnits = DynamicVisco
def convert(self, unit: DynamicViscosityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: DynamicViscosityUnits = DynamicViscosityUnits.NewtonSecondPerMeterSquared) -> DynamicViscosityDto:
+ """
+ Get a new instance of DynamicViscosity DTO representing the current unit.
+
+ :param hold_in_unit: The specific DynamicViscosity unit to store the DynamicViscosity value in the DTO representation.
+ :type hold_in_unit: DynamicViscosityUnits
+ :return: A new instance of DynamicViscosityDto.
+ :rtype: DynamicViscosityDto
+ """
+ return DynamicViscosityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: DynamicViscosityUnits = DynamicViscosityUnits.NewtonSecondPerMeterSquared):
+ """
+ Get a DynamicViscosity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific DynamicViscosity unit to store the DynamicViscosity value in the DTO representation.
+ :type hold_in_unit: DynamicViscosityUnits
+ :return: JSON object represents DynamicViscosity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonSecondPerMeterSquared"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(dynamic_viscosity_dto: DynamicViscosityDto):
+ """
+ Obtain a new instance of DynamicViscosity from a DTO unit object.
+
+ :param dynamic_viscosity_dto: The DynamicViscosity DTO representation.
+ :type dynamic_viscosity_dto: DynamicViscosityDto
+ :return: A new instance of DynamicViscosity.
+ :rtype: DynamicViscosity
+ """
+ return DynamicViscosity(dynamic_viscosity_dto.value, dynamic_viscosity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of DynamicViscosity from a DTO unit json representation.
+
+ :param data: The DynamicViscosity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonSecondPerMeterSquared"}
+ :return: A new instance of DynamicViscosity.
+ :rtype: DynamicViscosity
+ """
+ return DynamicViscosity.from_dto(DynamicViscosityDto.from_json(data))
+
def __convert_from_base(self, from_unit: DynamicViscosityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_admittance.py b/unitsnet_py/units/electric_admittance.py
index 6944e2d..8ae14dd 100644
--- a/unitsnet_py/units/electric_admittance.py
+++ b/unitsnet_py/units/electric_admittance.py
@@ -10,27 +10,77 @@ class ElectricAdmittanceUnits(Enum):
ElectricAdmittanceUnits enumeration
"""
- Siemens = 'siemens'
+ Siemens = 'Siemens'
"""
"""
- Nanosiemens = 'nanosiemens'
+ Nanosiemens = 'Nanosiemens'
"""
"""
- Microsiemens = 'microsiemens'
+ Microsiemens = 'Microsiemens'
"""
"""
- Millisiemens = 'millisiemens'
+ Millisiemens = 'Millisiemens'
"""
"""
+class ElectricAdmittanceDto:
+ """
+ A DTO representation of a ElectricAdmittance
+
+ Attributes:
+ value (float): The value of the ElectricAdmittance.
+ unit (ElectricAdmittanceUnits): The specific unit that the ElectricAdmittance value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricAdmittanceUnits):
+ """
+ Create a new DTO representation of a ElectricAdmittance
+
+ Parameters:
+ value (float): The value of the ElectricAdmittance.
+ unit (ElectricAdmittanceUnits): The specific unit that the ElectricAdmittance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricAdmittance
+ """
+ self.unit: ElectricAdmittanceUnits = unit
+ """
+ The specific unit that the ElectricAdmittance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricAdmittance DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricAdmittance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Siemens"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricAdmittance DTO from a json representation.
+
+ :param data: The ElectricAdmittance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Siemens"}
+ :return: A new instance of ElectricAdmittanceDto.
+ :rtype: ElectricAdmittanceDto
+ """
+ return ElectricAdmittanceDto(value=data["value"], unit=ElectricAdmittanceUnits(data["unit"]))
+
+
class ElectricAdmittance(AbstractMeasure):
"""
Electric admittance is a measure of how easily a circuit or device will allow a current to flow. It is defined as the inverse of impedance. The SI unit of admittance is the siemens (symbol S).
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: ElectricAdmittanceUnits = ElectricAd
def convert(self, unit: ElectricAdmittanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricAdmittanceUnits = ElectricAdmittanceUnits.Siemens) -> ElectricAdmittanceDto:
+ """
+ Get a new instance of ElectricAdmittance DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricAdmittance unit to store the ElectricAdmittance value in the DTO representation.
+ :type hold_in_unit: ElectricAdmittanceUnits
+ :return: A new instance of ElectricAdmittanceDto.
+ :rtype: ElectricAdmittanceDto
+ """
+ return ElectricAdmittanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricAdmittanceUnits = ElectricAdmittanceUnits.Siemens):
+ """
+ Get a ElectricAdmittance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricAdmittance unit to store the ElectricAdmittance value in the DTO representation.
+ :type hold_in_unit: ElectricAdmittanceUnits
+ :return: JSON object represents ElectricAdmittance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Siemens"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_admittance_dto: ElectricAdmittanceDto):
+ """
+ Obtain a new instance of ElectricAdmittance from a DTO unit object.
+
+ :param electric_admittance_dto: The ElectricAdmittance DTO representation.
+ :type electric_admittance_dto: ElectricAdmittanceDto
+ :return: A new instance of ElectricAdmittance.
+ :rtype: ElectricAdmittance
+ """
+ return ElectricAdmittance(electric_admittance_dto.value, electric_admittance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricAdmittance from a DTO unit json representation.
+
+ :param data: The ElectricAdmittance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Siemens"}
+ :return: A new instance of ElectricAdmittance.
+ :rtype: ElectricAdmittance
+ """
+ return ElectricAdmittance.from_dto(ElectricAdmittanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricAdmittanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_charge.py b/unitsnet_py/units/electric_charge.py
index afd1d49..3f14018 100644
--- a/unitsnet_py/units/electric_charge.py
+++ b/unitsnet_py/units/electric_charge.py
@@ -10,62 +10,112 @@ class ElectricChargeUnits(Enum):
ElectricChargeUnits enumeration
"""
- Coulomb = 'coulomb'
+ Coulomb = 'Coulomb'
"""
"""
- AmpereHour = 'ampere_hour'
+ AmpereHour = 'AmpereHour'
"""
"""
- Picocoulomb = 'picocoulomb'
+ Picocoulomb = 'Picocoulomb'
"""
"""
- Nanocoulomb = 'nanocoulomb'
+ Nanocoulomb = 'Nanocoulomb'
"""
"""
- Microcoulomb = 'microcoulomb'
+ Microcoulomb = 'Microcoulomb'
"""
"""
- Millicoulomb = 'millicoulomb'
+ Millicoulomb = 'Millicoulomb'
"""
"""
- Kilocoulomb = 'kilocoulomb'
+ Kilocoulomb = 'Kilocoulomb'
"""
"""
- Megacoulomb = 'megacoulomb'
+ Megacoulomb = 'Megacoulomb'
"""
"""
- MilliampereHour = 'milliampere_hour'
+ MilliampereHour = 'MilliampereHour'
"""
"""
- KiloampereHour = 'kiloampere_hour'
+ KiloampereHour = 'KiloampereHour'
"""
"""
- MegaampereHour = 'megaampere_hour'
+ MegaampereHour = 'MegaampereHour'
"""
"""
+class ElectricChargeDto:
+ """
+ A DTO representation of a ElectricCharge
+
+ Attributes:
+ value (float): The value of the ElectricCharge.
+ unit (ElectricChargeUnits): The specific unit that the ElectricCharge value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricChargeUnits):
+ """
+ Create a new DTO representation of a ElectricCharge
+
+ Parameters:
+ value (float): The value of the ElectricCharge.
+ unit (ElectricChargeUnits): The specific unit that the ElectricCharge value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricCharge
+ """
+ self.unit: ElectricChargeUnits = unit
+ """
+ The specific unit that the ElectricCharge value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricCharge DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricCharge DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Coulomb"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricCharge DTO from a json representation.
+
+ :param data: The ElectricCharge DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Coulomb"}
+ :return: A new instance of ElectricChargeDto.
+ :rtype: ElectricChargeDto
+ """
+ return ElectricChargeDto(value=data["value"], unit=ElectricChargeUnits(data["unit"]))
+
+
class ElectricCharge(AbstractMeasure):
"""
Electric charge is the physical property of matter that causes it to experience a force when placed in an electromagnetic field.
@@ -107,6 +157,54 @@ def __init__(self, value: float, from_unit: ElectricChargeUnits = ElectricCharge
def convert(self, unit: ElectricChargeUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricChargeUnits = ElectricChargeUnits.Coulomb) -> ElectricChargeDto:
+ """
+ Get a new instance of ElectricCharge DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCharge unit to store the ElectricCharge value in the DTO representation.
+ :type hold_in_unit: ElectricChargeUnits
+ :return: A new instance of ElectricChargeDto.
+ :rtype: ElectricChargeDto
+ """
+ return ElectricChargeDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricChargeUnits = ElectricChargeUnits.Coulomb):
+ """
+ Get a ElectricCharge DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCharge unit to store the ElectricCharge value in the DTO representation.
+ :type hold_in_unit: ElectricChargeUnits
+ :return: JSON object represents ElectricCharge DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Coulomb"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_charge_dto: ElectricChargeDto):
+ """
+ Obtain a new instance of ElectricCharge from a DTO unit object.
+
+ :param electric_charge_dto: The ElectricCharge DTO representation.
+ :type electric_charge_dto: ElectricChargeDto
+ :return: A new instance of ElectricCharge.
+ :rtype: ElectricCharge
+ """
+ return ElectricCharge(electric_charge_dto.value, electric_charge_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricCharge from a DTO unit json representation.
+
+ :param data: The ElectricCharge DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Coulomb"}
+ :return: A new instance of ElectricCharge.
+ :rtype: ElectricCharge
+ """
+ return ElectricCharge.from_dto(ElectricChargeDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricChargeUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_charge_density.py b/unitsnet_py/units/electric_charge_density.py
index b274a43..8975871 100644
--- a/unitsnet_py/units/electric_charge_density.py
+++ b/unitsnet_py/units/electric_charge_density.py
@@ -10,12 +10,62 @@ class ElectricChargeDensityUnits(Enum):
ElectricChargeDensityUnits enumeration
"""
- CoulombPerCubicMeter = 'coulomb_per_cubic_meter'
+ CoulombPerCubicMeter = 'CoulombPerCubicMeter'
"""
"""
+class ElectricChargeDensityDto:
+ """
+ A DTO representation of a ElectricChargeDensity
+
+ Attributes:
+ value (float): The value of the ElectricChargeDensity.
+ unit (ElectricChargeDensityUnits): The specific unit that the ElectricChargeDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricChargeDensityUnits):
+ """
+ Create a new DTO representation of a ElectricChargeDensity
+
+ Parameters:
+ value (float): The value of the ElectricChargeDensity.
+ unit (ElectricChargeDensityUnits): The specific unit that the ElectricChargeDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricChargeDensity
+ """
+ self.unit: ElectricChargeDensityUnits = unit
+ """
+ The specific unit that the ElectricChargeDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricChargeDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricChargeDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CoulombPerCubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricChargeDensity DTO from a json representation.
+
+ :param data: The ElectricChargeDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CoulombPerCubicMeter"}
+ :return: A new instance of ElectricChargeDensityDto.
+ :rtype: ElectricChargeDensityDto
+ """
+ return ElectricChargeDensityDto(value=data["value"], unit=ElectricChargeDensityUnits(data["unit"]))
+
+
class ElectricChargeDensity(AbstractMeasure):
"""
In electromagnetism, charge density is a measure of the amount of electric charge per volume.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: ElectricChargeDensityUnits = Electri
def convert(self, unit: ElectricChargeDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricChargeDensityUnits = ElectricChargeDensityUnits.CoulombPerCubicMeter) -> ElectricChargeDensityDto:
+ """
+ Get a new instance of ElectricChargeDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricChargeDensity unit to store the ElectricChargeDensity value in the DTO representation.
+ :type hold_in_unit: ElectricChargeDensityUnits
+ :return: A new instance of ElectricChargeDensityDto.
+ :rtype: ElectricChargeDensityDto
+ """
+ return ElectricChargeDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricChargeDensityUnits = ElectricChargeDensityUnits.CoulombPerCubicMeter):
+ """
+ Get a ElectricChargeDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricChargeDensity unit to store the ElectricChargeDensity value in the DTO representation.
+ :type hold_in_unit: ElectricChargeDensityUnits
+ :return: JSON object represents ElectricChargeDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CoulombPerCubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_charge_density_dto: ElectricChargeDensityDto):
+ """
+ Obtain a new instance of ElectricChargeDensity from a DTO unit object.
+
+ :param electric_charge_density_dto: The ElectricChargeDensity DTO representation.
+ :type electric_charge_density_dto: ElectricChargeDensityDto
+ :return: A new instance of ElectricChargeDensity.
+ :rtype: ElectricChargeDensity
+ """
+ return ElectricChargeDensity(electric_charge_density_dto.value, electric_charge_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricChargeDensity from a DTO unit json representation.
+
+ :param data: The ElectricChargeDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CoulombPerCubicMeter"}
+ :return: A new instance of ElectricChargeDensity.
+ :rtype: ElectricChargeDensity
+ """
+ return ElectricChargeDensity.from_dto(ElectricChargeDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricChargeDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_conductance.py b/unitsnet_py/units/electric_conductance.py
index c04b951..4676df2 100644
--- a/unitsnet_py/units/electric_conductance.py
+++ b/unitsnet_py/units/electric_conductance.py
@@ -10,32 +10,82 @@ class ElectricConductanceUnits(Enum):
ElectricConductanceUnits enumeration
"""
- Siemens = 'siemens'
+ Siemens = 'Siemens'
"""
"""
- Nanosiemens = 'nanosiemens'
+ Nanosiemens = 'Nanosiemens'
"""
"""
- Microsiemens = 'microsiemens'
+ Microsiemens = 'Microsiemens'
"""
"""
- Millisiemens = 'millisiemens'
+ Millisiemens = 'Millisiemens'
"""
"""
- Kilosiemens = 'kilosiemens'
+ Kilosiemens = 'Kilosiemens'
"""
"""
+class ElectricConductanceDto:
+ """
+ A DTO representation of a ElectricConductance
+
+ Attributes:
+ value (float): The value of the ElectricConductance.
+ unit (ElectricConductanceUnits): The specific unit that the ElectricConductance value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricConductanceUnits):
+ """
+ Create a new DTO representation of a ElectricConductance
+
+ Parameters:
+ value (float): The value of the ElectricConductance.
+ unit (ElectricConductanceUnits): The specific unit that the ElectricConductance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricConductance
+ """
+ self.unit: ElectricConductanceUnits = unit
+ """
+ The specific unit that the ElectricConductance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricConductance DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricConductance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Siemens"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricConductance DTO from a json representation.
+
+ :param data: The ElectricConductance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Siemens"}
+ :return: A new instance of ElectricConductanceDto.
+ :rtype: ElectricConductanceDto
+ """
+ return ElectricConductanceDto(value=data["value"], unit=ElectricConductanceUnits(data["unit"]))
+
+
class ElectricConductance(AbstractMeasure):
"""
The electrical conductance of an electrical conductor is a measure of the easeness to pass an electric current through that conductor.
@@ -65,6 +115,54 @@ def __init__(self, value: float, from_unit: ElectricConductanceUnits = ElectricC
def convert(self, unit: ElectricConductanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricConductanceUnits = ElectricConductanceUnits.Siemens) -> ElectricConductanceDto:
+ """
+ Get a new instance of ElectricConductance DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricConductance unit to store the ElectricConductance value in the DTO representation.
+ :type hold_in_unit: ElectricConductanceUnits
+ :return: A new instance of ElectricConductanceDto.
+ :rtype: ElectricConductanceDto
+ """
+ return ElectricConductanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricConductanceUnits = ElectricConductanceUnits.Siemens):
+ """
+ Get a ElectricConductance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricConductance unit to store the ElectricConductance value in the DTO representation.
+ :type hold_in_unit: ElectricConductanceUnits
+ :return: JSON object represents ElectricConductance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Siemens"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_conductance_dto: ElectricConductanceDto):
+ """
+ Obtain a new instance of ElectricConductance from a DTO unit object.
+
+ :param electric_conductance_dto: The ElectricConductance DTO representation.
+ :type electric_conductance_dto: ElectricConductanceDto
+ :return: A new instance of ElectricConductance.
+ :rtype: ElectricConductance
+ """
+ return ElectricConductance(electric_conductance_dto.value, electric_conductance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricConductance from a DTO unit json representation.
+
+ :param data: The ElectricConductance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Siemens"}
+ :return: A new instance of ElectricConductance.
+ :rtype: ElectricConductance
+ """
+ return ElectricConductance.from_dto(ElectricConductanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricConductanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_conductivity.py b/unitsnet_py/units/electric_conductivity.py
index 0b48d52..685717f 100644
--- a/unitsnet_py/units/electric_conductivity.py
+++ b/unitsnet_py/units/electric_conductivity.py
@@ -10,37 +10,87 @@ class ElectricConductivityUnits(Enum):
ElectricConductivityUnits enumeration
"""
- SiemensPerMeter = 'siemens_per_meter'
+ SiemensPerMeter = 'SiemensPerMeter'
"""
"""
- SiemensPerInch = 'siemens_per_inch'
+ SiemensPerInch = 'SiemensPerInch'
"""
"""
- SiemensPerFoot = 'siemens_per_foot'
+ SiemensPerFoot = 'SiemensPerFoot'
"""
"""
- SiemensPerCentimeter = 'siemens_per_centimeter'
+ SiemensPerCentimeter = 'SiemensPerCentimeter'
"""
"""
- MicrosiemensPerCentimeter = 'microsiemens_per_centimeter'
+ MicrosiemensPerCentimeter = 'MicrosiemensPerCentimeter'
"""
"""
- MillisiemensPerCentimeter = 'millisiemens_per_centimeter'
+ MillisiemensPerCentimeter = 'MillisiemensPerCentimeter'
"""
"""
+class ElectricConductivityDto:
+ """
+ A DTO representation of a ElectricConductivity
+
+ Attributes:
+ value (float): The value of the ElectricConductivity.
+ unit (ElectricConductivityUnits): The specific unit that the ElectricConductivity value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricConductivityUnits):
+ """
+ Create a new DTO representation of a ElectricConductivity
+
+ Parameters:
+ value (float): The value of the ElectricConductivity.
+ unit (ElectricConductivityUnits): The specific unit that the ElectricConductivity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricConductivity
+ """
+ self.unit: ElectricConductivityUnits = unit
+ """
+ The specific unit that the ElectricConductivity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricConductivity DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricConductivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SiemensPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricConductivity DTO from a json representation.
+
+ :param data: The ElectricConductivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SiemensPerMeter"}
+ :return: A new instance of ElectricConductivityDto.
+ :rtype: ElectricConductivityDto
+ """
+ return ElectricConductivityDto(value=data["value"], unit=ElectricConductivityUnits(data["unit"]))
+
+
class ElectricConductivity(AbstractMeasure):
"""
Electrical conductivity or specific conductance is the reciprocal of electrical resistivity, and measures a material's ability to conduct an electric current.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: ElectricConductivityUnits = Electric
def convert(self, unit: ElectricConductivityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricConductivityUnits = ElectricConductivityUnits.SiemensPerMeter) -> ElectricConductivityDto:
+ """
+ Get a new instance of ElectricConductivity DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricConductivity unit to store the ElectricConductivity value in the DTO representation.
+ :type hold_in_unit: ElectricConductivityUnits
+ :return: A new instance of ElectricConductivityDto.
+ :rtype: ElectricConductivityDto
+ """
+ return ElectricConductivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricConductivityUnits = ElectricConductivityUnits.SiemensPerMeter):
+ """
+ Get a ElectricConductivity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricConductivity unit to store the ElectricConductivity value in the DTO representation.
+ :type hold_in_unit: ElectricConductivityUnits
+ :return: JSON object represents ElectricConductivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SiemensPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_conductivity_dto: ElectricConductivityDto):
+ """
+ Obtain a new instance of ElectricConductivity from a DTO unit object.
+
+ :param electric_conductivity_dto: The ElectricConductivity DTO representation.
+ :type electric_conductivity_dto: ElectricConductivityDto
+ :return: A new instance of ElectricConductivity.
+ :rtype: ElectricConductivity
+ """
+ return ElectricConductivity(electric_conductivity_dto.value, electric_conductivity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricConductivity from a DTO unit json representation.
+
+ :param data: The ElectricConductivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SiemensPerMeter"}
+ :return: A new instance of ElectricConductivity.
+ :rtype: ElectricConductivity
+ """
+ return ElectricConductivity.from_dto(ElectricConductivityDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricConductivityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_current.py b/unitsnet_py/units/electric_current.py
index 412befa..c96e6a3 100644
--- a/unitsnet_py/units/electric_current.py
+++ b/unitsnet_py/units/electric_current.py
@@ -10,52 +10,102 @@ class ElectricCurrentUnits(Enum):
ElectricCurrentUnits enumeration
"""
- Ampere = 'ampere'
+ Ampere = 'Ampere'
"""
"""
- Femtoampere = 'femtoampere'
+ Femtoampere = 'Femtoampere'
"""
"""
- Picoampere = 'picoampere'
+ Picoampere = 'Picoampere'
"""
"""
- Nanoampere = 'nanoampere'
+ Nanoampere = 'Nanoampere'
"""
"""
- Microampere = 'microampere'
+ Microampere = 'Microampere'
"""
"""
- Milliampere = 'milliampere'
+ Milliampere = 'Milliampere'
"""
"""
- Centiampere = 'centiampere'
+ Centiampere = 'Centiampere'
"""
"""
- Kiloampere = 'kiloampere'
+ Kiloampere = 'Kiloampere'
"""
"""
- Megaampere = 'megaampere'
+ Megaampere = 'Megaampere'
"""
"""
+class ElectricCurrentDto:
+ """
+ A DTO representation of a ElectricCurrent
+
+ Attributes:
+ value (float): The value of the ElectricCurrent.
+ unit (ElectricCurrentUnits): The specific unit that the ElectricCurrent value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricCurrentUnits):
+ """
+ Create a new DTO representation of a ElectricCurrent
+
+ Parameters:
+ value (float): The value of the ElectricCurrent.
+ unit (ElectricCurrentUnits): The specific unit that the ElectricCurrent value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricCurrent
+ """
+ self.unit: ElectricCurrentUnits = unit
+ """
+ The specific unit that the ElectricCurrent value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricCurrent DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricCurrent DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Ampere"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricCurrent DTO from a json representation.
+
+ :param data: The ElectricCurrent DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Ampere"}
+ :return: A new instance of ElectricCurrentDto.
+ :rtype: ElectricCurrentDto
+ """
+ return ElectricCurrentDto(value=data["value"], unit=ElectricCurrentUnits(data["unit"]))
+
+
class ElectricCurrent(AbstractMeasure):
"""
An electric current is a flow of electric charge. In electric circuits this charge is often carried by moving electrons in a wire. It can also be carried by ions in an electrolyte, or by both ions and electrons such as in a plasma.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: ElectricCurrentUnits = ElectricCurre
def convert(self, unit: ElectricCurrentUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricCurrentUnits = ElectricCurrentUnits.Ampere) -> ElectricCurrentDto:
+ """
+ Get a new instance of ElectricCurrent DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCurrent unit to store the ElectricCurrent value in the DTO representation.
+ :type hold_in_unit: ElectricCurrentUnits
+ :return: A new instance of ElectricCurrentDto.
+ :rtype: ElectricCurrentDto
+ """
+ return ElectricCurrentDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricCurrentUnits = ElectricCurrentUnits.Ampere):
+ """
+ Get a ElectricCurrent DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCurrent unit to store the ElectricCurrent value in the DTO representation.
+ :type hold_in_unit: ElectricCurrentUnits
+ :return: JSON object represents ElectricCurrent DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Ampere"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_current_dto: ElectricCurrentDto):
+ """
+ Obtain a new instance of ElectricCurrent from a DTO unit object.
+
+ :param electric_current_dto: The ElectricCurrent DTO representation.
+ :type electric_current_dto: ElectricCurrentDto
+ :return: A new instance of ElectricCurrent.
+ :rtype: ElectricCurrent
+ """
+ return ElectricCurrent(electric_current_dto.value, electric_current_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricCurrent from a DTO unit json representation.
+
+ :param data: The ElectricCurrent DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Ampere"}
+ :return: A new instance of ElectricCurrent.
+ :rtype: ElectricCurrent
+ """
+ return ElectricCurrent.from_dto(ElectricCurrentDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricCurrentUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_current_density.py b/unitsnet_py/units/electric_current_density.py
index 1b4d098..a06c12e 100644
--- a/unitsnet_py/units/electric_current_density.py
+++ b/unitsnet_py/units/electric_current_density.py
@@ -10,22 +10,72 @@ class ElectricCurrentDensityUnits(Enum):
ElectricCurrentDensityUnits enumeration
"""
- AmperePerSquareMeter = 'ampere_per_square_meter'
+ AmperePerSquareMeter = 'AmperePerSquareMeter'
"""
"""
- AmperePerSquareInch = 'ampere_per_square_inch'
+ AmperePerSquareInch = 'AmperePerSquareInch'
"""
"""
- AmperePerSquareFoot = 'ampere_per_square_foot'
+ AmperePerSquareFoot = 'AmperePerSquareFoot'
"""
"""
+class ElectricCurrentDensityDto:
+ """
+ A DTO representation of a ElectricCurrentDensity
+
+ Attributes:
+ value (float): The value of the ElectricCurrentDensity.
+ unit (ElectricCurrentDensityUnits): The specific unit that the ElectricCurrentDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricCurrentDensityUnits):
+ """
+ Create a new DTO representation of a ElectricCurrentDensity
+
+ Parameters:
+ value (float): The value of the ElectricCurrentDensity.
+ unit (ElectricCurrentDensityUnits): The specific unit that the ElectricCurrentDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricCurrentDensity
+ """
+ self.unit: ElectricCurrentDensityUnits = unit
+ """
+ The specific unit that the ElectricCurrentDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricCurrentDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricCurrentDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "AmperePerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricCurrentDensity DTO from a json representation.
+
+ :param data: The ElectricCurrentDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "AmperePerSquareMeter"}
+ :return: A new instance of ElectricCurrentDensityDto.
+ :rtype: ElectricCurrentDensityDto
+ """
+ return ElectricCurrentDensityDto(value=data["value"], unit=ElectricCurrentDensityUnits(data["unit"]))
+
+
class ElectricCurrentDensity(AbstractMeasure):
"""
In electromagnetism, current density is the electric current per unit area of cross section.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: ElectricCurrentDensityUnits = Electr
def convert(self, unit: ElectricCurrentDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricCurrentDensityUnits = ElectricCurrentDensityUnits.AmperePerSquareMeter) -> ElectricCurrentDensityDto:
+ """
+ Get a new instance of ElectricCurrentDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCurrentDensity unit to store the ElectricCurrentDensity value in the DTO representation.
+ :type hold_in_unit: ElectricCurrentDensityUnits
+ :return: A new instance of ElectricCurrentDensityDto.
+ :rtype: ElectricCurrentDensityDto
+ """
+ return ElectricCurrentDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricCurrentDensityUnits = ElectricCurrentDensityUnits.AmperePerSquareMeter):
+ """
+ Get a ElectricCurrentDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCurrentDensity unit to store the ElectricCurrentDensity value in the DTO representation.
+ :type hold_in_unit: ElectricCurrentDensityUnits
+ :return: JSON object represents ElectricCurrentDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "AmperePerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_current_density_dto: ElectricCurrentDensityDto):
+ """
+ Obtain a new instance of ElectricCurrentDensity from a DTO unit object.
+
+ :param electric_current_density_dto: The ElectricCurrentDensity DTO representation.
+ :type electric_current_density_dto: ElectricCurrentDensityDto
+ :return: A new instance of ElectricCurrentDensity.
+ :rtype: ElectricCurrentDensity
+ """
+ return ElectricCurrentDensity(electric_current_density_dto.value, electric_current_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricCurrentDensity from a DTO unit json representation.
+
+ :param data: The ElectricCurrentDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "AmperePerSquareMeter"}
+ :return: A new instance of ElectricCurrentDensity.
+ :rtype: ElectricCurrentDensity
+ """
+ return ElectricCurrentDensity.from_dto(ElectricCurrentDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricCurrentDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_current_gradient.py b/unitsnet_py/units/electric_current_gradient.py
index 0d6762e..7a05a87 100644
--- a/unitsnet_py/units/electric_current_gradient.py
+++ b/unitsnet_py/units/electric_current_gradient.py
@@ -10,42 +10,92 @@ class ElectricCurrentGradientUnits(Enum):
ElectricCurrentGradientUnits enumeration
"""
- AmperePerSecond = 'ampere_per_second'
+ AmperePerSecond = 'AmperePerSecond'
"""
"""
- AmperePerMinute = 'ampere_per_minute'
+ AmperePerMinute = 'AmperePerMinute'
"""
"""
- AmperePerMillisecond = 'ampere_per_millisecond'
+ AmperePerMillisecond = 'AmperePerMillisecond'
"""
"""
- AmperePerMicrosecond = 'ampere_per_microsecond'
+ AmperePerMicrosecond = 'AmperePerMicrosecond'
"""
"""
- AmperePerNanosecond = 'ampere_per_nanosecond'
+ AmperePerNanosecond = 'AmperePerNanosecond'
"""
"""
- MilliamperePerSecond = 'milliampere_per_second'
+ MilliamperePerSecond = 'MilliamperePerSecond'
"""
"""
- MilliamperePerMinute = 'milliampere_per_minute'
+ MilliamperePerMinute = 'MilliamperePerMinute'
"""
"""
+class ElectricCurrentGradientDto:
+ """
+ A DTO representation of a ElectricCurrentGradient
+
+ Attributes:
+ value (float): The value of the ElectricCurrentGradient.
+ unit (ElectricCurrentGradientUnits): The specific unit that the ElectricCurrentGradient value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricCurrentGradientUnits):
+ """
+ Create a new DTO representation of a ElectricCurrentGradient
+
+ Parameters:
+ value (float): The value of the ElectricCurrentGradient.
+ unit (ElectricCurrentGradientUnits): The specific unit that the ElectricCurrentGradient value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricCurrentGradient
+ """
+ self.unit: ElectricCurrentGradientUnits = unit
+ """
+ The specific unit that the ElectricCurrentGradient value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricCurrentGradient DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricCurrentGradient DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "AmperePerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricCurrentGradient DTO from a json representation.
+
+ :param data: The ElectricCurrentGradient DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "AmperePerSecond"}
+ :return: A new instance of ElectricCurrentGradientDto.
+ :rtype: ElectricCurrentGradientDto
+ """
+ return ElectricCurrentGradientDto(value=data["value"], unit=ElectricCurrentGradientUnits(data["unit"]))
+
+
class ElectricCurrentGradient(AbstractMeasure):
"""
In electromagnetism, the current gradient describes how the current changes in time.
@@ -79,6 +129,54 @@ def __init__(self, value: float, from_unit: ElectricCurrentGradientUnits = Elect
def convert(self, unit: ElectricCurrentGradientUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricCurrentGradientUnits = ElectricCurrentGradientUnits.AmperePerSecond) -> ElectricCurrentGradientDto:
+ """
+ Get a new instance of ElectricCurrentGradient DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCurrentGradient unit to store the ElectricCurrentGradient value in the DTO representation.
+ :type hold_in_unit: ElectricCurrentGradientUnits
+ :return: A new instance of ElectricCurrentGradientDto.
+ :rtype: ElectricCurrentGradientDto
+ """
+ return ElectricCurrentGradientDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricCurrentGradientUnits = ElectricCurrentGradientUnits.AmperePerSecond):
+ """
+ Get a ElectricCurrentGradient DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricCurrentGradient unit to store the ElectricCurrentGradient value in the DTO representation.
+ :type hold_in_unit: ElectricCurrentGradientUnits
+ :return: JSON object represents ElectricCurrentGradient DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "AmperePerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_current_gradient_dto: ElectricCurrentGradientDto):
+ """
+ Obtain a new instance of ElectricCurrentGradient from a DTO unit object.
+
+ :param electric_current_gradient_dto: The ElectricCurrentGradient DTO representation.
+ :type electric_current_gradient_dto: ElectricCurrentGradientDto
+ :return: A new instance of ElectricCurrentGradient.
+ :rtype: ElectricCurrentGradient
+ """
+ return ElectricCurrentGradient(electric_current_gradient_dto.value, electric_current_gradient_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricCurrentGradient from a DTO unit json representation.
+
+ :param data: The ElectricCurrentGradient DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "AmperePerSecond"}
+ :return: A new instance of ElectricCurrentGradient.
+ :rtype: ElectricCurrentGradient
+ """
+ return ElectricCurrentGradient.from_dto(ElectricCurrentGradientDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricCurrentGradientUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_field.py b/unitsnet_py/units/electric_field.py
index db74b4f..2e23fde 100644
--- a/unitsnet_py/units/electric_field.py
+++ b/unitsnet_py/units/electric_field.py
@@ -10,12 +10,62 @@ class ElectricFieldUnits(Enum):
ElectricFieldUnits enumeration
"""
- VoltPerMeter = 'volt_per_meter'
+ VoltPerMeter = 'VoltPerMeter'
"""
"""
+class ElectricFieldDto:
+ """
+ A DTO representation of a ElectricField
+
+ Attributes:
+ value (float): The value of the ElectricField.
+ unit (ElectricFieldUnits): The specific unit that the ElectricField value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricFieldUnits):
+ """
+ Create a new DTO representation of a ElectricField
+
+ Parameters:
+ value (float): The value of the ElectricField.
+ unit (ElectricFieldUnits): The specific unit that the ElectricField value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricField
+ """
+ self.unit: ElectricFieldUnits = unit
+ """
+ The specific unit that the ElectricField value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricField DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricField DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricField DTO from a json representation.
+
+ :param data: The ElectricField DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltPerMeter"}
+ :return: A new instance of ElectricFieldDto.
+ :rtype: ElectricFieldDto
+ """
+ return ElectricFieldDto(value=data["value"], unit=ElectricFieldUnits(data["unit"]))
+
+
class ElectricField(AbstractMeasure):
"""
An electric field is a force field that surrounds electric charges that attracts or repels other electric charges.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: ElectricFieldUnits = ElectricFieldUn
def convert(self, unit: ElectricFieldUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricFieldUnits = ElectricFieldUnits.VoltPerMeter) -> ElectricFieldDto:
+ """
+ Get a new instance of ElectricField DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricField unit to store the ElectricField value in the DTO representation.
+ :type hold_in_unit: ElectricFieldUnits
+ :return: A new instance of ElectricFieldDto.
+ :rtype: ElectricFieldDto
+ """
+ return ElectricFieldDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricFieldUnits = ElectricFieldUnits.VoltPerMeter):
+ """
+ Get a ElectricField DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricField unit to store the ElectricField value in the DTO representation.
+ :type hold_in_unit: ElectricFieldUnits
+ :return: JSON object represents ElectricField DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_field_dto: ElectricFieldDto):
+ """
+ Obtain a new instance of ElectricField from a DTO unit object.
+
+ :param electric_field_dto: The ElectricField DTO representation.
+ :type electric_field_dto: ElectricFieldDto
+ :return: A new instance of ElectricField.
+ :rtype: ElectricField
+ """
+ return ElectricField(electric_field_dto.value, electric_field_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricField from a DTO unit json representation.
+
+ :param data: The ElectricField DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltPerMeter"}
+ :return: A new instance of ElectricField.
+ :rtype: ElectricField
+ """
+ return ElectricField.from_dto(ElectricFieldDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricFieldUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_inductance.py b/unitsnet_py/units/electric_inductance.py
index c7c9306..32b2f74 100644
--- a/unitsnet_py/units/electric_inductance.py
+++ b/unitsnet_py/units/electric_inductance.py
@@ -10,32 +10,82 @@ class ElectricInductanceUnits(Enum):
ElectricInductanceUnits enumeration
"""
- Henry = 'henry'
+ Henry = 'Henry'
"""
"""
- Picohenry = 'picohenry'
+ Picohenry = 'Picohenry'
"""
"""
- Nanohenry = 'nanohenry'
+ Nanohenry = 'Nanohenry'
"""
"""
- Microhenry = 'microhenry'
+ Microhenry = 'Microhenry'
"""
"""
- Millihenry = 'millihenry'
+ Millihenry = 'Millihenry'
"""
"""
+class ElectricInductanceDto:
+ """
+ A DTO representation of a ElectricInductance
+
+ Attributes:
+ value (float): The value of the ElectricInductance.
+ unit (ElectricInductanceUnits): The specific unit that the ElectricInductance value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricInductanceUnits):
+ """
+ Create a new DTO representation of a ElectricInductance
+
+ Parameters:
+ value (float): The value of the ElectricInductance.
+ unit (ElectricInductanceUnits): The specific unit that the ElectricInductance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricInductance
+ """
+ self.unit: ElectricInductanceUnits = unit
+ """
+ The specific unit that the ElectricInductance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricInductance DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricInductance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Henry"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricInductance DTO from a json representation.
+
+ :param data: The ElectricInductance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Henry"}
+ :return: A new instance of ElectricInductanceDto.
+ :rtype: ElectricInductanceDto
+ """
+ return ElectricInductanceDto(value=data["value"], unit=ElectricInductanceUnits(data["unit"]))
+
+
class ElectricInductance(AbstractMeasure):
"""
Inductance is a property of an electrical conductor which opposes a change in current.
@@ -65,6 +115,54 @@ def __init__(self, value: float, from_unit: ElectricInductanceUnits = ElectricIn
def convert(self, unit: ElectricInductanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricInductanceUnits = ElectricInductanceUnits.Henry) -> ElectricInductanceDto:
+ """
+ Get a new instance of ElectricInductance DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricInductance unit to store the ElectricInductance value in the DTO representation.
+ :type hold_in_unit: ElectricInductanceUnits
+ :return: A new instance of ElectricInductanceDto.
+ :rtype: ElectricInductanceDto
+ """
+ return ElectricInductanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricInductanceUnits = ElectricInductanceUnits.Henry):
+ """
+ Get a ElectricInductance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricInductance unit to store the ElectricInductance value in the DTO representation.
+ :type hold_in_unit: ElectricInductanceUnits
+ :return: JSON object represents ElectricInductance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Henry"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_inductance_dto: ElectricInductanceDto):
+ """
+ Obtain a new instance of ElectricInductance from a DTO unit object.
+
+ :param electric_inductance_dto: The ElectricInductance DTO representation.
+ :type electric_inductance_dto: ElectricInductanceDto
+ :return: A new instance of ElectricInductance.
+ :rtype: ElectricInductance
+ """
+ return ElectricInductance(electric_inductance_dto.value, electric_inductance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricInductance from a DTO unit json representation.
+
+ :param data: The ElectricInductance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Henry"}
+ :return: A new instance of ElectricInductance.
+ :rtype: ElectricInductance
+ """
+ return ElectricInductance.from_dto(ElectricInductanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricInductanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_potential.py b/unitsnet_py/units/electric_potential.py
index 30f8485..bb31c9c 100644
--- a/unitsnet_py/units/electric_potential.py
+++ b/unitsnet_py/units/electric_potential.py
@@ -10,37 +10,87 @@ class ElectricPotentialUnits(Enum):
ElectricPotentialUnits enumeration
"""
- Volt = 'volt'
+ Volt = 'Volt'
"""
"""
- Nanovolt = 'nanovolt'
+ Nanovolt = 'Nanovolt'
"""
"""
- Microvolt = 'microvolt'
+ Microvolt = 'Microvolt'
"""
"""
- Millivolt = 'millivolt'
+ Millivolt = 'Millivolt'
"""
"""
- Kilovolt = 'kilovolt'
+ Kilovolt = 'Kilovolt'
"""
"""
- Megavolt = 'megavolt'
+ Megavolt = 'Megavolt'
"""
"""
+class ElectricPotentialDto:
+ """
+ A DTO representation of a ElectricPotential
+
+ Attributes:
+ value (float): The value of the ElectricPotential.
+ unit (ElectricPotentialUnits): The specific unit that the ElectricPotential value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricPotentialUnits):
+ """
+ Create a new DTO representation of a ElectricPotential
+
+ Parameters:
+ value (float): The value of the ElectricPotential.
+ unit (ElectricPotentialUnits): The specific unit that the ElectricPotential value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricPotential
+ """
+ self.unit: ElectricPotentialUnits = unit
+ """
+ The specific unit that the ElectricPotential value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricPotential DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricPotential DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Volt"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricPotential DTO from a json representation.
+
+ :param data: The ElectricPotential DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Volt"}
+ :return: A new instance of ElectricPotentialDto.
+ :rtype: ElectricPotentialDto
+ """
+ return ElectricPotentialDto(value=data["value"], unit=ElectricPotentialUnits(data["unit"]))
+
+
class ElectricPotential(AbstractMeasure):
"""
In classical electromagnetism, the electric potential (a scalar quantity denoted by Φ, ΦE or V and also called the electric field potential or the electrostatic potential) at a point is the amount of electric potential energy that a unitary point charge would have when located at that point.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: ElectricPotentialUnits = ElectricPot
def convert(self, unit: ElectricPotentialUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricPotentialUnits = ElectricPotentialUnits.Volt) -> ElectricPotentialDto:
+ """
+ Get a new instance of ElectricPotential DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotential unit to store the ElectricPotential value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialUnits
+ :return: A new instance of ElectricPotentialDto.
+ :rtype: ElectricPotentialDto
+ """
+ return ElectricPotentialDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricPotentialUnits = ElectricPotentialUnits.Volt):
+ """
+ Get a ElectricPotential DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotential unit to store the ElectricPotential value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialUnits
+ :return: JSON object represents ElectricPotential DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Volt"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_potential_dto: ElectricPotentialDto):
+ """
+ Obtain a new instance of ElectricPotential from a DTO unit object.
+
+ :param electric_potential_dto: The ElectricPotential DTO representation.
+ :type electric_potential_dto: ElectricPotentialDto
+ :return: A new instance of ElectricPotential.
+ :rtype: ElectricPotential
+ """
+ return ElectricPotential(electric_potential_dto.value, electric_potential_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricPotential from a DTO unit json representation.
+
+ :param data: The ElectricPotential DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Volt"}
+ :return: A new instance of ElectricPotential.
+ :rtype: ElectricPotential
+ """
+ return ElectricPotential.from_dto(ElectricPotentialDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricPotentialUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_potential_ac.py b/unitsnet_py/units/electric_potential_ac.py
index 48da5a0..b24c8c4 100644
--- a/unitsnet_py/units/electric_potential_ac.py
+++ b/unitsnet_py/units/electric_potential_ac.py
@@ -10,32 +10,82 @@ class ElectricPotentialAcUnits(Enum):
ElectricPotentialAcUnits enumeration
"""
- VoltAc = 'volt_ac'
+ VoltAc = 'VoltAc'
"""
"""
- MicrovoltAc = 'microvolt_ac'
+ MicrovoltAc = 'MicrovoltAc'
"""
"""
- MillivoltAc = 'millivolt_ac'
+ MillivoltAc = 'MillivoltAc'
"""
"""
- KilovoltAc = 'kilovolt_ac'
+ KilovoltAc = 'KilovoltAc'
"""
"""
- MegavoltAc = 'megavolt_ac'
+ MegavoltAc = 'MegavoltAc'
"""
"""
+class ElectricPotentialAcDto:
+ """
+ A DTO representation of a ElectricPotentialAc
+
+ Attributes:
+ value (float): The value of the ElectricPotentialAc.
+ unit (ElectricPotentialAcUnits): The specific unit that the ElectricPotentialAc value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricPotentialAcUnits):
+ """
+ Create a new DTO representation of a ElectricPotentialAc
+
+ Parameters:
+ value (float): The value of the ElectricPotentialAc.
+ unit (ElectricPotentialAcUnits): The specific unit that the ElectricPotentialAc value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricPotentialAc
+ """
+ self.unit: ElectricPotentialAcUnits = unit
+ """
+ The specific unit that the ElectricPotentialAc value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricPotentialAc DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricPotentialAc DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltAc"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricPotentialAc DTO from a json representation.
+
+ :param data: The ElectricPotentialAc DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltAc"}
+ :return: A new instance of ElectricPotentialAcDto.
+ :rtype: ElectricPotentialAcDto
+ """
+ return ElectricPotentialAcDto(value=data["value"], unit=ElectricPotentialAcUnits(data["unit"]))
+
+
class ElectricPotentialAc(AbstractMeasure):
"""
The Electric Potential of a system known to use Alternating Current.
@@ -65,6 +115,54 @@ def __init__(self, value: float, from_unit: ElectricPotentialAcUnits = ElectricP
def convert(self, unit: ElectricPotentialAcUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricPotentialAcUnits = ElectricPotentialAcUnits.VoltAc) -> ElectricPotentialAcDto:
+ """
+ Get a new instance of ElectricPotentialAc DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotentialAc unit to store the ElectricPotentialAc value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialAcUnits
+ :return: A new instance of ElectricPotentialAcDto.
+ :rtype: ElectricPotentialAcDto
+ """
+ return ElectricPotentialAcDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricPotentialAcUnits = ElectricPotentialAcUnits.VoltAc):
+ """
+ Get a ElectricPotentialAc DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotentialAc unit to store the ElectricPotentialAc value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialAcUnits
+ :return: JSON object represents ElectricPotentialAc DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltAc"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_potential_ac_dto: ElectricPotentialAcDto):
+ """
+ Obtain a new instance of ElectricPotentialAc from a DTO unit object.
+
+ :param electric_potential_ac_dto: The ElectricPotentialAc DTO representation.
+ :type electric_potential_ac_dto: ElectricPotentialAcDto
+ :return: A new instance of ElectricPotentialAc.
+ :rtype: ElectricPotentialAc
+ """
+ return ElectricPotentialAc(electric_potential_ac_dto.value, electric_potential_ac_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricPotentialAc from a DTO unit json representation.
+
+ :param data: The ElectricPotentialAc DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltAc"}
+ :return: A new instance of ElectricPotentialAc.
+ :rtype: ElectricPotentialAc
+ """
+ return ElectricPotentialAc.from_dto(ElectricPotentialAcDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricPotentialAcUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_potential_change_rate.py b/unitsnet_py/units/electric_potential_change_rate.py
index 8049d82..6a2d526 100644
--- a/unitsnet_py/units/electric_potential_change_rate.py
+++ b/unitsnet_py/units/electric_potential_change_rate.py
@@ -10,107 +10,157 @@ class ElectricPotentialChangeRateUnits(Enum):
ElectricPotentialChangeRateUnits enumeration
"""
- VoltPerSecond = 'volt_per_second'
+ VoltPerSecond = 'VoltPerSecond'
"""
"""
- VoltPerMicrosecond = 'volt_per_microsecond'
+ VoltPerMicrosecond = 'VoltPerMicrosecond'
"""
"""
- VoltPerMinute = 'volt_per_minute'
+ VoltPerMinute = 'VoltPerMinute'
"""
"""
- VoltPerHour = 'volt_per_hour'
+ VoltPerHour = 'VoltPerHour'
"""
"""
- MicrovoltPerSecond = 'microvolt_per_second'
+ MicrovoltPerSecond = 'MicrovoltPerSecond'
"""
"""
- MillivoltPerSecond = 'millivolt_per_second'
+ MillivoltPerSecond = 'MillivoltPerSecond'
"""
"""
- KilovoltPerSecond = 'kilovolt_per_second'
+ KilovoltPerSecond = 'KilovoltPerSecond'
"""
"""
- MegavoltPerSecond = 'megavolt_per_second'
+ MegavoltPerSecond = 'MegavoltPerSecond'
"""
"""
- MicrovoltPerMicrosecond = 'microvolt_per_microsecond'
+ MicrovoltPerMicrosecond = 'MicrovoltPerMicrosecond'
"""
"""
- MillivoltPerMicrosecond = 'millivolt_per_microsecond'
+ MillivoltPerMicrosecond = 'MillivoltPerMicrosecond'
"""
"""
- KilovoltPerMicrosecond = 'kilovolt_per_microsecond'
+ KilovoltPerMicrosecond = 'KilovoltPerMicrosecond'
"""
"""
- MegavoltPerMicrosecond = 'megavolt_per_microsecond'
+ MegavoltPerMicrosecond = 'MegavoltPerMicrosecond'
"""
"""
- MicrovoltPerMinute = 'microvolt_per_minute'
+ MicrovoltPerMinute = 'MicrovoltPerMinute'
"""
"""
- MillivoltPerMinute = 'millivolt_per_minute'
+ MillivoltPerMinute = 'MillivoltPerMinute'
"""
"""
- KilovoltPerMinute = 'kilovolt_per_minute'
+ KilovoltPerMinute = 'KilovoltPerMinute'
"""
"""
- MegavoltPerMinute = 'megavolt_per_minute'
+ MegavoltPerMinute = 'MegavoltPerMinute'
"""
"""
- MicrovoltPerHour = 'microvolt_per_hour'
+ MicrovoltPerHour = 'MicrovoltPerHour'
"""
"""
- MillivoltPerHour = 'millivolt_per_hour'
+ MillivoltPerHour = 'MillivoltPerHour'
"""
"""
- KilovoltPerHour = 'kilovolt_per_hour'
+ KilovoltPerHour = 'KilovoltPerHour'
"""
"""
- MegavoltPerHour = 'megavolt_per_hour'
+ MegavoltPerHour = 'MegavoltPerHour'
"""
"""
+class ElectricPotentialChangeRateDto:
+ """
+ A DTO representation of a ElectricPotentialChangeRate
+
+ Attributes:
+ value (float): The value of the ElectricPotentialChangeRate.
+ unit (ElectricPotentialChangeRateUnits): The specific unit that the ElectricPotentialChangeRate value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricPotentialChangeRateUnits):
+ """
+ Create a new DTO representation of a ElectricPotentialChangeRate
+
+ Parameters:
+ value (float): The value of the ElectricPotentialChangeRate.
+ unit (ElectricPotentialChangeRateUnits): The specific unit that the ElectricPotentialChangeRate value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricPotentialChangeRate
+ """
+ self.unit: ElectricPotentialChangeRateUnits = unit
+ """
+ The specific unit that the ElectricPotentialChangeRate value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricPotentialChangeRate DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricPotentialChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricPotentialChangeRate DTO from a json representation.
+
+ :param data: The ElectricPotentialChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltPerSecond"}
+ :return: A new instance of ElectricPotentialChangeRateDto.
+ :rtype: ElectricPotentialChangeRateDto
+ """
+ return ElectricPotentialChangeRateDto(value=data["value"], unit=ElectricPotentialChangeRateUnits(data["unit"]))
+
+
class ElectricPotentialChangeRate(AbstractMeasure):
"""
ElectricPotential change rate is the ratio of the electric potential change to the time during which the change occurred (value of electric potential changes per unit time).
@@ -170,6 +220,54 @@ def __init__(self, value: float, from_unit: ElectricPotentialChangeRateUnits = E
def convert(self, unit: ElectricPotentialChangeRateUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricPotentialChangeRateUnits = ElectricPotentialChangeRateUnits.VoltPerSecond) -> ElectricPotentialChangeRateDto:
+ """
+ Get a new instance of ElectricPotentialChangeRate DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotentialChangeRate unit to store the ElectricPotentialChangeRate value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialChangeRateUnits
+ :return: A new instance of ElectricPotentialChangeRateDto.
+ :rtype: ElectricPotentialChangeRateDto
+ """
+ return ElectricPotentialChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricPotentialChangeRateUnits = ElectricPotentialChangeRateUnits.VoltPerSecond):
+ """
+ Get a ElectricPotentialChangeRate DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotentialChangeRate unit to store the ElectricPotentialChangeRate value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialChangeRateUnits
+ :return: JSON object represents ElectricPotentialChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_potential_change_rate_dto: ElectricPotentialChangeRateDto):
+ """
+ Obtain a new instance of ElectricPotentialChangeRate from a DTO unit object.
+
+ :param electric_potential_change_rate_dto: The ElectricPotentialChangeRate DTO representation.
+ :type electric_potential_change_rate_dto: ElectricPotentialChangeRateDto
+ :return: A new instance of ElectricPotentialChangeRate.
+ :rtype: ElectricPotentialChangeRate
+ """
+ return ElectricPotentialChangeRate(electric_potential_change_rate_dto.value, electric_potential_change_rate_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricPotentialChangeRate from a DTO unit json representation.
+
+ :param data: The ElectricPotentialChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltPerSecond"}
+ :return: A new instance of ElectricPotentialChangeRate.
+ :rtype: ElectricPotentialChangeRate
+ """
+ return ElectricPotentialChangeRate.from_dto(ElectricPotentialChangeRateDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricPotentialChangeRateUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_potential_dc.py b/unitsnet_py/units/electric_potential_dc.py
index 83f43ba..e389d52 100644
--- a/unitsnet_py/units/electric_potential_dc.py
+++ b/unitsnet_py/units/electric_potential_dc.py
@@ -10,32 +10,82 @@ class ElectricPotentialDcUnits(Enum):
ElectricPotentialDcUnits enumeration
"""
- VoltDc = 'volt_dc'
+ VoltDc = 'VoltDc'
"""
"""
- MicrovoltDc = 'microvolt_dc'
+ MicrovoltDc = 'MicrovoltDc'
"""
"""
- MillivoltDc = 'millivolt_dc'
+ MillivoltDc = 'MillivoltDc'
"""
"""
- KilovoltDc = 'kilovolt_dc'
+ KilovoltDc = 'KilovoltDc'
"""
"""
- MegavoltDc = 'megavolt_dc'
+ MegavoltDc = 'MegavoltDc'
"""
"""
+class ElectricPotentialDcDto:
+ """
+ A DTO representation of a ElectricPotentialDc
+
+ Attributes:
+ value (float): The value of the ElectricPotentialDc.
+ unit (ElectricPotentialDcUnits): The specific unit that the ElectricPotentialDc value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricPotentialDcUnits):
+ """
+ Create a new DTO representation of a ElectricPotentialDc
+
+ Parameters:
+ value (float): The value of the ElectricPotentialDc.
+ unit (ElectricPotentialDcUnits): The specific unit that the ElectricPotentialDc value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricPotentialDc
+ """
+ self.unit: ElectricPotentialDcUnits = unit
+ """
+ The specific unit that the ElectricPotentialDc value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricPotentialDc DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricPotentialDc DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltDc"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricPotentialDc DTO from a json representation.
+
+ :param data: The ElectricPotentialDc DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltDc"}
+ :return: A new instance of ElectricPotentialDcDto.
+ :rtype: ElectricPotentialDcDto
+ """
+ return ElectricPotentialDcDto(value=data["value"], unit=ElectricPotentialDcUnits(data["unit"]))
+
+
class ElectricPotentialDc(AbstractMeasure):
"""
The Electric Potential of a system known to use Direct Current.
@@ -65,6 +115,54 @@ def __init__(self, value: float, from_unit: ElectricPotentialDcUnits = ElectricP
def convert(self, unit: ElectricPotentialDcUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricPotentialDcUnits = ElectricPotentialDcUnits.VoltDc) -> ElectricPotentialDcDto:
+ """
+ Get a new instance of ElectricPotentialDc DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotentialDc unit to store the ElectricPotentialDc value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialDcUnits
+ :return: A new instance of ElectricPotentialDcDto.
+ :rtype: ElectricPotentialDcDto
+ """
+ return ElectricPotentialDcDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricPotentialDcUnits = ElectricPotentialDcUnits.VoltDc):
+ """
+ Get a ElectricPotentialDc DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricPotentialDc unit to store the ElectricPotentialDc value in the DTO representation.
+ :type hold_in_unit: ElectricPotentialDcUnits
+ :return: JSON object represents ElectricPotentialDc DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltDc"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_potential_dc_dto: ElectricPotentialDcDto):
+ """
+ Obtain a new instance of ElectricPotentialDc from a DTO unit object.
+
+ :param electric_potential_dc_dto: The ElectricPotentialDc DTO representation.
+ :type electric_potential_dc_dto: ElectricPotentialDcDto
+ :return: A new instance of ElectricPotentialDc.
+ :rtype: ElectricPotentialDc
+ """
+ return ElectricPotentialDc(electric_potential_dc_dto.value, electric_potential_dc_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricPotentialDc from a DTO unit json representation.
+
+ :param data: The ElectricPotentialDc DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltDc"}
+ :return: A new instance of ElectricPotentialDc.
+ :rtype: ElectricPotentialDc
+ """
+ return ElectricPotentialDc.from_dto(ElectricPotentialDcDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricPotentialDcUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_resistance.py b/unitsnet_py/units/electric_resistance.py
index 9d0e9c0..7d74b71 100644
--- a/unitsnet_py/units/electric_resistance.py
+++ b/unitsnet_py/units/electric_resistance.py
@@ -10,42 +10,92 @@ class ElectricResistanceUnits(Enum):
ElectricResistanceUnits enumeration
"""
- Ohm = 'ohm'
+ Ohm = 'Ohm'
"""
"""
- Microohm = 'microohm'
+ Microohm = 'Microohm'
"""
"""
- Milliohm = 'milliohm'
+ Milliohm = 'Milliohm'
"""
"""
- Kiloohm = 'kiloohm'
+ Kiloohm = 'Kiloohm'
"""
"""
- Megaohm = 'megaohm'
+ Megaohm = 'Megaohm'
"""
"""
- Gigaohm = 'gigaohm'
+ Gigaohm = 'Gigaohm'
"""
"""
- Teraohm = 'teraohm'
+ Teraohm = 'Teraohm'
"""
"""
+class ElectricResistanceDto:
+ """
+ A DTO representation of a ElectricResistance
+
+ Attributes:
+ value (float): The value of the ElectricResistance.
+ unit (ElectricResistanceUnits): The specific unit that the ElectricResistance value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricResistanceUnits):
+ """
+ Create a new DTO representation of a ElectricResistance
+
+ Parameters:
+ value (float): The value of the ElectricResistance.
+ unit (ElectricResistanceUnits): The specific unit that the ElectricResistance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricResistance
+ """
+ self.unit: ElectricResistanceUnits = unit
+ """
+ The specific unit that the ElectricResistance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricResistance DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricResistance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Ohm"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricResistance DTO from a json representation.
+
+ :param data: The ElectricResistance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Ohm"}
+ :return: A new instance of ElectricResistanceDto.
+ :rtype: ElectricResistanceDto
+ """
+ return ElectricResistanceDto(value=data["value"], unit=ElectricResistanceUnits(data["unit"]))
+
+
class ElectricResistance(AbstractMeasure):
"""
The electrical resistance of an electrical conductor is the opposition to the passage of an electric current through that conductor.
@@ -79,6 +129,54 @@ def __init__(self, value: float, from_unit: ElectricResistanceUnits = ElectricRe
def convert(self, unit: ElectricResistanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricResistanceUnits = ElectricResistanceUnits.Ohm) -> ElectricResistanceDto:
+ """
+ Get a new instance of ElectricResistance DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricResistance unit to store the ElectricResistance value in the DTO representation.
+ :type hold_in_unit: ElectricResistanceUnits
+ :return: A new instance of ElectricResistanceDto.
+ :rtype: ElectricResistanceDto
+ """
+ return ElectricResistanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricResistanceUnits = ElectricResistanceUnits.Ohm):
+ """
+ Get a ElectricResistance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricResistance unit to store the ElectricResistance value in the DTO representation.
+ :type hold_in_unit: ElectricResistanceUnits
+ :return: JSON object represents ElectricResistance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Ohm"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_resistance_dto: ElectricResistanceDto):
+ """
+ Obtain a new instance of ElectricResistance from a DTO unit object.
+
+ :param electric_resistance_dto: The ElectricResistance DTO representation.
+ :type electric_resistance_dto: ElectricResistanceDto
+ :return: A new instance of ElectricResistance.
+ :rtype: ElectricResistance
+ """
+ return ElectricResistance(electric_resistance_dto.value, electric_resistance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricResistance from a DTO unit json representation.
+
+ :param data: The ElectricResistance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Ohm"}
+ :return: A new instance of ElectricResistance.
+ :rtype: ElectricResistance
+ """
+ return ElectricResistance.from_dto(ElectricResistanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricResistanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_resistivity.py b/unitsnet_py/units/electric_resistivity.py
index b49c177..cc20ac3 100644
--- a/unitsnet_py/units/electric_resistivity.py
+++ b/unitsnet_py/units/electric_resistivity.py
@@ -10,77 +10,127 @@ class ElectricResistivityUnits(Enum):
ElectricResistivityUnits enumeration
"""
- OhmMeter = 'ohm_meter'
+ OhmMeter = 'OhmMeter'
"""
"""
- OhmCentimeter = 'ohm_centimeter'
+ OhmCentimeter = 'OhmCentimeter'
"""
"""
- PicoohmMeter = 'picoohm_meter'
+ PicoohmMeter = 'PicoohmMeter'
"""
"""
- NanoohmMeter = 'nanoohm_meter'
+ NanoohmMeter = 'NanoohmMeter'
"""
"""
- MicroohmMeter = 'microohm_meter'
+ MicroohmMeter = 'MicroohmMeter'
"""
"""
- MilliohmMeter = 'milliohm_meter'
+ MilliohmMeter = 'MilliohmMeter'
"""
"""
- KiloohmMeter = 'kiloohm_meter'
+ KiloohmMeter = 'KiloohmMeter'
"""
"""
- MegaohmMeter = 'megaohm_meter'
+ MegaohmMeter = 'MegaohmMeter'
"""
"""
- PicoohmCentimeter = 'picoohm_centimeter'
+ PicoohmCentimeter = 'PicoohmCentimeter'
"""
"""
- NanoohmCentimeter = 'nanoohm_centimeter'
+ NanoohmCentimeter = 'NanoohmCentimeter'
"""
"""
- MicroohmCentimeter = 'microohm_centimeter'
+ MicroohmCentimeter = 'MicroohmCentimeter'
"""
"""
- MilliohmCentimeter = 'milliohm_centimeter'
+ MilliohmCentimeter = 'MilliohmCentimeter'
"""
"""
- KiloohmCentimeter = 'kiloohm_centimeter'
+ KiloohmCentimeter = 'KiloohmCentimeter'
"""
"""
- MegaohmCentimeter = 'megaohm_centimeter'
+ MegaohmCentimeter = 'MegaohmCentimeter'
"""
"""
+class ElectricResistivityDto:
+ """
+ A DTO representation of a ElectricResistivity
+
+ Attributes:
+ value (float): The value of the ElectricResistivity.
+ unit (ElectricResistivityUnits): The specific unit that the ElectricResistivity value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricResistivityUnits):
+ """
+ Create a new DTO representation of a ElectricResistivity
+
+ Parameters:
+ value (float): The value of the ElectricResistivity.
+ unit (ElectricResistivityUnits): The specific unit that the ElectricResistivity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricResistivity
+ """
+ self.unit: ElectricResistivityUnits = unit
+ """
+ The specific unit that the ElectricResistivity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricResistivity DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricResistivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "OhmMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricResistivity DTO from a json representation.
+
+ :param data: The ElectricResistivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "OhmMeter"}
+ :return: A new instance of ElectricResistivityDto.
+ :rtype: ElectricResistivityDto
+ """
+ return ElectricResistivityDto(value=data["value"], unit=ElectricResistivityUnits(data["unit"]))
+
+
class ElectricResistivity(AbstractMeasure):
"""
Electrical resistivity (also known as resistivity, specific electrical resistance, or volume resistivity) is a fundamental property that quantifies how strongly a given material opposes the flow of electric current.
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: ElectricResistivityUnits = ElectricR
def convert(self, unit: ElectricResistivityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricResistivityUnits = ElectricResistivityUnits.OhmMeter) -> ElectricResistivityDto:
+ """
+ Get a new instance of ElectricResistivity DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricResistivity unit to store the ElectricResistivity value in the DTO representation.
+ :type hold_in_unit: ElectricResistivityUnits
+ :return: A new instance of ElectricResistivityDto.
+ :rtype: ElectricResistivityDto
+ """
+ return ElectricResistivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricResistivityUnits = ElectricResistivityUnits.OhmMeter):
+ """
+ Get a ElectricResistivity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricResistivity unit to store the ElectricResistivity value in the DTO representation.
+ :type hold_in_unit: ElectricResistivityUnits
+ :return: JSON object represents ElectricResistivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "OhmMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_resistivity_dto: ElectricResistivityDto):
+ """
+ Obtain a new instance of ElectricResistivity from a DTO unit object.
+
+ :param electric_resistivity_dto: The ElectricResistivity DTO representation.
+ :type electric_resistivity_dto: ElectricResistivityDto
+ :return: A new instance of ElectricResistivity.
+ :rtype: ElectricResistivity
+ """
+ return ElectricResistivity(electric_resistivity_dto.value, electric_resistivity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricResistivity from a DTO unit json representation.
+
+ :param data: The ElectricResistivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "OhmMeter"}
+ :return: A new instance of ElectricResistivity.
+ :rtype: ElectricResistivity
+ """
+ return ElectricResistivity.from_dto(ElectricResistivityDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricResistivityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/electric_surface_charge_density.py b/unitsnet_py/units/electric_surface_charge_density.py
index bc382ae..e5677a4 100644
--- a/unitsnet_py/units/electric_surface_charge_density.py
+++ b/unitsnet_py/units/electric_surface_charge_density.py
@@ -10,22 +10,72 @@ class ElectricSurfaceChargeDensityUnits(Enum):
ElectricSurfaceChargeDensityUnits enumeration
"""
- CoulombPerSquareMeter = 'coulomb_per_square_meter'
+ CoulombPerSquareMeter = 'CoulombPerSquareMeter'
"""
"""
- CoulombPerSquareCentimeter = 'coulomb_per_square_centimeter'
+ CoulombPerSquareCentimeter = 'CoulombPerSquareCentimeter'
"""
"""
- CoulombPerSquareInch = 'coulomb_per_square_inch'
+ CoulombPerSquareInch = 'CoulombPerSquareInch'
"""
"""
+class ElectricSurfaceChargeDensityDto:
+ """
+ A DTO representation of a ElectricSurfaceChargeDensity
+
+ Attributes:
+ value (float): The value of the ElectricSurfaceChargeDensity.
+ unit (ElectricSurfaceChargeDensityUnits): The specific unit that the ElectricSurfaceChargeDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: ElectricSurfaceChargeDensityUnits):
+ """
+ Create a new DTO representation of a ElectricSurfaceChargeDensity
+
+ Parameters:
+ value (float): The value of the ElectricSurfaceChargeDensity.
+ unit (ElectricSurfaceChargeDensityUnits): The specific unit that the ElectricSurfaceChargeDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ElectricSurfaceChargeDensity
+ """
+ self.unit: ElectricSurfaceChargeDensityUnits = unit
+ """
+ The specific unit that the ElectricSurfaceChargeDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ElectricSurfaceChargeDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents ElectricSurfaceChargeDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CoulombPerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ElectricSurfaceChargeDensity DTO from a json representation.
+
+ :param data: The ElectricSurfaceChargeDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CoulombPerSquareMeter"}
+ :return: A new instance of ElectricSurfaceChargeDensityDto.
+ :rtype: ElectricSurfaceChargeDensityDto
+ """
+ return ElectricSurfaceChargeDensityDto(value=data["value"], unit=ElectricSurfaceChargeDensityUnits(data["unit"]))
+
+
class ElectricSurfaceChargeDensity(AbstractMeasure):
"""
In electromagnetism, surface charge density is a measure of the amount of electric charge per surface area.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: ElectricSurfaceChargeDensityUnits =
def convert(self, unit: ElectricSurfaceChargeDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ElectricSurfaceChargeDensityUnits = ElectricSurfaceChargeDensityUnits.CoulombPerSquareMeter) -> ElectricSurfaceChargeDensityDto:
+ """
+ Get a new instance of ElectricSurfaceChargeDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific ElectricSurfaceChargeDensity unit to store the ElectricSurfaceChargeDensity value in the DTO representation.
+ :type hold_in_unit: ElectricSurfaceChargeDensityUnits
+ :return: A new instance of ElectricSurfaceChargeDensityDto.
+ :rtype: ElectricSurfaceChargeDensityDto
+ """
+ return ElectricSurfaceChargeDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ElectricSurfaceChargeDensityUnits = ElectricSurfaceChargeDensityUnits.CoulombPerSquareMeter):
+ """
+ Get a ElectricSurfaceChargeDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ElectricSurfaceChargeDensity unit to store the ElectricSurfaceChargeDensity value in the DTO representation.
+ :type hold_in_unit: ElectricSurfaceChargeDensityUnits
+ :return: JSON object represents ElectricSurfaceChargeDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CoulombPerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(electric_surface_charge_density_dto: ElectricSurfaceChargeDensityDto):
+ """
+ Obtain a new instance of ElectricSurfaceChargeDensity from a DTO unit object.
+
+ :param electric_surface_charge_density_dto: The ElectricSurfaceChargeDensity DTO representation.
+ :type electric_surface_charge_density_dto: ElectricSurfaceChargeDensityDto
+ :return: A new instance of ElectricSurfaceChargeDensity.
+ :rtype: ElectricSurfaceChargeDensity
+ """
+ return ElectricSurfaceChargeDensity(electric_surface_charge_density_dto.value, electric_surface_charge_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ElectricSurfaceChargeDensity from a DTO unit json representation.
+
+ :param data: The ElectricSurfaceChargeDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CoulombPerSquareMeter"}
+ :return: A new instance of ElectricSurfaceChargeDensity.
+ :rtype: ElectricSurfaceChargeDensity
+ """
+ return ElectricSurfaceChargeDensity.from_dto(ElectricSurfaceChargeDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: ElectricSurfaceChargeDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/energy.py b/unitsnet_py/units/energy.py
index 723ada1..2e8defa 100644
--- a/unitsnet_py/units/energy.py
+++ b/unitsnet_py/units/energy.py
@@ -10,207 +10,257 @@ class EnergyUnits(Enum):
EnergyUnits enumeration
"""
- Joule = 'joule'
+ Joule = 'Joule'
"""
"""
- Calorie = 'calorie'
+ Calorie = 'Calorie'
"""
"""
- BritishThermalUnit = 'british_thermal_unit'
+ BritishThermalUnit = 'BritishThermalUnit'
"""
"""
- ElectronVolt = 'electron_volt'
+ ElectronVolt = 'ElectronVolt'
"""
"""
- FootPound = 'foot_pound'
+ FootPound = 'FootPound'
"""
"""
- Erg = 'erg'
+ Erg = 'Erg'
"""
"""
- WattHour = 'watt_hour'
+ WattHour = 'WattHour'
"""
"""
- WattDay = 'watt_day'
+ WattDay = 'WattDay'
"""
"""
- ThermEc = 'therm_ec'
+ ThermEc = 'ThermEc'
"""
"""
- ThermUs = 'therm_us'
+ ThermUs = 'ThermUs'
"""
"""
- ThermImperial = 'therm_imperial'
+ ThermImperial = 'ThermImperial'
"""
"""
- HorsepowerHour = 'horsepower_hour'
+ HorsepowerHour = 'HorsepowerHour'
"""
"""
- Nanojoule = 'nanojoule'
+ Nanojoule = 'Nanojoule'
"""
"""
- Microjoule = 'microjoule'
+ Microjoule = 'Microjoule'
"""
"""
- Millijoule = 'millijoule'
+ Millijoule = 'Millijoule'
"""
"""
- Kilojoule = 'kilojoule'
+ Kilojoule = 'Kilojoule'
"""
"""
- Megajoule = 'megajoule'
+ Megajoule = 'Megajoule'
"""
"""
- Gigajoule = 'gigajoule'
+ Gigajoule = 'Gigajoule'
"""
"""
- Terajoule = 'terajoule'
+ Terajoule = 'Terajoule'
"""
"""
- Petajoule = 'petajoule'
+ Petajoule = 'Petajoule'
"""
"""
- Kilocalorie = 'kilocalorie'
+ Kilocalorie = 'Kilocalorie'
"""
"""
- Megacalorie = 'megacalorie'
+ Megacalorie = 'Megacalorie'
"""
"""
- KilobritishThermalUnit = 'kilobritish_thermal_unit'
+ KilobritishThermalUnit = 'KilobritishThermalUnit'
"""
"""
- MegabritishThermalUnit = 'megabritish_thermal_unit'
+ MegabritishThermalUnit = 'MegabritishThermalUnit'
"""
"""
- GigabritishThermalUnit = 'gigabritish_thermal_unit'
+ GigabritishThermalUnit = 'GigabritishThermalUnit'
"""
"""
- KiloelectronVolt = 'kiloelectron_volt'
+ KiloelectronVolt = 'KiloelectronVolt'
"""
"""
- MegaelectronVolt = 'megaelectron_volt'
+ MegaelectronVolt = 'MegaelectronVolt'
"""
"""
- GigaelectronVolt = 'gigaelectron_volt'
+ GigaelectronVolt = 'GigaelectronVolt'
"""
"""
- TeraelectronVolt = 'teraelectron_volt'
+ TeraelectronVolt = 'TeraelectronVolt'
"""
"""
- KilowattHour = 'kilowatt_hour'
+ KilowattHour = 'KilowattHour'
"""
"""
- MegawattHour = 'megawatt_hour'
+ MegawattHour = 'MegawattHour'
"""
"""
- GigawattHour = 'gigawatt_hour'
+ GigawattHour = 'GigawattHour'
"""
"""
- TerawattHour = 'terawatt_hour'
+ TerawattHour = 'TerawattHour'
"""
"""
- KilowattDay = 'kilowatt_day'
+ KilowattDay = 'KilowattDay'
"""
"""
- MegawattDay = 'megawatt_day'
+ MegawattDay = 'MegawattDay'
"""
"""
- GigawattDay = 'gigawatt_day'
+ GigawattDay = 'GigawattDay'
"""
"""
- TerawattDay = 'terawatt_day'
+ TerawattDay = 'TerawattDay'
"""
"""
- DecathermEc = 'decatherm_ec'
+ DecathermEc = 'DecathermEc'
"""
"""
- DecathermUs = 'decatherm_us'
+ DecathermUs = 'DecathermUs'
"""
"""
- DecathermImperial = 'decatherm_imperial'
+ DecathermImperial = 'DecathermImperial'
"""
"""
+class EnergyDto:
+ """
+ A DTO representation of a Energy
+
+ Attributes:
+ value (float): The value of the Energy.
+ unit (EnergyUnits): The specific unit that the Energy value is representing.
+ """
+
+ def __init__(self, value: float, unit: EnergyUnits):
+ """
+ Create a new DTO representation of a Energy
+
+ Parameters:
+ value (float): The value of the Energy.
+ unit (EnergyUnits): The specific unit that the Energy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Energy
+ """
+ self.unit: EnergyUnits = unit
+ """
+ The specific unit that the Energy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Energy DTO JSON object representing the current unit.
+
+ :return: JSON object represents Energy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Joule"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Energy DTO from a json representation.
+
+ :param data: The Energy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Joule"}
+ :return: A new instance of EnergyDto.
+ :rtype: EnergyDto
+ """
+ return EnergyDto(value=data["value"], unit=EnergyUnits(data["unit"]))
+
+
class Energy(AbstractMeasure):
"""
The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second. Many other units of energy are included. Please do not confuse this definition of the calorie with the one colloquially used by the food industry, the large calorie, which is equivalent to 1 kcal. Thermochemical definition of the calorie is used. For BTU, the IT definition is used.
@@ -310,6 +360,54 @@ def __init__(self, value: float, from_unit: EnergyUnits = EnergyUnits.Joule):
def convert(self, unit: EnergyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: EnergyUnits = EnergyUnits.Joule) -> EnergyDto:
+ """
+ Get a new instance of Energy DTO representing the current unit.
+
+ :param hold_in_unit: The specific Energy unit to store the Energy value in the DTO representation.
+ :type hold_in_unit: EnergyUnits
+ :return: A new instance of EnergyDto.
+ :rtype: EnergyDto
+ """
+ return EnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: EnergyUnits = EnergyUnits.Joule):
+ """
+ Get a Energy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Energy unit to store the Energy value in the DTO representation.
+ :type hold_in_unit: EnergyUnits
+ :return: JSON object represents Energy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Joule"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(energy_dto: EnergyDto):
+ """
+ Obtain a new instance of Energy from a DTO unit object.
+
+ :param energy_dto: The Energy DTO representation.
+ :type energy_dto: EnergyDto
+ :return: A new instance of Energy.
+ :rtype: Energy
+ """
+ return Energy(energy_dto.value, energy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Energy from a DTO unit json representation.
+
+ :param data: The Energy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Joule"}
+ :return: A new instance of Energy.
+ :rtype: Energy
+ """
+ return Energy.from_dto(EnergyDto.from_json(data))
+
def __convert_from_base(self, from_unit: EnergyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/energy_density.py b/unitsnet_py/units/energy_density.py
index f4356a1..3cf8d24 100644
--- a/unitsnet_py/units/energy_density.py
+++ b/unitsnet_py/units/energy_density.py
@@ -10,67 +10,117 @@ class EnergyDensityUnits(Enum):
EnergyDensityUnits enumeration
"""
- JoulePerCubicMeter = 'joule_per_cubic_meter'
+ JoulePerCubicMeter = 'JoulePerCubicMeter'
"""
"""
- WattHourPerCubicMeter = 'watt_hour_per_cubic_meter'
+ WattHourPerCubicMeter = 'WattHourPerCubicMeter'
"""
"""
- KilojoulePerCubicMeter = 'kilojoule_per_cubic_meter'
+ KilojoulePerCubicMeter = 'KilojoulePerCubicMeter'
"""
"""
- MegajoulePerCubicMeter = 'megajoule_per_cubic_meter'
+ MegajoulePerCubicMeter = 'MegajoulePerCubicMeter'
"""
"""
- GigajoulePerCubicMeter = 'gigajoule_per_cubic_meter'
+ GigajoulePerCubicMeter = 'GigajoulePerCubicMeter'
"""
"""
- TerajoulePerCubicMeter = 'terajoule_per_cubic_meter'
+ TerajoulePerCubicMeter = 'TerajoulePerCubicMeter'
"""
"""
- PetajoulePerCubicMeter = 'petajoule_per_cubic_meter'
+ PetajoulePerCubicMeter = 'PetajoulePerCubicMeter'
"""
"""
- KilowattHourPerCubicMeter = 'kilowatt_hour_per_cubic_meter'
+ KilowattHourPerCubicMeter = 'KilowattHourPerCubicMeter'
"""
"""
- MegawattHourPerCubicMeter = 'megawatt_hour_per_cubic_meter'
+ MegawattHourPerCubicMeter = 'MegawattHourPerCubicMeter'
"""
"""
- GigawattHourPerCubicMeter = 'gigawatt_hour_per_cubic_meter'
+ GigawattHourPerCubicMeter = 'GigawattHourPerCubicMeter'
"""
"""
- TerawattHourPerCubicMeter = 'terawatt_hour_per_cubic_meter'
+ TerawattHourPerCubicMeter = 'TerawattHourPerCubicMeter'
"""
"""
- PetawattHourPerCubicMeter = 'petawatt_hour_per_cubic_meter'
+ PetawattHourPerCubicMeter = 'PetawattHourPerCubicMeter'
"""
"""
+class EnergyDensityDto:
+ """
+ A DTO representation of a EnergyDensity
+
+ Attributes:
+ value (float): The value of the EnergyDensity.
+ unit (EnergyDensityUnits): The specific unit that the EnergyDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: EnergyDensityUnits):
+ """
+ Create a new DTO representation of a EnergyDensity
+
+ Parameters:
+ value (float): The value of the EnergyDensity.
+ unit (EnergyDensityUnits): The specific unit that the EnergyDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the EnergyDensity
+ """
+ self.unit: EnergyDensityUnits = unit
+ """
+ The specific unit that the EnergyDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a EnergyDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents EnergyDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerCubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of EnergyDensity DTO from a json representation.
+
+ :param data: The EnergyDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerCubicMeter"}
+ :return: A new instance of EnergyDensityDto.
+ :rtype: EnergyDensityDto
+ """
+ return EnergyDensityDto(value=data["value"], unit=EnergyDensityUnits(data["unit"]))
+
+
class EnergyDensity(AbstractMeasure):
"""
None
@@ -114,6 +164,54 @@ def __init__(self, value: float, from_unit: EnergyDensityUnits = EnergyDensityUn
def convert(self, unit: EnergyDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: EnergyDensityUnits = EnergyDensityUnits.JoulePerCubicMeter) -> EnergyDensityDto:
+ """
+ Get a new instance of EnergyDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific EnergyDensity unit to store the EnergyDensity value in the DTO representation.
+ :type hold_in_unit: EnergyDensityUnits
+ :return: A new instance of EnergyDensityDto.
+ :rtype: EnergyDensityDto
+ """
+ return EnergyDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: EnergyDensityUnits = EnergyDensityUnits.JoulePerCubicMeter):
+ """
+ Get a EnergyDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific EnergyDensity unit to store the EnergyDensity value in the DTO representation.
+ :type hold_in_unit: EnergyDensityUnits
+ :return: JSON object represents EnergyDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerCubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(energy_density_dto: EnergyDensityDto):
+ """
+ Obtain a new instance of EnergyDensity from a DTO unit object.
+
+ :param energy_density_dto: The EnergyDensity DTO representation.
+ :type energy_density_dto: EnergyDensityDto
+ :return: A new instance of EnergyDensity.
+ :rtype: EnergyDensity
+ """
+ return EnergyDensity(energy_density_dto.value, energy_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of EnergyDensity from a DTO unit json representation.
+
+ :param data: The EnergyDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerCubicMeter"}
+ :return: A new instance of EnergyDensity.
+ :rtype: EnergyDensity
+ """
+ return EnergyDensity.from_dto(EnergyDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: EnergyDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/entropy.py b/unitsnet_py/units/entropy.py
index 362f320..eef5386 100644
--- a/unitsnet_py/units/entropy.py
+++ b/unitsnet_py/units/entropy.py
@@ -10,42 +10,92 @@ class EntropyUnits(Enum):
EntropyUnits enumeration
"""
- JoulePerKelvin = 'joule_per_kelvin'
+ JoulePerKelvin = 'JoulePerKelvin'
"""
"""
- CaloriePerKelvin = 'calorie_per_kelvin'
+ CaloriePerKelvin = 'CaloriePerKelvin'
"""
"""
- JoulePerDegreeCelsius = 'joule_per_degree_celsius'
+ JoulePerDegreeCelsius = 'JoulePerDegreeCelsius'
"""
"""
- KilojoulePerKelvin = 'kilojoule_per_kelvin'
+ KilojoulePerKelvin = 'KilojoulePerKelvin'
"""
"""
- MegajoulePerKelvin = 'megajoule_per_kelvin'
+ MegajoulePerKelvin = 'MegajoulePerKelvin'
"""
"""
- KilocaloriePerKelvin = 'kilocalorie_per_kelvin'
+ KilocaloriePerKelvin = 'KilocaloriePerKelvin'
"""
"""
- KilojoulePerDegreeCelsius = 'kilojoule_per_degree_celsius'
+ KilojoulePerDegreeCelsius = 'KilojoulePerDegreeCelsius'
"""
"""
+class EntropyDto:
+ """
+ A DTO representation of a Entropy
+
+ Attributes:
+ value (float): The value of the Entropy.
+ unit (EntropyUnits): The specific unit that the Entropy value is representing.
+ """
+
+ def __init__(self, value: float, unit: EntropyUnits):
+ """
+ Create a new DTO representation of a Entropy
+
+ Parameters:
+ value (float): The value of the Entropy.
+ unit (EntropyUnits): The specific unit that the Entropy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Entropy
+ """
+ self.unit: EntropyUnits = unit
+ """
+ The specific unit that the Entropy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Entropy DTO JSON object representing the current unit.
+
+ :return: JSON object represents Entropy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerKelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Entropy DTO from a json representation.
+
+ :param data: The Entropy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerKelvin"}
+ :return: A new instance of EntropyDto.
+ :rtype: EntropyDto
+ """
+ return EntropyDto(value=data["value"], unit=EntropyUnits(data["unit"]))
+
+
class Entropy(AbstractMeasure):
"""
Entropy is an important concept in the branch of science known as thermodynamics. The idea of "irreversibility" is central to the understanding of entropy. It is often said that entropy is an expression of the disorder, or randomness of a system, or of our lack of information about it. Entropy is an extensive property. It has the dimension of energy divided by temperature, which has a unit of joules per kelvin (J/K) in the International System of Units
@@ -79,6 +129,54 @@ def __init__(self, value: float, from_unit: EntropyUnits = EntropyUnits.JoulePer
def convert(self, unit: EntropyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: EntropyUnits = EntropyUnits.JoulePerKelvin) -> EntropyDto:
+ """
+ Get a new instance of Entropy DTO representing the current unit.
+
+ :param hold_in_unit: The specific Entropy unit to store the Entropy value in the DTO representation.
+ :type hold_in_unit: EntropyUnits
+ :return: A new instance of EntropyDto.
+ :rtype: EntropyDto
+ """
+ return EntropyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: EntropyUnits = EntropyUnits.JoulePerKelvin):
+ """
+ Get a Entropy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Entropy unit to store the Entropy value in the DTO representation.
+ :type hold_in_unit: EntropyUnits
+ :return: JSON object represents Entropy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerKelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(entropy_dto: EntropyDto):
+ """
+ Obtain a new instance of Entropy from a DTO unit object.
+
+ :param entropy_dto: The Entropy DTO representation.
+ :type entropy_dto: EntropyDto
+ :return: A new instance of Entropy.
+ :rtype: Entropy
+ """
+ return Entropy(entropy_dto.value, entropy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Entropy from a DTO unit json representation.
+
+ :param data: The Entropy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerKelvin"}
+ :return: A new instance of Entropy.
+ :rtype: Entropy
+ """
+ return Entropy.from_dto(EntropyDto.from_json(data))
+
def __convert_from_base(self, from_unit: EntropyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/force.py b/unitsnet_py/units/force.py
index cbb4098..60fdfaa 100644
--- a/unitsnet_py/units/force.py
+++ b/unitsnet_py/units/force.py
@@ -10,82 +10,132 @@ class ForceUnits(Enum):
ForceUnits enumeration
"""
- Dyn = 'dyn'
+ Dyn = 'Dyn'
"""
One dyne is equal to 10 micronewtons, 10e−5 N or to 10 nsn (nanosthenes) in the old metre–tonne–second system of units.
"""
- KilogramForce = 'kilogram_force'
+ KilogramForce = 'KilogramForce'
"""
The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N.
"""
- TonneForce = 'tonne_force'
+ TonneForce = 'TonneForce'
"""
The tonne-force, metric ton-force, megagram-force, and megapond (Mp) are each 1000 kilograms-force.
"""
- Newton = 'newton'
+ Newton = 'Newton'
"""
The newton (symbol: N) is the unit of force in the International System of Units (SI). It is defined as 1 kg⋅m/s2, the force which gives a mass of 1 kilogram an acceleration of 1 metre per second per second.
"""
- KiloPond = 'kilo_pond'
+ KiloPond = 'KiloPond'
"""
The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N.
"""
- Poundal = 'poundal'
+ Poundal = 'Poundal'
"""
The poundal is defined as the force necessary to accelerate 1 pound-mass at 1 foot per second per second. 1 pdl = 0.138254954376 N exactly.
"""
- PoundForce = 'pound_force'
+ PoundForce = 'PoundForce'
"""
The standard values of acceleration of the standard gravitational field (gn) and the international avoirdupois pound (lb) result in a pound-force equal to 4.4482216152605 N.
"""
- OunceForce = 'ounce_force'
+ OunceForce = 'OunceForce'
"""
An ounce-force is 1⁄16 of a pound-force, or about 0.2780139 newtons.
"""
- ShortTonForce = 'short_ton_force'
+ ShortTonForce = 'ShortTonForce'
"""
The short ton-force is a unit of force equal to 2,000 pounds-force (907.18474 kgf), that is most commonly used in the United States – known there simply as the ton or US ton.
"""
- Micronewton = 'micronewton'
+ Micronewton = 'Micronewton'
"""
"""
- Millinewton = 'millinewton'
+ Millinewton = 'Millinewton'
"""
"""
- Decanewton = 'decanewton'
+ Decanewton = 'Decanewton'
"""
"""
- Kilonewton = 'kilonewton'
+ Kilonewton = 'Kilonewton'
"""
"""
- Meganewton = 'meganewton'
+ Meganewton = 'Meganewton'
"""
"""
- KilopoundForce = 'kilopound_force'
+ KilopoundForce = 'KilopoundForce'
"""
"""
+class ForceDto:
+ """
+ A DTO representation of a Force
+
+ Attributes:
+ value (float): The value of the Force.
+ unit (ForceUnits): The specific unit that the Force value is representing.
+ """
+
+ def __init__(self, value: float, unit: ForceUnits):
+ """
+ Create a new DTO representation of a Force
+
+ Parameters:
+ value (float): The value of the Force.
+ unit (ForceUnits): The specific unit that the Force value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Force
+ """
+ self.unit: ForceUnits = unit
+ """
+ The specific unit that the Force value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Force DTO JSON object representing the current unit.
+
+ :return: JSON object represents Force DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Newton"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Force DTO from a json representation.
+
+ :param data: The Force DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Newton"}
+ :return: A new instance of ForceDto.
+ :rtype: ForceDto
+ """
+ return ForceDto(value=data["value"], unit=ForceUnits(data["unit"]))
+
+
class Force(AbstractMeasure):
"""
In physics, a force is any influence that causes an object to undergo a certain change, either concerning its movement, direction, or geometrical construction. In other words, a force can cause an object with mass to change its velocity (which includes to begin moving from a state of rest), i.e., to accelerate, or a flexible object to deform, or both. Force can also be described by intuitive concepts such as a push or a pull. A force has both magnitude and direction, making it a vector quantity. It is measured in the SI unit of newtons and represented by the symbol F.
@@ -135,6 +185,54 @@ def __init__(self, value: float, from_unit: ForceUnits = ForceUnits.Newton):
def convert(self, unit: ForceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ForceUnits = ForceUnits.Newton) -> ForceDto:
+ """
+ Get a new instance of Force DTO representing the current unit.
+
+ :param hold_in_unit: The specific Force unit to store the Force value in the DTO representation.
+ :type hold_in_unit: ForceUnits
+ :return: A new instance of ForceDto.
+ :rtype: ForceDto
+ """
+ return ForceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ForceUnits = ForceUnits.Newton):
+ """
+ Get a Force DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Force unit to store the Force value in the DTO representation.
+ :type hold_in_unit: ForceUnits
+ :return: JSON object represents Force DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Newton"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(force_dto: ForceDto):
+ """
+ Obtain a new instance of Force from a DTO unit object.
+
+ :param force_dto: The Force DTO representation.
+ :type force_dto: ForceDto
+ :return: A new instance of Force.
+ :rtype: Force
+ """
+ return Force(force_dto.value, force_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Force from a DTO unit json representation.
+
+ :param data: The Force DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Newton"}
+ :return: A new instance of Force.
+ :rtype: Force
+ """
+ return Force.from_dto(ForceDto.from_json(data))
+
def __convert_from_base(self, from_unit: ForceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/force_change_rate.py b/unitsnet_py/units/force_change_rate.py
index 7fd0908..20ef45d 100644
--- a/unitsnet_py/units/force_change_rate.py
+++ b/unitsnet_py/units/force_change_rate.py
@@ -10,82 +10,132 @@ class ForceChangeRateUnits(Enum):
ForceChangeRateUnits enumeration
"""
- NewtonPerMinute = 'newton_per_minute'
+ NewtonPerMinute = 'NewtonPerMinute'
"""
"""
- NewtonPerSecond = 'newton_per_second'
+ NewtonPerSecond = 'NewtonPerSecond'
"""
"""
- PoundForcePerMinute = 'pound_force_per_minute'
+ PoundForcePerMinute = 'PoundForcePerMinute'
"""
"""
- PoundForcePerSecond = 'pound_force_per_second'
+ PoundForcePerSecond = 'PoundForcePerSecond'
"""
"""
- DecanewtonPerMinute = 'decanewton_per_minute'
+ DecanewtonPerMinute = 'DecanewtonPerMinute'
"""
"""
- KilonewtonPerMinute = 'kilonewton_per_minute'
+ KilonewtonPerMinute = 'KilonewtonPerMinute'
"""
"""
- NanonewtonPerSecond = 'nanonewton_per_second'
+ NanonewtonPerSecond = 'NanonewtonPerSecond'
"""
"""
- MicronewtonPerSecond = 'micronewton_per_second'
+ MicronewtonPerSecond = 'MicronewtonPerSecond'
"""
"""
- MillinewtonPerSecond = 'millinewton_per_second'
+ MillinewtonPerSecond = 'MillinewtonPerSecond'
"""
"""
- CentinewtonPerSecond = 'centinewton_per_second'
+ CentinewtonPerSecond = 'CentinewtonPerSecond'
"""
"""
- DecinewtonPerSecond = 'decinewton_per_second'
+ DecinewtonPerSecond = 'DecinewtonPerSecond'
"""
"""
- DecanewtonPerSecond = 'decanewton_per_second'
+ DecanewtonPerSecond = 'DecanewtonPerSecond'
"""
"""
- KilonewtonPerSecond = 'kilonewton_per_second'
+ KilonewtonPerSecond = 'KilonewtonPerSecond'
"""
"""
- KilopoundForcePerMinute = 'kilopound_force_per_minute'
+ KilopoundForcePerMinute = 'KilopoundForcePerMinute'
"""
"""
- KilopoundForcePerSecond = 'kilopound_force_per_second'
+ KilopoundForcePerSecond = 'KilopoundForcePerSecond'
"""
"""
+class ForceChangeRateDto:
+ """
+ A DTO representation of a ForceChangeRate
+
+ Attributes:
+ value (float): The value of the ForceChangeRate.
+ unit (ForceChangeRateUnits): The specific unit that the ForceChangeRate value is representing.
+ """
+
+ def __init__(self, value: float, unit: ForceChangeRateUnits):
+ """
+ Create a new DTO representation of a ForceChangeRate
+
+ Parameters:
+ value (float): The value of the ForceChangeRate.
+ unit (ForceChangeRateUnits): The specific unit that the ForceChangeRate value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ForceChangeRate
+ """
+ self.unit: ForceChangeRateUnits = unit
+ """
+ The specific unit that the ForceChangeRate value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ForceChangeRate DTO JSON object representing the current unit.
+
+ :return: JSON object represents ForceChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ForceChangeRate DTO from a json representation.
+
+ :param data: The ForceChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonPerSecond"}
+ :return: A new instance of ForceChangeRateDto.
+ :rtype: ForceChangeRateDto
+ """
+ return ForceChangeRateDto(value=data["value"], unit=ForceChangeRateUnits(data["unit"]))
+
+
class ForceChangeRate(AbstractMeasure):
"""
Force change rate is the ratio of the force change to the time during which the change occurred (value of force changes per unit time).
@@ -135,6 +185,54 @@ def __init__(self, value: float, from_unit: ForceChangeRateUnits = ForceChangeRa
def convert(self, unit: ForceChangeRateUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ForceChangeRateUnits = ForceChangeRateUnits.NewtonPerSecond) -> ForceChangeRateDto:
+ """
+ Get a new instance of ForceChangeRate DTO representing the current unit.
+
+ :param hold_in_unit: The specific ForceChangeRate unit to store the ForceChangeRate value in the DTO representation.
+ :type hold_in_unit: ForceChangeRateUnits
+ :return: A new instance of ForceChangeRateDto.
+ :rtype: ForceChangeRateDto
+ """
+ return ForceChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ForceChangeRateUnits = ForceChangeRateUnits.NewtonPerSecond):
+ """
+ Get a ForceChangeRate DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ForceChangeRate unit to store the ForceChangeRate value in the DTO representation.
+ :type hold_in_unit: ForceChangeRateUnits
+ :return: JSON object represents ForceChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(force_change_rate_dto: ForceChangeRateDto):
+ """
+ Obtain a new instance of ForceChangeRate from a DTO unit object.
+
+ :param force_change_rate_dto: The ForceChangeRate DTO representation.
+ :type force_change_rate_dto: ForceChangeRateDto
+ :return: A new instance of ForceChangeRate.
+ :rtype: ForceChangeRate
+ """
+ return ForceChangeRate(force_change_rate_dto.value, force_change_rate_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ForceChangeRate from a DTO unit json representation.
+
+ :param data: The ForceChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonPerSecond"}
+ :return: A new instance of ForceChangeRate.
+ :rtype: ForceChangeRate
+ """
+ return ForceChangeRate.from_dto(ForceChangeRateDto.from_json(data))
+
def __convert_from_base(self, from_unit: ForceChangeRateUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/force_per_length.py b/unitsnet_py/units/force_per_length.py
index 8f79f09..28e9732 100644
--- a/unitsnet_py/units/force_per_length.py
+++ b/unitsnet_py/units/force_per_length.py
@@ -10,197 +10,247 @@ class ForcePerLengthUnits(Enum):
ForcePerLengthUnits enumeration
"""
- NewtonPerMeter = 'newton_per_meter'
+ NewtonPerMeter = 'NewtonPerMeter'
"""
"""
- NewtonPerCentimeter = 'newton_per_centimeter'
+ NewtonPerCentimeter = 'NewtonPerCentimeter'
"""
"""
- NewtonPerMillimeter = 'newton_per_millimeter'
+ NewtonPerMillimeter = 'NewtonPerMillimeter'
"""
"""
- KilogramForcePerMeter = 'kilogram_force_per_meter'
+ KilogramForcePerMeter = 'KilogramForcePerMeter'
"""
"""
- KilogramForcePerCentimeter = 'kilogram_force_per_centimeter'
+ KilogramForcePerCentimeter = 'KilogramForcePerCentimeter'
"""
"""
- KilogramForcePerMillimeter = 'kilogram_force_per_millimeter'
+ KilogramForcePerMillimeter = 'KilogramForcePerMillimeter'
"""
"""
- TonneForcePerMeter = 'tonne_force_per_meter'
+ TonneForcePerMeter = 'TonneForcePerMeter'
"""
"""
- TonneForcePerCentimeter = 'tonne_force_per_centimeter'
+ TonneForcePerCentimeter = 'TonneForcePerCentimeter'
"""
"""
- TonneForcePerMillimeter = 'tonne_force_per_millimeter'
+ TonneForcePerMillimeter = 'TonneForcePerMillimeter'
"""
"""
- PoundForcePerFoot = 'pound_force_per_foot'
+ PoundForcePerFoot = 'PoundForcePerFoot'
"""
"""
- PoundForcePerInch = 'pound_force_per_inch'
+ PoundForcePerInch = 'PoundForcePerInch'
"""
"""
- PoundForcePerYard = 'pound_force_per_yard'
+ PoundForcePerYard = 'PoundForcePerYard'
"""
"""
- KilopoundForcePerFoot = 'kilopound_force_per_foot'
+ KilopoundForcePerFoot = 'KilopoundForcePerFoot'
"""
"""
- KilopoundForcePerInch = 'kilopound_force_per_inch'
+ KilopoundForcePerInch = 'KilopoundForcePerInch'
"""
"""
- NanonewtonPerMeter = 'nanonewton_per_meter'
+ NanonewtonPerMeter = 'NanonewtonPerMeter'
"""
"""
- MicronewtonPerMeter = 'micronewton_per_meter'
+ MicronewtonPerMeter = 'MicronewtonPerMeter'
"""
"""
- MillinewtonPerMeter = 'millinewton_per_meter'
+ MillinewtonPerMeter = 'MillinewtonPerMeter'
"""
"""
- CentinewtonPerMeter = 'centinewton_per_meter'
+ CentinewtonPerMeter = 'CentinewtonPerMeter'
"""
"""
- DecinewtonPerMeter = 'decinewton_per_meter'
+ DecinewtonPerMeter = 'DecinewtonPerMeter'
"""
"""
- DecanewtonPerMeter = 'decanewton_per_meter'
+ DecanewtonPerMeter = 'DecanewtonPerMeter'
"""
"""
- KilonewtonPerMeter = 'kilonewton_per_meter'
+ KilonewtonPerMeter = 'KilonewtonPerMeter'
"""
"""
- MeganewtonPerMeter = 'meganewton_per_meter'
+ MeganewtonPerMeter = 'MeganewtonPerMeter'
"""
"""
- NanonewtonPerCentimeter = 'nanonewton_per_centimeter'
+ NanonewtonPerCentimeter = 'NanonewtonPerCentimeter'
"""
"""
- MicronewtonPerCentimeter = 'micronewton_per_centimeter'
+ MicronewtonPerCentimeter = 'MicronewtonPerCentimeter'
"""
"""
- MillinewtonPerCentimeter = 'millinewton_per_centimeter'
+ MillinewtonPerCentimeter = 'MillinewtonPerCentimeter'
"""
"""
- CentinewtonPerCentimeter = 'centinewton_per_centimeter'
+ CentinewtonPerCentimeter = 'CentinewtonPerCentimeter'
"""
"""
- DecinewtonPerCentimeter = 'decinewton_per_centimeter'
+ DecinewtonPerCentimeter = 'DecinewtonPerCentimeter'
"""
"""
- DecanewtonPerCentimeter = 'decanewton_per_centimeter'
+ DecanewtonPerCentimeter = 'DecanewtonPerCentimeter'
"""
"""
- KilonewtonPerCentimeter = 'kilonewton_per_centimeter'
+ KilonewtonPerCentimeter = 'KilonewtonPerCentimeter'
"""
"""
- MeganewtonPerCentimeter = 'meganewton_per_centimeter'
+ MeganewtonPerCentimeter = 'MeganewtonPerCentimeter'
"""
"""
- NanonewtonPerMillimeter = 'nanonewton_per_millimeter'
+ NanonewtonPerMillimeter = 'NanonewtonPerMillimeter'
"""
"""
- MicronewtonPerMillimeter = 'micronewton_per_millimeter'
+ MicronewtonPerMillimeter = 'MicronewtonPerMillimeter'
"""
"""
- MillinewtonPerMillimeter = 'millinewton_per_millimeter'
+ MillinewtonPerMillimeter = 'MillinewtonPerMillimeter'
"""
"""
- CentinewtonPerMillimeter = 'centinewton_per_millimeter'
+ CentinewtonPerMillimeter = 'CentinewtonPerMillimeter'
"""
"""
- DecinewtonPerMillimeter = 'decinewton_per_millimeter'
+ DecinewtonPerMillimeter = 'DecinewtonPerMillimeter'
"""
"""
- DecanewtonPerMillimeter = 'decanewton_per_millimeter'
+ DecanewtonPerMillimeter = 'DecanewtonPerMillimeter'
"""
"""
- KilonewtonPerMillimeter = 'kilonewton_per_millimeter'
+ KilonewtonPerMillimeter = 'KilonewtonPerMillimeter'
"""
"""
- MeganewtonPerMillimeter = 'meganewton_per_millimeter'
+ MeganewtonPerMillimeter = 'MeganewtonPerMillimeter'
"""
"""
+class ForcePerLengthDto:
+ """
+ A DTO representation of a ForcePerLength
+
+ Attributes:
+ value (float): The value of the ForcePerLength.
+ unit (ForcePerLengthUnits): The specific unit that the ForcePerLength value is representing.
+ """
+
+ def __init__(self, value: float, unit: ForcePerLengthUnits):
+ """
+ Create a new DTO representation of a ForcePerLength
+
+ Parameters:
+ value (float): The value of the ForcePerLength.
+ unit (ForcePerLengthUnits): The specific unit that the ForcePerLength value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ForcePerLength
+ """
+ self.unit: ForcePerLengthUnits = unit
+ """
+ The specific unit that the ForcePerLength value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ForcePerLength DTO JSON object representing the current unit.
+
+ :return: JSON object represents ForcePerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ForcePerLength DTO from a json representation.
+
+ :param data: The ForcePerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonPerMeter"}
+ :return: A new instance of ForcePerLengthDto.
+ :rtype: ForcePerLengthDto
+ """
+ return ForcePerLengthDto(value=data["value"], unit=ForcePerLengthUnits(data["unit"]))
+
+
class ForcePerLength(AbstractMeasure):
"""
The magnitude of force per unit length.
@@ -296,6 +346,54 @@ def __init__(self, value: float, from_unit: ForcePerLengthUnits = ForcePerLength
def convert(self, unit: ForcePerLengthUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ForcePerLengthUnits = ForcePerLengthUnits.NewtonPerMeter) -> ForcePerLengthDto:
+ """
+ Get a new instance of ForcePerLength DTO representing the current unit.
+
+ :param hold_in_unit: The specific ForcePerLength unit to store the ForcePerLength value in the DTO representation.
+ :type hold_in_unit: ForcePerLengthUnits
+ :return: A new instance of ForcePerLengthDto.
+ :rtype: ForcePerLengthDto
+ """
+ return ForcePerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ForcePerLengthUnits = ForcePerLengthUnits.NewtonPerMeter):
+ """
+ Get a ForcePerLength DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ForcePerLength unit to store the ForcePerLength value in the DTO representation.
+ :type hold_in_unit: ForcePerLengthUnits
+ :return: JSON object represents ForcePerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(force_per_length_dto: ForcePerLengthDto):
+ """
+ Obtain a new instance of ForcePerLength from a DTO unit object.
+
+ :param force_per_length_dto: The ForcePerLength DTO representation.
+ :type force_per_length_dto: ForcePerLengthDto
+ :return: A new instance of ForcePerLength.
+ :rtype: ForcePerLength
+ """
+ return ForcePerLength(force_per_length_dto.value, force_per_length_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ForcePerLength from a DTO unit json representation.
+
+ :param data: The ForcePerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonPerMeter"}
+ :return: A new instance of ForcePerLength.
+ :rtype: ForcePerLength
+ """
+ return ForcePerLength.from_dto(ForcePerLengthDto.from_json(data))
+
def __convert_from_base(self, from_unit: ForcePerLengthUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/frequency.py b/unitsnet_py/units/frequency.py
index 7205052..b2d5bdb 100644
--- a/unitsnet_py/units/frequency.py
+++ b/unitsnet_py/units/frequency.py
@@ -10,72 +10,122 @@ class FrequencyUnits(Enum):
FrequencyUnits enumeration
"""
- Hertz = 'hertz'
+ Hertz = 'Hertz'
"""
"""
- RadianPerSecond = 'radian_per_second'
+ RadianPerSecond = 'RadianPerSecond'
"""
"""
- CyclePerMinute = 'cycle_per_minute'
+ CyclePerMinute = 'CyclePerMinute'
"""
"""
- CyclePerHour = 'cycle_per_hour'
+ CyclePerHour = 'CyclePerHour'
"""
"""
- BeatPerMinute = 'beat_per_minute'
+ BeatPerMinute = 'BeatPerMinute'
"""
"""
- PerSecond = 'per_second'
+ PerSecond = 'PerSecond'
"""
"""
- BUnit = 'b_unit'
+ BUnit = 'BUnit'
"""
"""
- Microhertz = 'microhertz'
+ Microhertz = 'Microhertz'
"""
"""
- Millihertz = 'millihertz'
+ Millihertz = 'Millihertz'
"""
"""
- Kilohertz = 'kilohertz'
+ Kilohertz = 'Kilohertz'
"""
"""
- Megahertz = 'megahertz'
+ Megahertz = 'Megahertz'
"""
"""
- Gigahertz = 'gigahertz'
+ Gigahertz = 'Gigahertz'
"""
"""
- Terahertz = 'terahertz'
+ Terahertz = 'Terahertz'
"""
"""
+class FrequencyDto:
+ """
+ A DTO representation of a Frequency
+
+ Attributes:
+ value (float): The value of the Frequency.
+ unit (FrequencyUnits): The specific unit that the Frequency value is representing.
+ """
+
+ def __init__(self, value: float, unit: FrequencyUnits):
+ """
+ Create a new DTO representation of a Frequency
+
+ Parameters:
+ value (float): The value of the Frequency.
+ unit (FrequencyUnits): The specific unit that the Frequency value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Frequency
+ """
+ self.unit: FrequencyUnits = unit
+ """
+ The specific unit that the Frequency value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Frequency DTO JSON object representing the current unit.
+
+ :return: JSON object represents Frequency DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Hertz"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Frequency DTO from a json representation.
+
+ :param data: The Frequency DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Hertz"}
+ :return: A new instance of FrequencyDto.
+ :rtype: FrequencyDto
+ """
+ return FrequencyDto(value=data["value"], unit=FrequencyUnits(data["unit"]))
+
+
class Frequency(AbstractMeasure):
"""
The number of occurrences of a repeating event per unit time.
@@ -121,6 +171,54 @@ def __init__(self, value: float, from_unit: FrequencyUnits = FrequencyUnits.Hert
def convert(self, unit: FrequencyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: FrequencyUnits = FrequencyUnits.Hertz) -> FrequencyDto:
+ """
+ Get a new instance of Frequency DTO representing the current unit.
+
+ :param hold_in_unit: The specific Frequency unit to store the Frequency value in the DTO representation.
+ :type hold_in_unit: FrequencyUnits
+ :return: A new instance of FrequencyDto.
+ :rtype: FrequencyDto
+ """
+ return FrequencyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: FrequencyUnits = FrequencyUnits.Hertz):
+ """
+ Get a Frequency DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Frequency unit to store the Frequency value in the DTO representation.
+ :type hold_in_unit: FrequencyUnits
+ :return: JSON object represents Frequency DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Hertz"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(frequency_dto: FrequencyDto):
+ """
+ Obtain a new instance of Frequency from a DTO unit object.
+
+ :param frequency_dto: The Frequency DTO representation.
+ :type frequency_dto: FrequencyDto
+ :return: A new instance of Frequency.
+ :rtype: Frequency
+ """
+ return Frequency(frequency_dto.value, frequency_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Frequency from a DTO unit json representation.
+
+ :param data: The Frequency DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Hertz"}
+ :return: A new instance of Frequency.
+ :rtype: Frequency
+ """
+ return Frequency.from_dto(FrequencyDto.from_json(data))
+
def __convert_from_base(self, from_unit: FrequencyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/fuel_efficiency.py b/unitsnet_py/units/fuel_efficiency.py
index af87c76..b6c8c45 100644
--- a/unitsnet_py/units/fuel_efficiency.py
+++ b/unitsnet_py/units/fuel_efficiency.py
@@ -10,27 +10,77 @@ class FuelEfficiencyUnits(Enum):
FuelEfficiencyUnits enumeration
"""
- LiterPer100Kilometers = 'liter_per100_kilometers'
+ LiterPer100Kilometers = 'LiterPer100Kilometers'
"""
"""
- MilePerUsGallon = 'mile_per_us_gallon'
+ MilePerUsGallon = 'MilePerUsGallon'
"""
"""
- MilePerUkGallon = 'mile_per_uk_gallon'
+ MilePerUkGallon = 'MilePerUkGallon'
"""
"""
- KilometerPerLiter = 'kilometer_per_liter'
+ KilometerPerLiter = 'KilometerPerLiter'
"""
"""
+class FuelEfficiencyDto:
+ """
+ A DTO representation of a FuelEfficiency
+
+ Attributes:
+ value (float): The value of the FuelEfficiency.
+ unit (FuelEfficiencyUnits): The specific unit that the FuelEfficiency value is representing.
+ """
+
+ def __init__(self, value: float, unit: FuelEfficiencyUnits):
+ """
+ Create a new DTO representation of a FuelEfficiency
+
+ Parameters:
+ value (float): The value of the FuelEfficiency.
+ unit (FuelEfficiencyUnits): The specific unit that the FuelEfficiency value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the FuelEfficiency
+ """
+ self.unit: FuelEfficiencyUnits = unit
+ """
+ The specific unit that the FuelEfficiency value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a FuelEfficiency DTO JSON object representing the current unit.
+
+ :return: JSON object represents FuelEfficiency DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "LiterPer100Kilometers"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of FuelEfficiency DTO from a json representation.
+
+ :param data: The FuelEfficiency DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "LiterPer100Kilometers"}
+ :return: A new instance of FuelEfficiencyDto.
+ :rtype: FuelEfficiencyDto
+ """
+ return FuelEfficiencyDto(value=data["value"], unit=FuelEfficiencyUnits(data["unit"]))
+
+
class FuelEfficiency(AbstractMeasure):
"""
Fuel efficiency is a form of thermal efficiency, meaning the ratio from effort to result of a process that converts chemical potential energy contained in a carrier (fuel) into kinetic energy or work. Fuel economy is stated as "fuel consumption" in liters per 100 kilometers (L/100 km). In countries using non-metric system, fuel economy is expressed in miles per gallon (mpg) (imperial galon or US galon).
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: FuelEfficiencyUnits = FuelEfficiency
def convert(self, unit: FuelEfficiencyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: FuelEfficiencyUnits = FuelEfficiencyUnits.LiterPer100Kilometers) -> FuelEfficiencyDto:
+ """
+ Get a new instance of FuelEfficiency DTO representing the current unit.
+
+ :param hold_in_unit: The specific FuelEfficiency unit to store the FuelEfficiency value in the DTO representation.
+ :type hold_in_unit: FuelEfficiencyUnits
+ :return: A new instance of FuelEfficiencyDto.
+ :rtype: FuelEfficiencyDto
+ """
+ return FuelEfficiencyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: FuelEfficiencyUnits = FuelEfficiencyUnits.LiterPer100Kilometers):
+ """
+ Get a FuelEfficiency DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific FuelEfficiency unit to store the FuelEfficiency value in the DTO representation.
+ :type hold_in_unit: FuelEfficiencyUnits
+ :return: JSON object represents FuelEfficiency DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "LiterPer100Kilometers"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(fuel_efficiency_dto: FuelEfficiencyDto):
+ """
+ Obtain a new instance of FuelEfficiency from a DTO unit object.
+
+ :param fuel_efficiency_dto: The FuelEfficiency DTO representation.
+ :type fuel_efficiency_dto: FuelEfficiencyDto
+ :return: A new instance of FuelEfficiency.
+ :rtype: FuelEfficiency
+ """
+ return FuelEfficiency(fuel_efficiency_dto.value, fuel_efficiency_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of FuelEfficiency from a DTO unit json representation.
+
+ :param data: The FuelEfficiency DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "LiterPer100Kilometers"}
+ :return: A new instance of FuelEfficiency.
+ :rtype: FuelEfficiency
+ """
+ return FuelEfficiency.from_dto(FuelEfficiencyDto.from_json(data))
+
def __convert_from_base(self, from_unit: FuelEfficiencyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/heat_flux.py b/unitsnet_py/units/heat_flux.py
index 6416432..d35b447 100644
--- a/unitsnet_py/units/heat_flux.py
+++ b/unitsnet_py/units/heat_flux.py
@@ -10,97 +10,147 @@ class HeatFluxUnits(Enum):
HeatFluxUnits enumeration
"""
- WattPerSquareMeter = 'watt_per_square_meter'
+ WattPerSquareMeter = 'WattPerSquareMeter'
"""
"""
- WattPerSquareInch = 'watt_per_square_inch'
+ WattPerSquareInch = 'WattPerSquareInch'
"""
"""
- WattPerSquareFoot = 'watt_per_square_foot'
+ WattPerSquareFoot = 'WattPerSquareFoot'
"""
"""
- BtuPerSecondSquareInch = 'btu_per_second_square_inch'
+ BtuPerSecondSquareInch = 'BtuPerSecondSquareInch'
"""
"""
- BtuPerSecondSquareFoot = 'btu_per_second_square_foot'
+ BtuPerSecondSquareFoot = 'BtuPerSecondSquareFoot'
"""
"""
- BtuPerMinuteSquareFoot = 'btu_per_minute_square_foot'
+ BtuPerMinuteSquareFoot = 'BtuPerMinuteSquareFoot'
"""
"""
- BtuPerHourSquareFoot = 'btu_per_hour_square_foot'
+ BtuPerHourSquareFoot = 'BtuPerHourSquareFoot'
"""
"""
- CaloriePerSecondSquareCentimeter = 'calorie_per_second_square_centimeter'
+ CaloriePerSecondSquareCentimeter = 'CaloriePerSecondSquareCentimeter'
"""
"""
- KilocaloriePerHourSquareMeter = 'kilocalorie_per_hour_square_meter'
+ KilocaloriePerHourSquareMeter = 'KilocaloriePerHourSquareMeter'
"""
"""
- PoundForcePerFootSecond = 'pound_force_per_foot_second'
+ PoundForcePerFootSecond = 'PoundForcePerFootSecond'
"""
"""
- PoundPerSecondCubed = 'pound_per_second_cubed'
+ PoundPerSecondCubed = 'PoundPerSecondCubed'
"""
"""
- NanowattPerSquareMeter = 'nanowatt_per_square_meter'
+ NanowattPerSquareMeter = 'NanowattPerSquareMeter'
"""
"""
- MicrowattPerSquareMeter = 'microwatt_per_square_meter'
+ MicrowattPerSquareMeter = 'MicrowattPerSquareMeter'
"""
"""
- MilliwattPerSquareMeter = 'milliwatt_per_square_meter'
+ MilliwattPerSquareMeter = 'MilliwattPerSquareMeter'
"""
"""
- CentiwattPerSquareMeter = 'centiwatt_per_square_meter'
+ CentiwattPerSquareMeter = 'CentiwattPerSquareMeter'
"""
"""
- DeciwattPerSquareMeter = 'deciwatt_per_square_meter'
+ DeciwattPerSquareMeter = 'DeciwattPerSquareMeter'
"""
"""
- KilowattPerSquareMeter = 'kilowatt_per_square_meter'
+ KilowattPerSquareMeter = 'KilowattPerSquareMeter'
"""
"""
- KilocaloriePerSecondSquareCentimeter = 'kilocalorie_per_second_square_centimeter'
+ KilocaloriePerSecondSquareCentimeter = 'KilocaloriePerSecondSquareCentimeter'
"""
"""
+class HeatFluxDto:
+ """
+ A DTO representation of a HeatFlux
+
+ Attributes:
+ value (float): The value of the HeatFlux.
+ unit (HeatFluxUnits): The specific unit that the HeatFlux value is representing.
+ """
+
+ def __init__(self, value: float, unit: HeatFluxUnits):
+ """
+ Create a new DTO representation of a HeatFlux
+
+ Parameters:
+ value (float): The value of the HeatFlux.
+ unit (HeatFluxUnits): The specific unit that the HeatFlux value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the HeatFlux
+ """
+ self.unit: HeatFluxUnits = unit
+ """
+ The specific unit that the HeatFlux value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a HeatFlux DTO JSON object representing the current unit.
+
+ :return: JSON object represents HeatFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of HeatFlux DTO from a json representation.
+
+ :param data: The HeatFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerSquareMeter"}
+ :return: A new instance of HeatFluxDto.
+ :rtype: HeatFluxDto
+ """
+ return HeatFluxDto(value=data["value"], unit=HeatFluxUnits(data["unit"]))
+
+
class HeatFlux(AbstractMeasure):
"""
Heat flux is the flow of energy per unit of area per unit of time
@@ -156,6 +206,54 @@ def __init__(self, value: float, from_unit: HeatFluxUnits = HeatFluxUnits.WattPe
def convert(self, unit: HeatFluxUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: HeatFluxUnits = HeatFluxUnits.WattPerSquareMeter) -> HeatFluxDto:
+ """
+ Get a new instance of HeatFlux DTO representing the current unit.
+
+ :param hold_in_unit: The specific HeatFlux unit to store the HeatFlux value in the DTO representation.
+ :type hold_in_unit: HeatFluxUnits
+ :return: A new instance of HeatFluxDto.
+ :rtype: HeatFluxDto
+ """
+ return HeatFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: HeatFluxUnits = HeatFluxUnits.WattPerSquareMeter):
+ """
+ Get a HeatFlux DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific HeatFlux unit to store the HeatFlux value in the DTO representation.
+ :type hold_in_unit: HeatFluxUnits
+ :return: JSON object represents HeatFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(heat_flux_dto: HeatFluxDto):
+ """
+ Obtain a new instance of HeatFlux from a DTO unit object.
+
+ :param heat_flux_dto: The HeatFlux DTO representation.
+ :type heat_flux_dto: HeatFluxDto
+ :return: A new instance of HeatFlux.
+ :rtype: HeatFlux
+ """
+ return HeatFlux(heat_flux_dto.value, heat_flux_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of HeatFlux from a DTO unit json representation.
+
+ :param data: The HeatFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerSquareMeter"}
+ :return: A new instance of HeatFlux.
+ :rtype: HeatFlux
+ """
+ return HeatFlux.from_dto(HeatFluxDto.from_json(data))
+
def __convert_from_base(self, from_unit: HeatFluxUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/heat_transfer_coefficient.py b/unitsnet_py/units/heat_transfer_coefficient.py
index 1ec0e0b..a485a7b 100644
--- a/unitsnet_py/units/heat_transfer_coefficient.py
+++ b/unitsnet_py/units/heat_transfer_coefficient.py
@@ -10,32 +10,82 @@ class HeatTransferCoefficientUnits(Enum):
HeatTransferCoefficientUnits enumeration
"""
- WattPerSquareMeterKelvin = 'watt_per_square_meter_kelvin'
+ WattPerSquareMeterKelvin = 'WattPerSquareMeterKelvin'
"""
"""
- WattPerSquareMeterCelsius = 'watt_per_square_meter_celsius'
+ WattPerSquareMeterCelsius = 'WattPerSquareMeterCelsius'
"""
"""
- BtuPerHourSquareFootDegreeFahrenheit = 'btu_per_hour_square_foot_degree_fahrenheit'
+ BtuPerHourSquareFootDegreeFahrenheit = 'BtuPerHourSquareFootDegreeFahrenheit'
"""
"""
- CaloriePerHourSquareMeterDegreeCelsius = 'calorie_per_hour_square_meter_degree_celsius'
+ CaloriePerHourSquareMeterDegreeCelsius = 'CaloriePerHourSquareMeterDegreeCelsius'
"""
"""
- KilocaloriePerHourSquareMeterDegreeCelsius = 'kilocalorie_per_hour_square_meter_degree_celsius'
+ KilocaloriePerHourSquareMeterDegreeCelsius = 'KilocaloriePerHourSquareMeterDegreeCelsius'
"""
"""
+class HeatTransferCoefficientDto:
+ """
+ A DTO representation of a HeatTransferCoefficient
+
+ Attributes:
+ value (float): The value of the HeatTransferCoefficient.
+ unit (HeatTransferCoefficientUnits): The specific unit that the HeatTransferCoefficient value is representing.
+ """
+
+ def __init__(self, value: float, unit: HeatTransferCoefficientUnits):
+ """
+ Create a new DTO representation of a HeatTransferCoefficient
+
+ Parameters:
+ value (float): The value of the HeatTransferCoefficient.
+ unit (HeatTransferCoefficientUnits): The specific unit that the HeatTransferCoefficient value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the HeatTransferCoefficient
+ """
+ self.unit: HeatTransferCoefficientUnits = unit
+ """
+ The specific unit that the HeatTransferCoefficient value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a HeatTransferCoefficient DTO JSON object representing the current unit.
+
+ :return: JSON object represents HeatTransferCoefficient DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerSquareMeterKelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of HeatTransferCoefficient DTO from a json representation.
+
+ :param data: The HeatTransferCoefficient DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerSquareMeterKelvin"}
+ :return: A new instance of HeatTransferCoefficientDto.
+ :rtype: HeatTransferCoefficientDto
+ """
+ return HeatTransferCoefficientDto(value=data["value"], unit=HeatTransferCoefficientUnits(data["unit"]))
+
+
class HeatTransferCoefficient(AbstractMeasure):
"""
The heat transfer coefficient or film coefficient, or film effectiveness, in thermodynamics and in mechanics is the proportionality constant between the heat flux and the thermodynamic driving force for the flow of heat (i.e., the temperature difference, ΔT)
@@ -65,6 +115,54 @@ def __init__(self, value: float, from_unit: HeatTransferCoefficientUnits = HeatT
def convert(self, unit: HeatTransferCoefficientUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: HeatTransferCoefficientUnits = HeatTransferCoefficientUnits.WattPerSquareMeterKelvin) -> HeatTransferCoefficientDto:
+ """
+ Get a new instance of HeatTransferCoefficient DTO representing the current unit.
+
+ :param hold_in_unit: The specific HeatTransferCoefficient unit to store the HeatTransferCoefficient value in the DTO representation.
+ :type hold_in_unit: HeatTransferCoefficientUnits
+ :return: A new instance of HeatTransferCoefficientDto.
+ :rtype: HeatTransferCoefficientDto
+ """
+ return HeatTransferCoefficientDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: HeatTransferCoefficientUnits = HeatTransferCoefficientUnits.WattPerSquareMeterKelvin):
+ """
+ Get a HeatTransferCoefficient DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific HeatTransferCoefficient unit to store the HeatTransferCoefficient value in the DTO representation.
+ :type hold_in_unit: HeatTransferCoefficientUnits
+ :return: JSON object represents HeatTransferCoefficient DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerSquareMeterKelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(heat_transfer_coefficient_dto: HeatTransferCoefficientDto):
+ """
+ Obtain a new instance of HeatTransferCoefficient from a DTO unit object.
+
+ :param heat_transfer_coefficient_dto: The HeatTransferCoefficient DTO representation.
+ :type heat_transfer_coefficient_dto: HeatTransferCoefficientDto
+ :return: A new instance of HeatTransferCoefficient.
+ :rtype: HeatTransferCoefficient
+ """
+ return HeatTransferCoefficient(heat_transfer_coefficient_dto.value, heat_transfer_coefficient_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of HeatTransferCoefficient from a DTO unit json representation.
+
+ :param data: The HeatTransferCoefficient DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerSquareMeterKelvin"}
+ :return: A new instance of HeatTransferCoefficient.
+ :rtype: HeatTransferCoefficient
+ """
+ return HeatTransferCoefficient.from_dto(HeatTransferCoefficientDto.from_json(data))
+
def __convert_from_base(self, from_unit: HeatTransferCoefficientUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/illuminance.py b/unitsnet_py/units/illuminance.py
index 688568b..24748fd 100644
--- a/unitsnet_py/units/illuminance.py
+++ b/unitsnet_py/units/illuminance.py
@@ -10,27 +10,77 @@ class IlluminanceUnits(Enum):
IlluminanceUnits enumeration
"""
- Lux = 'lux'
+ Lux = 'Lux'
"""
"""
- Millilux = 'millilux'
+ Millilux = 'Millilux'
"""
"""
- Kilolux = 'kilolux'
+ Kilolux = 'Kilolux'
"""
"""
- Megalux = 'megalux'
+ Megalux = 'Megalux'
"""
"""
+class IlluminanceDto:
+ """
+ A DTO representation of a Illuminance
+
+ Attributes:
+ value (float): The value of the Illuminance.
+ unit (IlluminanceUnits): The specific unit that the Illuminance value is representing.
+ """
+
+ def __init__(self, value: float, unit: IlluminanceUnits):
+ """
+ Create a new DTO representation of a Illuminance
+
+ Parameters:
+ value (float): The value of the Illuminance.
+ unit (IlluminanceUnits): The specific unit that the Illuminance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Illuminance
+ """
+ self.unit: IlluminanceUnits = unit
+ """
+ The specific unit that the Illuminance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Illuminance DTO JSON object representing the current unit.
+
+ :return: JSON object represents Illuminance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Lux"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Illuminance DTO from a json representation.
+
+ :param data: The Illuminance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Lux"}
+ :return: A new instance of IlluminanceDto.
+ :rtype: IlluminanceDto
+ """
+ return IlluminanceDto(value=data["value"], unit=IlluminanceUnits(data["unit"]))
+
+
class Illuminance(AbstractMeasure):
"""
In photometry, illuminance is the total luminous flux incident on a surface, per unit area.
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: IlluminanceUnits = IlluminanceUnits.
def convert(self, unit: IlluminanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: IlluminanceUnits = IlluminanceUnits.Lux) -> IlluminanceDto:
+ """
+ Get a new instance of Illuminance DTO representing the current unit.
+
+ :param hold_in_unit: The specific Illuminance unit to store the Illuminance value in the DTO representation.
+ :type hold_in_unit: IlluminanceUnits
+ :return: A new instance of IlluminanceDto.
+ :rtype: IlluminanceDto
+ """
+ return IlluminanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: IlluminanceUnits = IlluminanceUnits.Lux):
+ """
+ Get a Illuminance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Illuminance unit to store the Illuminance value in the DTO representation.
+ :type hold_in_unit: IlluminanceUnits
+ :return: JSON object represents Illuminance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Lux"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(illuminance_dto: IlluminanceDto):
+ """
+ Obtain a new instance of Illuminance from a DTO unit object.
+
+ :param illuminance_dto: The Illuminance DTO representation.
+ :type illuminance_dto: IlluminanceDto
+ :return: A new instance of Illuminance.
+ :rtype: Illuminance
+ """
+ return Illuminance(illuminance_dto.value, illuminance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Illuminance from a DTO unit json representation.
+
+ :param data: The Illuminance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Lux"}
+ :return: A new instance of Illuminance.
+ :rtype: Illuminance
+ """
+ return Illuminance.from_dto(IlluminanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: IlluminanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/impulse.py b/unitsnet_py/units/impulse.py
index e25feca..9a8fb34 100644
--- a/unitsnet_py/units/impulse.py
+++ b/unitsnet_py/units/impulse.py
@@ -10,72 +10,122 @@ class ImpulseUnits(Enum):
ImpulseUnits enumeration
"""
- KilogramMeterPerSecond = 'kilogram_meter_per_second'
+ KilogramMeterPerSecond = 'KilogramMeterPerSecond'
"""
"""
- NewtonSecond = 'newton_second'
+ NewtonSecond = 'NewtonSecond'
"""
"""
- PoundFootPerSecond = 'pound_foot_per_second'
+ PoundFootPerSecond = 'PoundFootPerSecond'
"""
"""
- PoundForceSecond = 'pound_force_second'
+ PoundForceSecond = 'PoundForceSecond'
"""
"""
- SlugFootPerSecond = 'slug_foot_per_second'
+ SlugFootPerSecond = 'SlugFootPerSecond'
"""
"""
- NanonewtonSecond = 'nanonewton_second'
+ NanonewtonSecond = 'NanonewtonSecond'
"""
"""
- MicronewtonSecond = 'micronewton_second'
+ MicronewtonSecond = 'MicronewtonSecond'
"""
"""
- MillinewtonSecond = 'millinewton_second'
+ MillinewtonSecond = 'MillinewtonSecond'
"""
"""
- CentinewtonSecond = 'centinewton_second'
+ CentinewtonSecond = 'CentinewtonSecond'
"""
"""
- DecinewtonSecond = 'decinewton_second'
+ DecinewtonSecond = 'DecinewtonSecond'
"""
"""
- DecanewtonSecond = 'decanewton_second'
+ DecanewtonSecond = 'DecanewtonSecond'
"""
"""
- KilonewtonSecond = 'kilonewton_second'
+ KilonewtonSecond = 'KilonewtonSecond'
"""
"""
- MeganewtonSecond = 'meganewton_second'
+ MeganewtonSecond = 'MeganewtonSecond'
"""
"""
+class ImpulseDto:
+ """
+ A DTO representation of a Impulse
+
+ Attributes:
+ value (float): The value of the Impulse.
+ unit (ImpulseUnits): The specific unit that the Impulse value is representing.
+ """
+
+ def __init__(self, value: float, unit: ImpulseUnits):
+ """
+ Create a new DTO representation of a Impulse
+
+ Parameters:
+ value (float): The value of the Impulse.
+ unit (ImpulseUnits): The specific unit that the Impulse value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Impulse
+ """
+ self.unit: ImpulseUnits = unit
+ """
+ The specific unit that the Impulse value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Impulse DTO JSON object representing the current unit.
+
+ :return: JSON object represents Impulse DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Impulse DTO from a json representation.
+
+ :param data: The Impulse DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonSecond"}
+ :return: A new instance of ImpulseDto.
+ :rtype: ImpulseDto
+ """
+ return ImpulseDto(value=data["value"], unit=ImpulseUnits(data["unit"]))
+
+
class Impulse(AbstractMeasure):
"""
In classical mechanics, impulse is the integral of a force, F, over the time interval, t, for which it acts. Impulse applied to an object produces an equivalent vector change in its linear momentum, also in the resultant direction.
@@ -121,6 +171,54 @@ def __init__(self, value: float, from_unit: ImpulseUnits = ImpulseUnits.NewtonSe
def convert(self, unit: ImpulseUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ImpulseUnits = ImpulseUnits.NewtonSecond) -> ImpulseDto:
+ """
+ Get a new instance of Impulse DTO representing the current unit.
+
+ :param hold_in_unit: The specific Impulse unit to store the Impulse value in the DTO representation.
+ :type hold_in_unit: ImpulseUnits
+ :return: A new instance of ImpulseDto.
+ :rtype: ImpulseDto
+ """
+ return ImpulseDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ImpulseUnits = ImpulseUnits.NewtonSecond):
+ """
+ Get a Impulse DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Impulse unit to store the Impulse value in the DTO representation.
+ :type hold_in_unit: ImpulseUnits
+ :return: JSON object represents Impulse DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(impulse_dto: ImpulseDto):
+ """
+ Obtain a new instance of Impulse from a DTO unit object.
+
+ :param impulse_dto: The Impulse DTO representation.
+ :type impulse_dto: ImpulseDto
+ :return: A new instance of Impulse.
+ :rtype: Impulse
+ """
+ return Impulse(impulse_dto.value, impulse_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Impulse from a DTO unit json representation.
+
+ :param data: The Impulse DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonSecond"}
+ :return: A new instance of Impulse.
+ :rtype: Impulse
+ """
+ return Impulse.from_dto(ImpulseDto.from_json(data))
+
def __convert_from_base(self, from_unit: ImpulseUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/information.py b/unitsnet_py/units/information.py
index 8d48cba..4d84c36 100644
--- a/unitsnet_py/units/information.py
+++ b/unitsnet_py/units/information.py
@@ -10,77 +10,127 @@ class InformationUnits(Enum):
InformationUnits enumeration
"""
- Byte = 'byte'
+ Byte = 'Byte'
"""
"""
- Bit = 'bit'
+ Bit = 'Bit'
"""
"""
- Kilobyte = 'kilobyte'
+ Kilobyte = 'Kilobyte'
"""
"""
- Megabyte = 'megabyte'
+ Megabyte = 'Megabyte'
"""
"""
- Gigabyte = 'gigabyte'
+ Gigabyte = 'Gigabyte'
"""
"""
- Terabyte = 'terabyte'
+ Terabyte = 'Terabyte'
"""
"""
- Petabyte = 'petabyte'
+ Petabyte = 'Petabyte'
"""
"""
- Exabyte = 'exabyte'
+ Exabyte = 'Exabyte'
"""
"""
- Kilobit = 'kilobit'
+ Kilobit = 'Kilobit'
"""
"""
- Megabit = 'megabit'
+ Megabit = 'Megabit'
"""
"""
- Gigabit = 'gigabit'
+ Gigabit = 'Gigabit'
"""
"""
- Terabit = 'terabit'
+ Terabit = 'Terabit'
"""
"""
- Petabit = 'petabit'
+ Petabit = 'Petabit'
"""
"""
- Exabit = 'exabit'
+ Exabit = 'Exabit'
"""
"""
+class InformationDto:
+ """
+ A DTO representation of a Information
+
+ Attributes:
+ value (float): The value of the Information.
+ unit (InformationUnits): The specific unit that the Information value is representing.
+ """
+
+ def __init__(self, value: float, unit: InformationUnits):
+ """
+ Create a new DTO representation of a Information
+
+ Parameters:
+ value (float): The value of the Information.
+ unit (InformationUnits): The specific unit that the Information value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Information
+ """
+ self.unit: InformationUnits = unit
+ """
+ The specific unit that the Information value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Information DTO JSON object representing the current unit.
+
+ :return: JSON object represents Information DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Bit"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Information DTO from a json representation.
+
+ :param data: The Information DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Bit"}
+ :return: A new instance of InformationDto.
+ :rtype: InformationDto
+ """
+ return InformationDto(value=data["value"], unit=InformationUnits(data["unit"]))
+
+
class Information(AbstractMeasure):
"""
In computing and telecommunications, a unit of information is the capacity of some standard data storage system or communication channel, used to measure the capacities of other systems and channels. In information theory, units of information are also used to measure the information contents or entropy of random variables.
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: InformationUnits = InformationUnits.
def convert(self, unit: InformationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: InformationUnits = InformationUnits.Bit) -> InformationDto:
+ """
+ Get a new instance of Information DTO representing the current unit.
+
+ :param hold_in_unit: The specific Information unit to store the Information value in the DTO representation.
+ :type hold_in_unit: InformationUnits
+ :return: A new instance of InformationDto.
+ :rtype: InformationDto
+ """
+ return InformationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: InformationUnits = InformationUnits.Bit):
+ """
+ Get a Information DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Information unit to store the Information value in the DTO representation.
+ :type hold_in_unit: InformationUnits
+ :return: JSON object represents Information DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Bit"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(information_dto: InformationDto):
+ """
+ Obtain a new instance of Information from a DTO unit object.
+
+ :param information_dto: The Information DTO representation.
+ :type information_dto: InformationDto
+ :return: A new instance of Information.
+ :rtype: Information
+ """
+ return Information(information_dto.value, information_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Information from a DTO unit json representation.
+
+ :param data: The Information DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Bit"}
+ :return: A new instance of Information.
+ :rtype: Information
+ """
+ return Information.from_dto(InformationDto.from_json(data))
+
def __convert_from_base(self, from_unit: InformationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/irradiance.py b/unitsnet_py/units/irradiance.py
index 98cb688..18025eb 100644
--- a/unitsnet_py/units/irradiance.py
+++ b/unitsnet_py/units/irradiance.py
@@ -10,77 +10,127 @@ class IrradianceUnits(Enum):
IrradianceUnits enumeration
"""
- WattPerSquareMeter = 'watt_per_square_meter'
+ WattPerSquareMeter = 'WattPerSquareMeter'
"""
"""
- WattPerSquareCentimeter = 'watt_per_square_centimeter'
+ WattPerSquareCentimeter = 'WattPerSquareCentimeter'
"""
"""
- PicowattPerSquareMeter = 'picowatt_per_square_meter'
+ PicowattPerSquareMeter = 'PicowattPerSquareMeter'
"""
"""
- NanowattPerSquareMeter = 'nanowatt_per_square_meter'
+ NanowattPerSquareMeter = 'NanowattPerSquareMeter'
"""
"""
- MicrowattPerSquareMeter = 'microwatt_per_square_meter'
+ MicrowattPerSquareMeter = 'MicrowattPerSquareMeter'
"""
"""
- MilliwattPerSquareMeter = 'milliwatt_per_square_meter'
+ MilliwattPerSquareMeter = 'MilliwattPerSquareMeter'
"""
"""
- KilowattPerSquareMeter = 'kilowatt_per_square_meter'
+ KilowattPerSquareMeter = 'KilowattPerSquareMeter'
"""
"""
- MegawattPerSquareMeter = 'megawatt_per_square_meter'
+ MegawattPerSquareMeter = 'MegawattPerSquareMeter'
"""
"""
- PicowattPerSquareCentimeter = 'picowatt_per_square_centimeter'
+ PicowattPerSquareCentimeter = 'PicowattPerSquareCentimeter'
"""
"""
- NanowattPerSquareCentimeter = 'nanowatt_per_square_centimeter'
+ NanowattPerSquareCentimeter = 'NanowattPerSquareCentimeter'
"""
"""
- MicrowattPerSquareCentimeter = 'microwatt_per_square_centimeter'
+ MicrowattPerSquareCentimeter = 'MicrowattPerSquareCentimeter'
"""
"""
- MilliwattPerSquareCentimeter = 'milliwatt_per_square_centimeter'
+ MilliwattPerSquareCentimeter = 'MilliwattPerSquareCentimeter'
"""
"""
- KilowattPerSquareCentimeter = 'kilowatt_per_square_centimeter'
+ KilowattPerSquareCentimeter = 'KilowattPerSquareCentimeter'
"""
"""
- MegawattPerSquareCentimeter = 'megawatt_per_square_centimeter'
+ MegawattPerSquareCentimeter = 'MegawattPerSquareCentimeter'
"""
"""
+class IrradianceDto:
+ """
+ A DTO representation of a Irradiance
+
+ Attributes:
+ value (float): The value of the Irradiance.
+ unit (IrradianceUnits): The specific unit that the Irradiance value is representing.
+ """
+
+ def __init__(self, value: float, unit: IrradianceUnits):
+ """
+ Create a new DTO representation of a Irradiance
+
+ Parameters:
+ value (float): The value of the Irradiance.
+ unit (IrradianceUnits): The specific unit that the Irradiance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Irradiance
+ """
+ self.unit: IrradianceUnits = unit
+ """
+ The specific unit that the Irradiance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Irradiance DTO JSON object representing the current unit.
+
+ :return: JSON object represents Irradiance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Irradiance DTO from a json representation.
+
+ :param data: The Irradiance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerSquareMeter"}
+ :return: A new instance of IrradianceDto.
+ :rtype: IrradianceDto
+ """
+ return IrradianceDto(value=data["value"], unit=IrradianceUnits(data["unit"]))
+
+
class Irradiance(AbstractMeasure):
"""
Irradiance is the intensity of ultraviolet (UV) or visible light incident on a surface.
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: IrradianceUnits = IrradianceUnits.Wa
def convert(self, unit: IrradianceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: IrradianceUnits = IrradianceUnits.WattPerSquareMeter) -> IrradianceDto:
+ """
+ Get a new instance of Irradiance DTO representing the current unit.
+
+ :param hold_in_unit: The specific Irradiance unit to store the Irradiance value in the DTO representation.
+ :type hold_in_unit: IrradianceUnits
+ :return: A new instance of IrradianceDto.
+ :rtype: IrradianceDto
+ """
+ return IrradianceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: IrradianceUnits = IrradianceUnits.WattPerSquareMeter):
+ """
+ Get a Irradiance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Irradiance unit to store the Irradiance value in the DTO representation.
+ :type hold_in_unit: IrradianceUnits
+ :return: JSON object represents Irradiance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(irradiance_dto: IrradianceDto):
+ """
+ Obtain a new instance of Irradiance from a DTO unit object.
+
+ :param irradiance_dto: The Irradiance DTO representation.
+ :type irradiance_dto: IrradianceDto
+ :return: A new instance of Irradiance.
+ :rtype: Irradiance
+ """
+ return Irradiance(irradiance_dto.value, irradiance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Irradiance from a DTO unit json representation.
+
+ :param data: The Irradiance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerSquareMeter"}
+ :return: A new instance of Irradiance.
+ :rtype: Irradiance
+ """
+ return Irradiance.from_dto(IrradianceDto.from_json(data))
+
def __convert_from_base(self, from_unit: IrradianceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/irradiation.py b/unitsnet_py/units/irradiation.py
index 5cff7c3..f9903f8 100644
--- a/unitsnet_py/units/irradiation.py
+++ b/unitsnet_py/units/irradiation.py
@@ -10,52 +10,102 @@ class IrradiationUnits(Enum):
IrradiationUnits enumeration
"""
- JoulePerSquareMeter = 'joule_per_square_meter'
+ JoulePerSquareMeter = 'JoulePerSquareMeter'
"""
"""
- JoulePerSquareCentimeter = 'joule_per_square_centimeter'
+ JoulePerSquareCentimeter = 'JoulePerSquareCentimeter'
"""
"""
- JoulePerSquareMillimeter = 'joule_per_square_millimeter'
+ JoulePerSquareMillimeter = 'JoulePerSquareMillimeter'
"""
"""
- WattHourPerSquareMeter = 'watt_hour_per_square_meter'
+ WattHourPerSquareMeter = 'WattHourPerSquareMeter'
"""
"""
- BtuPerSquareFoot = 'btu_per_square_foot'
+ BtuPerSquareFoot = 'BtuPerSquareFoot'
"""
"""
- KilojoulePerSquareMeter = 'kilojoule_per_square_meter'
+ KilojoulePerSquareMeter = 'KilojoulePerSquareMeter'
"""
"""
- MillijoulePerSquareCentimeter = 'millijoule_per_square_centimeter'
+ MillijoulePerSquareCentimeter = 'MillijoulePerSquareCentimeter'
"""
"""
- KilowattHourPerSquareMeter = 'kilowatt_hour_per_square_meter'
+ KilowattHourPerSquareMeter = 'KilowattHourPerSquareMeter'
"""
"""
- KilobtuPerSquareFoot = 'kilobtu_per_square_foot'
+ KilobtuPerSquareFoot = 'KilobtuPerSquareFoot'
"""
"""
+class IrradiationDto:
+ """
+ A DTO representation of a Irradiation
+
+ Attributes:
+ value (float): The value of the Irradiation.
+ unit (IrradiationUnits): The specific unit that the Irradiation value is representing.
+ """
+
+ def __init__(self, value: float, unit: IrradiationUnits):
+ """
+ Create a new DTO representation of a Irradiation
+
+ Parameters:
+ value (float): The value of the Irradiation.
+ unit (IrradiationUnits): The specific unit that the Irradiation value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Irradiation
+ """
+ self.unit: IrradiationUnits = unit
+ """
+ The specific unit that the Irradiation value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Irradiation DTO JSON object representing the current unit.
+
+ :return: JSON object represents Irradiation DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Irradiation DTO from a json representation.
+
+ :param data: The Irradiation DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerSquareMeter"}
+ :return: A new instance of IrradiationDto.
+ :rtype: IrradiationDto
+ """
+ return IrradiationDto(value=data["value"], unit=IrradiationUnits(data["unit"]))
+
+
class Irradiation(AbstractMeasure):
"""
Irradiation is the process by which an object is exposed to radiation. The exposure can originate from various sources, including natural sources.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: IrradiationUnits = IrradiationUnits.
def convert(self, unit: IrradiationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: IrradiationUnits = IrradiationUnits.JoulePerSquareMeter) -> IrradiationDto:
+ """
+ Get a new instance of Irradiation DTO representing the current unit.
+
+ :param hold_in_unit: The specific Irradiation unit to store the Irradiation value in the DTO representation.
+ :type hold_in_unit: IrradiationUnits
+ :return: A new instance of IrradiationDto.
+ :rtype: IrradiationDto
+ """
+ return IrradiationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: IrradiationUnits = IrradiationUnits.JoulePerSquareMeter):
+ """
+ Get a Irradiation DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Irradiation unit to store the Irradiation value in the DTO representation.
+ :type hold_in_unit: IrradiationUnits
+ :return: JSON object represents Irradiation DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(irradiation_dto: IrradiationDto):
+ """
+ Obtain a new instance of Irradiation from a DTO unit object.
+
+ :param irradiation_dto: The Irradiation DTO representation.
+ :type irradiation_dto: IrradiationDto
+ :return: A new instance of Irradiation.
+ :rtype: Irradiation
+ """
+ return Irradiation(irradiation_dto.value, irradiation_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Irradiation from a DTO unit json representation.
+
+ :param data: The Irradiation DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerSquareMeter"}
+ :return: A new instance of Irradiation.
+ :rtype: Irradiation
+ """
+ return Irradiation.from_dto(IrradiationDto.from_json(data))
+
def __convert_from_base(self, from_unit: IrradiationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/jerk.py b/unitsnet_py/units/jerk.py
index 3d27828..a728fb5 100644
--- a/unitsnet_py/units/jerk.py
+++ b/unitsnet_py/units/jerk.py
@@ -10,62 +10,112 @@ class JerkUnits(Enum):
JerkUnits enumeration
"""
- MeterPerSecondCubed = 'meter_per_second_cubed'
+ MeterPerSecondCubed = 'MeterPerSecondCubed'
"""
"""
- InchPerSecondCubed = 'inch_per_second_cubed'
+ InchPerSecondCubed = 'InchPerSecondCubed'
"""
"""
- FootPerSecondCubed = 'foot_per_second_cubed'
+ FootPerSecondCubed = 'FootPerSecondCubed'
"""
"""
- StandardGravitiesPerSecond = 'standard_gravities_per_second'
+ StandardGravitiesPerSecond = 'StandardGravitiesPerSecond'
"""
"""
- NanometerPerSecondCubed = 'nanometer_per_second_cubed'
+ NanometerPerSecondCubed = 'NanometerPerSecondCubed'
"""
"""
- MicrometerPerSecondCubed = 'micrometer_per_second_cubed'
+ MicrometerPerSecondCubed = 'MicrometerPerSecondCubed'
"""
"""
- MillimeterPerSecondCubed = 'millimeter_per_second_cubed'
+ MillimeterPerSecondCubed = 'MillimeterPerSecondCubed'
"""
"""
- CentimeterPerSecondCubed = 'centimeter_per_second_cubed'
+ CentimeterPerSecondCubed = 'CentimeterPerSecondCubed'
"""
"""
- DecimeterPerSecondCubed = 'decimeter_per_second_cubed'
+ DecimeterPerSecondCubed = 'DecimeterPerSecondCubed'
"""
"""
- KilometerPerSecondCubed = 'kilometer_per_second_cubed'
+ KilometerPerSecondCubed = 'KilometerPerSecondCubed'
"""
"""
- MillistandardGravitiesPerSecond = 'millistandard_gravities_per_second'
+ MillistandardGravitiesPerSecond = 'MillistandardGravitiesPerSecond'
"""
"""
+class JerkDto:
+ """
+ A DTO representation of a Jerk
+
+ Attributes:
+ value (float): The value of the Jerk.
+ unit (JerkUnits): The specific unit that the Jerk value is representing.
+ """
+
+ def __init__(self, value: float, unit: JerkUnits):
+ """
+ Create a new DTO representation of a Jerk
+
+ Parameters:
+ value (float): The value of the Jerk.
+ unit (JerkUnits): The specific unit that the Jerk value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Jerk
+ """
+ self.unit: JerkUnits = unit
+ """
+ The specific unit that the Jerk value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Jerk DTO JSON object representing the current unit.
+
+ :return: JSON object represents Jerk DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterPerSecondCubed"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Jerk DTO from a json representation.
+
+ :param data: The Jerk DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterPerSecondCubed"}
+ :return: A new instance of JerkDto.
+ :rtype: JerkDto
+ """
+ return JerkDto(value=data["value"], unit=JerkUnits(data["unit"]))
+
+
class Jerk(AbstractMeasure):
"""
None
@@ -107,6 +157,54 @@ def __init__(self, value: float, from_unit: JerkUnits = JerkUnits.MeterPerSecond
def convert(self, unit: JerkUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: JerkUnits = JerkUnits.MeterPerSecondCubed) -> JerkDto:
+ """
+ Get a new instance of Jerk DTO representing the current unit.
+
+ :param hold_in_unit: The specific Jerk unit to store the Jerk value in the DTO representation.
+ :type hold_in_unit: JerkUnits
+ :return: A new instance of JerkDto.
+ :rtype: JerkDto
+ """
+ return JerkDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: JerkUnits = JerkUnits.MeterPerSecondCubed):
+ """
+ Get a Jerk DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Jerk unit to store the Jerk value in the DTO representation.
+ :type hold_in_unit: JerkUnits
+ :return: JSON object represents Jerk DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterPerSecondCubed"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(jerk_dto: JerkDto):
+ """
+ Obtain a new instance of Jerk from a DTO unit object.
+
+ :param jerk_dto: The Jerk DTO representation.
+ :type jerk_dto: JerkDto
+ :return: A new instance of Jerk.
+ :rtype: Jerk
+ """
+ return Jerk(jerk_dto.value, jerk_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Jerk from a DTO unit json representation.
+
+ :param data: The Jerk DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterPerSecondCubed"}
+ :return: A new instance of Jerk.
+ :rtype: Jerk
+ """
+ return Jerk.from_dto(JerkDto.from_json(data))
+
def __convert_from_base(self, from_unit: JerkUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/kinematic_viscosity.py b/unitsnet_py/units/kinematic_viscosity.py
index aebb256..4346955 100644
--- a/unitsnet_py/units/kinematic_viscosity.py
+++ b/unitsnet_py/units/kinematic_viscosity.py
@@ -10,52 +10,102 @@ class KinematicViscosityUnits(Enum):
KinematicViscosityUnits enumeration
"""
- SquareMeterPerSecond = 'square_meter_per_second'
+ SquareMeterPerSecond = 'SquareMeterPerSecond'
"""
"""
- Stokes = 'stokes'
+ Stokes = 'Stokes'
"""
"""
- SquareFootPerSecond = 'square_foot_per_second'
+ SquareFootPerSecond = 'SquareFootPerSecond'
"""
"""
- Nanostokes = 'nanostokes'
+ Nanostokes = 'Nanostokes'
"""
"""
- Microstokes = 'microstokes'
+ Microstokes = 'Microstokes'
"""
"""
- Millistokes = 'millistokes'
+ Millistokes = 'Millistokes'
"""
"""
- Centistokes = 'centistokes'
+ Centistokes = 'Centistokes'
"""
"""
- Decistokes = 'decistokes'
+ Decistokes = 'Decistokes'
"""
"""
- Kilostokes = 'kilostokes'
+ Kilostokes = 'Kilostokes'
"""
"""
+class KinematicViscosityDto:
+ """
+ A DTO representation of a KinematicViscosity
+
+ Attributes:
+ value (float): The value of the KinematicViscosity.
+ unit (KinematicViscosityUnits): The specific unit that the KinematicViscosity value is representing.
+ """
+
+ def __init__(self, value: float, unit: KinematicViscosityUnits):
+ """
+ Create a new DTO representation of a KinematicViscosity
+
+ Parameters:
+ value (float): The value of the KinematicViscosity.
+ unit (KinematicViscosityUnits): The specific unit that the KinematicViscosity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the KinematicViscosity
+ """
+ self.unit: KinematicViscosityUnits = unit
+ """
+ The specific unit that the KinematicViscosity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a KinematicViscosity DTO JSON object representing the current unit.
+
+ :return: JSON object represents KinematicViscosity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeterPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of KinematicViscosity DTO from a json representation.
+
+ :param data: The KinematicViscosity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeterPerSecond"}
+ :return: A new instance of KinematicViscosityDto.
+ :rtype: KinematicViscosityDto
+ """
+ return KinematicViscosityDto(value=data["value"], unit=KinematicViscosityUnits(data["unit"]))
+
+
class KinematicViscosity(AbstractMeasure):
"""
The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: KinematicViscosityUnits = KinematicV
def convert(self, unit: KinematicViscosityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: KinematicViscosityUnits = KinematicViscosityUnits.SquareMeterPerSecond) -> KinematicViscosityDto:
+ """
+ Get a new instance of KinematicViscosity DTO representing the current unit.
+
+ :param hold_in_unit: The specific KinematicViscosity unit to store the KinematicViscosity value in the DTO representation.
+ :type hold_in_unit: KinematicViscosityUnits
+ :return: A new instance of KinematicViscosityDto.
+ :rtype: KinematicViscosityDto
+ """
+ return KinematicViscosityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: KinematicViscosityUnits = KinematicViscosityUnits.SquareMeterPerSecond):
+ """
+ Get a KinematicViscosity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific KinematicViscosity unit to store the KinematicViscosity value in the DTO representation.
+ :type hold_in_unit: KinematicViscosityUnits
+ :return: JSON object represents KinematicViscosity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeterPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(kinematic_viscosity_dto: KinematicViscosityDto):
+ """
+ Obtain a new instance of KinematicViscosity from a DTO unit object.
+
+ :param kinematic_viscosity_dto: The KinematicViscosity DTO representation.
+ :type kinematic_viscosity_dto: KinematicViscosityDto
+ :return: A new instance of KinematicViscosity.
+ :rtype: KinematicViscosity
+ """
+ return KinematicViscosity(kinematic_viscosity_dto.value, kinematic_viscosity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of KinematicViscosity from a DTO unit json representation.
+
+ :param data: The KinematicViscosity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeterPerSecond"}
+ :return: A new instance of KinematicViscosity.
+ :rtype: KinematicViscosity
+ """
+ return KinematicViscosity.from_dto(KinematicViscosityDto.from_json(data))
+
def __convert_from_base(self, from_unit: KinematicViscosityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/leak_rate.py b/unitsnet_py/units/leak_rate.py
index 98f6c4d..10d2c96 100644
--- a/unitsnet_py/units/leak_rate.py
+++ b/unitsnet_py/units/leak_rate.py
@@ -10,22 +10,72 @@ class LeakRateUnits(Enum):
LeakRateUnits enumeration
"""
- PascalCubicMeterPerSecond = 'pascal_cubic_meter_per_second'
+ PascalCubicMeterPerSecond = 'PascalCubicMeterPerSecond'
"""
"""
- MillibarLiterPerSecond = 'millibar_liter_per_second'
+ MillibarLiterPerSecond = 'MillibarLiterPerSecond'
"""
"""
- TorrLiterPerSecond = 'torr_liter_per_second'
+ TorrLiterPerSecond = 'TorrLiterPerSecond'
"""
"""
+class LeakRateDto:
+ """
+ A DTO representation of a LeakRate
+
+ Attributes:
+ value (float): The value of the LeakRate.
+ unit (LeakRateUnits): The specific unit that the LeakRate value is representing.
+ """
+
+ def __init__(self, value: float, unit: LeakRateUnits):
+ """
+ Create a new DTO representation of a LeakRate
+
+ Parameters:
+ value (float): The value of the LeakRate.
+ unit (LeakRateUnits): The specific unit that the LeakRate value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the LeakRate
+ """
+ self.unit: LeakRateUnits = unit
+ """
+ The specific unit that the LeakRate value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a LeakRate DTO JSON object representing the current unit.
+
+ :return: JSON object represents LeakRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "PascalCubicMeterPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of LeakRate DTO from a json representation.
+
+ :param data: The LeakRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "PascalCubicMeterPerSecond"}
+ :return: A new instance of LeakRateDto.
+ :rtype: LeakRateDto
+ """
+ return LeakRateDto(value=data["value"], unit=LeakRateUnits(data["unit"]))
+
+
class LeakRate(AbstractMeasure):
"""
A leakage rate of QL = 1 Pa-m³/s is given when the pressure in a closed, evacuated container with a volume of 1 m³ rises by 1 Pa per second or when the pressure in the container drops by 1 Pa in the event of overpressure.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: LeakRateUnits = LeakRateUnits.Pascal
def convert(self, unit: LeakRateUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LeakRateUnits = LeakRateUnits.PascalCubicMeterPerSecond) -> LeakRateDto:
+ """
+ Get a new instance of LeakRate DTO representing the current unit.
+
+ :param hold_in_unit: The specific LeakRate unit to store the LeakRate value in the DTO representation.
+ :type hold_in_unit: LeakRateUnits
+ :return: A new instance of LeakRateDto.
+ :rtype: LeakRateDto
+ """
+ return LeakRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LeakRateUnits = LeakRateUnits.PascalCubicMeterPerSecond):
+ """
+ Get a LeakRate DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific LeakRate unit to store the LeakRate value in the DTO representation.
+ :type hold_in_unit: LeakRateUnits
+ :return: JSON object represents LeakRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "PascalCubicMeterPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(leak_rate_dto: LeakRateDto):
+ """
+ Obtain a new instance of LeakRate from a DTO unit object.
+
+ :param leak_rate_dto: The LeakRate DTO representation.
+ :type leak_rate_dto: LeakRateDto
+ :return: A new instance of LeakRate.
+ :rtype: LeakRate
+ """
+ return LeakRate(leak_rate_dto.value, leak_rate_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of LeakRate from a DTO unit json representation.
+
+ :param data: The LeakRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "PascalCubicMeterPerSecond"}
+ :return: A new instance of LeakRate.
+ :rtype: LeakRate
+ """
+ return LeakRate.from_dto(LeakRateDto.from_json(data))
+
def __convert_from_base(self, from_unit: LeakRateUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/length.py b/unitsnet_py/units/length.py
index 25eeb78..1af3b8a 100644
--- a/unitsnet_py/units/length.py
+++ b/unitsnet_py/units/length.py
@@ -10,217 +10,267 @@ class LengthUnits(Enum):
LengthUnits enumeration
"""
- Meter = 'meter'
+ Meter = 'Meter'
"""
"""
- Mile = 'mile'
+ Mile = 'Mile'
"""
The statute mile was standardised between the British Commonwealth and the United States by an international agreement in 1959, when it was formally redefined with respect to SI units as exactly 1,609.344 metres.
"""
- Yard = 'yard'
+ Yard = 'Yard'
"""
The yard (symbol: yd) is an English unit of length in both the British imperial and US customary systems of measurement equalling 3 feet (or 36 inches). Since 1959 the yard has been by international agreement standardized as exactly 0.9144 meter. A distance of 1,760 yards is equal to 1 mile.
"""
- Foot = 'foot'
+ Foot = 'Foot'
"""
"""
- UsSurveyFoot = 'us_survey_foot'
+ UsSurveyFoot = 'UsSurveyFoot'
"""
In the United States, the foot was defined as 12 inches, with the inch being defined by the Mendenhall Order of 1893 as 39.37 inches = 1 m. This makes a U.S. survey foot exactly 1200/3937 meters.
"""
- Inch = 'inch'
+ Inch = 'Inch'
"""
"""
- Mil = 'mil'
+ Mil = 'Mil'
"""
"""
- NauticalMile = 'nautical_mile'
+ NauticalMile = 'NauticalMile'
"""
"""
- Fathom = 'fathom'
+ Fathom = 'Fathom'
"""
"""
- Shackle = 'shackle'
+ Shackle = 'Shackle'
"""
"""
- Microinch = 'microinch'
+ Microinch = 'Microinch'
"""
"""
- PrinterPoint = 'printer_point'
+ PrinterPoint = 'PrinterPoint'
"""
"""
- DtpPoint = 'dtp_point'
+ DtpPoint = 'DtpPoint'
"""
"""
- PrinterPica = 'printer_pica'
+ PrinterPica = 'PrinterPica'
"""
"""
- DtpPica = 'dtp_pica'
+ DtpPica = 'DtpPica'
"""
"""
- Twip = 'twip'
+ Twip = 'Twip'
"""
"""
- Hand = 'hand'
+ Hand = 'Hand'
"""
"""
- AstronomicalUnit = 'astronomical_unit'
+ AstronomicalUnit = 'AstronomicalUnit'
"""
One Astronomical Unit is the distance from the solar system Star, the sun, to planet Earth.
"""
- Parsec = 'parsec'
+ Parsec = 'Parsec'
"""
A parsec is defined as the distance at which one astronomical unit (AU) subtends an angle of one arcsecond.
"""
- LightYear = 'light_year'
+ LightYear = 'LightYear'
"""
A Light Year (ly) is the distance that light travel during an Earth year, ie 365 days.
"""
- SolarRadius = 'solar_radius'
+ SolarRadius = 'SolarRadius'
"""
Solar radius is a ratio unit to the radius of the solar system star, the sun.
"""
- Chain = 'chain'
+ Chain = 'Chain'
"""
"""
- Angstrom = 'angstrom'
+ Angstrom = 'Angstrom'
"""
Angstrom is a metric unit of length equal to 1e-10 meter
"""
- DataMile = 'data_mile'
+ DataMile = 'DataMile'
"""
In radar-related subjects and in JTIDS, a data mile is a unit of distance equal to 6000 feet (1.8288 kilometres or 0.987 nautical miles).
"""
- Femtometer = 'femtometer'
+ Femtometer = 'Femtometer'
"""
"""
- Picometer = 'picometer'
+ Picometer = 'Picometer'
"""
"""
- Nanometer = 'nanometer'
+ Nanometer = 'Nanometer'
"""
"""
- Micrometer = 'micrometer'
+ Micrometer = 'Micrometer'
"""
"""
- Millimeter = 'millimeter'
+ Millimeter = 'Millimeter'
"""
"""
- Centimeter = 'centimeter'
+ Centimeter = 'Centimeter'
"""
"""
- Decimeter = 'decimeter'
+ Decimeter = 'Decimeter'
"""
"""
- Decameter = 'decameter'
+ Decameter = 'Decameter'
"""
"""
- Hectometer = 'hectometer'
+ Hectometer = 'Hectometer'
"""
"""
- Kilometer = 'kilometer'
+ Kilometer = 'Kilometer'
"""
"""
- Megameter = 'megameter'
+ Megameter = 'Megameter'
"""
"""
- Gigameter = 'gigameter'
+ Gigameter = 'Gigameter'
"""
"""
- Kiloyard = 'kiloyard'
+ Kiloyard = 'Kiloyard'
"""
"""
- Kilofoot = 'kilofoot'
+ Kilofoot = 'Kilofoot'
"""
"""
- Kiloparsec = 'kiloparsec'
+ Kiloparsec = 'Kiloparsec'
"""
"""
- Megaparsec = 'megaparsec'
+ Megaparsec = 'Megaparsec'
"""
"""
- KilolightYear = 'kilolight_year'
+ KilolightYear = 'KilolightYear'
"""
"""
- MegalightYear = 'megalight_year'
+ MegalightYear = 'MegalightYear'
"""
"""
+class LengthDto:
+ """
+ A DTO representation of a Length
+
+ Attributes:
+ value (float): The value of the Length.
+ unit (LengthUnits): The specific unit that the Length value is representing.
+ """
+
+ def __init__(self, value: float, unit: LengthUnits):
+ """
+ Create a new DTO representation of a Length
+
+ Parameters:
+ value (float): The value of the Length.
+ unit (LengthUnits): The specific unit that the Length value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Length
+ """
+ self.unit: LengthUnits = unit
+ """
+ The specific unit that the Length value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Length DTO JSON object representing the current unit.
+
+ :return: JSON object represents Length DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Meter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Length DTO from a json representation.
+
+ :param data: The Length DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Meter"}
+ :return: A new instance of LengthDto.
+ :rtype: LengthDto
+ """
+ return LengthDto(value=data["value"], unit=LengthUnits(data["unit"]))
+
+
class Length(AbstractMeasure):
"""
Many different units of length have been used around the world. The main units in modern use are U.S. customary units in the United States and the Metric system elsewhere. British Imperial units are still used for some purposes in the United Kingdom and some other countries. The metric system is sub-divided into SI and non-SI units.
@@ -324,6 +374,54 @@ def __init__(self, value: float, from_unit: LengthUnits = LengthUnits.Meter):
def convert(self, unit: LengthUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LengthUnits = LengthUnits.Meter) -> LengthDto:
+ """
+ Get a new instance of Length DTO representing the current unit.
+
+ :param hold_in_unit: The specific Length unit to store the Length value in the DTO representation.
+ :type hold_in_unit: LengthUnits
+ :return: A new instance of LengthDto.
+ :rtype: LengthDto
+ """
+ return LengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LengthUnits = LengthUnits.Meter):
+ """
+ Get a Length DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Length unit to store the Length value in the DTO representation.
+ :type hold_in_unit: LengthUnits
+ :return: JSON object represents Length DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Meter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(length_dto: LengthDto):
+ """
+ Obtain a new instance of Length from a DTO unit object.
+
+ :param length_dto: The Length DTO representation.
+ :type length_dto: LengthDto
+ :return: A new instance of Length.
+ :rtype: Length
+ """
+ return Length(length_dto.value, length_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Length from a DTO unit json representation.
+
+ :param data: The Length DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Meter"}
+ :return: A new instance of Length.
+ :rtype: Length
+ """
+ return Length.from_dto(LengthDto.from_json(data))
+
def __convert_from_base(self, from_unit: LengthUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/level.py b/unitsnet_py/units/level.py
index 814d996..2ddf6c5 100644
--- a/unitsnet_py/units/level.py
+++ b/unitsnet_py/units/level.py
@@ -10,17 +10,67 @@ class LevelUnits(Enum):
LevelUnits enumeration
"""
- Decibel = 'decibel'
+ Decibel = 'Decibel'
"""
"""
- Neper = 'neper'
+ Neper = 'Neper'
"""
"""
+class LevelDto:
+ """
+ A DTO representation of a Level
+
+ Attributes:
+ value (float): The value of the Level.
+ unit (LevelUnits): The specific unit that the Level value is representing.
+ """
+
+ def __init__(self, value: float, unit: LevelUnits):
+ """
+ Create a new DTO representation of a Level
+
+ Parameters:
+ value (float): The value of the Level.
+ unit (LevelUnits): The specific unit that the Level value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Level
+ """
+ self.unit: LevelUnits = unit
+ """
+ The specific unit that the Level value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Level DTO JSON object representing the current unit.
+
+ :return: JSON object represents Level DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Decibel"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Level DTO from a json representation.
+
+ :param data: The Level DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Decibel"}
+ :return: A new instance of LevelDto.
+ :rtype: LevelDto
+ """
+ return LevelDto(value=data["value"], unit=LevelUnits(data["unit"]))
+
+
class Level(AbstractMeasure):
"""
Level is the logarithm of the ratio of a quantity Q to a reference value of that quantity, Q₀, expressed in dimensionless units.
@@ -44,6 +94,54 @@ def __init__(self, value: float, from_unit: LevelUnits = LevelUnits.Decibel):
def convert(self, unit: LevelUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LevelUnits = LevelUnits.Decibel) -> LevelDto:
+ """
+ Get a new instance of Level DTO representing the current unit.
+
+ :param hold_in_unit: The specific Level unit to store the Level value in the DTO representation.
+ :type hold_in_unit: LevelUnits
+ :return: A new instance of LevelDto.
+ :rtype: LevelDto
+ """
+ return LevelDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LevelUnits = LevelUnits.Decibel):
+ """
+ Get a Level DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Level unit to store the Level value in the DTO representation.
+ :type hold_in_unit: LevelUnits
+ :return: JSON object represents Level DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Decibel"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(level_dto: LevelDto):
+ """
+ Obtain a new instance of Level from a DTO unit object.
+
+ :param level_dto: The Level DTO representation.
+ :type level_dto: LevelDto
+ :return: A new instance of Level.
+ :rtype: Level
+ """
+ return Level(level_dto.value, level_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Level from a DTO unit json representation.
+
+ :param data: The Level DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Decibel"}
+ :return: A new instance of Level.
+ :rtype: Level
+ """
+ return Level.from_dto(LevelDto.from_json(data))
+
def __convert_from_base(self, from_unit: LevelUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/linear_density.py b/unitsnet_py/units/linear_density.py
index 68ad6dd..f0c9582 100644
--- a/unitsnet_py/units/linear_density.py
+++ b/unitsnet_py/units/linear_density.py
@@ -10,77 +10,127 @@ class LinearDensityUnits(Enum):
LinearDensityUnits enumeration
"""
- GramPerMillimeter = 'gram_per_millimeter'
+ GramPerMillimeter = 'GramPerMillimeter'
"""
"""
- GramPerCentimeter = 'gram_per_centimeter'
+ GramPerCentimeter = 'GramPerCentimeter'
"""
"""
- GramPerMeter = 'gram_per_meter'
+ GramPerMeter = 'GramPerMeter'
"""
"""
- PoundPerInch = 'pound_per_inch'
+ PoundPerInch = 'PoundPerInch'
"""
"""
- PoundPerFoot = 'pound_per_foot'
+ PoundPerFoot = 'PoundPerFoot'
"""
"""
- MicrogramPerMillimeter = 'microgram_per_millimeter'
+ MicrogramPerMillimeter = 'MicrogramPerMillimeter'
"""
"""
- MilligramPerMillimeter = 'milligram_per_millimeter'
+ MilligramPerMillimeter = 'MilligramPerMillimeter'
"""
"""
- KilogramPerMillimeter = 'kilogram_per_millimeter'
+ KilogramPerMillimeter = 'KilogramPerMillimeter'
"""
"""
- MicrogramPerCentimeter = 'microgram_per_centimeter'
+ MicrogramPerCentimeter = 'MicrogramPerCentimeter'
"""
"""
- MilligramPerCentimeter = 'milligram_per_centimeter'
+ MilligramPerCentimeter = 'MilligramPerCentimeter'
"""
"""
- KilogramPerCentimeter = 'kilogram_per_centimeter'
+ KilogramPerCentimeter = 'KilogramPerCentimeter'
"""
"""
- MicrogramPerMeter = 'microgram_per_meter'
+ MicrogramPerMeter = 'MicrogramPerMeter'
"""
"""
- MilligramPerMeter = 'milligram_per_meter'
+ MilligramPerMeter = 'MilligramPerMeter'
"""
"""
- KilogramPerMeter = 'kilogram_per_meter'
+ KilogramPerMeter = 'KilogramPerMeter'
"""
"""
+class LinearDensityDto:
+ """
+ A DTO representation of a LinearDensity
+
+ Attributes:
+ value (float): The value of the LinearDensity.
+ unit (LinearDensityUnits): The specific unit that the LinearDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: LinearDensityUnits):
+ """
+ Create a new DTO representation of a LinearDensity
+
+ Parameters:
+ value (float): The value of the LinearDensity.
+ unit (LinearDensityUnits): The specific unit that the LinearDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the LinearDensity
+ """
+ self.unit: LinearDensityUnits = unit
+ """
+ The specific unit that the LinearDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a LinearDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents LinearDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of LinearDensity DTO from a json representation.
+
+ :param data: The LinearDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerMeter"}
+ :return: A new instance of LinearDensityDto.
+ :rtype: LinearDensityDto
+ """
+ return LinearDensityDto(value=data["value"], unit=LinearDensityUnits(data["unit"]))
+
+
class LinearDensity(AbstractMeasure):
"""
The Linear Density, or more precisely, the linear mass density, of a substance is its mass per unit length. The term linear density is most often used when describing the characteristics of one-dimensional objects, although linear density can also be used to describe the density of a three-dimensional quantity along one particular dimension.
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: LinearDensityUnits = LinearDensityUn
def convert(self, unit: LinearDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LinearDensityUnits = LinearDensityUnits.KilogramPerMeter) -> LinearDensityDto:
+ """
+ Get a new instance of LinearDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific LinearDensity unit to store the LinearDensity value in the DTO representation.
+ :type hold_in_unit: LinearDensityUnits
+ :return: A new instance of LinearDensityDto.
+ :rtype: LinearDensityDto
+ """
+ return LinearDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LinearDensityUnits = LinearDensityUnits.KilogramPerMeter):
+ """
+ Get a LinearDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific LinearDensity unit to store the LinearDensity value in the DTO representation.
+ :type hold_in_unit: LinearDensityUnits
+ :return: JSON object represents LinearDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(linear_density_dto: LinearDensityDto):
+ """
+ Obtain a new instance of LinearDensity from a DTO unit object.
+
+ :param linear_density_dto: The LinearDensity DTO representation.
+ :type linear_density_dto: LinearDensityDto
+ :return: A new instance of LinearDensity.
+ :rtype: LinearDensity
+ """
+ return LinearDensity(linear_density_dto.value, linear_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of LinearDensity from a DTO unit json representation.
+
+ :param data: The LinearDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerMeter"}
+ :return: A new instance of LinearDensity.
+ :rtype: LinearDensity
+ """
+ return LinearDensity.from_dto(LinearDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: LinearDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/linear_power_density.py b/unitsnet_py/units/linear_power_density.py
index 82b72c1..c81bb0b 100644
--- a/unitsnet_py/units/linear_power_density.py
+++ b/unitsnet_py/units/linear_power_density.py
@@ -10,132 +10,182 @@ class LinearPowerDensityUnits(Enum):
LinearPowerDensityUnits enumeration
"""
- WattPerMeter = 'watt_per_meter'
+ WattPerMeter = 'WattPerMeter'
"""
"""
- WattPerCentimeter = 'watt_per_centimeter'
+ WattPerCentimeter = 'WattPerCentimeter'
"""
"""
- WattPerMillimeter = 'watt_per_millimeter'
+ WattPerMillimeter = 'WattPerMillimeter'
"""
"""
- WattPerInch = 'watt_per_inch'
+ WattPerInch = 'WattPerInch'
"""
"""
- WattPerFoot = 'watt_per_foot'
+ WattPerFoot = 'WattPerFoot'
"""
"""
- MilliwattPerMeter = 'milliwatt_per_meter'
+ MilliwattPerMeter = 'MilliwattPerMeter'
"""
"""
- KilowattPerMeter = 'kilowatt_per_meter'
+ KilowattPerMeter = 'KilowattPerMeter'
"""
"""
- MegawattPerMeter = 'megawatt_per_meter'
+ MegawattPerMeter = 'MegawattPerMeter'
"""
"""
- GigawattPerMeter = 'gigawatt_per_meter'
+ GigawattPerMeter = 'GigawattPerMeter'
"""
"""
- MilliwattPerCentimeter = 'milliwatt_per_centimeter'
+ MilliwattPerCentimeter = 'MilliwattPerCentimeter'
"""
"""
- KilowattPerCentimeter = 'kilowatt_per_centimeter'
+ KilowattPerCentimeter = 'KilowattPerCentimeter'
"""
"""
- MegawattPerCentimeter = 'megawatt_per_centimeter'
+ MegawattPerCentimeter = 'MegawattPerCentimeter'
"""
"""
- GigawattPerCentimeter = 'gigawatt_per_centimeter'
+ GigawattPerCentimeter = 'GigawattPerCentimeter'
"""
"""
- MilliwattPerMillimeter = 'milliwatt_per_millimeter'
+ MilliwattPerMillimeter = 'MilliwattPerMillimeter'
"""
"""
- KilowattPerMillimeter = 'kilowatt_per_millimeter'
+ KilowattPerMillimeter = 'KilowattPerMillimeter'
"""
"""
- MegawattPerMillimeter = 'megawatt_per_millimeter'
+ MegawattPerMillimeter = 'MegawattPerMillimeter'
"""
"""
- GigawattPerMillimeter = 'gigawatt_per_millimeter'
+ GigawattPerMillimeter = 'GigawattPerMillimeter'
"""
"""
- MilliwattPerInch = 'milliwatt_per_inch'
+ MilliwattPerInch = 'MilliwattPerInch'
"""
"""
- KilowattPerInch = 'kilowatt_per_inch'
+ KilowattPerInch = 'KilowattPerInch'
"""
"""
- MegawattPerInch = 'megawatt_per_inch'
+ MegawattPerInch = 'MegawattPerInch'
"""
"""
- GigawattPerInch = 'gigawatt_per_inch'
+ GigawattPerInch = 'GigawattPerInch'
"""
"""
- MilliwattPerFoot = 'milliwatt_per_foot'
+ MilliwattPerFoot = 'MilliwattPerFoot'
"""
"""
- KilowattPerFoot = 'kilowatt_per_foot'
+ KilowattPerFoot = 'KilowattPerFoot'
"""
"""
- MegawattPerFoot = 'megawatt_per_foot'
+ MegawattPerFoot = 'MegawattPerFoot'
"""
"""
- GigawattPerFoot = 'gigawatt_per_foot'
+ GigawattPerFoot = 'GigawattPerFoot'
"""
"""
+class LinearPowerDensityDto:
+ """
+ A DTO representation of a LinearPowerDensity
+
+ Attributes:
+ value (float): The value of the LinearPowerDensity.
+ unit (LinearPowerDensityUnits): The specific unit that the LinearPowerDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: LinearPowerDensityUnits):
+ """
+ Create a new DTO representation of a LinearPowerDensity
+
+ Parameters:
+ value (float): The value of the LinearPowerDensity.
+ unit (LinearPowerDensityUnits): The specific unit that the LinearPowerDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the LinearPowerDensity
+ """
+ self.unit: LinearPowerDensityUnits = unit
+ """
+ The specific unit that the LinearPowerDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a LinearPowerDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents LinearPowerDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of LinearPowerDensity DTO from a json representation.
+
+ :param data: The LinearPowerDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerMeter"}
+ :return: A new instance of LinearPowerDensityDto.
+ :rtype: LinearPowerDensityDto
+ """
+ return LinearPowerDensityDto(value=data["value"], unit=LinearPowerDensityUnits(data["unit"]))
+
+
class LinearPowerDensity(AbstractMeasure):
"""
The Linear Power Density of a substance is its power per unit length. The term linear density is most often used when describing the characteristics of one-dimensional objects, although linear density can also be used to describe the density of a three-dimensional quantity along one particular dimension.
@@ -205,6 +255,54 @@ def __init__(self, value: float, from_unit: LinearPowerDensityUnits = LinearPowe
def convert(self, unit: LinearPowerDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LinearPowerDensityUnits = LinearPowerDensityUnits.WattPerMeter) -> LinearPowerDensityDto:
+ """
+ Get a new instance of LinearPowerDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific LinearPowerDensity unit to store the LinearPowerDensity value in the DTO representation.
+ :type hold_in_unit: LinearPowerDensityUnits
+ :return: A new instance of LinearPowerDensityDto.
+ :rtype: LinearPowerDensityDto
+ """
+ return LinearPowerDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LinearPowerDensityUnits = LinearPowerDensityUnits.WattPerMeter):
+ """
+ Get a LinearPowerDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific LinearPowerDensity unit to store the LinearPowerDensity value in the DTO representation.
+ :type hold_in_unit: LinearPowerDensityUnits
+ :return: JSON object represents LinearPowerDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(linear_power_density_dto: LinearPowerDensityDto):
+ """
+ Obtain a new instance of LinearPowerDensity from a DTO unit object.
+
+ :param linear_power_density_dto: The LinearPowerDensity DTO representation.
+ :type linear_power_density_dto: LinearPowerDensityDto
+ :return: A new instance of LinearPowerDensity.
+ :rtype: LinearPowerDensity
+ """
+ return LinearPowerDensity(linear_power_density_dto.value, linear_power_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of LinearPowerDensity from a DTO unit json representation.
+
+ :param data: The LinearPowerDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerMeter"}
+ :return: A new instance of LinearPowerDensity.
+ :rtype: LinearPowerDensity
+ """
+ return LinearPowerDensity.from_dto(LinearPowerDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: LinearPowerDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/luminance.py b/unitsnet_py/units/luminance.py
index a61315e..e83dcdc 100644
--- a/unitsnet_py/units/luminance.py
+++ b/unitsnet_py/units/luminance.py
@@ -10,57 +10,107 @@ class LuminanceUnits(Enum):
LuminanceUnits enumeration
"""
- CandelaPerSquareMeter = 'candela_per_square_meter'
+ CandelaPerSquareMeter = 'CandelaPerSquareMeter'
"""
"""
- CandelaPerSquareFoot = 'candela_per_square_foot'
+ CandelaPerSquareFoot = 'CandelaPerSquareFoot'
"""
"""
- CandelaPerSquareInch = 'candela_per_square_inch'
+ CandelaPerSquareInch = 'CandelaPerSquareInch'
"""
"""
- Nit = 'nit'
+ Nit = 'Nit'
"""
"""
- NanocandelaPerSquareMeter = 'nanocandela_per_square_meter'
+ NanocandelaPerSquareMeter = 'NanocandelaPerSquareMeter'
"""
"""
- MicrocandelaPerSquareMeter = 'microcandela_per_square_meter'
+ MicrocandelaPerSquareMeter = 'MicrocandelaPerSquareMeter'
"""
"""
- MillicandelaPerSquareMeter = 'millicandela_per_square_meter'
+ MillicandelaPerSquareMeter = 'MillicandelaPerSquareMeter'
"""
"""
- CenticandelaPerSquareMeter = 'centicandela_per_square_meter'
+ CenticandelaPerSquareMeter = 'CenticandelaPerSquareMeter'
"""
"""
- DecicandelaPerSquareMeter = 'decicandela_per_square_meter'
+ DecicandelaPerSquareMeter = 'DecicandelaPerSquareMeter'
"""
"""
- KilocandelaPerSquareMeter = 'kilocandela_per_square_meter'
+ KilocandelaPerSquareMeter = 'KilocandelaPerSquareMeter'
"""
"""
+class LuminanceDto:
+ """
+ A DTO representation of a Luminance
+
+ Attributes:
+ value (float): The value of the Luminance.
+ unit (LuminanceUnits): The specific unit that the Luminance value is representing.
+ """
+
+ def __init__(self, value: float, unit: LuminanceUnits):
+ """
+ Create a new DTO representation of a Luminance
+
+ Parameters:
+ value (float): The value of the Luminance.
+ unit (LuminanceUnits): The specific unit that the Luminance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Luminance
+ """
+ self.unit: LuminanceUnits = unit
+ """
+ The specific unit that the Luminance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Luminance DTO JSON object representing the current unit.
+
+ :return: JSON object represents Luminance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CandelaPerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Luminance DTO from a json representation.
+
+ :param data: The Luminance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CandelaPerSquareMeter"}
+ :return: A new instance of LuminanceDto.
+ :rtype: LuminanceDto
+ """
+ return LuminanceDto(value=data["value"], unit=LuminanceUnits(data["unit"]))
+
+
class Luminance(AbstractMeasure):
"""
None
@@ -100,6 +150,54 @@ def __init__(self, value: float, from_unit: LuminanceUnits = LuminanceUnits.Cand
def convert(self, unit: LuminanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LuminanceUnits = LuminanceUnits.CandelaPerSquareMeter) -> LuminanceDto:
+ """
+ Get a new instance of Luminance DTO representing the current unit.
+
+ :param hold_in_unit: The specific Luminance unit to store the Luminance value in the DTO representation.
+ :type hold_in_unit: LuminanceUnits
+ :return: A new instance of LuminanceDto.
+ :rtype: LuminanceDto
+ """
+ return LuminanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LuminanceUnits = LuminanceUnits.CandelaPerSquareMeter):
+ """
+ Get a Luminance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Luminance unit to store the Luminance value in the DTO representation.
+ :type hold_in_unit: LuminanceUnits
+ :return: JSON object represents Luminance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CandelaPerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(luminance_dto: LuminanceDto):
+ """
+ Obtain a new instance of Luminance from a DTO unit object.
+
+ :param luminance_dto: The Luminance DTO representation.
+ :type luminance_dto: LuminanceDto
+ :return: A new instance of Luminance.
+ :rtype: Luminance
+ """
+ return Luminance(luminance_dto.value, luminance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Luminance from a DTO unit json representation.
+
+ :param data: The Luminance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CandelaPerSquareMeter"}
+ :return: A new instance of Luminance.
+ :rtype: Luminance
+ """
+ return Luminance.from_dto(LuminanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: LuminanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/luminosity.py b/unitsnet_py/units/luminosity.py
index 35774c2..4df82de 100644
--- a/unitsnet_py/units/luminosity.py
+++ b/unitsnet_py/units/luminosity.py
@@ -10,77 +10,127 @@ class LuminosityUnits(Enum):
LuminosityUnits enumeration
"""
- Watt = 'watt'
+ Watt = 'Watt'
"""
"""
- SolarLuminosity = 'solar_luminosity'
+ SolarLuminosity = 'SolarLuminosity'
"""
"""
- Femtowatt = 'femtowatt'
+ Femtowatt = 'Femtowatt'
"""
"""
- Picowatt = 'picowatt'
+ Picowatt = 'Picowatt'
"""
"""
- Nanowatt = 'nanowatt'
+ Nanowatt = 'Nanowatt'
"""
"""
- Microwatt = 'microwatt'
+ Microwatt = 'Microwatt'
"""
"""
- Milliwatt = 'milliwatt'
+ Milliwatt = 'Milliwatt'
"""
"""
- Deciwatt = 'deciwatt'
+ Deciwatt = 'Deciwatt'
"""
"""
- Decawatt = 'decawatt'
+ Decawatt = 'Decawatt'
"""
"""
- Kilowatt = 'kilowatt'
+ Kilowatt = 'Kilowatt'
"""
"""
- Megawatt = 'megawatt'
+ Megawatt = 'Megawatt'
"""
"""
- Gigawatt = 'gigawatt'
+ Gigawatt = 'Gigawatt'
"""
"""
- Terawatt = 'terawatt'
+ Terawatt = 'Terawatt'
"""
"""
- Petawatt = 'petawatt'
+ Petawatt = 'Petawatt'
"""
"""
+class LuminosityDto:
+ """
+ A DTO representation of a Luminosity
+
+ Attributes:
+ value (float): The value of the Luminosity.
+ unit (LuminosityUnits): The specific unit that the Luminosity value is representing.
+ """
+
+ def __init__(self, value: float, unit: LuminosityUnits):
+ """
+ Create a new DTO representation of a Luminosity
+
+ Parameters:
+ value (float): The value of the Luminosity.
+ unit (LuminosityUnits): The specific unit that the Luminosity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Luminosity
+ """
+ self.unit: LuminosityUnits = unit
+ """
+ The specific unit that the Luminosity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Luminosity DTO JSON object representing the current unit.
+
+ :return: JSON object represents Luminosity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Watt"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Luminosity DTO from a json representation.
+
+ :param data: The Luminosity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Watt"}
+ :return: A new instance of LuminosityDto.
+ :rtype: LuminosityDto
+ """
+ return LuminosityDto(value=data["value"], unit=LuminosityUnits(data["unit"]))
+
+
class Luminosity(AbstractMeasure):
"""
Luminosity is an absolute measure of radiated electromagnetic power (light), the radiant power emitted by a light-emitting object.
@@ -128,6 +178,54 @@ def __init__(self, value: float, from_unit: LuminosityUnits = LuminosityUnits.Wa
def convert(self, unit: LuminosityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LuminosityUnits = LuminosityUnits.Watt) -> LuminosityDto:
+ """
+ Get a new instance of Luminosity DTO representing the current unit.
+
+ :param hold_in_unit: The specific Luminosity unit to store the Luminosity value in the DTO representation.
+ :type hold_in_unit: LuminosityUnits
+ :return: A new instance of LuminosityDto.
+ :rtype: LuminosityDto
+ """
+ return LuminosityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LuminosityUnits = LuminosityUnits.Watt):
+ """
+ Get a Luminosity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Luminosity unit to store the Luminosity value in the DTO representation.
+ :type hold_in_unit: LuminosityUnits
+ :return: JSON object represents Luminosity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Watt"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(luminosity_dto: LuminosityDto):
+ """
+ Obtain a new instance of Luminosity from a DTO unit object.
+
+ :param luminosity_dto: The Luminosity DTO representation.
+ :type luminosity_dto: LuminosityDto
+ :return: A new instance of Luminosity.
+ :rtype: Luminosity
+ """
+ return Luminosity(luminosity_dto.value, luminosity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Luminosity from a DTO unit json representation.
+
+ :param data: The Luminosity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Watt"}
+ :return: A new instance of Luminosity.
+ :rtype: Luminosity
+ """
+ return Luminosity.from_dto(LuminosityDto.from_json(data))
+
def __convert_from_base(self, from_unit: LuminosityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/luminous_flux.py b/unitsnet_py/units/luminous_flux.py
index 1ef4d71..bd61749 100644
--- a/unitsnet_py/units/luminous_flux.py
+++ b/unitsnet_py/units/luminous_flux.py
@@ -10,12 +10,62 @@ class LuminousFluxUnits(Enum):
LuminousFluxUnits enumeration
"""
- Lumen = 'lumen'
+ Lumen = 'Lumen'
"""
"""
+class LuminousFluxDto:
+ """
+ A DTO representation of a LuminousFlux
+
+ Attributes:
+ value (float): The value of the LuminousFlux.
+ unit (LuminousFluxUnits): The specific unit that the LuminousFlux value is representing.
+ """
+
+ def __init__(self, value: float, unit: LuminousFluxUnits):
+ """
+ Create a new DTO representation of a LuminousFlux
+
+ Parameters:
+ value (float): The value of the LuminousFlux.
+ unit (LuminousFluxUnits): The specific unit that the LuminousFlux value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the LuminousFlux
+ """
+ self.unit: LuminousFluxUnits = unit
+ """
+ The specific unit that the LuminousFlux value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a LuminousFlux DTO JSON object representing the current unit.
+
+ :return: JSON object represents LuminousFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Lumen"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of LuminousFlux DTO from a json representation.
+
+ :param data: The LuminousFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Lumen"}
+ :return: A new instance of LuminousFluxDto.
+ :rtype: LuminousFluxDto
+ """
+ return LuminousFluxDto(value=data["value"], unit=LuminousFluxUnits(data["unit"]))
+
+
class LuminousFlux(AbstractMeasure):
"""
In photometry, luminous flux or luminous power is the measure of the perceived power of light.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: LuminousFluxUnits = LuminousFluxUnit
def convert(self, unit: LuminousFluxUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LuminousFluxUnits = LuminousFluxUnits.Lumen) -> LuminousFluxDto:
+ """
+ Get a new instance of LuminousFlux DTO representing the current unit.
+
+ :param hold_in_unit: The specific LuminousFlux unit to store the LuminousFlux value in the DTO representation.
+ :type hold_in_unit: LuminousFluxUnits
+ :return: A new instance of LuminousFluxDto.
+ :rtype: LuminousFluxDto
+ """
+ return LuminousFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LuminousFluxUnits = LuminousFluxUnits.Lumen):
+ """
+ Get a LuminousFlux DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific LuminousFlux unit to store the LuminousFlux value in the DTO representation.
+ :type hold_in_unit: LuminousFluxUnits
+ :return: JSON object represents LuminousFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Lumen"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(luminous_flux_dto: LuminousFluxDto):
+ """
+ Obtain a new instance of LuminousFlux from a DTO unit object.
+
+ :param luminous_flux_dto: The LuminousFlux DTO representation.
+ :type luminous_flux_dto: LuminousFluxDto
+ :return: A new instance of LuminousFlux.
+ :rtype: LuminousFlux
+ """
+ return LuminousFlux(luminous_flux_dto.value, luminous_flux_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of LuminousFlux from a DTO unit json representation.
+
+ :param data: The LuminousFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Lumen"}
+ :return: A new instance of LuminousFlux.
+ :rtype: LuminousFlux
+ """
+ return LuminousFlux.from_dto(LuminousFluxDto.from_json(data))
+
def __convert_from_base(self, from_unit: LuminousFluxUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/luminous_intensity.py b/unitsnet_py/units/luminous_intensity.py
index 9cc16db..1349d15 100644
--- a/unitsnet_py/units/luminous_intensity.py
+++ b/unitsnet_py/units/luminous_intensity.py
@@ -10,12 +10,62 @@ class LuminousIntensityUnits(Enum):
LuminousIntensityUnits enumeration
"""
- Candela = 'candela'
+ Candela = 'Candela'
"""
"""
+class LuminousIntensityDto:
+ """
+ A DTO representation of a LuminousIntensity
+
+ Attributes:
+ value (float): The value of the LuminousIntensity.
+ unit (LuminousIntensityUnits): The specific unit that the LuminousIntensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: LuminousIntensityUnits):
+ """
+ Create a new DTO representation of a LuminousIntensity
+
+ Parameters:
+ value (float): The value of the LuminousIntensity.
+ unit (LuminousIntensityUnits): The specific unit that the LuminousIntensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the LuminousIntensity
+ """
+ self.unit: LuminousIntensityUnits = unit
+ """
+ The specific unit that the LuminousIntensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a LuminousIntensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents LuminousIntensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Candela"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of LuminousIntensity DTO from a json representation.
+
+ :param data: The LuminousIntensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Candela"}
+ :return: A new instance of LuminousIntensityDto.
+ :rtype: LuminousIntensityDto
+ """
+ return LuminousIntensityDto(value=data["value"], unit=LuminousIntensityUnits(data["unit"]))
+
+
class LuminousIntensity(AbstractMeasure):
"""
In photometry, luminous intensity is a measure of the wavelength-weighted power emitted by a light source in a particular direction per unit solid angle, based on the luminosity function, a standardized model of the sensitivity of the human eye.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: LuminousIntensityUnits = LuminousInt
def convert(self, unit: LuminousIntensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: LuminousIntensityUnits = LuminousIntensityUnits.Candela) -> LuminousIntensityDto:
+ """
+ Get a new instance of LuminousIntensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific LuminousIntensity unit to store the LuminousIntensity value in the DTO representation.
+ :type hold_in_unit: LuminousIntensityUnits
+ :return: A new instance of LuminousIntensityDto.
+ :rtype: LuminousIntensityDto
+ """
+ return LuminousIntensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: LuminousIntensityUnits = LuminousIntensityUnits.Candela):
+ """
+ Get a LuminousIntensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific LuminousIntensity unit to store the LuminousIntensity value in the DTO representation.
+ :type hold_in_unit: LuminousIntensityUnits
+ :return: JSON object represents LuminousIntensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Candela"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(luminous_intensity_dto: LuminousIntensityDto):
+ """
+ Obtain a new instance of LuminousIntensity from a DTO unit object.
+
+ :param luminous_intensity_dto: The LuminousIntensity DTO representation.
+ :type luminous_intensity_dto: LuminousIntensityDto
+ :return: A new instance of LuminousIntensity.
+ :rtype: LuminousIntensity
+ """
+ return LuminousIntensity(luminous_intensity_dto.value, luminous_intensity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of LuminousIntensity from a DTO unit json representation.
+
+ :param data: The LuminousIntensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Candela"}
+ :return: A new instance of LuminousIntensity.
+ :rtype: LuminousIntensity
+ """
+ return LuminousIntensity.from_dto(LuminousIntensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: LuminousIntensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/magnetic_field.py b/unitsnet_py/units/magnetic_field.py
index c787cc2..7f06293 100644
--- a/unitsnet_py/units/magnetic_field.py
+++ b/unitsnet_py/units/magnetic_field.py
@@ -10,37 +10,87 @@ class MagneticFieldUnits(Enum):
MagneticFieldUnits enumeration
"""
- Tesla = 'tesla'
+ Tesla = 'Tesla'
"""
"""
- Gauss = 'gauss'
+ Gauss = 'Gauss'
"""
"""
- Nanotesla = 'nanotesla'
+ Nanotesla = 'Nanotesla'
"""
"""
- Microtesla = 'microtesla'
+ Microtesla = 'Microtesla'
"""
"""
- Millitesla = 'millitesla'
+ Millitesla = 'Millitesla'
"""
"""
- Milligauss = 'milligauss'
+ Milligauss = 'Milligauss'
"""
"""
+class MagneticFieldDto:
+ """
+ A DTO representation of a MagneticField
+
+ Attributes:
+ value (float): The value of the MagneticField.
+ unit (MagneticFieldUnits): The specific unit that the MagneticField value is representing.
+ """
+
+ def __init__(self, value: float, unit: MagneticFieldUnits):
+ """
+ Create a new DTO representation of a MagneticField
+
+ Parameters:
+ value (float): The value of the MagneticField.
+ unit (MagneticFieldUnits): The specific unit that the MagneticField value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MagneticField
+ """
+ self.unit: MagneticFieldUnits = unit
+ """
+ The specific unit that the MagneticField value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MagneticField DTO JSON object representing the current unit.
+
+ :return: JSON object represents MagneticField DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Tesla"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MagneticField DTO from a json representation.
+
+ :param data: The MagneticField DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Tesla"}
+ :return: A new instance of MagneticFieldDto.
+ :rtype: MagneticFieldDto
+ """
+ return MagneticFieldDto(value=data["value"], unit=MagneticFieldUnits(data["unit"]))
+
+
class MagneticField(AbstractMeasure):
"""
A magnetic field is a force field that is created by moving electric charges (electric currents) and magnetic dipoles, and exerts a force on other nearby moving charges and magnetic dipoles.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: MagneticFieldUnits = MagneticFieldUn
def convert(self, unit: MagneticFieldUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MagneticFieldUnits = MagneticFieldUnits.Tesla) -> MagneticFieldDto:
+ """
+ Get a new instance of MagneticField DTO representing the current unit.
+
+ :param hold_in_unit: The specific MagneticField unit to store the MagneticField value in the DTO representation.
+ :type hold_in_unit: MagneticFieldUnits
+ :return: A new instance of MagneticFieldDto.
+ :rtype: MagneticFieldDto
+ """
+ return MagneticFieldDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MagneticFieldUnits = MagneticFieldUnits.Tesla):
+ """
+ Get a MagneticField DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MagneticField unit to store the MagneticField value in the DTO representation.
+ :type hold_in_unit: MagneticFieldUnits
+ :return: JSON object represents MagneticField DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Tesla"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(magnetic_field_dto: MagneticFieldDto):
+ """
+ Obtain a new instance of MagneticField from a DTO unit object.
+
+ :param magnetic_field_dto: The MagneticField DTO representation.
+ :type magnetic_field_dto: MagneticFieldDto
+ :return: A new instance of MagneticField.
+ :rtype: MagneticField
+ """
+ return MagneticField(magnetic_field_dto.value, magnetic_field_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MagneticField from a DTO unit json representation.
+
+ :param data: The MagneticField DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Tesla"}
+ :return: A new instance of MagneticField.
+ :rtype: MagneticField
+ """
+ return MagneticField.from_dto(MagneticFieldDto.from_json(data))
+
def __convert_from_base(self, from_unit: MagneticFieldUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/magnetic_flux.py b/unitsnet_py/units/magnetic_flux.py
index 56e736a..05da675 100644
--- a/unitsnet_py/units/magnetic_flux.py
+++ b/unitsnet_py/units/magnetic_flux.py
@@ -10,12 +10,62 @@ class MagneticFluxUnits(Enum):
MagneticFluxUnits enumeration
"""
- Weber = 'weber'
+ Weber = 'Weber'
"""
"""
+class MagneticFluxDto:
+ """
+ A DTO representation of a MagneticFlux
+
+ Attributes:
+ value (float): The value of the MagneticFlux.
+ unit (MagneticFluxUnits): The specific unit that the MagneticFlux value is representing.
+ """
+
+ def __init__(self, value: float, unit: MagneticFluxUnits):
+ """
+ Create a new DTO representation of a MagneticFlux
+
+ Parameters:
+ value (float): The value of the MagneticFlux.
+ unit (MagneticFluxUnits): The specific unit that the MagneticFlux value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MagneticFlux
+ """
+ self.unit: MagneticFluxUnits = unit
+ """
+ The specific unit that the MagneticFlux value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MagneticFlux DTO JSON object representing the current unit.
+
+ :return: JSON object represents MagneticFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Weber"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MagneticFlux DTO from a json representation.
+
+ :param data: The MagneticFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Weber"}
+ :return: A new instance of MagneticFluxDto.
+ :rtype: MagneticFluxDto
+ """
+ return MagneticFluxDto(value=data["value"], unit=MagneticFluxUnits(data["unit"]))
+
+
class MagneticFlux(AbstractMeasure):
"""
In physics, specifically electromagnetism, the magnetic flux through a surface is the surface integral of the normal component of the magnetic field B passing through that surface.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: MagneticFluxUnits = MagneticFluxUnit
def convert(self, unit: MagneticFluxUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MagneticFluxUnits = MagneticFluxUnits.Weber) -> MagneticFluxDto:
+ """
+ Get a new instance of MagneticFlux DTO representing the current unit.
+
+ :param hold_in_unit: The specific MagneticFlux unit to store the MagneticFlux value in the DTO representation.
+ :type hold_in_unit: MagneticFluxUnits
+ :return: A new instance of MagneticFluxDto.
+ :rtype: MagneticFluxDto
+ """
+ return MagneticFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MagneticFluxUnits = MagneticFluxUnits.Weber):
+ """
+ Get a MagneticFlux DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MagneticFlux unit to store the MagneticFlux value in the DTO representation.
+ :type hold_in_unit: MagneticFluxUnits
+ :return: JSON object represents MagneticFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Weber"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(magnetic_flux_dto: MagneticFluxDto):
+ """
+ Obtain a new instance of MagneticFlux from a DTO unit object.
+
+ :param magnetic_flux_dto: The MagneticFlux DTO representation.
+ :type magnetic_flux_dto: MagneticFluxDto
+ :return: A new instance of MagneticFlux.
+ :rtype: MagneticFlux
+ """
+ return MagneticFlux(magnetic_flux_dto.value, magnetic_flux_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MagneticFlux from a DTO unit json representation.
+
+ :param data: The MagneticFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Weber"}
+ :return: A new instance of MagneticFlux.
+ :rtype: MagneticFlux
+ """
+ return MagneticFlux.from_dto(MagneticFluxDto.from_json(data))
+
def __convert_from_base(self, from_unit: MagneticFluxUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/magnetization.py b/unitsnet_py/units/magnetization.py
index bed97dc..90dcee8 100644
--- a/unitsnet_py/units/magnetization.py
+++ b/unitsnet_py/units/magnetization.py
@@ -10,12 +10,62 @@ class MagnetizationUnits(Enum):
MagnetizationUnits enumeration
"""
- AmperePerMeter = 'ampere_per_meter'
+ AmperePerMeter = 'AmperePerMeter'
"""
"""
+class MagnetizationDto:
+ """
+ A DTO representation of a Magnetization
+
+ Attributes:
+ value (float): The value of the Magnetization.
+ unit (MagnetizationUnits): The specific unit that the Magnetization value is representing.
+ """
+
+ def __init__(self, value: float, unit: MagnetizationUnits):
+ """
+ Create a new DTO representation of a Magnetization
+
+ Parameters:
+ value (float): The value of the Magnetization.
+ unit (MagnetizationUnits): The specific unit that the Magnetization value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Magnetization
+ """
+ self.unit: MagnetizationUnits = unit
+ """
+ The specific unit that the Magnetization value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Magnetization DTO JSON object representing the current unit.
+
+ :return: JSON object represents Magnetization DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "AmperePerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Magnetization DTO from a json representation.
+
+ :param data: The Magnetization DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "AmperePerMeter"}
+ :return: A new instance of MagnetizationDto.
+ :rtype: MagnetizationDto
+ """
+ return MagnetizationDto(value=data["value"], unit=MagnetizationUnits(data["unit"]))
+
+
class Magnetization(AbstractMeasure):
"""
In classical electromagnetism, magnetization is the vector field that expresses the density of permanent or induced magnetic dipole moments in a magnetic material.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: MagnetizationUnits = MagnetizationUn
def convert(self, unit: MagnetizationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MagnetizationUnits = MagnetizationUnits.AmperePerMeter) -> MagnetizationDto:
+ """
+ Get a new instance of Magnetization DTO representing the current unit.
+
+ :param hold_in_unit: The specific Magnetization unit to store the Magnetization value in the DTO representation.
+ :type hold_in_unit: MagnetizationUnits
+ :return: A new instance of MagnetizationDto.
+ :rtype: MagnetizationDto
+ """
+ return MagnetizationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MagnetizationUnits = MagnetizationUnits.AmperePerMeter):
+ """
+ Get a Magnetization DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Magnetization unit to store the Magnetization value in the DTO representation.
+ :type hold_in_unit: MagnetizationUnits
+ :return: JSON object represents Magnetization DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "AmperePerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(magnetization_dto: MagnetizationDto):
+ """
+ Obtain a new instance of Magnetization from a DTO unit object.
+
+ :param magnetization_dto: The Magnetization DTO representation.
+ :type magnetization_dto: MagnetizationDto
+ :return: A new instance of Magnetization.
+ :rtype: Magnetization
+ """
+ return Magnetization(magnetization_dto.value, magnetization_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Magnetization from a DTO unit json representation.
+
+ :param data: The Magnetization DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "AmperePerMeter"}
+ :return: A new instance of Magnetization.
+ :rtype: Magnetization
+ """
+ return Magnetization.from_dto(MagnetizationDto.from_json(data))
+
def __convert_from_base(self, from_unit: MagnetizationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/mass.py b/unitsnet_py/units/mass.py
index 36db9b8..5fa1230 100644
--- a/unitsnet_py/units/mass.py
+++ b/unitsnet_py/units/mass.py
@@ -10,142 +10,192 @@ class MassUnits(Enum):
MassUnits enumeration
"""
- Gram = 'gram'
+ Gram = 'Gram'
"""
"""
- Tonne = 'tonne'
+ Tonne = 'Tonne'
"""
"""
- ShortTon = 'short_ton'
+ ShortTon = 'ShortTon'
"""
The short ton is a unit of mass equal to 2,000 pounds (907.18474 kg), that is most commonly used in the United States – known there simply as the ton.
"""
- LongTon = 'long_ton'
+ LongTon = 'LongTon'
"""
Long ton (weight ton or Imperial ton) is a unit of mass equal to 2,240 pounds (1,016 kg) and is the name for the unit called the "ton" in the avoirdupois or Imperial system of measurements that was used in the United Kingdom and several other Commonwealth countries before metrication.
"""
- Pound = 'pound'
+ Pound = 'Pound'
"""
The pound or pound-mass (abbreviations: lb, lbm) is a unit of mass used in the imperial, United States customary and other systems of measurement. A number of different definitions have been used, the most common today being the international avoirdupois pound which is legally defined as exactly 0.45359237 kilograms, and which is divided into 16 avoirdupois ounces.
"""
- Ounce = 'ounce'
+ Ounce = 'Ounce'
"""
The international avoirdupois ounce (abbreviated oz) is defined as exactly 28.349523125 g under the international yard and pound agreement of 1959, signed by the United States and countries of the Commonwealth of Nations. 16 oz make up an avoirdupois pound.
"""
- Slug = 'slug'
+ Slug = 'Slug'
"""
The slug (abbreviation slug) is a unit of mass that is accelerated by 1 ft/s² when a force of one pound (lbf) is exerted on it.
"""
- Stone = 'stone'
+ Stone = 'Stone'
"""
The stone (abbreviation st) is a unit of mass equal to 14 pounds avoirdupois (about 6.35 kilograms) used in Great Britain and Ireland for measuring human body weight.
"""
- ShortHundredweight = 'short_hundredweight'
+ ShortHundredweight = 'ShortHundredweight'
"""
The short hundredweight (abbreviation cwt) is a unit of mass equal to 100 pounds in US and Canada. In British English, the short hundredweight is referred to as the "cental".
"""
- LongHundredweight = 'long_hundredweight'
+ LongHundredweight = 'LongHundredweight'
"""
The long or imperial hundredweight (abbreviation cwt) is a unit of mass equal to 112 pounds in US and Canada.
"""
- Grain = 'grain'
+ Grain = 'Grain'
"""
A grain is a unit of measurement of mass, and in the troy weight, avoirdupois, and Apothecaries' system, equal to exactly 64.79891 milligrams.
"""
- SolarMass = 'solar_mass'
+ SolarMass = 'SolarMass'
"""
Solar mass is a ratio unit to the mass of the solar system star, the sun.
"""
- EarthMass = 'earth_mass'
+ EarthMass = 'EarthMass'
"""
Earth mass is a ratio unit to the mass of planet Earth.
"""
- Femtogram = 'femtogram'
+ Femtogram = 'Femtogram'
"""
"""
- Picogram = 'picogram'
+ Picogram = 'Picogram'
"""
"""
- Nanogram = 'nanogram'
+ Nanogram = 'Nanogram'
"""
"""
- Microgram = 'microgram'
+ Microgram = 'Microgram'
"""
"""
- Milligram = 'milligram'
+ Milligram = 'Milligram'
"""
"""
- Centigram = 'centigram'
+ Centigram = 'Centigram'
"""
"""
- Decigram = 'decigram'
+ Decigram = 'Decigram'
"""
"""
- Decagram = 'decagram'
+ Decagram = 'Decagram'
"""
"""
- Hectogram = 'hectogram'
+ Hectogram = 'Hectogram'
"""
"""
- Kilogram = 'kilogram'
+ Kilogram = 'Kilogram'
"""
"""
- Kilotonne = 'kilotonne'
+ Kilotonne = 'Kilotonne'
"""
"""
- Megatonne = 'megatonne'
+ Megatonne = 'Megatonne'
"""
"""
- Kilopound = 'kilopound'
+ Kilopound = 'Kilopound'
"""
"""
- Megapound = 'megapound'
+ Megapound = 'Megapound'
"""
"""
+class MassDto:
+ """
+ A DTO representation of a Mass
+
+ Attributes:
+ value (float): The value of the Mass.
+ unit (MassUnits): The specific unit that the Mass value is representing.
+ """
+
+ def __init__(self, value: float, unit: MassUnits):
+ """
+ Create a new DTO representation of a Mass
+
+ Parameters:
+ value (float): The value of the Mass.
+ unit (MassUnits): The specific unit that the Mass value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Mass
+ """
+ self.unit: MassUnits = unit
+ """
+ The specific unit that the Mass value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Mass DTO JSON object representing the current unit.
+
+ :return: JSON object represents Mass DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Kilogram"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Mass DTO from a json representation.
+
+ :param data: The Mass DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Kilogram"}
+ :return: A new instance of MassDto.
+ :rtype: MassDto
+ """
+ return MassDto(value=data["value"], unit=MassUnits(data["unit"]))
+
+
class Mass(AbstractMeasure):
"""
In physics, mass (from Greek μᾶζα "barley cake, lump [of dough]") is a property of a physical system or body, giving rise to the phenomena of the body's resistance to being accelerated by a force and the strength of its mutual gravitational attraction with other bodies. Instruments such as mass balances or scales use those phenomena to measure mass. The SI unit of mass is the kilogram (kg).
@@ -219,6 +269,54 @@ def __init__(self, value: float, from_unit: MassUnits = MassUnits.Kilogram):
def convert(self, unit: MassUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MassUnits = MassUnits.Kilogram) -> MassDto:
+ """
+ Get a new instance of Mass DTO representing the current unit.
+
+ :param hold_in_unit: The specific Mass unit to store the Mass value in the DTO representation.
+ :type hold_in_unit: MassUnits
+ :return: A new instance of MassDto.
+ :rtype: MassDto
+ """
+ return MassDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MassUnits = MassUnits.Kilogram):
+ """
+ Get a Mass DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Mass unit to store the Mass value in the DTO representation.
+ :type hold_in_unit: MassUnits
+ :return: JSON object represents Mass DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Kilogram"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(mass_dto: MassDto):
+ """
+ Obtain a new instance of Mass from a DTO unit object.
+
+ :param mass_dto: The Mass DTO representation.
+ :type mass_dto: MassDto
+ :return: A new instance of Mass.
+ :rtype: Mass
+ """
+ return Mass(mass_dto.value, mass_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Mass from a DTO unit json representation.
+
+ :param data: The Mass DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Kilogram"}
+ :return: A new instance of Mass.
+ :rtype: Mass
+ """
+ return Mass.from_dto(MassDto.from_json(data))
+
def __convert_from_base(self, from_unit: MassUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/mass_concentration.py b/unitsnet_py/units/mass_concentration.py
index 283d8b5..0a35d5c 100644
--- a/unitsnet_py/units/mass_concentration.py
+++ b/unitsnet_py/units/mass_concentration.py
@@ -10,252 +10,302 @@ class MassConcentrationUnits(Enum):
MassConcentrationUnits enumeration
"""
- GramPerCubicMillimeter = 'gram_per_cubic_millimeter'
+ GramPerCubicMillimeter = 'GramPerCubicMillimeter'
"""
"""
- GramPerCubicCentimeter = 'gram_per_cubic_centimeter'
+ GramPerCubicCentimeter = 'GramPerCubicCentimeter'
"""
"""
- GramPerCubicMeter = 'gram_per_cubic_meter'
+ GramPerCubicMeter = 'GramPerCubicMeter'
"""
"""
- GramPerMicroliter = 'gram_per_microliter'
+ GramPerMicroliter = 'GramPerMicroliter'
"""
"""
- GramPerMilliliter = 'gram_per_milliliter'
+ GramPerMilliliter = 'GramPerMilliliter'
"""
"""
- GramPerDeciliter = 'gram_per_deciliter'
+ GramPerDeciliter = 'GramPerDeciliter'
"""
"""
- GramPerLiter = 'gram_per_liter'
+ GramPerLiter = 'GramPerLiter'
"""
"""
- TonnePerCubicMillimeter = 'tonne_per_cubic_millimeter'
+ TonnePerCubicMillimeter = 'TonnePerCubicMillimeter'
"""
"""
- TonnePerCubicCentimeter = 'tonne_per_cubic_centimeter'
+ TonnePerCubicCentimeter = 'TonnePerCubicCentimeter'
"""
"""
- TonnePerCubicMeter = 'tonne_per_cubic_meter'
+ TonnePerCubicMeter = 'TonnePerCubicMeter'
"""
"""
- PoundPerCubicInch = 'pound_per_cubic_inch'
+ PoundPerCubicInch = 'PoundPerCubicInch'
"""
"""
- PoundPerCubicFoot = 'pound_per_cubic_foot'
+ PoundPerCubicFoot = 'PoundPerCubicFoot'
"""
"""
- SlugPerCubicFoot = 'slug_per_cubic_foot'
+ SlugPerCubicFoot = 'SlugPerCubicFoot'
"""
"""
- PoundPerUSGallon = 'pound_per_us_gallon'
+ PoundPerUSGallon = 'PoundPerUSGallon'
"""
"""
- OuncePerUSGallon = 'ounce_per_us_gallon'
+ OuncePerUSGallon = 'OuncePerUSGallon'
"""
"""
- OuncePerImperialGallon = 'ounce_per_imperial_gallon'
+ OuncePerImperialGallon = 'OuncePerImperialGallon'
"""
"""
- PoundPerImperialGallon = 'pound_per_imperial_gallon'
+ PoundPerImperialGallon = 'PoundPerImperialGallon'
"""
"""
- KilogramPerCubicMillimeter = 'kilogram_per_cubic_millimeter'
+ KilogramPerCubicMillimeter = 'KilogramPerCubicMillimeter'
"""
"""
- KilogramPerCubicCentimeter = 'kilogram_per_cubic_centimeter'
+ KilogramPerCubicCentimeter = 'KilogramPerCubicCentimeter'
"""
"""
- KilogramPerCubicMeter = 'kilogram_per_cubic_meter'
+ KilogramPerCubicMeter = 'KilogramPerCubicMeter'
"""
"""
- MilligramPerCubicMeter = 'milligram_per_cubic_meter'
+ MilligramPerCubicMeter = 'MilligramPerCubicMeter'
"""
"""
- MicrogramPerCubicMeter = 'microgram_per_cubic_meter'
+ MicrogramPerCubicMeter = 'MicrogramPerCubicMeter'
"""
"""
- PicogramPerMicroliter = 'picogram_per_microliter'
+ PicogramPerMicroliter = 'PicogramPerMicroliter'
"""
"""
- NanogramPerMicroliter = 'nanogram_per_microliter'
+ NanogramPerMicroliter = 'NanogramPerMicroliter'
"""
"""
- MicrogramPerMicroliter = 'microgram_per_microliter'
+ MicrogramPerMicroliter = 'MicrogramPerMicroliter'
"""
"""
- MilligramPerMicroliter = 'milligram_per_microliter'
+ MilligramPerMicroliter = 'MilligramPerMicroliter'
"""
"""
- CentigramPerMicroliter = 'centigram_per_microliter'
+ CentigramPerMicroliter = 'CentigramPerMicroliter'
"""
"""
- DecigramPerMicroliter = 'decigram_per_microliter'
+ DecigramPerMicroliter = 'DecigramPerMicroliter'
"""
"""
- PicogramPerMilliliter = 'picogram_per_milliliter'
+ PicogramPerMilliliter = 'PicogramPerMilliliter'
"""
"""
- NanogramPerMilliliter = 'nanogram_per_milliliter'
+ NanogramPerMilliliter = 'NanogramPerMilliliter'
"""
"""
- MicrogramPerMilliliter = 'microgram_per_milliliter'
+ MicrogramPerMilliliter = 'MicrogramPerMilliliter'
"""
"""
- MilligramPerMilliliter = 'milligram_per_milliliter'
+ MilligramPerMilliliter = 'MilligramPerMilliliter'
"""
"""
- CentigramPerMilliliter = 'centigram_per_milliliter'
+ CentigramPerMilliliter = 'CentigramPerMilliliter'
"""
"""
- DecigramPerMilliliter = 'decigram_per_milliliter'
+ DecigramPerMilliliter = 'DecigramPerMilliliter'
"""
"""
- PicogramPerDeciliter = 'picogram_per_deciliter'
+ PicogramPerDeciliter = 'PicogramPerDeciliter'
"""
"""
- NanogramPerDeciliter = 'nanogram_per_deciliter'
+ NanogramPerDeciliter = 'NanogramPerDeciliter'
"""
"""
- MicrogramPerDeciliter = 'microgram_per_deciliter'
+ MicrogramPerDeciliter = 'MicrogramPerDeciliter'
"""
"""
- MilligramPerDeciliter = 'milligram_per_deciliter'
+ MilligramPerDeciliter = 'MilligramPerDeciliter'
"""
"""
- CentigramPerDeciliter = 'centigram_per_deciliter'
+ CentigramPerDeciliter = 'CentigramPerDeciliter'
"""
"""
- DecigramPerDeciliter = 'decigram_per_deciliter'
+ DecigramPerDeciliter = 'DecigramPerDeciliter'
"""
"""
- PicogramPerLiter = 'picogram_per_liter'
+ PicogramPerLiter = 'PicogramPerLiter'
"""
"""
- NanogramPerLiter = 'nanogram_per_liter'
+ NanogramPerLiter = 'NanogramPerLiter'
"""
"""
- MicrogramPerLiter = 'microgram_per_liter'
+ MicrogramPerLiter = 'MicrogramPerLiter'
"""
"""
- MilligramPerLiter = 'milligram_per_liter'
+ MilligramPerLiter = 'MilligramPerLiter'
"""
"""
- CentigramPerLiter = 'centigram_per_liter'
+ CentigramPerLiter = 'CentigramPerLiter'
"""
"""
- DecigramPerLiter = 'decigram_per_liter'
+ DecigramPerLiter = 'DecigramPerLiter'
"""
"""
- KilogramPerLiter = 'kilogram_per_liter'
+ KilogramPerLiter = 'KilogramPerLiter'
"""
"""
- KilopoundPerCubicInch = 'kilopound_per_cubic_inch'
+ KilopoundPerCubicInch = 'KilopoundPerCubicInch'
"""
"""
- KilopoundPerCubicFoot = 'kilopound_per_cubic_foot'
+ KilopoundPerCubicFoot = 'KilopoundPerCubicFoot'
"""
"""
+class MassConcentrationDto:
+ """
+ A DTO representation of a MassConcentration
+
+ Attributes:
+ value (float): The value of the MassConcentration.
+ unit (MassConcentrationUnits): The specific unit that the MassConcentration value is representing.
+ """
+
+ def __init__(self, value: float, unit: MassConcentrationUnits):
+ """
+ Create a new DTO representation of a MassConcentration
+
+ Parameters:
+ value (float): The value of the MassConcentration.
+ unit (MassConcentrationUnits): The specific unit that the MassConcentration value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MassConcentration
+ """
+ self.unit: MassConcentrationUnits = unit
+ """
+ The specific unit that the MassConcentration value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MassConcentration DTO JSON object representing the current unit.
+
+ :return: JSON object represents MassConcentration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MassConcentration DTO from a json representation.
+
+ :param data: The MassConcentration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ :return: A new instance of MassConcentrationDto.
+ :rtype: MassConcentrationDto
+ """
+ return MassConcentrationDto(value=data["value"], unit=MassConcentrationUnits(data["unit"]))
+
+
class MassConcentration(AbstractMeasure):
"""
In chemistry, the mass concentration ρi (or γi) is defined as the mass of a constituent mi divided by the volume of the mixture V
@@ -373,6 +423,54 @@ def __init__(self, value: float, from_unit: MassConcentrationUnits = MassConcent
def convert(self, unit: MassConcentrationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MassConcentrationUnits = MassConcentrationUnits.KilogramPerCubicMeter) -> MassConcentrationDto:
+ """
+ Get a new instance of MassConcentration DTO representing the current unit.
+
+ :param hold_in_unit: The specific MassConcentration unit to store the MassConcentration value in the DTO representation.
+ :type hold_in_unit: MassConcentrationUnits
+ :return: A new instance of MassConcentrationDto.
+ :rtype: MassConcentrationDto
+ """
+ return MassConcentrationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MassConcentrationUnits = MassConcentrationUnits.KilogramPerCubicMeter):
+ """
+ Get a MassConcentration DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MassConcentration unit to store the MassConcentration value in the DTO representation.
+ :type hold_in_unit: MassConcentrationUnits
+ :return: JSON object represents MassConcentration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(mass_concentration_dto: MassConcentrationDto):
+ """
+ Obtain a new instance of MassConcentration from a DTO unit object.
+
+ :param mass_concentration_dto: The MassConcentration DTO representation.
+ :type mass_concentration_dto: MassConcentrationDto
+ :return: A new instance of MassConcentration.
+ :rtype: MassConcentration
+ """
+ return MassConcentration(mass_concentration_dto.value, mass_concentration_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MassConcentration from a DTO unit json representation.
+
+ :param data: The MassConcentration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerCubicMeter"}
+ :return: A new instance of MassConcentration.
+ :rtype: MassConcentration
+ """
+ return MassConcentration.from_dto(MassConcentrationDto.from_json(data))
+
def __convert_from_base(self, from_unit: MassConcentrationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/mass_flow.py b/unitsnet_py/units/mass_flow.py
index 22d4367..2b218b2 100644
--- a/unitsnet_py/units/mass_flow.py
+++ b/unitsnet_py/units/mass_flow.py
@@ -10,172 +10,222 @@ class MassFlowUnits(Enum):
MassFlowUnits enumeration
"""
- GramPerSecond = 'gram_per_second'
+ GramPerSecond = 'GramPerSecond'
"""
"""
- GramPerDay = 'gram_per_day'
+ GramPerDay = 'GramPerDay'
"""
"""
- GramPerHour = 'gram_per_hour'
+ GramPerHour = 'GramPerHour'
"""
"""
- KilogramPerHour = 'kilogram_per_hour'
+ KilogramPerHour = 'KilogramPerHour'
"""
"""
- KilogramPerMinute = 'kilogram_per_minute'
+ KilogramPerMinute = 'KilogramPerMinute'
"""
"""
- TonnePerHour = 'tonne_per_hour'
+ TonnePerHour = 'TonnePerHour'
"""
"""
- PoundPerDay = 'pound_per_day'
+ PoundPerDay = 'PoundPerDay'
"""
"""
- PoundPerHour = 'pound_per_hour'
+ PoundPerHour = 'PoundPerHour'
"""
"""
- PoundPerMinute = 'pound_per_minute'
+ PoundPerMinute = 'PoundPerMinute'
"""
"""
- PoundPerSecond = 'pound_per_second'
+ PoundPerSecond = 'PoundPerSecond'
"""
"""
- TonnePerDay = 'tonne_per_day'
+ TonnePerDay = 'TonnePerDay'
"""
"""
- ShortTonPerHour = 'short_ton_per_hour'
+ ShortTonPerHour = 'ShortTonPerHour'
"""
"""
- NanogramPerSecond = 'nanogram_per_second'
+ NanogramPerSecond = 'NanogramPerSecond'
"""
"""
- MicrogramPerSecond = 'microgram_per_second'
+ MicrogramPerSecond = 'MicrogramPerSecond'
"""
"""
- MilligramPerSecond = 'milligram_per_second'
+ MilligramPerSecond = 'MilligramPerSecond'
"""
"""
- CentigramPerSecond = 'centigram_per_second'
+ CentigramPerSecond = 'CentigramPerSecond'
"""
"""
- DecigramPerSecond = 'decigram_per_second'
+ DecigramPerSecond = 'DecigramPerSecond'
"""
"""
- DecagramPerSecond = 'decagram_per_second'
+ DecagramPerSecond = 'DecagramPerSecond'
"""
"""
- HectogramPerSecond = 'hectogram_per_second'
+ HectogramPerSecond = 'HectogramPerSecond'
"""
"""
- KilogramPerSecond = 'kilogram_per_second'
+ KilogramPerSecond = 'KilogramPerSecond'
"""
"""
- NanogramPerDay = 'nanogram_per_day'
+ NanogramPerDay = 'NanogramPerDay'
"""
"""
- MicrogramPerDay = 'microgram_per_day'
+ MicrogramPerDay = 'MicrogramPerDay'
"""
"""
- MilligramPerDay = 'milligram_per_day'
+ MilligramPerDay = 'MilligramPerDay'
"""
"""
- CentigramPerDay = 'centigram_per_day'
+ CentigramPerDay = 'CentigramPerDay'
"""
"""
- DecigramPerDay = 'decigram_per_day'
+ DecigramPerDay = 'DecigramPerDay'
"""
"""
- DecagramPerDay = 'decagram_per_day'
+ DecagramPerDay = 'DecagramPerDay'
"""
"""
- HectogramPerDay = 'hectogram_per_day'
+ HectogramPerDay = 'HectogramPerDay'
"""
"""
- KilogramPerDay = 'kilogram_per_day'
+ KilogramPerDay = 'KilogramPerDay'
"""
"""
- MegagramPerDay = 'megagram_per_day'
+ MegagramPerDay = 'MegagramPerDay'
"""
"""
- MegapoundPerDay = 'megapound_per_day'
+ MegapoundPerDay = 'MegapoundPerDay'
"""
"""
- MegapoundPerHour = 'megapound_per_hour'
+ MegapoundPerHour = 'MegapoundPerHour'
"""
"""
- MegapoundPerMinute = 'megapound_per_minute'
+ MegapoundPerMinute = 'MegapoundPerMinute'
"""
"""
- MegapoundPerSecond = 'megapound_per_second'
+ MegapoundPerSecond = 'MegapoundPerSecond'
"""
"""
+class MassFlowDto:
+ """
+ A DTO representation of a MassFlow
+
+ Attributes:
+ value (float): The value of the MassFlow.
+ unit (MassFlowUnits): The specific unit that the MassFlow value is representing.
+ """
+
+ def __init__(self, value: float, unit: MassFlowUnits):
+ """
+ Create a new DTO representation of a MassFlow
+
+ Parameters:
+ value (float): The value of the MassFlow.
+ unit (MassFlowUnits): The specific unit that the MassFlow value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MassFlow
+ """
+ self.unit: MassFlowUnits = unit
+ """
+ The specific unit that the MassFlow value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MassFlow DTO JSON object representing the current unit.
+
+ :return: JSON object represents MassFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "GramPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MassFlow DTO from a json representation.
+
+ :param data: The MassFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "GramPerSecond"}
+ :return: A new instance of MassFlowDto.
+ :rtype: MassFlowDto
+ """
+ return MassFlowDto(value=data["value"], unit=MassFlowUnits(data["unit"]))
+
+
class MassFlow(AbstractMeasure):
"""
Mass flow is the ratio of the mass change to the time during which the change occurred (value of mass changes per unit time).
@@ -261,6 +311,54 @@ def __init__(self, value: float, from_unit: MassFlowUnits = MassFlowUnits.GramPe
def convert(self, unit: MassFlowUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MassFlowUnits = MassFlowUnits.GramPerSecond) -> MassFlowDto:
+ """
+ Get a new instance of MassFlow DTO representing the current unit.
+
+ :param hold_in_unit: The specific MassFlow unit to store the MassFlow value in the DTO representation.
+ :type hold_in_unit: MassFlowUnits
+ :return: A new instance of MassFlowDto.
+ :rtype: MassFlowDto
+ """
+ return MassFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MassFlowUnits = MassFlowUnits.GramPerSecond):
+ """
+ Get a MassFlow DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MassFlow unit to store the MassFlow value in the DTO representation.
+ :type hold_in_unit: MassFlowUnits
+ :return: JSON object represents MassFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "GramPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(mass_flow_dto: MassFlowDto):
+ """
+ Obtain a new instance of MassFlow from a DTO unit object.
+
+ :param mass_flow_dto: The MassFlow DTO representation.
+ :type mass_flow_dto: MassFlowDto
+ :return: A new instance of MassFlow.
+ :rtype: MassFlow
+ """
+ return MassFlow(mass_flow_dto.value, mass_flow_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MassFlow from a DTO unit json representation.
+
+ :param data: The MassFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "GramPerSecond"}
+ :return: A new instance of MassFlow.
+ :rtype: MassFlow
+ """
+ return MassFlow.from_dto(MassFlowDto.from_json(data))
+
def __convert_from_base(self, from_unit: MassFlowUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/mass_flux.py b/unitsnet_py/units/mass_flux.py
index 916325e..b3af0ac 100644
--- a/unitsnet_py/units/mass_flux.py
+++ b/unitsnet_py/units/mass_flux.py
@@ -10,67 +10,117 @@ class MassFluxUnits(Enum):
MassFluxUnits enumeration
"""
- GramPerSecondPerSquareMeter = 'gram_per_second_per_square_meter'
+ GramPerSecondPerSquareMeter = 'GramPerSecondPerSquareMeter'
"""
"""
- GramPerSecondPerSquareCentimeter = 'gram_per_second_per_square_centimeter'
+ GramPerSecondPerSquareCentimeter = 'GramPerSecondPerSquareCentimeter'
"""
"""
- GramPerSecondPerSquareMillimeter = 'gram_per_second_per_square_millimeter'
+ GramPerSecondPerSquareMillimeter = 'GramPerSecondPerSquareMillimeter'
"""
"""
- GramPerHourPerSquareMeter = 'gram_per_hour_per_square_meter'
+ GramPerHourPerSquareMeter = 'GramPerHourPerSquareMeter'
"""
"""
- GramPerHourPerSquareCentimeter = 'gram_per_hour_per_square_centimeter'
+ GramPerHourPerSquareCentimeter = 'GramPerHourPerSquareCentimeter'
"""
"""
- GramPerHourPerSquareMillimeter = 'gram_per_hour_per_square_millimeter'
+ GramPerHourPerSquareMillimeter = 'GramPerHourPerSquareMillimeter'
"""
"""
- KilogramPerSecondPerSquareMeter = 'kilogram_per_second_per_square_meter'
+ KilogramPerSecondPerSquareMeter = 'KilogramPerSecondPerSquareMeter'
"""
"""
- KilogramPerSecondPerSquareCentimeter = 'kilogram_per_second_per_square_centimeter'
+ KilogramPerSecondPerSquareCentimeter = 'KilogramPerSecondPerSquareCentimeter'
"""
"""
- KilogramPerSecondPerSquareMillimeter = 'kilogram_per_second_per_square_millimeter'
+ KilogramPerSecondPerSquareMillimeter = 'KilogramPerSecondPerSquareMillimeter'
"""
"""
- KilogramPerHourPerSquareMeter = 'kilogram_per_hour_per_square_meter'
+ KilogramPerHourPerSquareMeter = 'KilogramPerHourPerSquareMeter'
"""
"""
- KilogramPerHourPerSquareCentimeter = 'kilogram_per_hour_per_square_centimeter'
+ KilogramPerHourPerSquareCentimeter = 'KilogramPerHourPerSquareCentimeter'
"""
"""
- KilogramPerHourPerSquareMillimeter = 'kilogram_per_hour_per_square_millimeter'
+ KilogramPerHourPerSquareMillimeter = 'KilogramPerHourPerSquareMillimeter'
"""
"""
+class MassFluxDto:
+ """
+ A DTO representation of a MassFlux
+
+ Attributes:
+ value (float): The value of the MassFlux.
+ unit (MassFluxUnits): The specific unit that the MassFlux value is representing.
+ """
+
+ def __init__(self, value: float, unit: MassFluxUnits):
+ """
+ Create a new DTO representation of a MassFlux
+
+ Parameters:
+ value (float): The value of the MassFlux.
+ unit (MassFluxUnits): The specific unit that the MassFlux value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MassFlux
+ """
+ self.unit: MassFluxUnits = unit
+ """
+ The specific unit that the MassFlux value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MassFlux DTO JSON object representing the current unit.
+
+ :return: JSON object represents MassFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerSecondPerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MassFlux DTO from a json representation.
+
+ :param data: The MassFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerSecondPerSquareMeter"}
+ :return: A new instance of MassFluxDto.
+ :rtype: MassFluxDto
+ """
+ return MassFluxDto(value=data["value"], unit=MassFluxUnits(data["unit"]))
+
+
class MassFlux(AbstractMeasure):
"""
Mass flux is the mass flow rate per unit area.
@@ -114,6 +164,54 @@ def __init__(self, value: float, from_unit: MassFluxUnits = MassFluxUnits.Kilogr
def convert(self, unit: MassFluxUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MassFluxUnits = MassFluxUnits.KilogramPerSecondPerSquareMeter) -> MassFluxDto:
+ """
+ Get a new instance of MassFlux DTO representing the current unit.
+
+ :param hold_in_unit: The specific MassFlux unit to store the MassFlux value in the DTO representation.
+ :type hold_in_unit: MassFluxUnits
+ :return: A new instance of MassFluxDto.
+ :rtype: MassFluxDto
+ """
+ return MassFluxDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MassFluxUnits = MassFluxUnits.KilogramPerSecondPerSquareMeter):
+ """
+ Get a MassFlux DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MassFlux unit to store the MassFlux value in the DTO representation.
+ :type hold_in_unit: MassFluxUnits
+ :return: JSON object represents MassFlux DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerSecondPerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(mass_flux_dto: MassFluxDto):
+ """
+ Obtain a new instance of MassFlux from a DTO unit object.
+
+ :param mass_flux_dto: The MassFlux DTO representation.
+ :type mass_flux_dto: MassFluxDto
+ :return: A new instance of MassFlux.
+ :rtype: MassFlux
+ """
+ return MassFlux(mass_flux_dto.value, mass_flux_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MassFlux from a DTO unit json representation.
+
+ :param data: The MassFlux DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerSecondPerSquareMeter"}
+ :return: A new instance of MassFlux.
+ :rtype: MassFlux
+ """
+ return MassFlux.from_dto(MassFluxDto.from_json(data))
+
def __convert_from_base(self, from_unit: MassFluxUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/mass_fraction.py b/unitsnet_py/units/mass_fraction.py
index e7684dc..4eeedf2 100644
--- a/unitsnet_py/units/mass_fraction.py
+++ b/unitsnet_py/units/mass_fraction.py
@@ -10,127 +10,177 @@ class MassFractionUnits(Enum):
MassFractionUnits enumeration
"""
- DecimalFraction = 'decimal_fraction'
+ DecimalFraction = 'DecimalFraction'
"""
"""
- GramPerGram = 'gram_per_gram'
+ GramPerGram = 'GramPerGram'
"""
"""
- GramPerKilogram = 'gram_per_kilogram'
+ GramPerKilogram = 'GramPerKilogram'
"""
"""
- Percent = 'percent'
+ Percent = 'Percent'
"""
"""
- PartPerThousand = 'part_per_thousand'
+ PartPerThousand = 'PartPerThousand'
"""
"""
- PartPerMillion = 'part_per_million'
+ PartPerMillion = 'PartPerMillion'
"""
"""
- PartPerBillion = 'part_per_billion'
+ PartPerBillion = 'PartPerBillion'
"""
"""
- PartPerTrillion = 'part_per_trillion'
+ PartPerTrillion = 'PartPerTrillion'
"""
"""
- NanogramPerGram = 'nanogram_per_gram'
+ NanogramPerGram = 'NanogramPerGram'
"""
"""
- MicrogramPerGram = 'microgram_per_gram'
+ MicrogramPerGram = 'MicrogramPerGram'
"""
"""
- MilligramPerGram = 'milligram_per_gram'
+ MilligramPerGram = 'MilligramPerGram'
"""
"""
- CentigramPerGram = 'centigram_per_gram'
+ CentigramPerGram = 'CentigramPerGram'
"""
"""
- DecigramPerGram = 'decigram_per_gram'
+ DecigramPerGram = 'DecigramPerGram'
"""
"""
- DecagramPerGram = 'decagram_per_gram'
+ DecagramPerGram = 'DecagramPerGram'
"""
"""
- HectogramPerGram = 'hectogram_per_gram'
+ HectogramPerGram = 'HectogramPerGram'
"""
"""
- KilogramPerGram = 'kilogram_per_gram'
+ KilogramPerGram = 'KilogramPerGram'
"""
"""
- NanogramPerKilogram = 'nanogram_per_kilogram'
+ NanogramPerKilogram = 'NanogramPerKilogram'
"""
"""
- MicrogramPerKilogram = 'microgram_per_kilogram'
+ MicrogramPerKilogram = 'MicrogramPerKilogram'
"""
"""
- MilligramPerKilogram = 'milligram_per_kilogram'
+ MilligramPerKilogram = 'MilligramPerKilogram'
"""
"""
- CentigramPerKilogram = 'centigram_per_kilogram'
+ CentigramPerKilogram = 'CentigramPerKilogram'
"""
"""
- DecigramPerKilogram = 'decigram_per_kilogram'
+ DecigramPerKilogram = 'DecigramPerKilogram'
"""
"""
- DecagramPerKilogram = 'decagram_per_kilogram'
+ DecagramPerKilogram = 'DecagramPerKilogram'
"""
"""
- HectogramPerKilogram = 'hectogram_per_kilogram'
+ HectogramPerKilogram = 'HectogramPerKilogram'
"""
"""
- KilogramPerKilogram = 'kilogram_per_kilogram'
+ KilogramPerKilogram = 'KilogramPerKilogram'
"""
"""
+class MassFractionDto:
+ """
+ A DTO representation of a MassFraction
+
+ Attributes:
+ value (float): The value of the MassFraction.
+ unit (MassFractionUnits): The specific unit that the MassFraction value is representing.
+ """
+
+ def __init__(self, value: float, unit: MassFractionUnits):
+ """
+ Create a new DTO representation of a MassFraction
+
+ Parameters:
+ value (float): The value of the MassFraction.
+ unit (MassFractionUnits): The specific unit that the MassFraction value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MassFraction
+ """
+ self.unit: MassFractionUnits = unit
+ """
+ The specific unit that the MassFraction value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MassFraction DTO JSON object representing the current unit.
+
+ :return: JSON object represents MassFraction DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFraction"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MassFraction DTO from a json representation.
+
+ :param data: The MassFraction DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFraction"}
+ :return: A new instance of MassFractionDto.
+ :rtype: MassFractionDto
+ """
+ return MassFractionDto(value=data["value"], unit=MassFractionUnits(data["unit"]))
+
+
class MassFraction(AbstractMeasure):
"""
The mass fraction is defined as the mass of a constituent divided by the total mass of the mixture.
@@ -198,6 +248,54 @@ def __init__(self, value: float, from_unit: MassFractionUnits = MassFractionUnit
def convert(self, unit: MassFractionUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MassFractionUnits = MassFractionUnits.DecimalFraction) -> MassFractionDto:
+ """
+ Get a new instance of MassFraction DTO representing the current unit.
+
+ :param hold_in_unit: The specific MassFraction unit to store the MassFraction value in the DTO representation.
+ :type hold_in_unit: MassFractionUnits
+ :return: A new instance of MassFractionDto.
+ :rtype: MassFractionDto
+ """
+ return MassFractionDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MassFractionUnits = MassFractionUnits.DecimalFraction):
+ """
+ Get a MassFraction DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MassFraction unit to store the MassFraction value in the DTO representation.
+ :type hold_in_unit: MassFractionUnits
+ :return: JSON object represents MassFraction DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFraction"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(mass_fraction_dto: MassFractionDto):
+ """
+ Obtain a new instance of MassFraction from a DTO unit object.
+
+ :param mass_fraction_dto: The MassFraction DTO representation.
+ :type mass_fraction_dto: MassFractionDto
+ :return: A new instance of MassFraction.
+ :rtype: MassFraction
+ """
+ return MassFraction(mass_fraction_dto.value, mass_fraction_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MassFraction from a DTO unit json representation.
+
+ :param data: The MassFraction DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFraction"}
+ :return: A new instance of MassFraction.
+ :rtype: MassFraction
+ """
+ return MassFraction.from_dto(MassFractionDto.from_json(data))
+
def __convert_from_base(self, from_unit: MassFractionUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/mass_moment_of_inertia.py b/unitsnet_py/units/mass_moment_of_inertia.py
index 0d34aff..9e1baef 100644
--- a/unitsnet_py/units/mass_moment_of_inertia.py
+++ b/unitsnet_py/units/mass_moment_of_inertia.py
@@ -10,147 +10,197 @@ class MassMomentOfInertiaUnits(Enum):
MassMomentOfInertiaUnits enumeration
"""
- GramSquareMeter = 'gram_square_meter'
+ GramSquareMeter = 'GramSquareMeter'
"""
"""
- GramSquareDecimeter = 'gram_square_decimeter'
+ GramSquareDecimeter = 'GramSquareDecimeter'
"""
"""
- GramSquareCentimeter = 'gram_square_centimeter'
+ GramSquareCentimeter = 'GramSquareCentimeter'
"""
"""
- GramSquareMillimeter = 'gram_square_millimeter'
+ GramSquareMillimeter = 'GramSquareMillimeter'
"""
"""
- TonneSquareMeter = 'tonne_square_meter'
+ TonneSquareMeter = 'TonneSquareMeter'
"""
"""
- TonneSquareDecimeter = 'tonne_square_decimeter'
+ TonneSquareDecimeter = 'TonneSquareDecimeter'
"""
"""
- TonneSquareCentimeter = 'tonne_square_centimeter'
+ TonneSquareCentimeter = 'TonneSquareCentimeter'
"""
"""
- TonneSquareMilimeter = 'tonne_square_milimeter'
+ TonneSquareMilimeter = 'TonneSquareMilimeter'
"""
"""
- PoundSquareFoot = 'pound_square_foot'
+ PoundSquareFoot = 'PoundSquareFoot'
"""
"""
- PoundSquareInch = 'pound_square_inch'
+ PoundSquareInch = 'PoundSquareInch'
"""
"""
- SlugSquareFoot = 'slug_square_foot'
+ SlugSquareFoot = 'SlugSquareFoot'
"""
"""
- SlugSquareInch = 'slug_square_inch'
+ SlugSquareInch = 'SlugSquareInch'
"""
"""
- MilligramSquareMeter = 'milligram_square_meter'
+ MilligramSquareMeter = 'MilligramSquareMeter'
"""
"""
- KilogramSquareMeter = 'kilogram_square_meter'
+ KilogramSquareMeter = 'KilogramSquareMeter'
"""
"""
- MilligramSquareDecimeter = 'milligram_square_decimeter'
+ MilligramSquareDecimeter = 'MilligramSquareDecimeter'
"""
"""
- KilogramSquareDecimeter = 'kilogram_square_decimeter'
+ KilogramSquareDecimeter = 'KilogramSquareDecimeter'
"""
"""
- MilligramSquareCentimeter = 'milligram_square_centimeter'
+ MilligramSquareCentimeter = 'MilligramSquareCentimeter'
"""
"""
- KilogramSquareCentimeter = 'kilogram_square_centimeter'
+ KilogramSquareCentimeter = 'KilogramSquareCentimeter'
"""
"""
- MilligramSquareMillimeter = 'milligram_square_millimeter'
+ MilligramSquareMillimeter = 'MilligramSquareMillimeter'
"""
"""
- KilogramSquareMillimeter = 'kilogram_square_millimeter'
+ KilogramSquareMillimeter = 'KilogramSquareMillimeter'
"""
"""
- KilotonneSquareMeter = 'kilotonne_square_meter'
+ KilotonneSquareMeter = 'KilotonneSquareMeter'
"""
"""
- MegatonneSquareMeter = 'megatonne_square_meter'
+ MegatonneSquareMeter = 'MegatonneSquareMeter'
"""
"""
- KilotonneSquareDecimeter = 'kilotonne_square_decimeter'
+ KilotonneSquareDecimeter = 'KilotonneSquareDecimeter'
"""
"""
- MegatonneSquareDecimeter = 'megatonne_square_decimeter'
+ MegatonneSquareDecimeter = 'MegatonneSquareDecimeter'
"""
"""
- KilotonneSquareCentimeter = 'kilotonne_square_centimeter'
+ KilotonneSquareCentimeter = 'KilotonneSquareCentimeter'
"""
"""
- MegatonneSquareCentimeter = 'megatonne_square_centimeter'
+ MegatonneSquareCentimeter = 'MegatonneSquareCentimeter'
"""
"""
- KilotonneSquareMilimeter = 'kilotonne_square_milimeter'
+ KilotonneSquareMilimeter = 'KilotonneSquareMilimeter'
"""
"""
- MegatonneSquareMilimeter = 'megatonne_square_milimeter'
+ MegatonneSquareMilimeter = 'MegatonneSquareMilimeter'
"""
"""
+class MassMomentOfInertiaDto:
+ """
+ A DTO representation of a MassMomentOfInertia
+
+ Attributes:
+ value (float): The value of the MassMomentOfInertia.
+ unit (MassMomentOfInertiaUnits): The specific unit that the MassMomentOfInertia value is representing.
+ """
+
+ def __init__(self, value: float, unit: MassMomentOfInertiaUnits):
+ """
+ Create a new DTO representation of a MassMomentOfInertia
+
+ Parameters:
+ value (float): The value of the MassMomentOfInertia.
+ unit (MassMomentOfInertiaUnits): The specific unit that the MassMomentOfInertia value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MassMomentOfInertia
+ """
+ self.unit: MassMomentOfInertiaUnits = unit
+ """
+ The specific unit that the MassMomentOfInertia value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MassMomentOfInertia DTO JSON object representing the current unit.
+
+ :return: JSON object represents MassMomentOfInertia DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MassMomentOfInertia DTO from a json representation.
+
+ :param data: The MassMomentOfInertia DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramSquareMeter"}
+ :return: A new instance of MassMomentOfInertiaDto.
+ :rtype: MassMomentOfInertiaDto
+ """
+ return MassMomentOfInertiaDto(value=data["value"], unit=MassMomentOfInertiaUnits(data["unit"]))
+
+
class MassMomentOfInertia(AbstractMeasure):
"""
A property of body reflects how its mass is distributed with regard to an axis.
@@ -226,6 +276,54 @@ def __init__(self, value: float, from_unit: MassMomentOfInertiaUnits = MassMomen
def convert(self, unit: MassMomentOfInertiaUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MassMomentOfInertiaUnits = MassMomentOfInertiaUnits.KilogramSquareMeter) -> MassMomentOfInertiaDto:
+ """
+ Get a new instance of MassMomentOfInertia DTO representing the current unit.
+
+ :param hold_in_unit: The specific MassMomentOfInertia unit to store the MassMomentOfInertia value in the DTO representation.
+ :type hold_in_unit: MassMomentOfInertiaUnits
+ :return: A new instance of MassMomentOfInertiaDto.
+ :rtype: MassMomentOfInertiaDto
+ """
+ return MassMomentOfInertiaDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MassMomentOfInertiaUnits = MassMomentOfInertiaUnits.KilogramSquareMeter):
+ """
+ Get a MassMomentOfInertia DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MassMomentOfInertia unit to store the MassMomentOfInertia value in the DTO representation.
+ :type hold_in_unit: MassMomentOfInertiaUnits
+ :return: JSON object represents MassMomentOfInertia DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(mass_moment_of_inertia_dto: MassMomentOfInertiaDto):
+ """
+ Obtain a new instance of MassMomentOfInertia from a DTO unit object.
+
+ :param mass_moment_of_inertia_dto: The MassMomentOfInertia DTO representation.
+ :type mass_moment_of_inertia_dto: MassMomentOfInertiaDto
+ :return: A new instance of MassMomentOfInertia.
+ :rtype: MassMomentOfInertia
+ """
+ return MassMomentOfInertia(mass_moment_of_inertia_dto.value, mass_moment_of_inertia_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MassMomentOfInertia from a DTO unit json representation.
+
+ :param data: The MassMomentOfInertia DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramSquareMeter"}
+ :return: A new instance of MassMomentOfInertia.
+ :rtype: MassMomentOfInertia
+ """
+ return MassMomentOfInertia.from_dto(MassMomentOfInertiaDto.from_json(data))
+
def __convert_from_base(self, from_unit: MassMomentOfInertiaUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/molality.py b/unitsnet_py/units/molality.py
index aa7260c..e5ed1b4 100644
--- a/unitsnet_py/units/molality.py
+++ b/unitsnet_py/units/molality.py
@@ -10,17 +10,67 @@ class MolalityUnits(Enum):
MolalityUnits enumeration
"""
- MolePerKilogram = 'mole_per_kilogram'
+ MolePerKilogram = 'MolePerKilogram'
"""
"""
- MolePerGram = 'mole_per_gram'
+ MolePerGram = 'MolePerGram'
"""
"""
+class MolalityDto:
+ """
+ A DTO representation of a Molality
+
+ Attributes:
+ value (float): The value of the Molality.
+ unit (MolalityUnits): The specific unit that the Molality value is representing.
+ """
+
+ def __init__(self, value: float, unit: MolalityUnits):
+ """
+ Create a new DTO representation of a Molality
+
+ Parameters:
+ value (float): The value of the Molality.
+ unit (MolalityUnits): The specific unit that the Molality value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Molality
+ """
+ self.unit: MolalityUnits = unit
+ """
+ The specific unit that the Molality value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Molality DTO JSON object representing the current unit.
+
+ :return: JSON object represents Molality DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MolePerKilogram"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Molality DTO from a json representation.
+
+ :param data: The Molality DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MolePerKilogram"}
+ :return: A new instance of MolalityDto.
+ :rtype: MolalityDto
+ """
+ return MolalityDto(value=data["value"], unit=MolalityUnits(data["unit"]))
+
+
class Molality(AbstractMeasure):
"""
Molality is a measure of the amount of solute in a solution relative to a given mass of solvent.
@@ -44,6 +94,54 @@ def __init__(self, value: float, from_unit: MolalityUnits = MolalityUnits.MolePe
def convert(self, unit: MolalityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MolalityUnits = MolalityUnits.MolePerKilogram) -> MolalityDto:
+ """
+ Get a new instance of Molality DTO representing the current unit.
+
+ :param hold_in_unit: The specific Molality unit to store the Molality value in the DTO representation.
+ :type hold_in_unit: MolalityUnits
+ :return: A new instance of MolalityDto.
+ :rtype: MolalityDto
+ """
+ return MolalityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MolalityUnits = MolalityUnits.MolePerKilogram):
+ """
+ Get a Molality DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Molality unit to store the Molality value in the DTO representation.
+ :type hold_in_unit: MolalityUnits
+ :return: JSON object represents Molality DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MolePerKilogram"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(molality_dto: MolalityDto):
+ """
+ Obtain a new instance of Molality from a DTO unit object.
+
+ :param molality_dto: The Molality DTO representation.
+ :type molality_dto: MolalityDto
+ :return: A new instance of Molality.
+ :rtype: Molality
+ """
+ return Molality(molality_dto.value, molality_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Molality from a DTO unit json representation.
+
+ :param data: The Molality DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MolePerKilogram"}
+ :return: A new instance of Molality.
+ :rtype: Molality
+ """
+ return Molality.from_dto(MolalityDto.from_json(data))
+
def __convert_from_base(self, from_unit: MolalityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/molar_energy.py b/unitsnet_py/units/molar_energy.py
index 280e064..c051274 100644
--- a/unitsnet_py/units/molar_energy.py
+++ b/unitsnet_py/units/molar_energy.py
@@ -10,22 +10,72 @@ class MolarEnergyUnits(Enum):
MolarEnergyUnits enumeration
"""
- JoulePerMole = 'joule_per_mole'
+ JoulePerMole = 'JoulePerMole'
"""
"""
- KilojoulePerMole = 'kilojoule_per_mole'
+ KilojoulePerMole = 'KilojoulePerMole'
"""
"""
- MegajoulePerMole = 'megajoule_per_mole'
+ MegajoulePerMole = 'MegajoulePerMole'
"""
"""
+class MolarEnergyDto:
+ """
+ A DTO representation of a MolarEnergy
+
+ Attributes:
+ value (float): The value of the MolarEnergy.
+ unit (MolarEnergyUnits): The specific unit that the MolarEnergy value is representing.
+ """
+
+ def __init__(self, value: float, unit: MolarEnergyUnits):
+ """
+ Create a new DTO representation of a MolarEnergy
+
+ Parameters:
+ value (float): The value of the MolarEnergy.
+ unit (MolarEnergyUnits): The specific unit that the MolarEnergy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MolarEnergy
+ """
+ self.unit: MolarEnergyUnits = unit
+ """
+ The specific unit that the MolarEnergy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MolarEnergy DTO JSON object representing the current unit.
+
+ :return: JSON object represents MolarEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerMole"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MolarEnergy DTO from a json representation.
+
+ :param data: The MolarEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerMole"}
+ :return: A new instance of MolarEnergyDto.
+ :rtype: MolarEnergyDto
+ """
+ return MolarEnergyDto(value=data["value"], unit=MolarEnergyUnits(data["unit"]))
+
+
class MolarEnergy(AbstractMeasure):
"""
Molar energy is the amount of energy stored in 1 mole of a substance.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: MolarEnergyUnits = MolarEnergyUnits.
def convert(self, unit: MolarEnergyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MolarEnergyUnits = MolarEnergyUnits.JoulePerMole) -> MolarEnergyDto:
+ """
+ Get a new instance of MolarEnergy DTO representing the current unit.
+
+ :param hold_in_unit: The specific MolarEnergy unit to store the MolarEnergy value in the DTO representation.
+ :type hold_in_unit: MolarEnergyUnits
+ :return: A new instance of MolarEnergyDto.
+ :rtype: MolarEnergyDto
+ """
+ return MolarEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MolarEnergyUnits = MolarEnergyUnits.JoulePerMole):
+ """
+ Get a MolarEnergy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MolarEnergy unit to store the MolarEnergy value in the DTO representation.
+ :type hold_in_unit: MolarEnergyUnits
+ :return: JSON object represents MolarEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerMole"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(molar_energy_dto: MolarEnergyDto):
+ """
+ Obtain a new instance of MolarEnergy from a DTO unit object.
+
+ :param molar_energy_dto: The MolarEnergy DTO representation.
+ :type molar_energy_dto: MolarEnergyDto
+ :return: A new instance of MolarEnergy.
+ :rtype: MolarEnergy
+ """
+ return MolarEnergy(molar_energy_dto.value, molar_energy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MolarEnergy from a DTO unit json representation.
+
+ :param data: The MolarEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerMole"}
+ :return: A new instance of MolarEnergy.
+ :rtype: MolarEnergy
+ """
+ return MolarEnergy.from_dto(MolarEnergyDto.from_json(data))
+
def __convert_from_base(self, from_unit: MolarEnergyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/molar_entropy.py b/unitsnet_py/units/molar_entropy.py
index 4897d2c..072e7bf 100644
--- a/unitsnet_py/units/molar_entropy.py
+++ b/unitsnet_py/units/molar_entropy.py
@@ -10,22 +10,72 @@ class MolarEntropyUnits(Enum):
MolarEntropyUnits enumeration
"""
- JoulePerMoleKelvin = 'joule_per_mole_kelvin'
+ JoulePerMoleKelvin = 'JoulePerMoleKelvin'
"""
"""
- KilojoulePerMoleKelvin = 'kilojoule_per_mole_kelvin'
+ KilojoulePerMoleKelvin = 'KilojoulePerMoleKelvin'
"""
"""
- MegajoulePerMoleKelvin = 'megajoule_per_mole_kelvin'
+ MegajoulePerMoleKelvin = 'MegajoulePerMoleKelvin'
"""
"""
+class MolarEntropyDto:
+ """
+ A DTO representation of a MolarEntropy
+
+ Attributes:
+ value (float): The value of the MolarEntropy.
+ unit (MolarEntropyUnits): The specific unit that the MolarEntropy value is representing.
+ """
+
+ def __init__(self, value: float, unit: MolarEntropyUnits):
+ """
+ Create a new DTO representation of a MolarEntropy
+
+ Parameters:
+ value (float): The value of the MolarEntropy.
+ unit (MolarEntropyUnits): The specific unit that the MolarEntropy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MolarEntropy
+ """
+ self.unit: MolarEntropyUnits = unit
+ """
+ The specific unit that the MolarEntropy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MolarEntropy DTO JSON object representing the current unit.
+
+ :return: JSON object represents MolarEntropy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerMoleKelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MolarEntropy DTO from a json representation.
+
+ :param data: The MolarEntropy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerMoleKelvin"}
+ :return: A new instance of MolarEntropyDto.
+ :rtype: MolarEntropyDto
+ """
+ return MolarEntropyDto(value=data["value"], unit=MolarEntropyUnits(data["unit"]))
+
+
class MolarEntropy(AbstractMeasure):
"""
Molar entropy is amount of energy required to increase temperature of 1 mole substance by 1 Kelvin.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: MolarEntropyUnits = MolarEntropyUnit
def convert(self, unit: MolarEntropyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MolarEntropyUnits = MolarEntropyUnits.JoulePerMoleKelvin) -> MolarEntropyDto:
+ """
+ Get a new instance of MolarEntropy DTO representing the current unit.
+
+ :param hold_in_unit: The specific MolarEntropy unit to store the MolarEntropy value in the DTO representation.
+ :type hold_in_unit: MolarEntropyUnits
+ :return: A new instance of MolarEntropyDto.
+ :rtype: MolarEntropyDto
+ """
+ return MolarEntropyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MolarEntropyUnits = MolarEntropyUnits.JoulePerMoleKelvin):
+ """
+ Get a MolarEntropy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MolarEntropy unit to store the MolarEntropy value in the DTO representation.
+ :type hold_in_unit: MolarEntropyUnits
+ :return: JSON object represents MolarEntropy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerMoleKelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(molar_entropy_dto: MolarEntropyDto):
+ """
+ Obtain a new instance of MolarEntropy from a DTO unit object.
+
+ :param molar_entropy_dto: The MolarEntropy DTO representation.
+ :type molar_entropy_dto: MolarEntropyDto
+ :return: A new instance of MolarEntropy.
+ :rtype: MolarEntropy
+ """
+ return MolarEntropy(molar_entropy_dto.value, molar_entropy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MolarEntropy from a DTO unit json representation.
+
+ :param data: The MolarEntropy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerMoleKelvin"}
+ :return: A new instance of MolarEntropy.
+ :rtype: MolarEntropy
+ """
+ return MolarEntropy.from_dto(MolarEntropyDto.from_json(data))
+
def __convert_from_base(self, from_unit: MolarEntropyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/molar_flow.py b/unitsnet_py/units/molar_flow.py
index 49d3bf5..83f428d 100644
--- a/unitsnet_py/units/molar_flow.py
+++ b/unitsnet_py/units/molar_flow.py
@@ -10,52 +10,102 @@ class MolarFlowUnits(Enum):
MolarFlowUnits enumeration
"""
- MolePerSecond = 'mole_per_second'
+ MolePerSecond = 'MolePerSecond'
"""
"""
- MolePerMinute = 'mole_per_minute'
+ MolePerMinute = 'MolePerMinute'
"""
"""
- MolePerHour = 'mole_per_hour'
+ MolePerHour = 'MolePerHour'
"""
"""
- PoundMolePerSecond = 'pound_mole_per_second'
+ PoundMolePerSecond = 'PoundMolePerSecond'
"""
"""
- PoundMolePerMinute = 'pound_mole_per_minute'
+ PoundMolePerMinute = 'PoundMolePerMinute'
"""
"""
- PoundMolePerHour = 'pound_mole_per_hour'
+ PoundMolePerHour = 'PoundMolePerHour'
"""
"""
- KilomolePerSecond = 'kilomole_per_second'
+ KilomolePerSecond = 'KilomolePerSecond'
"""
"""
- KilomolePerMinute = 'kilomole_per_minute'
+ KilomolePerMinute = 'KilomolePerMinute'
"""
"""
- KilomolePerHour = 'kilomole_per_hour'
+ KilomolePerHour = 'KilomolePerHour'
"""
"""
+class MolarFlowDto:
+ """
+ A DTO representation of a MolarFlow
+
+ Attributes:
+ value (float): The value of the MolarFlow.
+ unit (MolarFlowUnits): The specific unit that the MolarFlow value is representing.
+ """
+
+ def __init__(self, value: float, unit: MolarFlowUnits):
+ """
+ Create a new DTO representation of a MolarFlow
+
+ Parameters:
+ value (float): The value of the MolarFlow.
+ unit (MolarFlowUnits): The specific unit that the MolarFlow value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MolarFlow
+ """
+ self.unit: MolarFlowUnits = unit
+ """
+ The specific unit that the MolarFlow value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MolarFlow DTO JSON object representing the current unit.
+
+ :return: JSON object represents MolarFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MolePerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MolarFlow DTO from a json representation.
+
+ :param data: The MolarFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MolePerSecond"}
+ :return: A new instance of MolarFlowDto.
+ :rtype: MolarFlowDto
+ """
+ return MolarFlowDto(value=data["value"], unit=MolarFlowUnits(data["unit"]))
+
+
class MolarFlow(AbstractMeasure):
"""
Molar flow is the ratio of the amount of substance change to the time during which the change occurred (value of amount of substance changes per unit time).
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: MolarFlowUnits = MolarFlowUnits.Mole
def convert(self, unit: MolarFlowUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MolarFlowUnits = MolarFlowUnits.MolePerSecond) -> MolarFlowDto:
+ """
+ Get a new instance of MolarFlow DTO representing the current unit.
+
+ :param hold_in_unit: The specific MolarFlow unit to store the MolarFlow value in the DTO representation.
+ :type hold_in_unit: MolarFlowUnits
+ :return: A new instance of MolarFlowDto.
+ :rtype: MolarFlowDto
+ """
+ return MolarFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MolarFlowUnits = MolarFlowUnits.MolePerSecond):
+ """
+ Get a MolarFlow DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MolarFlow unit to store the MolarFlow value in the DTO representation.
+ :type hold_in_unit: MolarFlowUnits
+ :return: JSON object represents MolarFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MolePerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(molar_flow_dto: MolarFlowDto):
+ """
+ Obtain a new instance of MolarFlow from a DTO unit object.
+
+ :param molar_flow_dto: The MolarFlow DTO representation.
+ :type molar_flow_dto: MolarFlowDto
+ :return: A new instance of MolarFlow.
+ :rtype: MolarFlow
+ """
+ return MolarFlow(molar_flow_dto.value, molar_flow_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MolarFlow from a DTO unit json representation.
+
+ :param data: The MolarFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MolePerSecond"}
+ :return: A new instance of MolarFlow.
+ :rtype: MolarFlow
+ """
+ return MolarFlow.from_dto(MolarFlowDto.from_json(data))
+
def __convert_from_base(self, from_unit: MolarFlowUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/molar_mass.py b/unitsnet_py/units/molar_mass.py
index 0fc7acb..723c735 100644
--- a/unitsnet_py/units/molar_mass.py
+++ b/unitsnet_py/units/molar_mass.py
@@ -10,72 +10,122 @@ class MolarMassUnits(Enum):
MolarMassUnits enumeration
"""
- GramPerMole = 'gram_per_mole'
+ GramPerMole = 'GramPerMole'
"""
"""
- KilogramPerKilomole = 'kilogram_per_kilomole'
+ KilogramPerKilomole = 'KilogramPerKilomole'
"""
"""
- PoundPerMole = 'pound_per_mole'
+ PoundPerMole = 'PoundPerMole'
"""
"""
- NanogramPerMole = 'nanogram_per_mole'
+ NanogramPerMole = 'NanogramPerMole'
"""
"""
- MicrogramPerMole = 'microgram_per_mole'
+ MicrogramPerMole = 'MicrogramPerMole'
"""
"""
- MilligramPerMole = 'milligram_per_mole'
+ MilligramPerMole = 'MilligramPerMole'
"""
"""
- CentigramPerMole = 'centigram_per_mole'
+ CentigramPerMole = 'CentigramPerMole'
"""
"""
- DecigramPerMole = 'decigram_per_mole'
+ DecigramPerMole = 'DecigramPerMole'
"""
"""
- DecagramPerMole = 'decagram_per_mole'
+ DecagramPerMole = 'DecagramPerMole'
"""
"""
- HectogramPerMole = 'hectogram_per_mole'
+ HectogramPerMole = 'HectogramPerMole'
"""
"""
- KilogramPerMole = 'kilogram_per_mole'
+ KilogramPerMole = 'KilogramPerMole'
"""
"""
- KilopoundPerMole = 'kilopound_per_mole'
+ KilopoundPerMole = 'KilopoundPerMole'
"""
"""
- MegapoundPerMole = 'megapound_per_mole'
+ MegapoundPerMole = 'MegapoundPerMole'
"""
"""
+class MolarMassDto:
+ """
+ A DTO representation of a MolarMass
+
+ Attributes:
+ value (float): The value of the MolarMass.
+ unit (MolarMassUnits): The specific unit that the MolarMass value is representing.
+ """
+
+ def __init__(self, value: float, unit: MolarMassUnits):
+ """
+ Create a new DTO representation of a MolarMass
+
+ Parameters:
+ value (float): The value of the MolarMass.
+ unit (MolarMassUnits): The specific unit that the MolarMass value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the MolarMass
+ """
+ self.unit: MolarMassUnits = unit
+ """
+ The specific unit that the MolarMass value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a MolarMass DTO JSON object representing the current unit.
+
+ :return: JSON object represents MolarMass DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerMole"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of MolarMass DTO from a json representation.
+
+ :param data: The MolarMass DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerMole"}
+ :return: A new instance of MolarMassDto.
+ :rtype: MolarMassDto
+ """
+ return MolarMassDto(value=data["value"], unit=MolarMassUnits(data["unit"]))
+
+
class MolarMass(AbstractMeasure):
"""
In chemistry, the molar mass M is a physical property defined as the mass of a given substance (chemical element or chemical compound) divided by the amount of substance.
@@ -121,6 +171,54 @@ def __init__(self, value: float, from_unit: MolarMassUnits = MolarMassUnits.Kilo
def convert(self, unit: MolarMassUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MolarMassUnits = MolarMassUnits.KilogramPerMole) -> MolarMassDto:
+ """
+ Get a new instance of MolarMass DTO representing the current unit.
+
+ :param hold_in_unit: The specific MolarMass unit to store the MolarMass value in the DTO representation.
+ :type hold_in_unit: MolarMassUnits
+ :return: A new instance of MolarMassDto.
+ :rtype: MolarMassDto
+ """
+ return MolarMassDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MolarMassUnits = MolarMassUnits.KilogramPerMole):
+ """
+ Get a MolarMass DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific MolarMass unit to store the MolarMass value in the DTO representation.
+ :type hold_in_unit: MolarMassUnits
+ :return: JSON object represents MolarMass DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KilogramPerMole"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(molar_mass_dto: MolarMassDto):
+ """
+ Obtain a new instance of MolarMass from a DTO unit object.
+
+ :param molar_mass_dto: The MolarMass DTO representation.
+ :type molar_mass_dto: MolarMassDto
+ :return: A new instance of MolarMass.
+ :rtype: MolarMass
+ """
+ return MolarMass(molar_mass_dto.value, molar_mass_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of MolarMass from a DTO unit json representation.
+
+ :param data: The MolarMass DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KilogramPerMole"}
+ :return: A new instance of MolarMass.
+ :rtype: MolarMass
+ """
+ return MolarMass.from_dto(MolarMassDto.from_json(data))
+
def __convert_from_base(self, from_unit: MolarMassUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/molarity.py b/unitsnet_py/units/molarity.py
index 918e378..d296088 100644
--- a/unitsnet_py/units/molarity.py
+++ b/unitsnet_py/units/molarity.py
@@ -10,62 +10,112 @@ class MolarityUnits(Enum):
MolarityUnits enumeration
"""
- MolePerCubicMeter = 'mole_per_cubic_meter'
+ MolePerCubicMeter = 'MolePerCubicMeter'
"""
"""
- MolePerLiter = 'mole_per_liter'
+ MolePerLiter = 'MolePerLiter'
"""
"""
- PoundMolePerCubicFoot = 'pound_mole_per_cubic_foot'
+ PoundMolePerCubicFoot = 'PoundMolePerCubicFoot'
"""
"""
- KilomolePerCubicMeter = 'kilomole_per_cubic_meter'
+ KilomolePerCubicMeter = 'KilomolePerCubicMeter'
"""
"""
- FemtomolePerLiter = 'femtomole_per_liter'
+ FemtomolePerLiter = 'FemtomolePerLiter'
"""
"""
- PicomolePerLiter = 'picomole_per_liter'
+ PicomolePerLiter = 'PicomolePerLiter'
"""
"""
- NanomolePerLiter = 'nanomole_per_liter'
+ NanomolePerLiter = 'NanomolePerLiter'
"""
"""
- MicromolePerLiter = 'micromole_per_liter'
+ MicromolePerLiter = 'MicromolePerLiter'
"""
"""
- MillimolePerLiter = 'millimole_per_liter'
+ MillimolePerLiter = 'MillimolePerLiter'
"""
"""
- CentimolePerLiter = 'centimole_per_liter'
+ CentimolePerLiter = 'CentimolePerLiter'
"""
"""
- DecimolePerLiter = 'decimole_per_liter'
+ DecimolePerLiter = 'DecimolePerLiter'
"""
"""
+class MolarityDto:
+ """
+ A DTO representation of a Molarity
+
+ Attributes:
+ value (float): The value of the Molarity.
+ unit (MolarityUnits): The specific unit that the Molarity value is representing.
+ """
+
+ def __init__(self, value: float, unit: MolarityUnits):
+ """
+ Create a new DTO representation of a Molarity
+
+ Parameters:
+ value (float): The value of the Molarity.
+ unit (MolarityUnits): The specific unit that the Molarity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Molarity
+ """
+ self.unit: MolarityUnits = unit
+ """
+ The specific unit that the Molarity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Molarity DTO JSON object representing the current unit.
+
+ :return: JSON object represents Molarity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MolePerCubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Molarity DTO from a json representation.
+
+ :param data: The Molarity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MolePerCubicMeter"}
+ :return: A new instance of MolarityDto.
+ :rtype: MolarityDto
+ """
+ return MolarityDto(value=data["value"], unit=MolarityUnits(data["unit"]))
+
+
class Molarity(AbstractMeasure):
"""
Molar concentration, also called molarity, amount concentration or substance concentration, is a measure of the concentration of a solute in a solution, or of any chemical species, in terms of amount of substance in a given volume.
@@ -107,6 +157,54 @@ def __init__(self, value: float, from_unit: MolarityUnits = MolarityUnits.MolePe
def convert(self, unit: MolarityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: MolarityUnits = MolarityUnits.MolePerCubicMeter) -> MolarityDto:
+ """
+ Get a new instance of Molarity DTO representing the current unit.
+
+ :param hold_in_unit: The specific Molarity unit to store the Molarity value in the DTO representation.
+ :type hold_in_unit: MolarityUnits
+ :return: A new instance of MolarityDto.
+ :rtype: MolarityDto
+ """
+ return MolarityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: MolarityUnits = MolarityUnits.MolePerCubicMeter):
+ """
+ Get a Molarity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Molarity unit to store the Molarity value in the DTO representation.
+ :type hold_in_unit: MolarityUnits
+ :return: JSON object represents Molarity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MolePerCubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(molarity_dto: MolarityDto):
+ """
+ Obtain a new instance of Molarity from a DTO unit object.
+
+ :param molarity_dto: The Molarity DTO representation.
+ :type molarity_dto: MolarityDto
+ :return: A new instance of Molarity.
+ :rtype: Molarity
+ """
+ return Molarity(molarity_dto.value, molarity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Molarity from a DTO unit json representation.
+
+ :param data: The Molarity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MolePerCubicMeter"}
+ :return: A new instance of Molarity.
+ :rtype: Molarity
+ """
+ return Molarity.from_dto(MolarityDto.from_json(data))
+
def __convert_from_base(self, from_unit: MolarityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/permeability.py b/unitsnet_py/units/permeability.py
index 4a22fd9..6c415c9 100644
--- a/unitsnet_py/units/permeability.py
+++ b/unitsnet_py/units/permeability.py
@@ -10,12 +10,62 @@ class PermeabilityUnits(Enum):
PermeabilityUnits enumeration
"""
- HenryPerMeter = 'henry_per_meter'
+ HenryPerMeter = 'HenryPerMeter'
"""
"""
+class PermeabilityDto:
+ """
+ A DTO representation of a Permeability
+
+ Attributes:
+ value (float): The value of the Permeability.
+ unit (PermeabilityUnits): The specific unit that the Permeability value is representing.
+ """
+
+ def __init__(self, value: float, unit: PermeabilityUnits):
+ """
+ Create a new DTO representation of a Permeability
+
+ Parameters:
+ value (float): The value of the Permeability.
+ unit (PermeabilityUnits): The specific unit that the Permeability value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Permeability
+ """
+ self.unit: PermeabilityUnits = unit
+ """
+ The specific unit that the Permeability value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Permeability DTO JSON object representing the current unit.
+
+ :return: JSON object represents Permeability DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "HenryPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Permeability DTO from a json representation.
+
+ :param data: The Permeability DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "HenryPerMeter"}
+ :return: A new instance of PermeabilityDto.
+ :rtype: PermeabilityDto
+ """
+ return PermeabilityDto(value=data["value"], unit=PermeabilityUnits(data["unit"]))
+
+
class Permeability(AbstractMeasure):
"""
In electromagnetism, permeability is the measure of the ability of a material to support the formation of a magnetic field within itself.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: PermeabilityUnits = PermeabilityUnit
def convert(self, unit: PermeabilityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PermeabilityUnits = PermeabilityUnits.HenryPerMeter) -> PermeabilityDto:
+ """
+ Get a new instance of Permeability DTO representing the current unit.
+
+ :param hold_in_unit: The specific Permeability unit to store the Permeability value in the DTO representation.
+ :type hold_in_unit: PermeabilityUnits
+ :return: A new instance of PermeabilityDto.
+ :rtype: PermeabilityDto
+ """
+ return PermeabilityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PermeabilityUnits = PermeabilityUnits.HenryPerMeter):
+ """
+ Get a Permeability DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Permeability unit to store the Permeability value in the DTO representation.
+ :type hold_in_unit: PermeabilityUnits
+ :return: JSON object represents Permeability DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "HenryPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(permeability_dto: PermeabilityDto):
+ """
+ Obtain a new instance of Permeability from a DTO unit object.
+
+ :param permeability_dto: The Permeability DTO representation.
+ :type permeability_dto: PermeabilityDto
+ :return: A new instance of Permeability.
+ :rtype: Permeability
+ """
+ return Permeability(permeability_dto.value, permeability_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Permeability from a DTO unit json representation.
+
+ :param data: The Permeability DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "HenryPerMeter"}
+ :return: A new instance of Permeability.
+ :rtype: Permeability
+ """
+ return Permeability.from_dto(PermeabilityDto.from_json(data))
+
def __convert_from_base(self, from_unit: PermeabilityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/permittivity.py b/unitsnet_py/units/permittivity.py
index 96d9148..090159d 100644
--- a/unitsnet_py/units/permittivity.py
+++ b/unitsnet_py/units/permittivity.py
@@ -10,12 +10,62 @@ class PermittivityUnits(Enum):
PermittivityUnits enumeration
"""
- FaradPerMeter = 'farad_per_meter'
+ FaradPerMeter = 'FaradPerMeter'
"""
"""
+class PermittivityDto:
+ """
+ A DTO representation of a Permittivity
+
+ Attributes:
+ value (float): The value of the Permittivity.
+ unit (PermittivityUnits): The specific unit that the Permittivity value is representing.
+ """
+
+ def __init__(self, value: float, unit: PermittivityUnits):
+ """
+ Create a new DTO representation of a Permittivity
+
+ Parameters:
+ value (float): The value of the Permittivity.
+ unit (PermittivityUnits): The specific unit that the Permittivity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Permittivity
+ """
+ self.unit: PermittivityUnits = unit
+ """
+ The specific unit that the Permittivity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Permittivity DTO JSON object representing the current unit.
+
+ :return: JSON object represents Permittivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "FaradPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Permittivity DTO from a json representation.
+
+ :param data: The Permittivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "FaradPerMeter"}
+ :return: A new instance of PermittivityDto.
+ :rtype: PermittivityDto
+ """
+ return PermittivityDto(value=data["value"], unit=PermittivityUnits(data["unit"]))
+
+
class Permittivity(AbstractMeasure):
"""
In electromagnetism, permittivity is the measure of resistance that is encountered when forming an electric field in a particular medium.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: PermittivityUnits = PermittivityUnit
def convert(self, unit: PermittivityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PermittivityUnits = PermittivityUnits.FaradPerMeter) -> PermittivityDto:
+ """
+ Get a new instance of Permittivity DTO representing the current unit.
+
+ :param hold_in_unit: The specific Permittivity unit to store the Permittivity value in the DTO representation.
+ :type hold_in_unit: PermittivityUnits
+ :return: A new instance of PermittivityDto.
+ :rtype: PermittivityDto
+ """
+ return PermittivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PermittivityUnits = PermittivityUnits.FaradPerMeter):
+ """
+ Get a Permittivity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Permittivity unit to store the Permittivity value in the DTO representation.
+ :type hold_in_unit: PermittivityUnits
+ :return: JSON object represents Permittivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "FaradPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(permittivity_dto: PermittivityDto):
+ """
+ Obtain a new instance of Permittivity from a DTO unit object.
+
+ :param permittivity_dto: The Permittivity DTO representation.
+ :type permittivity_dto: PermittivityDto
+ :return: A new instance of Permittivity.
+ :rtype: Permittivity
+ """
+ return Permittivity(permittivity_dto.value, permittivity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Permittivity from a DTO unit json representation.
+
+ :param data: The Permittivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "FaradPerMeter"}
+ :return: A new instance of Permittivity.
+ :rtype: Permittivity
+ """
+ return Permittivity.from_dto(PermittivityDto.from_json(data))
+
def __convert_from_base(self, from_unit: PermittivityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/porous_medium_permeability.py b/unitsnet_py/units/porous_medium_permeability.py
index 0a61d10..5212763 100644
--- a/unitsnet_py/units/porous_medium_permeability.py
+++ b/unitsnet_py/units/porous_medium_permeability.py
@@ -10,32 +10,82 @@ class PorousMediumPermeabilityUnits(Enum):
PorousMediumPermeabilityUnits enumeration
"""
- Darcy = 'darcy'
+ Darcy = 'Darcy'
"""
"""
- SquareMeter = 'square_meter'
+ SquareMeter = 'SquareMeter'
"""
"""
- SquareCentimeter = 'square_centimeter'
+ SquareCentimeter = 'SquareCentimeter'
"""
"""
- Microdarcy = 'microdarcy'
+ Microdarcy = 'Microdarcy'
"""
"""
- Millidarcy = 'millidarcy'
+ Millidarcy = 'Millidarcy'
"""
"""
+class PorousMediumPermeabilityDto:
+ """
+ A DTO representation of a PorousMediumPermeability
+
+ Attributes:
+ value (float): The value of the PorousMediumPermeability.
+ unit (PorousMediumPermeabilityUnits): The specific unit that the PorousMediumPermeability value is representing.
+ """
+
+ def __init__(self, value: float, unit: PorousMediumPermeabilityUnits):
+ """
+ Create a new DTO representation of a PorousMediumPermeability
+
+ Parameters:
+ value (float): The value of the PorousMediumPermeability.
+ unit (PorousMediumPermeabilityUnits): The specific unit that the PorousMediumPermeability value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the PorousMediumPermeability
+ """
+ self.unit: PorousMediumPermeabilityUnits = unit
+ """
+ The specific unit that the PorousMediumPermeability value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a PorousMediumPermeability DTO JSON object representing the current unit.
+
+ :return: JSON object represents PorousMediumPermeability DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of PorousMediumPermeability DTO from a json representation.
+
+ :param data: The PorousMediumPermeability DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeter"}
+ :return: A new instance of PorousMediumPermeabilityDto.
+ :rtype: PorousMediumPermeabilityDto
+ """
+ return PorousMediumPermeabilityDto(value=data["value"], unit=PorousMediumPermeabilityUnits(data["unit"]))
+
+
class PorousMediumPermeability(AbstractMeasure):
"""
None
@@ -65,6 +115,54 @@ def __init__(self, value: float, from_unit: PorousMediumPermeabilityUnits = Poro
def convert(self, unit: PorousMediumPermeabilityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PorousMediumPermeabilityUnits = PorousMediumPermeabilityUnits.SquareMeter) -> PorousMediumPermeabilityDto:
+ """
+ Get a new instance of PorousMediumPermeability DTO representing the current unit.
+
+ :param hold_in_unit: The specific PorousMediumPermeability unit to store the PorousMediumPermeability value in the DTO representation.
+ :type hold_in_unit: PorousMediumPermeabilityUnits
+ :return: A new instance of PorousMediumPermeabilityDto.
+ :rtype: PorousMediumPermeabilityDto
+ """
+ return PorousMediumPermeabilityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PorousMediumPermeabilityUnits = PorousMediumPermeabilityUnits.SquareMeter):
+ """
+ Get a PorousMediumPermeability DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific PorousMediumPermeability unit to store the PorousMediumPermeability value in the DTO representation.
+ :type hold_in_unit: PorousMediumPermeabilityUnits
+ :return: JSON object represents PorousMediumPermeability DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(porous_medium_permeability_dto: PorousMediumPermeabilityDto):
+ """
+ Obtain a new instance of PorousMediumPermeability from a DTO unit object.
+
+ :param porous_medium_permeability_dto: The PorousMediumPermeability DTO representation.
+ :type porous_medium_permeability_dto: PorousMediumPermeabilityDto
+ :return: A new instance of PorousMediumPermeability.
+ :rtype: PorousMediumPermeability
+ """
+ return PorousMediumPermeability(porous_medium_permeability_dto.value, porous_medium_permeability_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of PorousMediumPermeability from a DTO unit json representation.
+
+ :param data: The PorousMediumPermeability DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeter"}
+ :return: A new instance of PorousMediumPermeability.
+ :rtype: PorousMediumPermeability
+ """
+ return PorousMediumPermeability.from_dto(PorousMediumPermeabilityDto.from_json(data))
+
def __convert_from_base(self, from_unit: PorousMediumPermeabilityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/power.py b/unitsnet_py/units/power.py
index 766f7e0..aa220a1 100644
--- a/unitsnet_py/units/power.py
+++ b/unitsnet_py/units/power.py
@@ -10,137 +10,187 @@ class PowerUnits(Enum):
PowerUnits enumeration
"""
- Watt = 'watt'
+ Watt = 'Watt'
"""
"""
- MechanicalHorsepower = 'mechanical_horsepower'
+ MechanicalHorsepower = 'MechanicalHorsepower'
"""
"""
- MetricHorsepower = 'metric_horsepower'
+ MetricHorsepower = 'MetricHorsepower'
"""
"""
- ElectricalHorsepower = 'electrical_horsepower'
+ ElectricalHorsepower = 'ElectricalHorsepower'
"""
"""
- BoilerHorsepower = 'boiler_horsepower'
+ BoilerHorsepower = 'BoilerHorsepower'
"""
"""
- HydraulicHorsepower = 'hydraulic_horsepower'
+ HydraulicHorsepower = 'HydraulicHorsepower'
"""
"""
- BritishThermalUnitPerHour = 'british_thermal_unit_per_hour'
+ BritishThermalUnitPerHour = 'BritishThermalUnitPerHour'
"""
"""
- JoulePerHour = 'joule_per_hour'
+ JoulePerHour = 'JoulePerHour'
"""
"""
- Femtowatt = 'femtowatt'
+ Femtowatt = 'Femtowatt'
"""
"""
- Picowatt = 'picowatt'
+ Picowatt = 'Picowatt'
"""
"""
- Nanowatt = 'nanowatt'
+ Nanowatt = 'Nanowatt'
"""
"""
- Microwatt = 'microwatt'
+ Microwatt = 'Microwatt'
"""
"""
- Milliwatt = 'milliwatt'
+ Milliwatt = 'Milliwatt'
"""
"""
- Deciwatt = 'deciwatt'
+ Deciwatt = 'Deciwatt'
"""
"""
- Decawatt = 'decawatt'
+ Decawatt = 'Decawatt'
"""
"""
- Kilowatt = 'kilowatt'
+ Kilowatt = 'Kilowatt'
"""
"""
- Megawatt = 'megawatt'
+ Megawatt = 'Megawatt'
"""
"""
- Gigawatt = 'gigawatt'
+ Gigawatt = 'Gigawatt'
"""
"""
- Terawatt = 'terawatt'
+ Terawatt = 'Terawatt'
"""
"""
- Petawatt = 'petawatt'
+ Petawatt = 'Petawatt'
"""
"""
- KilobritishThermalUnitPerHour = 'kilobritish_thermal_unit_per_hour'
+ KilobritishThermalUnitPerHour = 'KilobritishThermalUnitPerHour'
"""
"""
- MegabritishThermalUnitPerHour = 'megabritish_thermal_unit_per_hour'
+ MegabritishThermalUnitPerHour = 'MegabritishThermalUnitPerHour'
"""
"""
- MillijoulePerHour = 'millijoule_per_hour'
+ MillijoulePerHour = 'MillijoulePerHour'
"""
"""
- KilojoulePerHour = 'kilojoule_per_hour'
+ KilojoulePerHour = 'KilojoulePerHour'
"""
"""
- MegajoulePerHour = 'megajoule_per_hour'
+ MegajoulePerHour = 'MegajoulePerHour'
"""
"""
- GigajoulePerHour = 'gigajoule_per_hour'
+ GigajoulePerHour = 'GigajoulePerHour'
"""
"""
+class PowerDto:
+ """
+ A DTO representation of a Power
+
+ Attributes:
+ value (float): The value of the Power.
+ unit (PowerUnits): The specific unit that the Power value is representing.
+ """
+
+ def __init__(self, value: float, unit: PowerUnits):
+ """
+ Create a new DTO representation of a Power
+
+ Parameters:
+ value (float): The value of the Power.
+ unit (PowerUnits): The specific unit that the Power value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Power
+ """
+ self.unit: PowerUnits = unit
+ """
+ The specific unit that the Power value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Power DTO JSON object representing the current unit.
+
+ :return: JSON object represents Power DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Watt"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Power DTO from a json representation.
+
+ :param data: The Power DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Watt"}
+ :return: A new instance of PowerDto.
+ :rtype: PowerDto
+ """
+ return PowerDto(value=data["value"], unit=PowerUnits(data["unit"]))
+
+
class Power(AbstractMeasure):
"""
In physics, power is the rate of doing work. It is equivalent to an amount of energy consumed per unit time.
@@ -212,6 +262,54 @@ def __init__(self, value: float, from_unit: PowerUnits = PowerUnits.Watt):
def convert(self, unit: PowerUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PowerUnits = PowerUnits.Watt) -> PowerDto:
+ """
+ Get a new instance of Power DTO representing the current unit.
+
+ :param hold_in_unit: The specific Power unit to store the Power value in the DTO representation.
+ :type hold_in_unit: PowerUnits
+ :return: A new instance of PowerDto.
+ :rtype: PowerDto
+ """
+ return PowerDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PowerUnits = PowerUnits.Watt):
+ """
+ Get a Power DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Power unit to store the Power value in the DTO representation.
+ :type hold_in_unit: PowerUnits
+ :return: JSON object represents Power DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Watt"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(power_dto: PowerDto):
+ """
+ Obtain a new instance of Power from a DTO unit object.
+
+ :param power_dto: The Power DTO representation.
+ :type power_dto: PowerDto
+ :return: A new instance of Power.
+ :rtype: Power
+ """
+ return Power(power_dto.value, power_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Power from a DTO unit json representation.
+
+ :param data: The Power DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Watt"}
+ :return: A new instance of Power.
+ :rtype: Power
+ """
+ return Power.from_dto(PowerDto.from_json(data))
+
def __convert_from_base(self, from_unit: PowerUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/power_density.py b/unitsnet_py/units/power_density.py
index 5c6a6e3..d01a93a 100644
--- a/unitsnet_py/units/power_density.py
+++ b/unitsnet_py/units/power_density.py
@@ -10,227 +10,277 @@ class PowerDensityUnits(Enum):
PowerDensityUnits enumeration
"""
- WattPerCubicMeter = 'watt_per_cubic_meter'
+ WattPerCubicMeter = 'WattPerCubicMeter'
"""
"""
- WattPerCubicInch = 'watt_per_cubic_inch'
+ WattPerCubicInch = 'WattPerCubicInch'
"""
"""
- WattPerCubicFoot = 'watt_per_cubic_foot'
+ WattPerCubicFoot = 'WattPerCubicFoot'
"""
"""
- WattPerLiter = 'watt_per_liter'
+ WattPerLiter = 'WattPerLiter'
"""
"""
- PicowattPerCubicMeter = 'picowatt_per_cubic_meter'
+ PicowattPerCubicMeter = 'PicowattPerCubicMeter'
"""
"""
- NanowattPerCubicMeter = 'nanowatt_per_cubic_meter'
+ NanowattPerCubicMeter = 'NanowattPerCubicMeter'
"""
"""
- MicrowattPerCubicMeter = 'microwatt_per_cubic_meter'
+ MicrowattPerCubicMeter = 'MicrowattPerCubicMeter'
"""
"""
- MilliwattPerCubicMeter = 'milliwatt_per_cubic_meter'
+ MilliwattPerCubicMeter = 'MilliwattPerCubicMeter'
"""
"""
- DeciwattPerCubicMeter = 'deciwatt_per_cubic_meter'
+ DeciwattPerCubicMeter = 'DeciwattPerCubicMeter'
"""
"""
- DecawattPerCubicMeter = 'decawatt_per_cubic_meter'
+ DecawattPerCubicMeter = 'DecawattPerCubicMeter'
"""
"""
- KilowattPerCubicMeter = 'kilowatt_per_cubic_meter'
+ KilowattPerCubicMeter = 'KilowattPerCubicMeter'
"""
"""
- MegawattPerCubicMeter = 'megawatt_per_cubic_meter'
+ MegawattPerCubicMeter = 'MegawattPerCubicMeter'
"""
"""
- GigawattPerCubicMeter = 'gigawatt_per_cubic_meter'
+ GigawattPerCubicMeter = 'GigawattPerCubicMeter'
"""
"""
- TerawattPerCubicMeter = 'terawatt_per_cubic_meter'
+ TerawattPerCubicMeter = 'TerawattPerCubicMeter'
"""
"""
- PicowattPerCubicInch = 'picowatt_per_cubic_inch'
+ PicowattPerCubicInch = 'PicowattPerCubicInch'
"""
"""
- NanowattPerCubicInch = 'nanowatt_per_cubic_inch'
+ NanowattPerCubicInch = 'NanowattPerCubicInch'
"""
"""
- MicrowattPerCubicInch = 'microwatt_per_cubic_inch'
+ MicrowattPerCubicInch = 'MicrowattPerCubicInch'
"""
"""
- MilliwattPerCubicInch = 'milliwatt_per_cubic_inch'
+ MilliwattPerCubicInch = 'MilliwattPerCubicInch'
"""
"""
- DeciwattPerCubicInch = 'deciwatt_per_cubic_inch'
+ DeciwattPerCubicInch = 'DeciwattPerCubicInch'
"""
"""
- DecawattPerCubicInch = 'decawatt_per_cubic_inch'
+ DecawattPerCubicInch = 'DecawattPerCubicInch'
"""
"""
- KilowattPerCubicInch = 'kilowatt_per_cubic_inch'
+ KilowattPerCubicInch = 'KilowattPerCubicInch'
"""
"""
- MegawattPerCubicInch = 'megawatt_per_cubic_inch'
+ MegawattPerCubicInch = 'MegawattPerCubicInch'
"""
"""
- GigawattPerCubicInch = 'gigawatt_per_cubic_inch'
+ GigawattPerCubicInch = 'GigawattPerCubicInch'
"""
"""
- TerawattPerCubicInch = 'terawatt_per_cubic_inch'
+ TerawattPerCubicInch = 'TerawattPerCubicInch'
"""
"""
- PicowattPerCubicFoot = 'picowatt_per_cubic_foot'
+ PicowattPerCubicFoot = 'PicowattPerCubicFoot'
"""
"""
- NanowattPerCubicFoot = 'nanowatt_per_cubic_foot'
+ NanowattPerCubicFoot = 'NanowattPerCubicFoot'
"""
"""
- MicrowattPerCubicFoot = 'microwatt_per_cubic_foot'
+ MicrowattPerCubicFoot = 'MicrowattPerCubicFoot'
"""
"""
- MilliwattPerCubicFoot = 'milliwatt_per_cubic_foot'
+ MilliwattPerCubicFoot = 'MilliwattPerCubicFoot'
"""
"""
- DeciwattPerCubicFoot = 'deciwatt_per_cubic_foot'
+ DeciwattPerCubicFoot = 'DeciwattPerCubicFoot'
"""
"""
- DecawattPerCubicFoot = 'decawatt_per_cubic_foot'
+ DecawattPerCubicFoot = 'DecawattPerCubicFoot'
"""
"""
- KilowattPerCubicFoot = 'kilowatt_per_cubic_foot'
+ KilowattPerCubicFoot = 'KilowattPerCubicFoot'
"""
"""
- MegawattPerCubicFoot = 'megawatt_per_cubic_foot'
+ MegawattPerCubicFoot = 'MegawattPerCubicFoot'
"""
"""
- GigawattPerCubicFoot = 'gigawatt_per_cubic_foot'
+ GigawattPerCubicFoot = 'GigawattPerCubicFoot'
"""
"""
- TerawattPerCubicFoot = 'terawatt_per_cubic_foot'
+ TerawattPerCubicFoot = 'TerawattPerCubicFoot'
"""
"""
- PicowattPerLiter = 'picowatt_per_liter'
+ PicowattPerLiter = 'PicowattPerLiter'
"""
"""
- NanowattPerLiter = 'nanowatt_per_liter'
+ NanowattPerLiter = 'NanowattPerLiter'
"""
"""
- MicrowattPerLiter = 'microwatt_per_liter'
+ MicrowattPerLiter = 'MicrowattPerLiter'
"""
"""
- MilliwattPerLiter = 'milliwatt_per_liter'
+ MilliwattPerLiter = 'MilliwattPerLiter'
"""
"""
- DeciwattPerLiter = 'deciwatt_per_liter'
+ DeciwattPerLiter = 'DeciwattPerLiter'
"""
"""
- DecawattPerLiter = 'decawatt_per_liter'
+ DecawattPerLiter = 'DecawattPerLiter'
"""
"""
- KilowattPerLiter = 'kilowatt_per_liter'
+ KilowattPerLiter = 'KilowattPerLiter'
"""
"""
- MegawattPerLiter = 'megawatt_per_liter'
+ MegawattPerLiter = 'MegawattPerLiter'
"""
"""
- GigawattPerLiter = 'gigawatt_per_liter'
+ GigawattPerLiter = 'GigawattPerLiter'
"""
"""
- TerawattPerLiter = 'terawatt_per_liter'
+ TerawattPerLiter = 'TerawattPerLiter'
"""
"""
+class PowerDensityDto:
+ """
+ A DTO representation of a PowerDensity
+
+ Attributes:
+ value (float): The value of the PowerDensity.
+ unit (PowerDensityUnits): The specific unit that the PowerDensity value is representing.
+ """
+
+ def __init__(self, value: float, unit: PowerDensityUnits):
+ """
+ Create a new DTO representation of a PowerDensity
+
+ Parameters:
+ value (float): The value of the PowerDensity.
+ unit (PowerDensityUnits): The specific unit that the PowerDensity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the PowerDensity
+ """
+ self.unit: PowerDensityUnits = unit
+ """
+ The specific unit that the PowerDensity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a PowerDensity DTO JSON object representing the current unit.
+
+ :return: JSON object represents PowerDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerCubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of PowerDensity DTO from a json representation.
+
+ :param data: The PowerDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerCubicMeter"}
+ :return: A new instance of PowerDensityDto.
+ :rtype: PowerDensityDto
+ """
+ return PowerDensityDto(value=data["value"], unit=PowerDensityUnits(data["unit"]))
+
+
class PowerDensity(AbstractMeasure):
"""
The amount of power in a volume.
@@ -338,6 +388,54 @@ def __init__(self, value: float, from_unit: PowerDensityUnits = PowerDensityUnit
def convert(self, unit: PowerDensityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PowerDensityUnits = PowerDensityUnits.WattPerCubicMeter) -> PowerDensityDto:
+ """
+ Get a new instance of PowerDensity DTO representing the current unit.
+
+ :param hold_in_unit: The specific PowerDensity unit to store the PowerDensity value in the DTO representation.
+ :type hold_in_unit: PowerDensityUnits
+ :return: A new instance of PowerDensityDto.
+ :rtype: PowerDensityDto
+ """
+ return PowerDensityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PowerDensityUnits = PowerDensityUnits.WattPerCubicMeter):
+ """
+ Get a PowerDensity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific PowerDensity unit to store the PowerDensity value in the DTO representation.
+ :type hold_in_unit: PowerDensityUnits
+ :return: JSON object represents PowerDensity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerCubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(power_density_dto: PowerDensityDto):
+ """
+ Obtain a new instance of PowerDensity from a DTO unit object.
+
+ :param power_density_dto: The PowerDensity DTO representation.
+ :type power_density_dto: PowerDensityDto
+ :return: A new instance of PowerDensity.
+ :rtype: PowerDensity
+ """
+ return PowerDensity(power_density_dto.value, power_density_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of PowerDensity from a DTO unit json representation.
+
+ :param data: The PowerDensity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerCubicMeter"}
+ :return: A new instance of PowerDensity.
+ :rtype: PowerDensity
+ """
+ return PowerDensity.from_dto(PowerDensityDto.from_json(data))
+
def __convert_from_base(self, from_unit: PowerDensityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/power_ratio.py b/unitsnet_py/units/power_ratio.py
index b0b6536..deb553a 100644
--- a/unitsnet_py/units/power_ratio.py
+++ b/unitsnet_py/units/power_ratio.py
@@ -10,17 +10,67 @@ class PowerRatioUnits(Enum):
PowerRatioUnits enumeration
"""
- DecibelWatt = 'decibel_watt'
+ DecibelWatt = 'DecibelWatt'
"""
"""
- DecibelMilliwatt = 'decibel_milliwatt'
+ DecibelMilliwatt = 'DecibelMilliwatt'
"""
"""
+class PowerRatioDto:
+ """
+ A DTO representation of a PowerRatio
+
+ Attributes:
+ value (float): The value of the PowerRatio.
+ unit (PowerRatioUnits): The specific unit that the PowerRatio value is representing.
+ """
+
+ def __init__(self, value: float, unit: PowerRatioUnits):
+ """
+ Create a new DTO representation of a PowerRatio
+
+ Parameters:
+ value (float): The value of the PowerRatio.
+ unit (PowerRatioUnits): The specific unit that the PowerRatio value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the PowerRatio
+ """
+ self.unit: PowerRatioUnits = unit
+ """
+ The specific unit that the PowerRatio value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a PowerRatio DTO JSON object representing the current unit.
+
+ :return: JSON object represents PowerRatio DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecibelWatt"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of PowerRatio DTO from a json representation.
+
+ :param data: The PowerRatio DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecibelWatt"}
+ :return: A new instance of PowerRatioDto.
+ :rtype: PowerRatioDto
+ """
+ return PowerRatioDto(value=data["value"], unit=PowerRatioUnits(data["unit"]))
+
+
class PowerRatio(AbstractMeasure):
"""
The strength of a signal expressed in decibels (dB) relative to one watt.
@@ -44,6 +94,54 @@ def __init__(self, value: float, from_unit: PowerRatioUnits = PowerRatioUnits.De
def convert(self, unit: PowerRatioUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PowerRatioUnits = PowerRatioUnits.DecibelWatt) -> PowerRatioDto:
+ """
+ Get a new instance of PowerRatio DTO representing the current unit.
+
+ :param hold_in_unit: The specific PowerRatio unit to store the PowerRatio value in the DTO representation.
+ :type hold_in_unit: PowerRatioUnits
+ :return: A new instance of PowerRatioDto.
+ :rtype: PowerRatioDto
+ """
+ return PowerRatioDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PowerRatioUnits = PowerRatioUnits.DecibelWatt):
+ """
+ Get a PowerRatio DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific PowerRatio unit to store the PowerRatio value in the DTO representation.
+ :type hold_in_unit: PowerRatioUnits
+ :return: JSON object represents PowerRatio DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecibelWatt"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(power_ratio_dto: PowerRatioDto):
+ """
+ Obtain a new instance of PowerRatio from a DTO unit object.
+
+ :param power_ratio_dto: The PowerRatio DTO representation.
+ :type power_ratio_dto: PowerRatioDto
+ :return: A new instance of PowerRatio.
+ :rtype: PowerRatio
+ """
+ return PowerRatio(power_ratio_dto.value, power_ratio_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of PowerRatio from a DTO unit json representation.
+
+ :param data: The PowerRatio DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecibelWatt"}
+ :return: A new instance of PowerRatio.
+ :rtype: PowerRatio
+ """
+ return PowerRatio.from_dto(PowerRatioDto.from_json(data))
+
def __convert_from_base(self, from_unit: PowerRatioUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/pressure.py b/unitsnet_py/units/pressure.py
index e43d1ea..0230f3c 100644
--- a/unitsnet_py/units/pressure.py
+++ b/unitsnet_py/units/pressure.py
@@ -10,252 +10,302 @@ class PressureUnits(Enum):
PressureUnits enumeration
"""
- Pascal = 'pascal'
+ Pascal = 'Pascal'
"""
"""
- Atmosphere = 'atmosphere'
+ Atmosphere = 'Atmosphere'
"""
"""
- Bar = 'bar'
+ Bar = 'Bar'
"""
"""
- KilogramForcePerSquareMeter = 'kilogram_force_per_square_meter'
+ KilogramForcePerSquareMeter = 'KilogramForcePerSquareMeter'
"""
"""
- KilogramForcePerSquareCentimeter = 'kilogram_force_per_square_centimeter'
+ KilogramForcePerSquareCentimeter = 'KilogramForcePerSquareCentimeter'
"""
"""
- KilogramForcePerSquareMillimeter = 'kilogram_force_per_square_millimeter'
+ KilogramForcePerSquareMillimeter = 'KilogramForcePerSquareMillimeter'
"""
"""
- NewtonPerSquareMeter = 'newton_per_square_meter'
+ NewtonPerSquareMeter = 'NewtonPerSquareMeter'
"""
"""
- NewtonPerSquareCentimeter = 'newton_per_square_centimeter'
+ NewtonPerSquareCentimeter = 'NewtonPerSquareCentimeter'
"""
"""
- NewtonPerSquareMillimeter = 'newton_per_square_millimeter'
+ NewtonPerSquareMillimeter = 'NewtonPerSquareMillimeter'
"""
"""
- TechnicalAtmosphere = 'technical_atmosphere'
+ TechnicalAtmosphere = 'TechnicalAtmosphere'
"""
"""
- Torr = 'torr'
+ Torr = 'Torr'
"""
"""
- PoundForcePerSquareInch = 'pound_force_per_square_inch'
+ PoundForcePerSquareInch = 'PoundForcePerSquareInch'
"""
"""
- PoundForcePerSquareMil = 'pound_force_per_square_mil'
+ PoundForcePerSquareMil = 'PoundForcePerSquareMil'
"""
"""
- PoundForcePerSquareFoot = 'pound_force_per_square_foot'
+ PoundForcePerSquareFoot = 'PoundForcePerSquareFoot'
"""
"""
- TonneForcePerSquareMillimeter = 'tonne_force_per_square_millimeter'
+ TonneForcePerSquareMillimeter = 'TonneForcePerSquareMillimeter'
"""
"""
- TonneForcePerSquareMeter = 'tonne_force_per_square_meter'
+ TonneForcePerSquareMeter = 'TonneForcePerSquareMeter'
"""
"""
- MeterOfHead = 'meter_of_head'
+ MeterOfHead = 'MeterOfHead'
"""
"""
- TonneForcePerSquareCentimeter = 'tonne_force_per_square_centimeter'
+ TonneForcePerSquareCentimeter = 'TonneForcePerSquareCentimeter'
"""
"""
- FootOfHead = 'foot_of_head'
+ FootOfHead = 'FootOfHead'
"""
"""
- MillimeterOfMercury = 'millimeter_of_mercury'
+ MillimeterOfMercury = 'MillimeterOfMercury'
"""
"""
- InchOfMercury = 'inch_of_mercury'
+ InchOfMercury = 'InchOfMercury'
"""
"""
- DynePerSquareCentimeter = 'dyne_per_square_centimeter'
+ DynePerSquareCentimeter = 'DynePerSquareCentimeter'
"""
"""
- PoundPerInchSecondSquared = 'pound_per_inch_second_squared'
+ PoundPerInchSecondSquared = 'PoundPerInchSecondSquared'
"""
"""
- MeterOfWaterColumn = 'meter_of_water_column'
+ MeterOfWaterColumn = 'MeterOfWaterColumn'
"""
"""
- InchOfWaterColumn = 'inch_of_water_column'
+ InchOfWaterColumn = 'InchOfWaterColumn'
"""
"""
- MeterOfElevation = 'meter_of_elevation'
+ MeterOfElevation = 'MeterOfElevation'
"""
"""
- FootOfElevation = 'foot_of_elevation'
+ FootOfElevation = 'FootOfElevation'
"""
"""
- Micropascal = 'micropascal'
+ Micropascal = 'Micropascal'
"""
"""
- Millipascal = 'millipascal'
+ Millipascal = 'Millipascal'
"""
"""
- Decapascal = 'decapascal'
+ Decapascal = 'Decapascal'
"""
"""
- Hectopascal = 'hectopascal'
+ Hectopascal = 'Hectopascal'
"""
"""
- Kilopascal = 'kilopascal'
+ Kilopascal = 'Kilopascal'
"""
"""
- Megapascal = 'megapascal'
+ Megapascal = 'Megapascal'
"""
"""
- Gigapascal = 'gigapascal'
+ Gigapascal = 'Gigapascal'
"""
"""
- Microbar = 'microbar'
+ Microbar = 'Microbar'
"""
"""
- Millibar = 'millibar'
+ Millibar = 'Millibar'
"""
"""
- Centibar = 'centibar'
+ Centibar = 'Centibar'
"""
"""
- Decibar = 'decibar'
+ Decibar = 'Decibar'
"""
"""
- Kilobar = 'kilobar'
+ Kilobar = 'Kilobar'
"""
"""
- Megabar = 'megabar'
+ Megabar = 'Megabar'
"""
"""
- KilonewtonPerSquareMeter = 'kilonewton_per_square_meter'
+ KilonewtonPerSquareMeter = 'KilonewtonPerSquareMeter'
"""
"""
- MeganewtonPerSquareMeter = 'meganewton_per_square_meter'
+ MeganewtonPerSquareMeter = 'MeganewtonPerSquareMeter'
"""
"""
- KilonewtonPerSquareCentimeter = 'kilonewton_per_square_centimeter'
+ KilonewtonPerSquareCentimeter = 'KilonewtonPerSquareCentimeter'
"""
"""
- KilonewtonPerSquareMillimeter = 'kilonewton_per_square_millimeter'
+ KilonewtonPerSquareMillimeter = 'KilonewtonPerSquareMillimeter'
"""
"""
- KilopoundForcePerSquareInch = 'kilopound_force_per_square_inch'
+ KilopoundForcePerSquareInch = 'KilopoundForcePerSquareInch'
"""
"""
- KilopoundForcePerSquareMil = 'kilopound_force_per_square_mil'
+ KilopoundForcePerSquareMil = 'KilopoundForcePerSquareMil'
"""
"""
- KilopoundForcePerSquareFoot = 'kilopound_force_per_square_foot'
+ KilopoundForcePerSquareFoot = 'KilopoundForcePerSquareFoot'
"""
"""
- MillimeterOfWaterColumn = 'millimeter_of_water_column'
+ MillimeterOfWaterColumn = 'MillimeterOfWaterColumn'
"""
"""
- CentimeterOfWaterColumn = 'centimeter_of_water_column'
+ CentimeterOfWaterColumn = 'CentimeterOfWaterColumn'
"""
"""
+class PressureDto:
+ """
+ A DTO representation of a Pressure
+
+ Attributes:
+ value (float): The value of the Pressure.
+ unit (PressureUnits): The specific unit that the Pressure value is representing.
+ """
+
+ def __init__(self, value: float, unit: PressureUnits):
+ """
+ Create a new DTO representation of a Pressure
+
+ Parameters:
+ value (float): The value of the Pressure.
+ unit (PressureUnits): The specific unit that the Pressure value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Pressure
+ """
+ self.unit: PressureUnits = unit
+ """
+ The specific unit that the Pressure value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Pressure DTO JSON object representing the current unit.
+
+ :return: JSON object represents Pressure DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Pascal"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Pressure DTO from a json representation.
+
+ :param data: The Pressure DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Pascal"}
+ :return: A new instance of PressureDto.
+ :rtype: PressureDto
+ """
+ return PressureDto(value=data["value"], unit=PressureUnits(data["unit"]))
+
+
class Pressure(AbstractMeasure):
"""
Pressure (symbol: P or p) is the ratio of force to the area over which that force is distributed. Pressure is force per unit area applied in a direction perpendicular to the surface of an object. Gauge pressure (also spelled gage pressure)[a] is the pressure relative to the local atmospheric or ambient pressure. Pressure is measured in any unit of force divided by any unit of area. The SI unit of pressure is the newton per square metre, which is called the pascal (Pa) after the seventeenth-century philosopher and scientist Blaise Pascal. A pressure of 1 Pa is small; it approximately equals the pressure exerted by a dollar bill resting flat on a table. Everyday pressures are often stated in kilopascals (1 kPa = 1000 Pa).
@@ -373,6 +423,54 @@ def __init__(self, value: float, from_unit: PressureUnits = PressureUnits.Pascal
def convert(self, unit: PressureUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PressureUnits = PressureUnits.Pascal) -> PressureDto:
+ """
+ Get a new instance of Pressure DTO representing the current unit.
+
+ :param hold_in_unit: The specific Pressure unit to store the Pressure value in the DTO representation.
+ :type hold_in_unit: PressureUnits
+ :return: A new instance of PressureDto.
+ :rtype: PressureDto
+ """
+ return PressureDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PressureUnits = PressureUnits.Pascal):
+ """
+ Get a Pressure DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Pressure unit to store the Pressure value in the DTO representation.
+ :type hold_in_unit: PressureUnits
+ :return: JSON object represents Pressure DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Pascal"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(pressure_dto: PressureDto):
+ """
+ Obtain a new instance of Pressure from a DTO unit object.
+
+ :param pressure_dto: The Pressure DTO representation.
+ :type pressure_dto: PressureDto
+ :return: A new instance of Pressure.
+ :rtype: Pressure
+ """
+ return Pressure(pressure_dto.value, pressure_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Pressure from a DTO unit json representation.
+
+ :param data: The Pressure DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Pascal"}
+ :return: A new instance of Pressure.
+ :rtype: Pressure
+ """
+ return Pressure.from_dto(PressureDto.from_json(data))
+
def __convert_from_base(self, from_unit: PressureUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/pressure_change_rate.py b/unitsnet_py/units/pressure_change_rate.py
index a3a5101..f099687 100644
--- a/unitsnet_py/units/pressure_change_rate.py
+++ b/unitsnet_py/units/pressure_change_rate.py
@@ -10,97 +10,147 @@ class PressureChangeRateUnits(Enum):
PressureChangeRateUnits enumeration
"""
- PascalPerSecond = 'pascal_per_second'
+ PascalPerSecond = 'PascalPerSecond'
"""
"""
- PascalPerMinute = 'pascal_per_minute'
+ PascalPerMinute = 'PascalPerMinute'
"""
"""
- MillimeterOfMercuryPerSecond = 'millimeter_of_mercury_per_second'
+ MillimeterOfMercuryPerSecond = 'MillimeterOfMercuryPerSecond'
"""
"""
- AtmospherePerSecond = 'atmosphere_per_second'
+ AtmospherePerSecond = 'AtmospherePerSecond'
"""
"""
- PoundForcePerSquareInchPerSecond = 'pound_force_per_square_inch_per_second'
+ PoundForcePerSquareInchPerSecond = 'PoundForcePerSquareInchPerSecond'
"""
"""
- PoundForcePerSquareInchPerMinute = 'pound_force_per_square_inch_per_minute'
+ PoundForcePerSquareInchPerMinute = 'PoundForcePerSquareInchPerMinute'
"""
"""
- BarPerSecond = 'bar_per_second'
+ BarPerSecond = 'BarPerSecond'
"""
"""
- BarPerMinute = 'bar_per_minute'
+ BarPerMinute = 'BarPerMinute'
"""
"""
- KilopascalPerSecond = 'kilopascal_per_second'
+ KilopascalPerSecond = 'KilopascalPerSecond'
"""
"""
- MegapascalPerSecond = 'megapascal_per_second'
+ MegapascalPerSecond = 'MegapascalPerSecond'
"""
"""
- KilopascalPerMinute = 'kilopascal_per_minute'
+ KilopascalPerMinute = 'KilopascalPerMinute'
"""
"""
- MegapascalPerMinute = 'megapascal_per_minute'
+ MegapascalPerMinute = 'MegapascalPerMinute'
"""
"""
- KilopoundForcePerSquareInchPerSecond = 'kilopound_force_per_square_inch_per_second'
+ KilopoundForcePerSquareInchPerSecond = 'KilopoundForcePerSquareInchPerSecond'
"""
"""
- MegapoundForcePerSquareInchPerSecond = 'megapound_force_per_square_inch_per_second'
+ MegapoundForcePerSquareInchPerSecond = 'MegapoundForcePerSquareInchPerSecond'
"""
"""
- KilopoundForcePerSquareInchPerMinute = 'kilopound_force_per_square_inch_per_minute'
+ KilopoundForcePerSquareInchPerMinute = 'KilopoundForcePerSquareInchPerMinute'
"""
"""
- MegapoundForcePerSquareInchPerMinute = 'megapound_force_per_square_inch_per_minute'
+ MegapoundForcePerSquareInchPerMinute = 'MegapoundForcePerSquareInchPerMinute'
"""
"""
- MillibarPerSecond = 'millibar_per_second'
+ MillibarPerSecond = 'MillibarPerSecond'
"""
"""
- MillibarPerMinute = 'millibar_per_minute'
+ MillibarPerMinute = 'MillibarPerMinute'
"""
"""
+class PressureChangeRateDto:
+ """
+ A DTO representation of a PressureChangeRate
+
+ Attributes:
+ value (float): The value of the PressureChangeRate.
+ unit (PressureChangeRateUnits): The specific unit that the PressureChangeRate value is representing.
+ """
+
+ def __init__(self, value: float, unit: PressureChangeRateUnits):
+ """
+ Create a new DTO representation of a PressureChangeRate
+
+ Parameters:
+ value (float): The value of the PressureChangeRate.
+ unit (PressureChangeRateUnits): The specific unit that the PressureChangeRate value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the PressureChangeRate
+ """
+ self.unit: PressureChangeRateUnits = unit
+ """
+ The specific unit that the PressureChangeRate value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a PressureChangeRate DTO JSON object representing the current unit.
+
+ :return: JSON object represents PressureChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "PascalPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of PressureChangeRate DTO from a json representation.
+
+ :param data: The PressureChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "PascalPerSecond"}
+ :return: A new instance of PressureChangeRateDto.
+ :rtype: PressureChangeRateDto
+ """
+ return PressureChangeRateDto(value=data["value"], unit=PressureChangeRateUnits(data["unit"]))
+
+
class PressureChangeRate(AbstractMeasure):
"""
Pressure change rate is the ratio of the pressure change to the time during which the change occurred (value of pressure changes per unit time).
@@ -156,6 +206,54 @@ def __init__(self, value: float, from_unit: PressureChangeRateUnits = PressureCh
def convert(self, unit: PressureChangeRateUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: PressureChangeRateUnits = PressureChangeRateUnits.PascalPerSecond) -> PressureChangeRateDto:
+ """
+ Get a new instance of PressureChangeRate DTO representing the current unit.
+
+ :param hold_in_unit: The specific PressureChangeRate unit to store the PressureChangeRate value in the DTO representation.
+ :type hold_in_unit: PressureChangeRateUnits
+ :return: A new instance of PressureChangeRateDto.
+ :rtype: PressureChangeRateDto
+ """
+ return PressureChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: PressureChangeRateUnits = PressureChangeRateUnits.PascalPerSecond):
+ """
+ Get a PressureChangeRate DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific PressureChangeRate unit to store the PressureChangeRate value in the DTO representation.
+ :type hold_in_unit: PressureChangeRateUnits
+ :return: JSON object represents PressureChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "PascalPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(pressure_change_rate_dto: PressureChangeRateDto):
+ """
+ Obtain a new instance of PressureChangeRate from a DTO unit object.
+
+ :param pressure_change_rate_dto: The PressureChangeRate DTO representation.
+ :type pressure_change_rate_dto: PressureChangeRateDto
+ :return: A new instance of PressureChangeRate.
+ :rtype: PressureChangeRate
+ """
+ return PressureChangeRate(pressure_change_rate_dto.value, pressure_change_rate_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of PressureChangeRate from a DTO unit json representation.
+
+ :param data: The PressureChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "PascalPerSecond"}
+ :return: A new instance of PressureChangeRate.
+ :rtype: PressureChangeRate
+ """
+ return PressureChangeRate.from_dto(PressureChangeRateDto.from_json(data))
+
def __convert_from_base(self, from_unit: PressureChangeRateUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/radiation_equivalent_dose.py b/unitsnet_py/units/radiation_equivalent_dose.py
index ab3c207..2eb63aa 100644
--- a/unitsnet_py/units/radiation_equivalent_dose.py
+++ b/unitsnet_py/units/radiation_equivalent_dose.py
@@ -10,37 +10,87 @@ class RadiationEquivalentDoseUnits(Enum):
RadiationEquivalentDoseUnits enumeration
"""
- Sievert = 'sievert'
+ Sievert = 'Sievert'
"""
The sievert is a unit in the International System of Units (SI) intended to represent the stochastic health risk of ionizing radiation, which is defined as the probability of causing radiation-induced cancer and genetic damage.
"""
- RoentgenEquivalentMan = 'roentgen_equivalent_man'
+ RoentgenEquivalentMan = 'RoentgenEquivalentMan'
"""
"""
- Nanosievert = 'nanosievert'
+ Nanosievert = 'Nanosievert'
"""
"""
- Microsievert = 'microsievert'
+ Microsievert = 'Microsievert'
"""
"""
- Millisievert = 'millisievert'
+ Millisievert = 'Millisievert'
"""
"""
- MilliroentgenEquivalentMan = 'milliroentgen_equivalent_man'
+ MilliroentgenEquivalentMan = 'MilliroentgenEquivalentMan'
"""
"""
+class RadiationEquivalentDoseDto:
+ """
+ A DTO representation of a RadiationEquivalentDose
+
+ Attributes:
+ value (float): The value of the RadiationEquivalentDose.
+ unit (RadiationEquivalentDoseUnits): The specific unit that the RadiationEquivalentDose value is representing.
+ """
+
+ def __init__(self, value: float, unit: RadiationEquivalentDoseUnits):
+ """
+ Create a new DTO representation of a RadiationEquivalentDose
+
+ Parameters:
+ value (float): The value of the RadiationEquivalentDose.
+ unit (RadiationEquivalentDoseUnits): The specific unit that the RadiationEquivalentDose value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RadiationEquivalentDose
+ """
+ self.unit: RadiationEquivalentDoseUnits = unit
+ """
+ The specific unit that the RadiationEquivalentDose value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RadiationEquivalentDose DTO JSON object representing the current unit.
+
+ :return: JSON object represents RadiationEquivalentDose DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Sievert"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RadiationEquivalentDose DTO from a json representation.
+
+ :param data: The RadiationEquivalentDose DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Sievert"}
+ :return: A new instance of RadiationEquivalentDoseDto.
+ :rtype: RadiationEquivalentDoseDto
+ """
+ return RadiationEquivalentDoseDto(value=data["value"], unit=RadiationEquivalentDoseUnits(data["unit"]))
+
+
class RadiationEquivalentDose(AbstractMeasure):
"""
Equivalent dose is a dose quantity representing the stochastic health effects of low levels of ionizing radiation on the human body which represents the probability of radiation-induced cancer and genetic damage.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: RadiationEquivalentDoseUnits = Radia
def convert(self, unit: RadiationEquivalentDoseUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RadiationEquivalentDoseUnits = RadiationEquivalentDoseUnits.Sievert) -> RadiationEquivalentDoseDto:
+ """
+ Get a new instance of RadiationEquivalentDose DTO representing the current unit.
+
+ :param hold_in_unit: The specific RadiationEquivalentDose unit to store the RadiationEquivalentDose value in the DTO representation.
+ :type hold_in_unit: RadiationEquivalentDoseUnits
+ :return: A new instance of RadiationEquivalentDoseDto.
+ :rtype: RadiationEquivalentDoseDto
+ """
+ return RadiationEquivalentDoseDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RadiationEquivalentDoseUnits = RadiationEquivalentDoseUnits.Sievert):
+ """
+ Get a RadiationEquivalentDose DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RadiationEquivalentDose unit to store the RadiationEquivalentDose value in the DTO representation.
+ :type hold_in_unit: RadiationEquivalentDoseUnits
+ :return: JSON object represents RadiationEquivalentDose DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Sievert"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(radiation_equivalent_dose_dto: RadiationEquivalentDoseDto):
+ """
+ Obtain a new instance of RadiationEquivalentDose from a DTO unit object.
+
+ :param radiation_equivalent_dose_dto: The RadiationEquivalentDose DTO representation.
+ :type radiation_equivalent_dose_dto: RadiationEquivalentDoseDto
+ :return: A new instance of RadiationEquivalentDose.
+ :rtype: RadiationEquivalentDose
+ """
+ return RadiationEquivalentDose(radiation_equivalent_dose_dto.value, radiation_equivalent_dose_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RadiationEquivalentDose from a DTO unit json representation.
+
+ :param data: The RadiationEquivalentDose DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Sievert"}
+ :return: A new instance of RadiationEquivalentDose.
+ :rtype: RadiationEquivalentDose
+ """
+ return RadiationEquivalentDose.from_dto(RadiationEquivalentDoseDto.from_json(data))
+
def __convert_from_base(self, from_unit: RadiationEquivalentDoseUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/radiation_exposure.py b/unitsnet_py/units/radiation_exposure.py
index dbb3615..c0abd31 100644
--- a/unitsnet_py/units/radiation_exposure.py
+++ b/unitsnet_py/units/radiation_exposure.py
@@ -10,47 +10,97 @@ class RadiationExposureUnits(Enum):
RadiationExposureUnits enumeration
"""
- CoulombPerKilogram = 'coulomb_per_kilogram'
+ CoulombPerKilogram = 'CoulombPerKilogram'
"""
"""
- Roentgen = 'roentgen'
+ Roentgen = 'Roentgen'
"""
"""
- PicocoulombPerKilogram = 'picocoulomb_per_kilogram'
+ PicocoulombPerKilogram = 'PicocoulombPerKilogram'
"""
"""
- NanocoulombPerKilogram = 'nanocoulomb_per_kilogram'
+ NanocoulombPerKilogram = 'NanocoulombPerKilogram'
"""
"""
- MicrocoulombPerKilogram = 'microcoulomb_per_kilogram'
+ MicrocoulombPerKilogram = 'MicrocoulombPerKilogram'
"""
"""
- MillicoulombPerKilogram = 'millicoulomb_per_kilogram'
+ MillicoulombPerKilogram = 'MillicoulombPerKilogram'
"""
"""
- Microroentgen = 'microroentgen'
+ Microroentgen = 'Microroentgen'
"""
"""
- Milliroentgen = 'milliroentgen'
+ Milliroentgen = 'Milliroentgen'
"""
"""
+class RadiationExposureDto:
+ """
+ A DTO representation of a RadiationExposure
+
+ Attributes:
+ value (float): The value of the RadiationExposure.
+ unit (RadiationExposureUnits): The specific unit that the RadiationExposure value is representing.
+ """
+
+ def __init__(self, value: float, unit: RadiationExposureUnits):
+ """
+ Create a new DTO representation of a RadiationExposure
+
+ Parameters:
+ value (float): The value of the RadiationExposure.
+ unit (RadiationExposureUnits): The specific unit that the RadiationExposure value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RadiationExposure
+ """
+ self.unit: RadiationExposureUnits = unit
+ """
+ The specific unit that the RadiationExposure value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RadiationExposure DTO JSON object representing the current unit.
+
+ :return: JSON object represents RadiationExposure DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CoulombPerKilogram"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RadiationExposure DTO from a json representation.
+
+ :param data: The RadiationExposure DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CoulombPerKilogram"}
+ :return: A new instance of RadiationExposureDto.
+ :rtype: RadiationExposureDto
+ """
+ return RadiationExposureDto(value=data["value"], unit=RadiationExposureUnits(data["unit"]))
+
+
class RadiationExposure(AbstractMeasure):
"""
Radiation exposure is a measure of the ionization of air due to ionizing radiation from photons.
@@ -86,6 +136,54 @@ def __init__(self, value: float, from_unit: RadiationExposureUnits = RadiationEx
def convert(self, unit: RadiationExposureUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RadiationExposureUnits = RadiationExposureUnits.CoulombPerKilogram) -> RadiationExposureDto:
+ """
+ Get a new instance of RadiationExposure DTO representing the current unit.
+
+ :param hold_in_unit: The specific RadiationExposure unit to store the RadiationExposure value in the DTO representation.
+ :type hold_in_unit: RadiationExposureUnits
+ :return: A new instance of RadiationExposureDto.
+ :rtype: RadiationExposureDto
+ """
+ return RadiationExposureDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RadiationExposureUnits = RadiationExposureUnits.CoulombPerKilogram):
+ """
+ Get a RadiationExposure DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RadiationExposure unit to store the RadiationExposure value in the DTO representation.
+ :type hold_in_unit: RadiationExposureUnits
+ :return: JSON object represents RadiationExposure DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CoulombPerKilogram"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(radiation_exposure_dto: RadiationExposureDto):
+ """
+ Obtain a new instance of RadiationExposure from a DTO unit object.
+
+ :param radiation_exposure_dto: The RadiationExposure DTO representation.
+ :type radiation_exposure_dto: RadiationExposureDto
+ :return: A new instance of RadiationExposure.
+ :rtype: RadiationExposure
+ """
+ return RadiationExposure(radiation_exposure_dto.value, radiation_exposure_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RadiationExposure from a DTO unit json representation.
+
+ :param data: The RadiationExposure DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CoulombPerKilogram"}
+ :return: A new instance of RadiationExposure.
+ :rtype: RadiationExposure
+ """
+ return RadiationExposure.from_dto(RadiationExposureDto.from_json(data))
+
def __convert_from_base(self, from_unit: RadiationExposureUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/radioactivity.py b/unitsnet_py/units/radioactivity.py
index 24fb03a..ff1a9fb 100644
--- a/unitsnet_py/units/radioactivity.py
+++ b/unitsnet_py/units/radioactivity.py
@@ -10,152 +10,202 @@ class RadioactivityUnits(Enum):
RadioactivityUnits enumeration
"""
- Becquerel = 'becquerel'
+ Becquerel = 'Becquerel'
"""
Activity of a quantity of radioactive material in which one nucleus decays per second.
"""
- Curie = 'curie'
+ Curie = 'Curie'
"""
"""
- Rutherford = 'rutherford'
+ Rutherford = 'Rutherford'
"""
Activity of a quantity of radioactive material in which one million nuclei decay per second.
"""
- Picobecquerel = 'picobecquerel'
+ Picobecquerel = 'Picobecquerel'
"""
"""
- Nanobecquerel = 'nanobecquerel'
+ Nanobecquerel = 'Nanobecquerel'
"""
"""
- Microbecquerel = 'microbecquerel'
+ Microbecquerel = 'Microbecquerel'
"""
"""
- Millibecquerel = 'millibecquerel'
+ Millibecquerel = 'Millibecquerel'
"""
"""
- Kilobecquerel = 'kilobecquerel'
+ Kilobecquerel = 'Kilobecquerel'
"""
"""
- Megabecquerel = 'megabecquerel'
+ Megabecquerel = 'Megabecquerel'
"""
"""
- Gigabecquerel = 'gigabecquerel'
+ Gigabecquerel = 'Gigabecquerel'
"""
"""
- Terabecquerel = 'terabecquerel'
+ Terabecquerel = 'Terabecquerel'
"""
"""
- Petabecquerel = 'petabecquerel'
+ Petabecquerel = 'Petabecquerel'
"""
"""
- Exabecquerel = 'exabecquerel'
+ Exabecquerel = 'Exabecquerel'
"""
"""
- Picocurie = 'picocurie'
+ Picocurie = 'Picocurie'
"""
"""
- Nanocurie = 'nanocurie'
+ Nanocurie = 'Nanocurie'
"""
"""
- Microcurie = 'microcurie'
+ Microcurie = 'Microcurie'
"""
"""
- Millicurie = 'millicurie'
+ Millicurie = 'Millicurie'
"""
"""
- Kilocurie = 'kilocurie'
+ Kilocurie = 'Kilocurie'
"""
"""
- Megacurie = 'megacurie'
+ Megacurie = 'Megacurie'
"""
"""
- Gigacurie = 'gigacurie'
+ Gigacurie = 'Gigacurie'
"""
"""
- Teracurie = 'teracurie'
+ Teracurie = 'Teracurie'
"""
"""
- Picorutherford = 'picorutherford'
+ Picorutherford = 'Picorutherford'
"""
"""
- Nanorutherford = 'nanorutherford'
+ Nanorutherford = 'Nanorutherford'
"""
"""
- Microrutherford = 'microrutherford'
+ Microrutherford = 'Microrutherford'
"""
"""
- Millirutherford = 'millirutherford'
+ Millirutherford = 'Millirutherford'
"""
"""
- Kilorutherford = 'kilorutherford'
+ Kilorutherford = 'Kilorutherford'
"""
"""
- Megarutherford = 'megarutherford'
+ Megarutherford = 'Megarutherford'
"""
"""
- Gigarutherford = 'gigarutherford'
+ Gigarutherford = 'Gigarutherford'
"""
"""
- Terarutherford = 'terarutherford'
+ Terarutherford = 'Terarutherford'
"""
"""
+class RadioactivityDto:
+ """
+ A DTO representation of a Radioactivity
+
+ Attributes:
+ value (float): The value of the Radioactivity.
+ unit (RadioactivityUnits): The specific unit that the Radioactivity value is representing.
+ """
+
+ def __init__(self, value: float, unit: RadioactivityUnits):
+ """
+ Create a new DTO representation of a Radioactivity
+
+ Parameters:
+ value (float): The value of the Radioactivity.
+ unit (RadioactivityUnits): The specific unit that the Radioactivity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Radioactivity
+ """
+ self.unit: RadioactivityUnits = unit
+ """
+ The specific unit that the Radioactivity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Radioactivity DTO JSON object representing the current unit.
+
+ :return: JSON object represents Radioactivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Becquerel"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Radioactivity DTO from a json representation.
+
+ :param data: The Radioactivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Becquerel"}
+ :return: A new instance of RadioactivityDto.
+ :rtype: RadioactivityDto
+ """
+ return RadioactivityDto(value=data["value"], unit=RadioactivityUnits(data["unit"]))
+
+
class Radioactivity(AbstractMeasure):
"""
Amount of ionizing radiation released when an element spontaneously emits energy as a result of the radioactive decay of an unstable atom per unit time.
@@ -233,6 +283,54 @@ def __init__(self, value: float, from_unit: RadioactivityUnits = RadioactivityUn
def convert(self, unit: RadioactivityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RadioactivityUnits = RadioactivityUnits.Becquerel) -> RadioactivityDto:
+ """
+ Get a new instance of Radioactivity DTO representing the current unit.
+
+ :param hold_in_unit: The specific Radioactivity unit to store the Radioactivity value in the DTO representation.
+ :type hold_in_unit: RadioactivityUnits
+ :return: A new instance of RadioactivityDto.
+ :rtype: RadioactivityDto
+ """
+ return RadioactivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RadioactivityUnits = RadioactivityUnits.Becquerel):
+ """
+ Get a Radioactivity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Radioactivity unit to store the Radioactivity value in the DTO representation.
+ :type hold_in_unit: RadioactivityUnits
+ :return: JSON object represents Radioactivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Becquerel"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(radioactivity_dto: RadioactivityDto):
+ """
+ Obtain a new instance of Radioactivity from a DTO unit object.
+
+ :param radioactivity_dto: The Radioactivity DTO representation.
+ :type radioactivity_dto: RadioactivityDto
+ :return: A new instance of Radioactivity.
+ :rtype: Radioactivity
+ """
+ return Radioactivity(radioactivity_dto.value, radioactivity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Radioactivity from a DTO unit json representation.
+
+ :param data: The Radioactivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Becquerel"}
+ :return: A new instance of Radioactivity.
+ :rtype: Radioactivity
+ """
+ return Radioactivity.from_dto(RadioactivityDto.from_json(data))
+
def __convert_from_base(self, from_unit: RadioactivityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/ratio.py b/unitsnet_py/units/ratio.py
index d18a9a8..72beebc 100644
--- a/unitsnet_py/units/ratio.py
+++ b/unitsnet_py/units/ratio.py
@@ -10,37 +10,87 @@ class RatioUnits(Enum):
RatioUnits enumeration
"""
- DecimalFraction = 'decimal_fraction'
+ DecimalFraction = 'DecimalFraction'
"""
"""
- Percent = 'percent'
+ Percent = 'Percent'
"""
"""
- PartPerThousand = 'part_per_thousand'
+ PartPerThousand = 'PartPerThousand'
"""
"""
- PartPerMillion = 'part_per_million'
+ PartPerMillion = 'PartPerMillion'
"""
"""
- PartPerBillion = 'part_per_billion'
+ PartPerBillion = 'PartPerBillion'
"""
"""
- PartPerTrillion = 'part_per_trillion'
+ PartPerTrillion = 'PartPerTrillion'
"""
"""
+class RatioDto:
+ """
+ A DTO representation of a Ratio
+
+ Attributes:
+ value (float): The value of the Ratio.
+ unit (RatioUnits): The specific unit that the Ratio value is representing.
+ """
+
+ def __init__(self, value: float, unit: RatioUnits):
+ """
+ Create a new DTO representation of a Ratio
+
+ Parameters:
+ value (float): The value of the Ratio.
+ unit (RatioUnits): The specific unit that the Ratio value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Ratio
+ """
+ self.unit: RatioUnits = unit
+ """
+ The specific unit that the Ratio value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Ratio DTO JSON object representing the current unit.
+
+ :return: JSON object represents Ratio DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFraction"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Ratio DTO from a json representation.
+
+ :param data: The Ratio DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFraction"}
+ :return: A new instance of RatioDto.
+ :rtype: RatioDto
+ """
+ return RatioDto(value=data["value"], unit=RatioUnits(data["unit"]))
+
+
class Ratio(AbstractMeasure):
"""
In mathematics, a ratio is a relationship between two numbers of the same kind (e.g., objects, persons, students, spoonfuls, units of whatever identical dimension), usually expressed as "a to b" or a:b, sometimes expressed arithmetically as a dimensionless quotient of the two that explicitly indicates how many times the first number contains the second (not necessarily an integer).
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: RatioUnits = RatioUnits.DecimalFract
def convert(self, unit: RatioUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RatioUnits = RatioUnits.DecimalFraction) -> RatioDto:
+ """
+ Get a new instance of Ratio DTO representing the current unit.
+
+ :param hold_in_unit: The specific Ratio unit to store the Ratio value in the DTO representation.
+ :type hold_in_unit: RatioUnits
+ :return: A new instance of RatioDto.
+ :rtype: RatioDto
+ """
+ return RatioDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RatioUnits = RatioUnits.DecimalFraction):
+ """
+ Get a Ratio DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Ratio unit to store the Ratio value in the DTO representation.
+ :type hold_in_unit: RatioUnits
+ :return: JSON object represents Ratio DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFraction"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(ratio_dto: RatioDto):
+ """
+ Obtain a new instance of Ratio from a DTO unit object.
+
+ :param ratio_dto: The Ratio DTO representation.
+ :type ratio_dto: RatioDto
+ :return: A new instance of Ratio.
+ :rtype: Ratio
+ """
+ return Ratio(ratio_dto.value, ratio_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Ratio from a DTO unit json representation.
+
+ :param data: The Ratio DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFraction"}
+ :return: A new instance of Ratio.
+ :rtype: Ratio
+ """
+ return Ratio.from_dto(RatioDto.from_json(data))
+
def __convert_from_base(self, from_unit: RatioUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/ratio_change_rate.py b/unitsnet_py/units/ratio_change_rate.py
index 6f0d97c..0842e10 100644
--- a/unitsnet_py/units/ratio_change_rate.py
+++ b/unitsnet_py/units/ratio_change_rate.py
@@ -10,17 +10,67 @@ class RatioChangeRateUnits(Enum):
RatioChangeRateUnits enumeration
"""
- PercentPerSecond = 'percent_per_second'
+ PercentPerSecond = 'PercentPerSecond'
"""
"""
- DecimalFractionPerSecond = 'decimal_fraction_per_second'
+ DecimalFractionPerSecond = 'DecimalFractionPerSecond'
"""
"""
+class RatioChangeRateDto:
+ """
+ A DTO representation of a RatioChangeRate
+
+ Attributes:
+ value (float): The value of the RatioChangeRate.
+ unit (RatioChangeRateUnits): The specific unit that the RatioChangeRate value is representing.
+ """
+
+ def __init__(self, value: float, unit: RatioChangeRateUnits):
+ """
+ Create a new DTO representation of a RatioChangeRate
+
+ Parameters:
+ value (float): The value of the RatioChangeRate.
+ unit (RatioChangeRateUnits): The specific unit that the RatioChangeRate value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RatioChangeRate
+ """
+ self.unit: RatioChangeRateUnits = unit
+ """
+ The specific unit that the RatioChangeRate value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RatioChangeRate DTO JSON object representing the current unit.
+
+ :return: JSON object represents RatioChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFractionPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RatioChangeRate DTO from a json representation.
+
+ :param data: The RatioChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFractionPerSecond"}
+ :return: A new instance of RatioChangeRateDto.
+ :rtype: RatioChangeRateDto
+ """
+ return RatioChangeRateDto(value=data["value"], unit=RatioChangeRateUnits(data["unit"]))
+
+
class RatioChangeRate(AbstractMeasure):
"""
The change in ratio per unit of time.
@@ -44,6 +94,54 @@ def __init__(self, value: float, from_unit: RatioChangeRateUnits = RatioChangeRa
def convert(self, unit: RatioChangeRateUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RatioChangeRateUnits = RatioChangeRateUnits.DecimalFractionPerSecond) -> RatioChangeRateDto:
+ """
+ Get a new instance of RatioChangeRate DTO representing the current unit.
+
+ :param hold_in_unit: The specific RatioChangeRate unit to store the RatioChangeRate value in the DTO representation.
+ :type hold_in_unit: RatioChangeRateUnits
+ :return: A new instance of RatioChangeRateDto.
+ :rtype: RatioChangeRateDto
+ """
+ return RatioChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RatioChangeRateUnits = RatioChangeRateUnits.DecimalFractionPerSecond):
+ """
+ Get a RatioChangeRate DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RatioChangeRate unit to store the RatioChangeRate value in the DTO representation.
+ :type hold_in_unit: RatioChangeRateUnits
+ :return: JSON object represents RatioChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFractionPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(ratio_change_rate_dto: RatioChangeRateDto):
+ """
+ Obtain a new instance of RatioChangeRate from a DTO unit object.
+
+ :param ratio_change_rate_dto: The RatioChangeRate DTO representation.
+ :type ratio_change_rate_dto: RatioChangeRateDto
+ :return: A new instance of RatioChangeRate.
+ :rtype: RatioChangeRate
+ """
+ return RatioChangeRate(ratio_change_rate_dto.value, ratio_change_rate_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RatioChangeRate from a DTO unit json representation.
+
+ :param data: The RatioChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFractionPerSecond"}
+ :return: A new instance of RatioChangeRate.
+ :rtype: RatioChangeRate
+ """
+ return RatioChangeRate.from_dto(RatioChangeRateDto.from_json(data))
+
def __convert_from_base(self, from_unit: RatioChangeRateUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/reactive_energy.py b/unitsnet_py/units/reactive_energy.py
index b172ba7..a00d7b8 100644
--- a/unitsnet_py/units/reactive_energy.py
+++ b/unitsnet_py/units/reactive_energy.py
@@ -10,22 +10,72 @@ class ReactiveEnergyUnits(Enum):
ReactiveEnergyUnits enumeration
"""
- VoltampereReactiveHour = 'voltampere_reactive_hour'
+ VoltampereReactiveHour = 'VoltampereReactiveHour'
"""
"""
- KilovoltampereReactiveHour = 'kilovoltampere_reactive_hour'
+ KilovoltampereReactiveHour = 'KilovoltampereReactiveHour'
"""
"""
- MegavoltampereReactiveHour = 'megavoltampere_reactive_hour'
+ MegavoltampereReactiveHour = 'MegavoltampereReactiveHour'
"""
"""
+class ReactiveEnergyDto:
+ """
+ A DTO representation of a ReactiveEnergy
+
+ Attributes:
+ value (float): The value of the ReactiveEnergy.
+ unit (ReactiveEnergyUnits): The specific unit that the ReactiveEnergy value is representing.
+ """
+
+ def __init__(self, value: float, unit: ReactiveEnergyUnits):
+ """
+ Create a new DTO representation of a ReactiveEnergy
+
+ Parameters:
+ value (float): The value of the ReactiveEnergy.
+ unit (ReactiveEnergyUnits): The specific unit that the ReactiveEnergy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ReactiveEnergy
+ """
+ self.unit: ReactiveEnergyUnits = unit
+ """
+ The specific unit that the ReactiveEnergy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ReactiveEnergy DTO JSON object representing the current unit.
+
+ :return: JSON object represents ReactiveEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltampereReactiveHour"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ReactiveEnergy DTO from a json representation.
+
+ :param data: The ReactiveEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltampereReactiveHour"}
+ :return: A new instance of ReactiveEnergyDto.
+ :rtype: ReactiveEnergyDto
+ """
+ return ReactiveEnergyDto(value=data["value"], unit=ReactiveEnergyUnits(data["unit"]))
+
+
class ReactiveEnergy(AbstractMeasure):
"""
The Volt-ampere reactive hour (expressed as varh) is the reactive power of one Volt-ampere reactive produced in one hour.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: ReactiveEnergyUnits = ReactiveEnergy
def convert(self, unit: ReactiveEnergyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ReactiveEnergyUnits = ReactiveEnergyUnits.VoltampereReactiveHour) -> ReactiveEnergyDto:
+ """
+ Get a new instance of ReactiveEnergy DTO representing the current unit.
+
+ :param hold_in_unit: The specific ReactiveEnergy unit to store the ReactiveEnergy value in the DTO representation.
+ :type hold_in_unit: ReactiveEnergyUnits
+ :return: A new instance of ReactiveEnergyDto.
+ :rtype: ReactiveEnergyDto
+ """
+ return ReactiveEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ReactiveEnergyUnits = ReactiveEnergyUnits.VoltampereReactiveHour):
+ """
+ Get a ReactiveEnergy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ReactiveEnergy unit to store the ReactiveEnergy value in the DTO representation.
+ :type hold_in_unit: ReactiveEnergyUnits
+ :return: JSON object represents ReactiveEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltampereReactiveHour"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(reactive_energy_dto: ReactiveEnergyDto):
+ """
+ Obtain a new instance of ReactiveEnergy from a DTO unit object.
+
+ :param reactive_energy_dto: The ReactiveEnergy DTO representation.
+ :type reactive_energy_dto: ReactiveEnergyDto
+ :return: A new instance of ReactiveEnergy.
+ :rtype: ReactiveEnergy
+ """
+ return ReactiveEnergy(reactive_energy_dto.value, reactive_energy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ReactiveEnergy from a DTO unit json representation.
+
+ :param data: The ReactiveEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltampereReactiveHour"}
+ :return: A new instance of ReactiveEnergy.
+ :rtype: ReactiveEnergy
+ """
+ return ReactiveEnergy.from_dto(ReactiveEnergyDto.from_json(data))
+
def __convert_from_base(self, from_unit: ReactiveEnergyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/reactive_power.py b/unitsnet_py/units/reactive_power.py
index 75d0488..73539f5 100644
--- a/unitsnet_py/units/reactive_power.py
+++ b/unitsnet_py/units/reactive_power.py
@@ -10,27 +10,77 @@ class ReactivePowerUnits(Enum):
ReactivePowerUnits enumeration
"""
- VoltampereReactive = 'voltampere_reactive'
+ VoltampereReactive = 'VoltampereReactive'
"""
"""
- KilovoltampereReactive = 'kilovoltampere_reactive'
+ KilovoltampereReactive = 'KilovoltampereReactive'
"""
"""
- MegavoltampereReactive = 'megavoltampere_reactive'
+ MegavoltampereReactive = 'MegavoltampereReactive'
"""
"""
- GigavoltampereReactive = 'gigavoltampere_reactive'
+ GigavoltampereReactive = 'GigavoltampereReactive'
"""
"""
+class ReactivePowerDto:
+ """
+ A DTO representation of a ReactivePower
+
+ Attributes:
+ value (float): The value of the ReactivePower.
+ unit (ReactivePowerUnits): The specific unit that the ReactivePower value is representing.
+ """
+
+ def __init__(self, value: float, unit: ReactivePowerUnits):
+ """
+ Create a new DTO representation of a ReactivePower
+
+ Parameters:
+ value (float): The value of the ReactivePower.
+ unit (ReactivePowerUnits): The specific unit that the ReactivePower value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ReactivePower
+ """
+ self.unit: ReactivePowerUnits = unit
+ """
+ The specific unit that the ReactivePower value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ReactivePower DTO JSON object representing the current unit.
+
+ :return: JSON object represents ReactivePower DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltampereReactive"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ReactivePower DTO from a json representation.
+
+ :param data: The ReactivePower DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltampereReactive"}
+ :return: A new instance of ReactivePowerDto.
+ :rtype: ReactivePowerDto
+ """
+ return ReactivePowerDto(value=data["value"], unit=ReactivePowerUnits(data["unit"]))
+
+
class ReactivePower(AbstractMeasure):
"""
Volt-ampere reactive (var) is a unit by which reactive power is expressed in an AC electric power system. Reactive power exists in an AC circuit when the current and voltage are not in phase.
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: ReactivePowerUnits = ReactivePowerUn
def convert(self, unit: ReactivePowerUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ReactivePowerUnits = ReactivePowerUnits.VoltampereReactive) -> ReactivePowerDto:
+ """
+ Get a new instance of ReactivePower DTO representing the current unit.
+
+ :param hold_in_unit: The specific ReactivePower unit to store the ReactivePower value in the DTO representation.
+ :type hold_in_unit: ReactivePowerUnits
+ :return: A new instance of ReactivePowerDto.
+ :rtype: ReactivePowerDto
+ """
+ return ReactivePowerDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ReactivePowerUnits = ReactivePowerUnits.VoltampereReactive):
+ """
+ Get a ReactivePower DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ReactivePower unit to store the ReactivePower value in the DTO representation.
+ :type hold_in_unit: ReactivePowerUnits
+ :return: JSON object represents ReactivePower DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "VoltampereReactive"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(reactive_power_dto: ReactivePowerDto):
+ """
+ Obtain a new instance of ReactivePower from a DTO unit object.
+
+ :param reactive_power_dto: The ReactivePower DTO representation.
+ :type reactive_power_dto: ReactivePowerDto
+ :return: A new instance of ReactivePower.
+ :rtype: ReactivePower
+ """
+ return ReactivePower(reactive_power_dto.value, reactive_power_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ReactivePower from a DTO unit json representation.
+
+ :param data: The ReactivePower DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "VoltampereReactive"}
+ :return: A new instance of ReactivePower.
+ :rtype: ReactivePower
+ """
+ return ReactivePower.from_dto(ReactivePowerDto.from_json(data))
+
def __convert_from_base(self, from_unit: ReactivePowerUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/reciprocal_area.py b/unitsnet_py/units/reciprocal_area.py
index 79a664a..cf5e543 100644
--- a/unitsnet_py/units/reciprocal_area.py
+++ b/unitsnet_py/units/reciprocal_area.py
@@ -10,62 +10,112 @@ class ReciprocalAreaUnits(Enum):
ReciprocalAreaUnits enumeration
"""
- InverseSquareMeter = 'inverse_square_meter'
+ InverseSquareMeter = 'InverseSquareMeter'
"""
"""
- InverseSquareKilometer = 'inverse_square_kilometer'
+ InverseSquareKilometer = 'InverseSquareKilometer'
"""
"""
- InverseSquareDecimeter = 'inverse_square_decimeter'
+ InverseSquareDecimeter = 'InverseSquareDecimeter'
"""
"""
- InverseSquareCentimeter = 'inverse_square_centimeter'
+ InverseSquareCentimeter = 'InverseSquareCentimeter'
"""
"""
- InverseSquareMillimeter = 'inverse_square_millimeter'
+ InverseSquareMillimeter = 'InverseSquareMillimeter'
"""
"""
- InverseSquareMicrometer = 'inverse_square_micrometer'
+ InverseSquareMicrometer = 'InverseSquareMicrometer'
"""
"""
- InverseSquareMile = 'inverse_square_mile'
+ InverseSquareMile = 'InverseSquareMile'
"""
"""
- InverseSquareYard = 'inverse_square_yard'
+ InverseSquareYard = 'InverseSquareYard'
"""
"""
- InverseSquareFoot = 'inverse_square_foot'
+ InverseSquareFoot = 'InverseSquareFoot'
"""
"""
- InverseUsSurveySquareFoot = 'inverse_us_survey_square_foot'
+ InverseUsSurveySquareFoot = 'InverseUsSurveySquareFoot'
"""
"""
- InverseSquareInch = 'inverse_square_inch'
+ InverseSquareInch = 'InverseSquareInch'
"""
"""
+class ReciprocalAreaDto:
+ """
+ A DTO representation of a ReciprocalArea
+
+ Attributes:
+ value (float): The value of the ReciprocalArea.
+ unit (ReciprocalAreaUnits): The specific unit that the ReciprocalArea value is representing.
+ """
+
+ def __init__(self, value: float, unit: ReciprocalAreaUnits):
+ """
+ Create a new DTO representation of a ReciprocalArea
+
+ Parameters:
+ value (float): The value of the ReciprocalArea.
+ unit (ReciprocalAreaUnits): The specific unit that the ReciprocalArea value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ReciprocalArea
+ """
+ self.unit: ReciprocalAreaUnits = unit
+ """
+ The specific unit that the ReciprocalArea value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ReciprocalArea DTO JSON object representing the current unit.
+
+ :return: JSON object represents ReciprocalArea DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InverseSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ReciprocalArea DTO from a json representation.
+
+ :param data: The ReciprocalArea DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InverseSquareMeter"}
+ :return: A new instance of ReciprocalAreaDto.
+ :rtype: ReciprocalAreaDto
+ """
+ return ReciprocalAreaDto(value=data["value"], unit=ReciprocalAreaUnits(data["unit"]))
+
+
class ReciprocalArea(AbstractMeasure):
"""
Reciprocal area (Inverse-square) quantity is used to specify a physical quantity inversely proportional to the square of the distance.
@@ -107,6 +157,54 @@ def __init__(self, value: float, from_unit: ReciprocalAreaUnits = ReciprocalArea
def convert(self, unit: ReciprocalAreaUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ReciprocalAreaUnits = ReciprocalAreaUnits.InverseSquareMeter) -> ReciprocalAreaDto:
+ """
+ Get a new instance of ReciprocalArea DTO representing the current unit.
+
+ :param hold_in_unit: The specific ReciprocalArea unit to store the ReciprocalArea value in the DTO representation.
+ :type hold_in_unit: ReciprocalAreaUnits
+ :return: A new instance of ReciprocalAreaDto.
+ :rtype: ReciprocalAreaDto
+ """
+ return ReciprocalAreaDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ReciprocalAreaUnits = ReciprocalAreaUnits.InverseSquareMeter):
+ """
+ Get a ReciprocalArea DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ReciprocalArea unit to store the ReciprocalArea value in the DTO representation.
+ :type hold_in_unit: ReciprocalAreaUnits
+ :return: JSON object represents ReciprocalArea DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InverseSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(reciprocal_area_dto: ReciprocalAreaDto):
+ """
+ Obtain a new instance of ReciprocalArea from a DTO unit object.
+
+ :param reciprocal_area_dto: The ReciprocalArea DTO representation.
+ :type reciprocal_area_dto: ReciprocalAreaDto
+ :return: A new instance of ReciprocalArea.
+ :rtype: ReciprocalArea
+ """
+ return ReciprocalArea(reciprocal_area_dto.value, reciprocal_area_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ReciprocalArea from a DTO unit json representation.
+
+ :param data: The ReciprocalArea DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InverseSquareMeter"}
+ :return: A new instance of ReciprocalArea.
+ :rtype: ReciprocalArea
+ """
+ return ReciprocalArea.from_dto(ReciprocalAreaDto.from_json(data))
+
def __convert_from_base(self, from_unit: ReciprocalAreaUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/reciprocal_length.py b/unitsnet_py/units/reciprocal_length.py
index c39a7fc..74142bb 100644
--- a/unitsnet_py/units/reciprocal_length.py
+++ b/unitsnet_py/units/reciprocal_length.py
@@ -10,57 +10,107 @@ class ReciprocalLengthUnits(Enum):
ReciprocalLengthUnits enumeration
"""
- InverseMeter = 'inverse_meter'
+ InverseMeter = 'InverseMeter'
"""
"""
- InverseCentimeter = 'inverse_centimeter'
+ InverseCentimeter = 'InverseCentimeter'
"""
"""
- InverseMillimeter = 'inverse_millimeter'
+ InverseMillimeter = 'InverseMillimeter'
"""
"""
- InverseMile = 'inverse_mile'
+ InverseMile = 'InverseMile'
"""
"""
- InverseYard = 'inverse_yard'
+ InverseYard = 'InverseYard'
"""
"""
- InverseFoot = 'inverse_foot'
+ InverseFoot = 'InverseFoot'
"""
"""
- InverseUsSurveyFoot = 'inverse_us_survey_foot'
+ InverseUsSurveyFoot = 'InverseUsSurveyFoot'
"""
"""
- InverseInch = 'inverse_inch'
+ InverseInch = 'InverseInch'
"""
"""
- InverseMil = 'inverse_mil'
+ InverseMil = 'InverseMil'
"""
"""
- InverseMicroinch = 'inverse_microinch'
+ InverseMicroinch = 'InverseMicroinch'
"""
"""
+class ReciprocalLengthDto:
+ """
+ A DTO representation of a ReciprocalLength
+
+ Attributes:
+ value (float): The value of the ReciprocalLength.
+ unit (ReciprocalLengthUnits): The specific unit that the ReciprocalLength value is representing.
+ """
+
+ def __init__(self, value: float, unit: ReciprocalLengthUnits):
+ """
+ Create a new DTO representation of a ReciprocalLength
+
+ Parameters:
+ value (float): The value of the ReciprocalLength.
+ unit (ReciprocalLengthUnits): The specific unit that the ReciprocalLength value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ReciprocalLength
+ """
+ self.unit: ReciprocalLengthUnits = unit
+ """
+ The specific unit that the ReciprocalLength value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ReciprocalLength DTO JSON object representing the current unit.
+
+ :return: JSON object represents ReciprocalLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InverseMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ReciprocalLength DTO from a json representation.
+
+ :param data: The ReciprocalLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InverseMeter"}
+ :return: A new instance of ReciprocalLengthDto.
+ :rtype: ReciprocalLengthDto
+ """
+ return ReciprocalLengthDto(value=data["value"], unit=ReciprocalLengthUnits(data["unit"]))
+
+
class ReciprocalLength(AbstractMeasure):
"""
Reciprocal (Inverse) Length is used in various fields of science and mathematics. It is defined as the inverse value of a length unit.
@@ -100,6 +150,54 @@ def __init__(self, value: float, from_unit: ReciprocalLengthUnits = ReciprocalLe
def convert(self, unit: ReciprocalLengthUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ReciprocalLengthUnits = ReciprocalLengthUnits.InverseMeter) -> ReciprocalLengthDto:
+ """
+ Get a new instance of ReciprocalLength DTO representing the current unit.
+
+ :param hold_in_unit: The specific ReciprocalLength unit to store the ReciprocalLength value in the DTO representation.
+ :type hold_in_unit: ReciprocalLengthUnits
+ :return: A new instance of ReciprocalLengthDto.
+ :rtype: ReciprocalLengthDto
+ """
+ return ReciprocalLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ReciprocalLengthUnits = ReciprocalLengthUnits.InverseMeter):
+ """
+ Get a ReciprocalLength DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ReciprocalLength unit to store the ReciprocalLength value in the DTO representation.
+ :type hold_in_unit: ReciprocalLengthUnits
+ :return: JSON object represents ReciprocalLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InverseMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(reciprocal_length_dto: ReciprocalLengthDto):
+ """
+ Obtain a new instance of ReciprocalLength from a DTO unit object.
+
+ :param reciprocal_length_dto: The ReciprocalLength DTO representation.
+ :type reciprocal_length_dto: ReciprocalLengthDto
+ :return: A new instance of ReciprocalLength.
+ :rtype: ReciprocalLength
+ """
+ return ReciprocalLength(reciprocal_length_dto.value, reciprocal_length_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ReciprocalLength from a DTO unit json representation.
+
+ :param data: The ReciprocalLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InverseMeter"}
+ :return: A new instance of ReciprocalLength.
+ :rtype: ReciprocalLength
+ """
+ return ReciprocalLength.from_dto(ReciprocalLengthDto.from_json(data))
+
def __convert_from_base(self, from_unit: ReciprocalLengthUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/relative_humidity.py b/unitsnet_py/units/relative_humidity.py
index e4cd83a..41cdc2f 100644
--- a/unitsnet_py/units/relative_humidity.py
+++ b/unitsnet_py/units/relative_humidity.py
@@ -10,12 +10,62 @@ class RelativeHumidityUnits(Enum):
RelativeHumidityUnits enumeration
"""
- Percent = 'percent'
+ Percent = 'Percent'
"""
"""
+class RelativeHumidityDto:
+ """
+ A DTO representation of a RelativeHumidity
+
+ Attributes:
+ value (float): The value of the RelativeHumidity.
+ unit (RelativeHumidityUnits): The specific unit that the RelativeHumidity value is representing.
+ """
+
+ def __init__(self, value: float, unit: RelativeHumidityUnits):
+ """
+ Create a new DTO representation of a RelativeHumidity
+
+ Parameters:
+ value (float): The value of the RelativeHumidity.
+ unit (RelativeHumidityUnits): The specific unit that the RelativeHumidity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RelativeHumidity
+ """
+ self.unit: RelativeHumidityUnits = unit
+ """
+ The specific unit that the RelativeHumidity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RelativeHumidity DTO JSON object representing the current unit.
+
+ :return: JSON object represents RelativeHumidity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Percent"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RelativeHumidity DTO from a json representation.
+
+ :param data: The RelativeHumidity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Percent"}
+ :return: A new instance of RelativeHumidityDto.
+ :rtype: RelativeHumidityDto
+ """
+ return RelativeHumidityDto(value=data["value"], unit=RelativeHumidityUnits(data["unit"]))
+
+
class RelativeHumidity(AbstractMeasure):
"""
Relative humidity is a ratio of the actual water vapor present in the air to the maximum water vapor in the air at the given temperature.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: RelativeHumidityUnits = RelativeHumi
def convert(self, unit: RelativeHumidityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RelativeHumidityUnits = RelativeHumidityUnits.Percent) -> RelativeHumidityDto:
+ """
+ Get a new instance of RelativeHumidity DTO representing the current unit.
+
+ :param hold_in_unit: The specific RelativeHumidity unit to store the RelativeHumidity value in the DTO representation.
+ :type hold_in_unit: RelativeHumidityUnits
+ :return: A new instance of RelativeHumidityDto.
+ :rtype: RelativeHumidityDto
+ """
+ return RelativeHumidityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RelativeHumidityUnits = RelativeHumidityUnits.Percent):
+ """
+ Get a RelativeHumidity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RelativeHumidity unit to store the RelativeHumidity value in the DTO representation.
+ :type hold_in_unit: RelativeHumidityUnits
+ :return: JSON object represents RelativeHumidity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Percent"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(relative_humidity_dto: RelativeHumidityDto):
+ """
+ Obtain a new instance of RelativeHumidity from a DTO unit object.
+
+ :param relative_humidity_dto: The RelativeHumidity DTO representation.
+ :type relative_humidity_dto: RelativeHumidityDto
+ :return: A new instance of RelativeHumidity.
+ :rtype: RelativeHumidity
+ """
+ return RelativeHumidity(relative_humidity_dto.value, relative_humidity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RelativeHumidity from a DTO unit json representation.
+
+ :param data: The RelativeHumidity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Percent"}
+ :return: A new instance of RelativeHumidity.
+ :rtype: RelativeHumidity
+ """
+ return RelativeHumidity.from_dto(RelativeHumidityDto.from_json(data))
+
def __convert_from_base(self, from_unit: RelativeHumidityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/rotational_acceleration.py b/unitsnet_py/units/rotational_acceleration.py
index 4d6af72..e72d854 100644
--- a/unitsnet_py/units/rotational_acceleration.py
+++ b/unitsnet_py/units/rotational_acceleration.py
@@ -10,27 +10,77 @@ class RotationalAccelerationUnits(Enum):
RotationalAccelerationUnits enumeration
"""
- RadianPerSecondSquared = 'radian_per_second_squared'
+ RadianPerSecondSquared = 'RadianPerSecondSquared'
"""
"""
- DegreePerSecondSquared = 'degree_per_second_squared'
+ DegreePerSecondSquared = 'DegreePerSecondSquared'
"""
"""
- RevolutionPerMinutePerSecond = 'revolution_per_minute_per_second'
+ RevolutionPerMinutePerSecond = 'RevolutionPerMinutePerSecond'
"""
"""
- RevolutionPerSecondSquared = 'revolution_per_second_squared'
+ RevolutionPerSecondSquared = 'RevolutionPerSecondSquared'
"""
"""
+class RotationalAccelerationDto:
+ """
+ A DTO representation of a RotationalAcceleration
+
+ Attributes:
+ value (float): The value of the RotationalAcceleration.
+ unit (RotationalAccelerationUnits): The specific unit that the RotationalAcceleration value is representing.
+ """
+
+ def __init__(self, value: float, unit: RotationalAccelerationUnits):
+ """
+ Create a new DTO representation of a RotationalAcceleration
+
+ Parameters:
+ value (float): The value of the RotationalAcceleration.
+ unit (RotationalAccelerationUnits): The specific unit that the RotationalAcceleration value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RotationalAcceleration
+ """
+ self.unit: RotationalAccelerationUnits = unit
+ """
+ The specific unit that the RotationalAcceleration value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RotationalAcceleration DTO JSON object representing the current unit.
+
+ :return: JSON object represents RotationalAcceleration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "RadianPerSecondSquared"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RotationalAcceleration DTO from a json representation.
+
+ :param data: The RotationalAcceleration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "RadianPerSecondSquared"}
+ :return: A new instance of RotationalAccelerationDto.
+ :rtype: RotationalAccelerationDto
+ """
+ return RotationalAccelerationDto(value=data["value"], unit=RotationalAccelerationUnits(data["unit"]))
+
+
class RotationalAcceleration(AbstractMeasure):
"""
Angular acceleration is the rate of change of rotational speed.
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: RotationalAccelerationUnits = Rotati
def convert(self, unit: RotationalAccelerationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RotationalAccelerationUnits = RotationalAccelerationUnits.RadianPerSecondSquared) -> RotationalAccelerationDto:
+ """
+ Get a new instance of RotationalAcceleration DTO representing the current unit.
+
+ :param hold_in_unit: The specific RotationalAcceleration unit to store the RotationalAcceleration value in the DTO representation.
+ :type hold_in_unit: RotationalAccelerationUnits
+ :return: A new instance of RotationalAccelerationDto.
+ :rtype: RotationalAccelerationDto
+ """
+ return RotationalAccelerationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RotationalAccelerationUnits = RotationalAccelerationUnits.RadianPerSecondSquared):
+ """
+ Get a RotationalAcceleration DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RotationalAcceleration unit to store the RotationalAcceleration value in the DTO representation.
+ :type hold_in_unit: RotationalAccelerationUnits
+ :return: JSON object represents RotationalAcceleration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "RadianPerSecondSquared"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(rotational_acceleration_dto: RotationalAccelerationDto):
+ """
+ Obtain a new instance of RotationalAcceleration from a DTO unit object.
+
+ :param rotational_acceleration_dto: The RotationalAcceleration DTO representation.
+ :type rotational_acceleration_dto: RotationalAccelerationDto
+ :return: A new instance of RotationalAcceleration.
+ :rtype: RotationalAcceleration
+ """
+ return RotationalAcceleration(rotational_acceleration_dto.value, rotational_acceleration_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RotationalAcceleration from a DTO unit json representation.
+
+ :param data: The RotationalAcceleration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "RadianPerSecondSquared"}
+ :return: A new instance of RotationalAcceleration.
+ :rtype: RotationalAcceleration
+ """
+ return RotationalAcceleration.from_dto(RotationalAccelerationDto.from_json(data))
+
def __convert_from_base(self, from_unit: RotationalAccelerationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/rotational_speed.py b/unitsnet_py/units/rotational_speed.py
index b593344..6658a70 100644
--- a/unitsnet_py/units/rotational_speed.py
+++ b/unitsnet_py/units/rotational_speed.py
@@ -10,72 +10,122 @@ class RotationalSpeedUnits(Enum):
RotationalSpeedUnits enumeration
"""
- RadianPerSecond = 'radian_per_second'
+ RadianPerSecond = 'RadianPerSecond'
"""
"""
- DegreePerSecond = 'degree_per_second'
+ DegreePerSecond = 'DegreePerSecond'
"""
"""
- DegreePerMinute = 'degree_per_minute'
+ DegreePerMinute = 'DegreePerMinute'
"""
"""
- RevolutionPerSecond = 'revolution_per_second'
+ RevolutionPerSecond = 'RevolutionPerSecond'
"""
"""
- RevolutionPerMinute = 'revolution_per_minute'
+ RevolutionPerMinute = 'RevolutionPerMinute'
"""
"""
- NanoradianPerSecond = 'nanoradian_per_second'
+ NanoradianPerSecond = 'NanoradianPerSecond'
"""
"""
- MicroradianPerSecond = 'microradian_per_second'
+ MicroradianPerSecond = 'MicroradianPerSecond'
"""
"""
- MilliradianPerSecond = 'milliradian_per_second'
+ MilliradianPerSecond = 'MilliradianPerSecond'
"""
"""
- CentiradianPerSecond = 'centiradian_per_second'
+ CentiradianPerSecond = 'CentiradianPerSecond'
"""
"""
- DeciradianPerSecond = 'deciradian_per_second'
+ DeciradianPerSecond = 'DeciradianPerSecond'
"""
"""
- NanodegreePerSecond = 'nanodegree_per_second'
+ NanodegreePerSecond = 'NanodegreePerSecond'
"""
"""
- MicrodegreePerSecond = 'microdegree_per_second'
+ MicrodegreePerSecond = 'MicrodegreePerSecond'
"""
"""
- MillidegreePerSecond = 'millidegree_per_second'
+ MillidegreePerSecond = 'MillidegreePerSecond'
"""
"""
+class RotationalSpeedDto:
+ """
+ A DTO representation of a RotationalSpeed
+
+ Attributes:
+ value (float): The value of the RotationalSpeed.
+ unit (RotationalSpeedUnits): The specific unit that the RotationalSpeed value is representing.
+ """
+
+ def __init__(self, value: float, unit: RotationalSpeedUnits):
+ """
+ Create a new DTO representation of a RotationalSpeed
+
+ Parameters:
+ value (float): The value of the RotationalSpeed.
+ unit (RotationalSpeedUnits): The specific unit that the RotationalSpeed value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RotationalSpeed
+ """
+ self.unit: RotationalSpeedUnits = unit
+ """
+ The specific unit that the RotationalSpeed value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RotationalSpeed DTO JSON object representing the current unit.
+
+ :return: JSON object represents RotationalSpeed DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "RadianPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RotationalSpeed DTO from a json representation.
+
+ :param data: The RotationalSpeed DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "RadianPerSecond"}
+ :return: A new instance of RotationalSpeedDto.
+ :rtype: RotationalSpeedDto
+ """
+ return RotationalSpeedDto(value=data["value"], unit=RotationalSpeedUnits(data["unit"]))
+
+
class RotationalSpeed(AbstractMeasure):
"""
Rotational speed (sometimes called speed of revolution) is the number of complete rotations, revolutions, cycles, or turns per time unit. Rotational speed is a cyclic frequency, measured in radians per second or in hertz in the SI System by scientists, or in revolutions per minute (rpm or min-1) or revolutions per second in everyday life. The symbol for rotational speed is ω (the Greek lowercase letter "omega").
@@ -121,6 +171,54 @@ def __init__(self, value: float, from_unit: RotationalSpeedUnits = RotationalSpe
def convert(self, unit: RotationalSpeedUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RotationalSpeedUnits = RotationalSpeedUnits.RadianPerSecond) -> RotationalSpeedDto:
+ """
+ Get a new instance of RotationalSpeed DTO representing the current unit.
+
+ :param hold_in_unit: The specific RotationalSpeed unit to store the RotationalSpeed value in the DTO representation.
+ :type hold_in_unit: RotationalSpeedUnits
+ :return: A new instance of RotationalSpeedDto.
+ :rtype: RotationalSpeedDto
+ """
+ return RotationalSpeedDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RotationalSpeedUnits = RotationalSpeedUnits.RadianPerSecond):
+ """
+ Get a RotationalSpeed DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RotationalSpeed unit to store the RotationalSpeed value in the DTO representation.
+ :type hold_in_unit: RotationalSpeedUnits
+ :return: JSON object represents RotationalSpeed DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "RadianPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(rotational_speed_dto: RotationalSpeedDto):
+ """
+ Obtain a new instance of RotationalSpeed from a DTO unit object.
+
+ :param rotational_speed_dto: The RotationalSpeed DTO representation.
+ :type rotational_speed_dto: RotationalSpeedDto
+ :return: A new instance of RotationalSpeed.
+ :rtype: RotationalSpeed
+ """
+ return RotationalSpeed(rotational_speed_dto.value, rotational_speed_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RotationalSpeed from a DTO unit json representation.
+
+ :param data: The RotationalSpeed DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "RadianPerSecond"}
+ :return: A new instance of RotationalSpeed.
+ :rtype: RotationalSpeed
+ """
+ return RotationalSpeed.from_dto(RotationalSpeedDto.from_json(data))
+
def __convert_from_base(self, from_unit: RotationalSpeedUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/rotational_stiffness.py b/unitsnet_py/units/rotational_stiffness.py
index 4256fcd..b7e6a8e 100644
--- a/unitsnet_py/units/rotational_stiffness.py
+++ b/unitsnet_py/units/rotational_stiffness.py
@@ -10,172 +10,222 @@ class RotationalStiffnessUnits(Enum):
RotationalStiffnessUnits enumeration
"""
- NewtonMeterPerRadian = 'newton_meter_per_radian'
+ NewtonMeterPerRadian = 'NewtonMeterPerRadian'
"""
"""
- PoundForceFootPerDegrees = 'pound_force_foot_per_degrees'
+ PoundForceFootPerDegrees = 'PoundForceFootPerDegrees'
"""
"""
- KilopoundForceFootPerDegrees = 'kilopound_force_foot_per_degrees'
+ KilopoundForceFootPerDegrees = 'KilopoundForceFootPerDegrees'
"""
"""
- NewtonMillimeterPerDegree = 'newton_millimeter_per_degree'
+ NewtonMillimeterPerDegree = 'NewtonMillimeterPerDegree'
"""
"""
- NewtonMeterPerDegree = 'newton_meter_per_degree'
+ NewtonMeterPerDegree = 'NewtonMeterPerDegree'
"""
"""
- NewtonMillimeterPerRadian = 'newton_millimeter_per_radian'
+ NewtonMillimeterPerRadian = 'NewtonMillimeterPerRadian'
"""
"""
- PoundForceFeetPerRadian = 'pound_force_feet_per_radian'
+ PoundForceFeetPerRadian = 'PoundForceFeetPerRadian'
"""
"""
- KilonewtonMeterPerRadian = 'kilonewton_meter_per_radian'
+ KilonewtonMeterPerRadian = 'KilonewtonMeterPerRadian'
"""
"""
- MeganewtonMeterPerRadian = 'meganewton_meter_per_radian'
+ MeganewtonMeterPerRadian = 'MeganewtonMeterPerRadian'
"""
"""
- NanonewtonMillimeterPerDegree = 'nanonewton_millimeter_per_degree'
+ NanonewtonMillimeterPerDegree = 'NanonewtonMillimeterPerDegree'
"""
"""
- MicronewtonMillimeterPerDegree = 'micronewton_millimeter_per_degree'
+ MicronewtonMillimeterPerDegree = 'MicronewtonMillimeterPerDegree'
"""
"""
- MillinewtonMillimeterPerDegree = 'millinewton_millimeter_per_degree'
+ MillinewtonMillimeterPerDegree = 'MillinewtonMillimeterPerDegree'
"""
"""
- CentinewtonMillimeterPerDegree = 'centinewton_millimeter_per_degree'
+ CentinewtonMillimeterPerDegree = 'CentinewtonMillimeterPerDegree'
"""
"""
- DecinewtonMillimeterPerDegree = 'decinewton_millimeter_per_degree'
+ DecinewtonMillimeterPerDegree = 'DecinewtonMillimeterPerDegree'
"""
"""
- DecanewtonMillimeterPerDegree = 'decanewton_millimeter_per_degree'
+ DecanewtonMillimeterPerDegree = 'DecanewtonMillimeterPerDegree'
"""
"""
- KilonewtonMillimeterPerDegree = 'kilonewton_millimeter_per_degree'
+ KilonewtonMillimeterPerDegree = 'KilonewtonMillimeterPerDegree'
"""
"""
- MeganewtonMillimeterPerDegree = 'meganewton_millimeter_per_degree'
+ MeganewtonMillimeterPerDegree = 'MeganewtonMillimeterPerDegree'
"""
"""
- NanonewtonMeterPerDegree = 'nanonewton_meter_per_degree'
+ NanonewtonMeterPerDegree = 'NanonewtonMeterPerDegree'
"""
"""
- MicronewtonMeterPerDegree = 'micronewton_meter_per_degree'
+ MicronewtonMeterPerDegree = 'MicronewtonMeterPerDegree'
"""
"""
- MillinewtonMeterPerDegree = 'millinewton_meter_per_degree'
+ MillinewtonMeterPerDegree = 'MillinewtonMeterPerDegree'
"""
"""
- CentinewtonMeterPerDegree = 'centinewton_meter_per_degree'
+ CentinewtonMeterPerDegree = 'CentinewtonMeterPerDegree'
"""
"""
- DecinewtonMeterPerDegree = 'decinewton_meter_per_degree'
+ DecinewtonMeterPerDegree = 'DecinewtonMeterPerDegree'
"""
"""
- DecanewtonMeterPerDegree = 'decanewton_meter_per_degree'
+ DecanewtonMeterPerDegree = 'DecanewtonMeterPerDegree'
"""
"""
- KilonewtonMeterPerDegree = 'kilonewton_meter_per_degree'
+ KilonewtonMeterPerDegree = 'KilonewtonMeterPerDegree'
"""
"""
- MeganewtonMeterPerDegree = 'meganewton_meter_per_degree'
+ MeganewtonMeterPerDegree = 'MeganewtonMeterPerDegree'
"""
"""
- NanonewtonMillimeterPerRadian = 'nanonewton_millimeter_per_radian'
+ NanonewtonMillimeterPerRadian = 'NanonewtonMillimeterPerRadian'
"""
"""
- MicronewtonMillimeterPerRadian = 'micronewton_millimeter_per_radian'
+ MicronewtonMillimeterPerRadian = 'MicronewtonMillimeterPerRadian'
"""
"""
- MillinewtonMillimeterPerRadian = 'millinewton_millimeter_per_radian'
+ MillinewtonMillimeterPerRadian = 'MillinewtonMillimeterPerRadian'
"""
"""
- CentinewtonMillimeterPerRadian = 'centinewton_millimeter_per_radian'
+ CentinewtonMillimeterPerRadian = 'CentinewtonMillimeterPerRadian'
"""
"""
- DecinewtonMillimeterPerRadian = 'decinewton_millimeter_per_radian'
+ DecinewtonMillimeterPerRadian = 'DecinewtonMillimeterPerRadian'
"""
"""
- DecanewtonMillimeterPerRadian = 'decanewton_millimeter_per_radian'
+ DecanewtonMillimeterPerRadian = 'DecanewtonMillimeterPerRadian'
"""
"""
- KilonewtonMillimeterPerRadian = 'kilonewton_millimeter_per_radian'
+ KilonewtonMillimeterPerRadian = 'KilonewtonMillimeterPerRadian'
"""
"""
- MeganewtonMillimeterPerRadian = 'meganewton_millimeter_per_radian'
+ MeganewtonMillimeterPerRadian = 'MeganewtonMillimeterPerRadian'
"""
"""
+class RotationalStiffnessDto:
+ """
+ A DTO representation of a RotationalStiffness
+
+ Attributes:
+ value (float): The value of the RotationalStiffness.
+ unit (RotationalStiffnessUnits): The specific unit that the RotationalStiffness value is representing.
+ """
+
+ def __init__(self, value: float, unit: RotationalStiffnessUnits):
+ """
+ Create a new DTO representation of a RotationalStiffness
+
+ Parameters:
+ value (float): The value of the RotationalStiffness.
+ unit (RotationalStiffnessUnits): The specific unit that the RotationalStiffness value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RotationalStiffness
+ """
+ self.unit: RotationalStiffnessUnits = unit
+ """
+ The specific unit that the RotationalStiffness value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RotationalStiffness DTO JSON object representing the current unit.
+
+ :return: JSON object represents RotationalStiffness DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeterPerRadian"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RotationalStiffness DTO from a json representation.
+
+ :param data: The RotationalStiffness DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeterPerRadian"}
+ :return: A new instance of RotationalStiffnessDto.
+ :rtype: RotationalStiffnessDto
+ """
+ return RotationalStiffnessDto(value=data["value"], unit=RotationalStiffnessUnits(data["unit"]))
+
+
class RotationalStiffness(AbstractMeasure):
"""
https://en.wikipedia.org/wiki/Stiffness#Rotational_stiffness
@@ -261,6 +311,54 @@ def __init__(self, value: float, from_unit: RotationalStiffnessUnits = Rotationa
def convert(self, unit: RotationalStiffnessUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RotationalStiffnessUnits = RotationalStiffnessUnits.NewtonMeterPerRadian) -> RotationalStiffnessDto:
+ """
+ Get a new instance of RotationalStiffness DTO representing the current unit.
+
+ :param hold_in_unit: The specific RotationalStiffness unit to store the RotationalStiffness value in the DTO representation.
+ :type hold_in_unit: RotationalStiffnessUnits
+ :return: A new instance of RotationalStiffnessDto.
+ :rtype: RotationalStiffnessDto
+ """
+ return RotationalStiffnessDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RotationalStiffnessUnits = RotationalStiffnessUnits.NewtonMeterPerRadian):
+ """
+ Get a RotationalStiffness DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RotationalStiffness unit to store the RotationalStiffness value in the DTO representation.
+ :type hold_in_unit: RotationalStiffnessUnits
+ :return: JSON object represents RotationalStiffness DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeterPerRadian"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(rotational_stiffness_dto: RotationalStiffnessDto):
+ """
+ Obtain a new instance of RotationalStiffness from a DTO unit object.
+
+ :param rotational_stiffness_dto: The RotationalStiffness DTO representation.
+ :type rotational_stiffness_dto: RotationalStiffnessDto
+ :return: A new instance of RotationalStiffness.
+ :rtype: RotationalStiffness
+ """
+ return RotationalStiffness(rotational_stiffness_dto.value, rotational_stiffness_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RotationalStiffness from a DTO unit json representation.
+
+ :param data: The RotationalStiffness DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeterPerRadian"}
+ :return: A new instance of RotationalStiffness.
+ :rtype: RotationalStiffness
+ """
+ return RotationalStiffness.from_dto(RotationalStiffnessDto.from_json(data))
+
def __convert_from_base(self, from_unit: RotationalStiffnessUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/rotational_stiffness_per_length.py b/unitsnet_py/units/rotational_stiffness_per_length.py
index 8042b1f..c5bf013 100644
--- a/unitsnet_py/units/rotational_stiffness_per_length.py
+++ b/unitsnet_py/units/rotational_stiffness_per_length.py
@@ -10,32 +10,82 @@ class RotationalStiffnessPerLengthUnits(Enum):
RotationalStiffnessPerLengthUnits enumeration
"""
- NewtonMeterPerRadianPerMeter = 'newton_meter_per_radian_per_meter'
+ NewtonMeterPerRadianPerMeter = 'NewtonMeterPerRadianPerMeter'
"""
"""
- PoundForceFootPerDegreesPerFoot = 'pound_force_foot_per_degrees_per_foot'
+ PoundForceFootPerDegreesPerFoot = 'PoundForceFootPerDegreesPerFoot'
"""
"""
- KilopoundForceFootPerDegreesPerFoot = 'kilopound_force_foot_per_degrees_per_foot'
+ KilopoundForceFootPerDegreesPerFoot = 'KilopoundForceFootPerDegreesPerFoot'
"""
"""
- KilonewtonMeterPerRadianPerMeter = 'kilonewton_meter_per_radian_per_meter'
+ KilonewtonMeterPerRadianPerMeter = 'KilonewtonMeterPerRadianPerMeter'
"""
"""
- MeganewtonMeterPerRadianPerMeter = 'meganewton_meter_per_radian_per_meter'
+ MeganewtonMeterPerRadianPerMeter = 'MeganewtonMeterPerRadianPerMeter'
"""
"""
+class RotationalStiffnessPerLengthDto:
+ """
+ A DTO representation of a RotationalStiffnessPerLength
+
+ Attributes:
+ value (float): The value of the RotationalStiffnessPerLength.
+ unit (RotationalStiffnessPerLengthUnits): The specific unit that the RotationalStiffnessPerLength value is representing.
+ """
+
+ def __init__(self, value: float, unit: RotationalStiffnessPerLengthUnits):
+ """
+ Create a new DTO representation of a RotationalStiffnessPerLength
+
+ Parameters:
+ value (float): The value of the RotationalStiffnessPerLength.
+ unit (RotationalStiffnessPerLengthUnits): The specific unit that the RotationalStiffnessPerLength value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the RotationalStiffnessPerLength
+ """
+ self.unit: RotationalStiffnessPerLengthUnits = unit
+ """
+ The specific unit that the RotationalStiffnessPerLength value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a RotationalStiffnessPerLength DTO JSON object representing the current unit.
+
+ :return: JSON object represents RotationalStiffnessPerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeterPerRadianPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of RotationalStiffnessPerLength DTO from a json representation.
+
+ :param data: The RotationalStiffnessPerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeterPerRadianPerMeter"}
+ :return: A new instance of RotationalStiffnessPerLengthDto.
+ :rtype: RotationalStiffnessPerLengthDto
+ """
+ return RotationalStiffnessPerLengthDto(value=data["value"], unit=RotationalStiffnessPerLengthUnits(data["unit"]))
+
+
class RotationalStiffnessPerLength(AbstractMeasure):
"""
https://en.wikipedia.org/wiki/Stiffness#Rotational_stiffness
@@ -65,6 +115,54 @@ def __init__(self, value: float, from_unit: RotationalStiffnessPerLengthUnits =
def convert(self, unit: RotationalStiffnessPerLengthUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: RotationalStiffnessPerLengthUnits = RotationalStiffnessPerLengthUnits.NewtonMeterPerRadianPerMeter) -> RotationalStiffnessPerLengthDto:
+ """
+ Get a new instance of RotationalStiffnessPerLength DTO representing the current unit.
+
+ :param hold_in_unit: The specific RotationalStiffnessPerLength unit to store the RotationalStiffnessPerLength value in the DTO representation.
+ :type hold_in_unit: RotationalStiffnessPerLengthUnits
+ :return: A new instance of RotationalStiffnessPerLengthDto.
+ :rtype: RotationalStiffnessPerLengthDto
+ """
+ return RotationalStiffnessPerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: RotationalStiffnessPerLengthUnits = RotationalStiffnessPerLengthUnits.NewtonMeterPerRadianPerMeter):
+ """
+ Get a RotationalStiffnessPerLength DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific RotationalStiffnessPerLength unit to store the RotationalStiffnessPerLength value in the DTO representation.
+ :type hold_in_unit: RotationalStiffnessPerLengthUnits
+ :return: JSON object represents RotationalStiffnessPerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeterPerRadianPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(rotational_stiffness_per_length_dto: RotationalStiffnessPerLengthDto):
+ """
+ Obtain a new instance of RotationalStiffnessPerLength from a DTO unit object.
+
+ :param rotational_stiffness_per_length_dto: The RotationalStiffnessPerLength DTO representation.
+ :type rotational_stiffness_per_length_dto: RotationalStiffnessPerLengthDto
+ :return: A new instance of RotationalStiffnessPerLength.
+ :rtype: RotationalStiffnessPerLength
+ """
+ return RotationalStiffnessPerLength(rotational_stiffness_per_length_dto.value, rotational_stiffness_per_length_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of RotationalStiffnessPerLength from a DTO unit json representation.
+
+ :param data: The RotationalStiffnessPerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeterPerRadianPerMeter"}
+ :return: A new instance of RotationalStiffnessPerLength.
+ :rtype: RotationalStiffnessPerLength
+ """
+ return RotationalStiffnessPerLength.from_dto(RotationalStiffnessPerLengthDto.from_json(data))
+
def __convert_from_base(self, from_unit: RotationalStiffnessPerLengthUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/scalar.py b/unitsnet_py/units/scalar.py
index 3248638..39d0219 100644
--- a/unitsnet_py/units/scalar.py
+++ b/unitsnet_py/units/scalar.py
@@ -10,12 +10,62 @@ class ScalarUnits(Enum):
ScalarUnits enumeration
"""
- Amount = 'amount'
+ Amount = 'Amount'
"""
"""
+class ScalarDto:
+ """
+ A DTO representation of a Scalar
+
+ Attributes:
+ value (float): The value of the Scalar.
+ unit (ScalarUnits): The specific unit that the Scalar value is representing.
+ """
+
+ def __init__(self, value: float, unit: ScalarUnits):
+ """
+ Create a new DTO representation of a Scalar
+
+ Parameters:
+ value (float): The value of the Scalar.
+ unit (ScalarUnits): The specific unit that the Scalar value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Scalar
+ """
+ self.unit: ScalarUnits = unit
+ """
+ The specific unit that the Scalar value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Scalar DTO JSON object representing the current unit.
+
+ :return: JSON object represents Scalar DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Amount"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Scalar DTO from a json representation.
+
+ :param data: The Scalar DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Amount"}
+ :return: A new instance of ScalarDto.
+ :rtype: ScalarDto
+ """
+ return ScalarDto(value=data["value"], unit=ScalarUnits(data["unit"]))
+
+
class Scalar(AbstractMeasure):
"""
A way of representing a number of items.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: ScalarUnits = ScalarUnits.Amount):
def convert(self, unit: ScalarUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ScalarUnits = ScalarUnits.Amount) -> ScalarDto:
+ """
+ Get a new instance of Scalar DTO representing the current unit.
+
+ :param hold_in_unit: The specific Scalar unit to store the Scalar value in the DTO representation.
+ :type hold_in_unit: ScalarUnits
+ :return: A new instance of ScalarDto.
+ :rtype: ScalarDto
+ """
+ return ScalarDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ScalarUnits = ScalarUnits.Amount):
+ """
+ Get a Scalar DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Scalar unit to store the Scalar value in the DTO representation.
+ :type hold_in_unit: ScalarUnits
+ :return: JSON object represents Scalar DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Amount"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(scalar_dto: ScalarDto):
+ """
+ Obtain a new instance of Scalar from a DTO unit object.
+
+ :param scalar_dto: The Scalar DTO representation.
+ :type scalar_dto: ScalarDto
+ :return: A new instance of Scalar.
+ :rtype: Scalar
+ """
+ return Scalar(scalar_dto.value, scalar_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Scalar from a DTO unit json representation.
+
+ :param data: The Scalar DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Amount"}
+ :return: A new instance of Scalar.
+ :rtype: Scalar
+ """
+ return Scalar.from_dto(ScalarDto.from_json(data))
+
def __convert_from_base(self, from_unit: ScalarUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/solid_angle.py b/unitsnet_py/units/solid_angle.py
index 0e38888..a5e03c1 100644
--- a/unitsnet_py/units/solid_angle.py
+++ b/unitsnet_py/units/solid_angle.py
@@ -10,12 +10,62 @@ class SolidAngleUnits(Enum):
SolidAngleUnits enumeration
"""
- Steradian = 'steradian'
+ Steradian = 'Steradian'
"""
"""
+class SolidAngleDto:
+ """
+ A DTO representation of a SolidAngle
+
+ Attributes:
+ value (float): The value of the SolidAngle.
+ unit (SolidAngleUnits): The specific unit that the SolidAngle value is representing.
+ """
+
+ def __init__(self, value: float, unit: SolidAngleUnits):
+ """
+ Create a new DTO representation of a SolidAngle
+
+ Parameters:
+ value (float): The value of the SolidAngle.
+ unit (SolidAngleUnits): The specific unit that the SolidAngle value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the SolidAngle
+ """
+ self.unit: SolidAngleUnits = unit
+ """
+ The specific unit that the SolidAngle value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a SolidAngle DTO JSON object representing the current unit.
+
+ :return: JSON object represents SolidAngle DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Steradian"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of SolidAngle DTO from a json representation.
+
+ :param data: The SolidAngle DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Steradian"}
+ :return: A new instance of SolidAngleDto.
+ :rtype: SolidAngleDto
+ """
+ return SolidAngleDto(value=data["value"], unit=SolidAngleUnits(data["unit"]))
+
+
class SolidAngle(AbstractMeasure):
"""
In geometry, a solid angle is the two-dimensional angle in three-dimensional space that an object subtends at a point.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: SolidAngleUnits = SolidAngleUnits.St
def convert(self, unit: SolidAngleUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: SolidAngleUnits = SolidAngleUnits.Steradian) -> SolidAngleDto:
+ """
+ Get a new instance of SolidAngle DTO representing the current unit.
+
+ :param hold_in_unit: The specific SolidAngle unit to store the SolidAngle value in the DTO representation.
+ :type hold_in_unit: SolidAngleUnits
+ :return: A new instance of SolidAngleDto.
+ :rtype: SolidAngleDto
+ """
+ return SolidAngleDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: SolidAngleUnits = SolidAngleUnits.Steradian):
+ """
+ Get a SolidAngle DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific SolidAngle unit to store the SolidAngle value in the DTO representation.
+ :type hold_in_unit: SolidAngleUnits
+ :return: JSON object represents SolidAngle DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Steradian"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(solid_angle_dto: SolidAngleDto):
+ """
+ Obtain a new instance of SolidAngle from a DTO unit object.
+
+ :param solid_angle_dto: The SolidAngle DTO representation.
+ :type solid_angle_dto: SolidAngleDto
+ :return: A new instance of SolidAngle.
+ :rtype: SolidAngle
+ """
+ return SolidAngle(solid_angle_dto.value, solid_angle_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of SolidAngle from a DTO unit json representation.
+
+ :param data: The SolidAngle DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Steradian"}
+ :return: A new instance of SolidAngle.
+ :rtype: SolidAngle
+ """
+ return SolidAngle.from_dto(SolidAngleDto.from_json(data))
+
def __convert_from_base(self, from_unit: SolidAngleUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/specific_energy.py b/unitsnet_py/units/specific_energy.py
index bab286b..7923f65 100644
--- a/unitsnet_py/units/specific_energy.py
+++ b/unitsnet_py/units/specific_energy.py
@@ -10,157 +10,207 @@ class SpecificEnergyUnits(Enum):
SpecificEnergyUnits enumeration
"""
- JoulePerKilogram = 'joule_per_kilogram'
+ JoulePerKilogram = 'JoulePerKilogram'
"""
"""
- MegaJoulePerTonne = 'mega_joule_per_tonne'
+ MegaJoulePerTonne = 'MegaJoulePerTonne'
"""
"""
- CaloriePerGram = 'calorie_per_gram'
+ CaloriePerGram = 'CaloriePerGram'
"""
"""
- WattHourPerKilogram = 'watt_hour_per_kilogram'
+ WattHourPerKilogram = 'WattHourPerKilogram'
"""
"""
- WattDayPerKilogram = 'watt_day_per_kilogram'
+ WattDayPerKilogram = 'WattDayPerKilogram'
"""
"""
- WattDayPerTonne = 'watt_day_per_tonne'
+ WattDayPerTonne = 'WattDayPerTonne'
"""
"""
- WattDayPerShortTon = 'watt_day_per_short_ton'
+ WattDayPerShortTon = 'WattDayPerShortTon'
"""
"""
- WattHourPerPound = 'watt_hour_per_pound'
+ WattHourPerPound = 'WattHourPerPound'
"""
"""
- BtuPerPound = 'btu_per_pound'
+ BtuPerPound = 'BtuPerPound'
"""
"""
- KilojoulePerKilogram = 'kilojoule_per_kilogram'
+ KilojoulePerKilogram = 'KilojoulePerKilogram'
"""
"""
- MegajoulePerKilogram = 'megajoule_per_kilogram'
+ MegajoulePerKilogram = 'MegajoulePerKilogram'
"""
"""
- KilocaloriePerGram = 'kilocalorie_per_gram'
+ KilocaloriePerGram = 'KilocaloriePerGram'
"""
"""
- KilowattHourPerKilogram = 'kilowatt_hour_per_kilogram'
+ KilowattHourPerKilogram = 'KilowattHourPerKilogram'
"""
"""
- MegawattHourPerKilogram = 'megawatt_hour_per_kilogram'
+ MegawattHourPerKilogram = 'MegawattHourPerKilogram'
"""
"""
- GigawattHourPerKilogram = 'gigawatt_hour_per_kilogram'
+ GigawattHourPerKilogram = 'GigawattHourPerKilogram'
"""
"""
- KilowattDayPerKilogram = 'kilowatt_day_per_kilogram'
+ KilowattDayPerKilogram = 'KilowattDayPerKilogram'
"""
"""
- MegawattDayPerKilogram = 'megawatt_day_per_kilogram'
+ MegawattDayPerKilogram = 'MegawattDayPerKilogram'
"""
"""
- GigawattDayPerKilogram = 'gigawatt_day_per_kilogram'
+ GigawattDayPerKilogram = 'GigawattDayPerKilogram'
"""
"""
- TerawattDayPerKilogram = 'terawatt_day_per_kilogram'
+ TerawattDayPerKilogram = 'TerawattDayPerKilogram'
"""
"""
- KilowattDayPerTonne = 'kilowatt_day_per_tonne'
+ KilowattDayPerTonne = 'KilowattDayPerTonne'
"""
"""
- MegawattDayPerTonne = 'megawatt_day_per_tonne'
+ MegawattDayPerTonne = 'MegawattDayPerTonne'
"""
"""
- GigawattDayPerTonne = 'gigawatt_day_per_tonne'
+ GigawattDayPerTonne = 'GigawattDayPerTonne'
"""
"""
- TerawattDayPerTonne = 'terawatt_day_per_tonne'
+ TerawattDayPerTonne = 'TerawattDayPerTonne'
"""
"""
- KilowattDayPerShortTon = 'kilowatt_day_per_short_ton'
+ KilowattDayPerShortTon = 'KilowattDayPerShortTon'
"""
"""
- MegawattDayPerShortTon = 'megawatt_day_per_short_ton'
+ MegawattDayPerShortTon = 'MegawattDayPerShortTon'
"""
"""
- GigawattDayPerShortTon = 'gigawatt_day_per_short_ton'
+ GigawattDayPerShortTon = 'GigawattDayPerShortTon'
"""
"""
- TerawattDayPerShortTon = 'terawatt_day_per_short_ton'
+ TerawattDayPerShortTon = 'TerawattDayPerShortTon'
"""
"""
- KilowattHourPerPound = 'kilowatt_hour_per_pound'
+ KilowattHourPerPound = 'KilowattHourPerPound'
"""
"""
- MegawattHourPerPound = 'megawatt_hour_per_pound'
+ MegawattHourPerPound = 'MegawattHourPerPound'
"""
"""
- GigawattHourPerPound = 'gigawatt_hour_per_pound'
+ GigawattHourPerPound = 'GigawattHourPerPound'
"""
"""
+class SpecificEnergyDto:
+ """
+ A DTO representation of a SpecificEnergy
+
+ Attributes:
+ value (float): The value of the SpecificEnergy.
+ unit (SpecificEnergyUnits): The specific unit that the SpecificEnergy value is representing.
+ """
+
+ def __init__(self, value: float, unit: SpecificEnergyUnits):
+ """
+ Create a new DTO representation of a SpecificEnergy
+
+ Parameters:
+ value (float): The value of the SpecificEnergy.
+ unit (SpecificEnergyUnits): The specific unit that the SpecificEnergy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the SpecificEnergy
+ """
+ self.unit: SpecificEnergyUnits = unit
+ """
+ The specific unit that the SpecificEnergy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a SpecificEnergy DTO JSON object representing the current unit.
+
+ :return: JSON object represents SpecificEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerKilogram"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of SpecificEnergy DTO from a json representation.
+
+ :param data: The SpecificEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerKilogram"}
+ :return: A new instance of SpecificEnergyDto.
+ :rtype: SpecificEnergyDto
+ """
+ return SpecificEnergyDto(value=data["value"], unit=SpecificEnergyUnits(data["unit"]))
+
+
class SpecificEnergy(AbstractMeasure):
"""
The SpecificEnergy
@@ -240,6 +290,54 @@ def __init__(self, value: float, from_unit: SpecificEnergyUnits = SpecificEnergy
def convert(self, unit: SpecificEnergyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: SpecificEnergyUnits = SpecificEnergyUnits.JoulePerKilogram) -> SpecificEnergyDto:
+ """
+ Get a new instance of SpecificEnergy DTO representing the current unit.
+
+ :param hold_in_unit: The specific SpecificEnergy unit to store the SpecificEnergy value in the DTO representation.
+ :type hold_in_unit: SpecificEnergyUnits
+ :return: A new instance of SpecificEnergyDto.
+ :rtype: SpecificEnergyDto
+ """
+ return SpecificEnergyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: SpecificEnergyUnits = SpecificEnergyUnits.JoulePerKilogram):
+ """
+ Get a SpecificEnergy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific SpecificEnergy unit to store the SpecificEnergy value in the DTO representation.
+ :type hold_in_unit: SpecificEnergyUnits
+ :return: JSON object represents SpecificEnergy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerKilogram"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(specific_energy_dto: SpecificEnergyDto):
+ """
+ Obtain a new instance of SpecificEnergy from a DTO unit object.
+
+ :param specific_energy_dto: The SpecificEnergy DTO representation.
+ :type specific_energy_dto: SpecificEnergyDto
+ :return: A new instance of SpecificEnergy.
+ :rtype: SpecificEnergy
+ """
+ return SpecificEnergy(specific_energy_dto.value, specific_energy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of SpecificEnergy from a DTO unit json representation.
+
+ :param data: The SpecificEnergy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerKilogram"}
+ :return: A new instance of SpecificEnergy.
+ :rtype: SpecificEnergy
+ """
+ return SpecificEnergy.from_dto(SpecificEnergyDto.from_json(data))
+
def __convert_from_base(self, from_unit: SpecificEnergyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/specific_entropy.py b/unitsnet_py/units/specific_entropy.py
index c72ca13..ec39d0f 100644
--- a/unitsnet_py/units/specific_entropy.py
+++ b/unitsnet_py/units/specific_entropy.py
@@ -10,52 +10,102 @@ class SpecificEntropyUnits(Enum):
SpecificEntropyUnits enumeration
"""
- JoulePerKilogramKelvin = 'joule_per_kilogram_kelvin'
+ JoulePerKilogramKelvin = 'JoulePerKilogramKelvin'
"""
"""
- JoulePerKilogramDegreeCelsius = 'joule_per_kilogram_degree_celsius'
+ JoulePerKilogramDegreeCelsius = 'JoulePerKilogramDegreeCelsius'
"""
"""
- CaloriePerGramKelvin = 'calorie_per_gram_kelvin'
+ CaloriePerGramKelvin = 'CaloriePerGramKelvin'
"""
"""
- BtuPerPoundFahrenheit = 'btu_per_pound_fahrenheit'
+ BtuPerPoundFahrenheit = 'BtuPerPoundFahrenheit'
"""
"""
- KilojoulePerKilogramKelvin = 'kilojoule_per_kilogram_kelvin'
+ KilojoulePerKilogramKelvin = 'KilojoulePerKilogramKelvin'
"""
"""
- MegajoulePerKilogramKelvin = 'megajoule_per_kilogram_kelvin'
+ MegajoulePerKilogramKelvin = 'MegajoulePerKilogramKelvin'
"""
"""
- KilojoulePerKilogramDegreeCelsius = 'kilojoule_per_kilogram_degree_celsius'
+ KilojoulePerKilogramDegreeCelsius = 'KilojoulePerKilogramDegreeCelsius'
"""
"""
- MegajoulePerKilogramDegreeCelsius = 'megajoule_per_kilogram_degree_celsius'
+ MegajoulePerKilogramDegreeCelsius = 'MegajoulePerKilogramDegreeCelsius'
"""
"""
- KilocaloriePerGramKelvin = 'kilocalorie_per_gram_kelvin'
+ KilocaloriePerGramKelvin = 'KilocaloriePerGramKelvin'
"""
"""
+class SpecificEntropyDto:
+ """
+ A DTO representation of a SpecificEntropy
+
+ Attributes:
+ value (float): The value of the SpecificEntropy.
+ unit (SpecificEntropyUnits): The specific unit that the SpecificEntropy value is representing.
+ """
+
+ def __init__(self, value: float, unit: SpecificEntropyUnits):
+ """
+ Create a new DTO representation of a SpecificEntropy
+
+ Parameters:
+ value (float): The value of the SpecificEntropy.
+ unit (SpecificEntropyUnits): The specific unit that the SpecificEntropy value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the SpecificEntropy
+ """
+ self.unit: SpecificEntropyUnits = unit
+ """
+ The specific unit that the SpecificEntropy value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a SpecificEntropy DTO JSON object representing the current unit.
+
+ :return: JSON object represents SpecificEntropy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerKilogramKelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of SpecificEntropy DTO from a json representation.
+
+ :param data: The SpecificEntropy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerKilogramKelvin"}
+ :return: A new instance of SpecificEntropyDto.
+ :rtype: SpecificEntropyDto
+ """
+ return SpecificEntropyDto(value=data["value"], unit=SpecificEntropyUnits(data["unit"]))
+
+
class SpecificEntropy(AbstractMeasure):
"""
Specific entropy is an amount of energy required to raise temperature of a substance by 1 Kelvin per unit mass.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: SpecificEntropyUnits = SpecificEntro
def convert(self, unit: SpecificEntropyUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: SpecificEntropyUnits = SpecificEntropyUnits.JoulePerKilogramKelvin) -> SpecificEntropyDto:
+ """
+ Get a new instance of SpecificEntropy DTO representing the current unit.
+
+ :param hold_in_unit: The specific SpecificEntropy unit to store the SpecificEntropy value in the DTO representation.
+ :type hold_in_unit: SpecificEntropyUnits
+ :return: A new instance of SpecificEntropyDto.
+ :rtype: SpecificEntropyDto
+ """
+ return SpecificEntropyDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: SpecificEntropyUnits = SpecificEntropyUnits.JoulePerKilogramKelvin):
+ """
+ Get a SpecificEntropy DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific SpecificEntropy unit to store the SpecificEntropy value in the DTO representation.
+ :type hold_in_unit: SpecificEntropyUnits
+ :return: JSON object represents SpecificEntropy DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerKilogramKelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(specific_entropy_dto: SpecificEntropyDto):
+ """
+ Obtain a new instance of SpecificEntropy from a DTO unit object.
+
+ :param specific_entropy_dto: The SpecificEntropy DTO representation.
+ :type specific_entropy_dto: SpecificEntropyDto
+ :return: A new instance of SpecificEntropy.
+ :rtype: SpecificEntropy
+ """
+ return SpecificEntropy(specific_entropy_dto.value, specific_entropy_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of SpecificEntropy from a DTO unit json representation.
+
+ :param data: The SpecificEntropy DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerKilogramKelvin"}
+ :return: A new instance of SpecificEntropy.
+ :rtype: SpecificEntropy
+ """
+ return SpecificEntropy.from_dto(SpecificEntropyDto.from_json(data))
+
def __convert_from_base(self, from_unit: SpecificEntropyUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/specific_fuel_consumption.py b/unitsnet_py/units/specific_fuel_consumption.py
index a376a57..30d2873 100644
--- a/unitsnet_py/units/specific_fuel_consumption.py
+++ b/unitsnet_py/units/specific_fuel_consumption.py
@@ -10,27 +10,77 @@ class SpecificFuelConsumptionUnits(Enum):
SpecificFuelConsumptionUnits enumeration
"""
- PoundMassPerPoundForceHour = 'pound_mass_per_pound_force_hour'
+ PoundMassPerPoundForceHour = 'PoundMassPerPoundForceHour'
"""
"""
- KilogramPerKilogramForceHour = 'kilogram_per_kilogram_force_hour'
+ KilogramPerKilogramForceHour = 'KilogramPerKilogramForceHour'
"""
"""
- GramPerKiloNewtonSecond = 'gram_per_kilo_newton_second'
+ GramPerKiloNewtonSecond = 'GramPerKiloNewtonSecond'
"""
"""
- KilogramPerKiloNewtonSecond = 'kilogram_per_kilo_newton_second'
+ KilogramPerKiloNewtonSecond = 'KilogramPerKiloNewtonSecond'
"""
"""
+class SpecificFuelConsumptionDto:
+ """
+ A DTO representation of a SpecificFuelConsumption
+
+ Attributes:
+ value (float): The value of the SpecificFuelConsumption.
+ unit (SpecificFuelConsumptionUnits): The specific unit that the SpecificFuelConsumption value is representing.
+ """
+
+ def __init__(self, value: float, unit: SpecificFuelConsumptionUnits):
+ """
+ Create a new DTO representation of a SpecificFuelConsumption
+
+ Parameters:
+ value (float): The value of the SpecificFuelConsumption.
+ unit (SpecificFuelConsumptionUnits): The specific unit that the SpecificFuelConsumption value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the SpecificFuelConsumption
+ """
+ self.unit: SpecificFuelConsumptionUnits = unit
+ """
+ The specific unit that the SpecificFuelConsumption value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a SpecificFuelConsumption DTO JSON object representing the current unit.
+
+ :return: JSON object represents SpecificFuelConsumption DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "GramPerKiloNewtonSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of SpecificFuelConsumption DTO from a json representation.
+
+ :param data: The SpecificFuelConsumption DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "GramPerKiloNewtonSecond"}
+ :return: A new instance of SpecificFuelConsumptionDto.
+ :rtype: SpecificFuelConsumptionDto
+ """
+ return SpecificFuelConsumptionDto(value=data["value"], unit=SpecificFuelConsumptionUnits(data["unit"]))
+
+
class SpecificFuelConsumption(AbstractMeasure):
"""
SFC is the fuel efficiency of an engine design with respect to thrust output
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: SpecificFuelConsumptionUnits = Speci
def convert(self, unit: SpecificFuelConsumptionUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: SpecificFuelConsumptionUnits = SpecificFuelConsumptionUnits.GramPerKiloNewtonSecond) -> SpecificFuelConsumptionDto:
+ """
+ Get a new instance of SpecificFuelConsumption DTO representing the current unit.
+
+ :param hold_in_unit: The specific SpecificFuelConsumption unit to store the SpecificFuelConsumption value in the DTO representation.
+ :type hold_in_unit: SpecificFuelConsumptionUnits
+ :return: A new instance of SpecificFuelConsumptionDto.
+ :rtype: SpecificFuelConsumptionDto
+ """
+ return SpecificFuelConsumptionDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: SpecificFuelConsumptionUnits = SpecificFuelConsumptionUnits.GramPerKiloNewtonSecond):
+ """
+ Get a SpecificFuelConsumption DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific SpecificFuelConsumption unit to store the SpecificFuelConsumption value in the DTO representation.
+ :type hold_in_unit: SpecificFuelConsumptionUnits
+ :return: JSON object represents SpecificFuelConsumption DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "GramPerKiloNewtonSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(specific_fuel_consumption_dto: SpecificFuelConsumptionDto):
+ """
+ Obtain a new instance of SpecificFuelConsumption from a DTO unit object.
+
+ :param specific_fuel_consumption_dto: The SpecificFuelConsumption DTO representation.
+ :type specific_fuel_consumption_dto: SpecificFuelConsumptionDto
+ :return: A new instance of SpecificFuelConsumption.
+ :rtype: SpecificFuelConsumption
+ """
+ return SpecificFuelConsumption(specific_fuel_consumption_dto.value, specific_fuel_consumption_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of SpecificFuelConsumption from a DTO unit json representation.
+
+ :param data: The SpecificFuelConsumption DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "GramPerKiloNewtonSecond"}
+ :return: A new instance of SpecificFuelConsumption.
+ :rtype: SpecificFuelConsumption
+ """
+ return SpecificFuelConsumption.from_dto(SpecificFuelConsumptionDto.from_json(data))
+
def __convert_from_base(self, from_unit: SpecificFuelConsumptionUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/specific_volume.py b/unitsnet_py/units/specific_volume.py
index 0a15689..fb0f8af 100644
--- a/unitsnet_py/units/specific_volume.py
+++ b/unitsnet_py/units/specific_volume.py
@@ -10,22 +10,72 @@ class SpecificVolumeUnits(Enum):
SpecificVolumeUnits enumeration
"""
- CubicMeterPerKilogram = 'cubic_meter_per_kilogram'
+ CubicMeterPerKilogram = 'CubicMeterPerKilogram'
"""
"""
- CubicFootPerPound = 'cubic_foot_per_pound'
+ CubicFootPerPound = 'CubicFootPerPound'
"""
"""
- MillicubicMeterPerKilogram = 'millicubic_meter_per_kilogram'
+ MillicubicMeterPerKilogram = 'MillicubicMeterPerKilogram'
"""
"""
+class SpecificVolumeDto:
+ """
+ A DTO representation of a SpecificVolume
+
+ Attributes:
+ value (float): The value of the SpecificVolume.
+ unit (SpecificVolumeUnits): The specific unit that the SpecificVolume value is representing.
+ """
+
+ def __init__(self, value: float, unit: SpecificVolumeUnits):
+ """
+ Create a new DTO representation of a SpecificVolume
+
+ Parameters:
+ value (float): The value of the SpecificVolume.
+ unit (SpecificVolumeUnits): The specific unit that the SpecificVolume value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the SpecificVolume
+ """
+ self.unit: SpecificVolumeUnits = unit
+ """
+ The specific unit that the SpecificVolume value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a SpecificVolume DTO JSON object representing the current unit.
+
+ :return: JSON object represents SpecificVolume DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerKilogram"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of SpecificVolume DTO from a json representation.
+
+ :param data: The SpecificVolume DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerKilogram"}
+ :return: A new instance of SpecificVolumeDto.
+ :rtype: SpecificVolumeDto
+ """
+ return SpecificVolumeDto(value=data["value"], unit=SpecificVolumeUnits(data["unit"]))
+
+
class SpecificVolume(AbstractMeasure):
"""
In thermodynamics, the specific volume of a substance is the ratio of the substance's volume to its mass. It is the reciprocal of density and an intrinsic property of matter as well.
@@ -51,6 +101,54 @@ def __init__(self, value: float, from_unit: SpecificVolumeUnits = SpecificVolume
def convert(self, unit: SpecificVolumeUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: SpecificVolumeUnits = SpecificVolumeUnits.CubicMeterPerKilogram) -> SpecificVolumeDto:
+ """
+ Get a new instance of SpecificVolume DTO representing the current unit.
+
+ :param hold_in_unit: The specific SpecificVolume unit to store the SpecificVolume value in the DTO representation.
+ :type hold_in_unit: SpecificVolumeUnits
+ :return: A new instance of SpecificVolumeDto.
+ :rtype: SpecificVolumeDto
+ """
+ return SpecificVolumeDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: SpecificVolumeUnits = SpecificVolumeUnits.CubicMeterPerKilogram):
+ """
+ Get a SpecificVolume DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific SpecificVolume unit to store the SpecificVolume value in the DTO representation.
+ :type hold_in_unit: SpecificVolumeUnits
+ :return: JSON object represents SpecificVolume DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerKilogram"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(specific_volume_dto: SpecificVolumeDto):
+ """
+ Obtain a new instance of SpecificVolume from a DTO unit object.
+
+ :param specific_volume_dto: The SpecificVolume DTO representation.
+ :type specific_volume_dto: SpecificVolumeDto
+ :return: A new instance of SpecificVolume.
+ :rtype: SpecificVolume
+ """
+ return SpecificVolume(specific_volume_dto.value, specific_volume_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of SpecificVolume from a DTO unit json representation.
+
+ :param data: The SpecificVolume DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerKilogram"}
+ :return: A new instance of SpecificVolume.
+ :rtype: SpecificVolume
+ """
+ return SpecificVolume.from_dto(SpecificVolumeDto.from_json(data))
+
def __convert_from_base(self, from_unit: SpecificVolumeUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/specific_weight.py b/unitsnet_py/units/specific_weight.py
index bac2033..8a7494a 100644
--- a/unitsnet_py/units/specific_weight.py
+++ b/unitsnet_py/units/specific_weight.py
@@ -10,92 +10,142 @@ class SpecificWeightUnits(Enum):
SpecificWeightUnits enumeration
"""
- NewtonPerCubicMillimeter = 'newton_per_cubic_millimeter'
+ NewtonPerCubicMillimeter = 'NewtonPerCubicMillimeter'
"""
"""
- NewtonPerCubicCentimeter = 'newton_per_cubic_centimeter'
+ NewtonPerCubicCentimeter = 'NewtonPerCubicCentimeter'
"""
"""
- NewtonPerCubicMeter = 'newton_per_cubic_meter'
+ NewtonPerCubicMeter = 'NewtonPerCubicMeter'
"""
"""
- KilogramForcePerCubicMillimeter = 'kilogram_force_per_cubic_millimeter'
+ KilogramForcePerCubicMillimeter = 'KilogramForcePerCubicMillimeter'
"""
"""
- KilogramForcePerCubicCentimeter = 'kilogram_force_per_cubic_centimeter'
+ KilogramForcePerCubicCentimeter = 'KilogramForcePerCubicCentimeter'
"""
"""
- KilogramForcePerCubicMeter = 'kilogram_force_per_cubic_meter'
+ KilogramForcePerCubicMeter = 'KilogramForcePerCubicMeter'
"""
"""
- PoundForcePerCubicInch = 'pound_force_per_cubic_inch'
+ PoundForcePerCubicInch = 'PoundForcePerCubicInch'
"""
"""
- PoundForcePerCubicFoot = 'pound_force_per_cubic_foot'
+ PoundForcePerCubicFoot = 'PoundForcePerCubicFoot'
"""
"""
- TonneForcePerCubicMillimeter = 'tonne_force_per_cubic_millimeter'
+ TonneForcePerCubicMillimeter = 'TonneForcePerCubicMillimeter'
"""
"""
- TonneForcePerCubicCentimeter = 'tonne_force_per_cubic_centimeter'
+ TonneForcePerCubicCentimeter = 'TonneForcePerCubicCentimeter'
"""
"""
- TonneForcePerCubicMeter = 'tonne_force_per_cubic_meter'
+ TonneForcePerCubicMeter = 'TonneForcePerCubicMeter'
"""
"""
- KilonewtonPerCubicMillimeter = 'kilonewton_per_cubic_millimeter'
+ KilonewtonPerCubicMillimeter = 'KilonewtonPerCubicMillimeter'
"""
"""
- KilonewtonPerCubicCentimeter = 'kilonewton_per_cubic_centimeter'
+ KilonewtonPerCubicCentimeter = 'KilonewtonPerCubicCentimeter'
"""
"""
- KilonewtonPerCubicMeter = 'kilonewton_per_cubic_meter'
+ KilonewtonPerCubicMeter = 'KilonewtonPerCubicMeter'
"""
"""
- MeganewtonPerCubicMeter = 'meganewton_per_cubic_meter'
+ MeganewtonPerCubicMeter = 'MeganewtonPerCubicMeter'
"""
"""
- KilopoundForcePerCubicInch = 'kilopound_force_per_cubic_inch'
+ KilopoundForcePerCubicInch = 'KilopoundForcePerCubicInch'
"""
"""
- KilopoundForcePerCubicFoot = 'kilopound_force_per_cubic_foot'
+ KilopoundForcePerCubicFoot = 'KilopoundForcePerCubicFoot'
"""
"""
+class SpecificWeightDto:
+ """
+ A DTO representation of a SpecificWeight
+
+ Attributes:
+ value (float): The value of the SpecificWeight.
+ unit (SpecificWeightUnits): The specific unit that the SpecificWeight value is representing.
+ """
+
+ def __init__(self, value: float, unit: SpecificWeightUnits):
+ """
+ Create a new DTO representation of a SpecificWeight
+
+ Parameters:
+ value (float): The value of the SpecificWeight.
+ unit (SpecificWeightUnits): The specific unit that the SpecificWeight value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the SpecificWeight
+ """
+ self.unit: SpecificWeightUnits = unit
+ """
+ The specific unit that the SpecificWeight value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a SpecificWeight DTO JSON object representing the current unit.
+
+ :return: JSON object represents SpecificWeight DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonPerCubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of SpecificWeight DTO from a json representation.
+
+ :param data: The SpecificWeight DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonPerCubicMeter"}
+ :return: A new instance of SpecificWeightDto.
+ :rtype: SpecificWeightDto
+ """
+ return SpecificWeightDto(value=data["value"], unit=SpecificWeightUnits(data["unit"]))
+
+
class SpecificWeight(AbstractMeasure):
"""
The SpecificWeight, or more precisely, the volumetric weight density, of a substance is its weight per unit volume.
@@ -149,6 +199,54 @@ def __init__(self, value: float, from_unit: SpecificWeightUnits = SpecificWeight
def convert(self, unit: SpecificWeightUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: SpecificWeightUnits = SpecificWeightUnits.NewtonPerCubicMeter) -> SpecificWeightDto:
+ """
+ Get a new instance of SpecificWeight DTO representing the current unit.
+
+ :param hold_in_unit: The specific SpecificWeight unit to store the SpecificWeight value in the DTO representation.
+ :type hold_in_unit: SpecificWeightUnits
+ :return: A new instance of SpecificWeightDto.
+ :rtype: SpecificWeightDto
+ """
+ return SpecificWeightDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: SpecificWeightUnits = SpecificWeightUnits.NewtonPerCubicMeter):
+ """
+ Get a SpecificWeight DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific SpecificWeight unit to store the SpecificWeight value in the DTO representation.
+ :type hold_in_unit: SpecificWeightUnits
+ :return: JSON object represents SpecificWeight DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonPerCubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(specific_weight_dto: SpecificWeightDto):
+ """
+ Obtain a new instance of SpecificWeight from a DTO unit object.
+
+ :param specific_weight_dto: The SpecificWeight DTO representation.
+ :type specific_weight_dto: SpecificWeightDto
+ :return: A new instance of SpecificWeight.
+ :rtype: SpecificWeight
+ """
+ return SpecificWeight(specific_weight_dto.value, specific_weight_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of SpecificWeight from a DTO unit json representation.
+
+ :param data: The SpecificWeight DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonPerCubicMeter"}
+ :return: A new instance of SpecificWeight.
+ :rtype: SpecificWeight
+ """
+ return SpecificWeight.from_dto(SpecificWeightDto.from_json(data))
+
def __convert_from_base(self, from_unit: SpecificWeightUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/speed.py b/unitsnet_py/units/speed.py
index 6b31a26..9e49bdb 100644
--- a/unitsnet_py/units/speed.py
+++ b/unitsnet_py/units/speed.py
@@ -10,172 +10,222 @@ class SpeedUnits(Enum):
SpeedUnits enumeration
"""
- MeterPerSecond = 'meter_per_second'
+ MeterPerSecond = 'MeterPerSecond'
"""
"""
- MeterPerMinute = 'meter_per_minute'
+ MeterPerMinute = 'MeterPerMinute'
"""
"""
- MeterPerHour = 'meter_per_hour'
+ MeterPerHour = 'MeterPerHour'
"""
"""
- FootPerSecond = 'foot_per_second'
+ FootPerSecond = 'FootPerSecond'
"""
"""
- FootPerMinute = 'foot_per_minute'
+ FootPerMinute = 'FootPerMinute'
"""
"""
- FootPerHour = 'foot_per_hour'
+ FootPerHour = 'FootPerHour'
"""
"""
- UsSurveyFootPerSecond = 'us_survey_foot_per_second'
+ UsSurveyFootPerSecond = 'UsSurveyFootPerSecond'
"""
"""
- UsSurveyFootPerMinute = 'us_survey_foot_per_minute'
+ UsSurveyFootPerMinute = 'UsSurveyFootPerMinute'
"""
"""
- UsSurveyFootPerHour = 'us_survey_foot_per_hour'
+ UsSurveyFootPerHour = 'UsSurveyFootPerHour'
"""
"""
- InchPerSecond = 'inch_per_second'
+ InchPerSecond = 'InchPerSecond'
"""
"""
- InchPerMinute = 'inch_per_minute'
+ InchPerMinute = 'InchPerMinute'
"""
"""
- InchPerHour = 'inch_per_hour'
+ InchPerHour = 'InchPerHour'
"""
"""
- YardPerSecond = 'yard_per_second'
+ YardPerSecond = 'YardPerSecond'
"""
"""
- YardPerMinute = 'yard_per_minute'
+ YardPerMinute = 'YardPerMinute'
"""
"""
- YardPerHour = 'yard_per_hour'
+ YardPerHour = 'YardPerHour'
"""
"""
- Knot = 'knot'
+ Knot = 'Knot'
"""
The knot, by definition, is a unit of speed equals to 1 nautical mile per hour, which is exactly 1852.000 metres per hour. The length of the internationally agreed nautical mile is 1852 m. The US adopted the international definition in 1954, the UK adopted the international nautical mile definition in 1970.
"""
- MilePerHour = 'mile_per_hour'
+ MilePerHour = 'MilePerHour'
"""
"""
- Mach = 'mach'
+ Mach = 'Mach'
"""
"""
- NanometerPerSecond = 'nanometer_per_second'
+ NanometerPerSecond = 'NanometerPerSecond'
"""
"""
- MicrometerPerSecond = 'micrometer_per_second'
+ MicrometerPerSecond = 'MicrometerPerSecond'
"""
"""
- MillimeterPerSecond = 'millimeter_per_second'
+ MillimeterPerSecond = 'MillimeterPerSecond'
"""
"""
- CentimeterPerSecond = 'centimeter_per_second'
+ CentimeterPerSecond = 'CentimeterPerSecond'
"""
"""
- DecimeterPerSecond = 'decimeter_per_second'
+ DecimeterPerSecond = 'DecimeterPerSecond'
"""
"""
- KilometerPerSecond = 'kilometer_per_second'
+ KilometerPerSecond = 'KilometerPerSecond'
"""
"""
- NanometerPerMinute = 'nanometer_per_minute'
+ NanometerPerMinute = 'NanometerPerMinute'
"""
"""
- MicrometerPerMinute = 'micrometer_per_minute'
+ MicrometerPerMinute = 'MicrometerPerMinute'
"""
"""
- MillimeterPerMinute = 'millimeter_per_minute'
+ MillimeterPerMinute = 'MillimeterPerMinute'
"""
"""
- CentimeterPerMinute = 'centimeter_per_minute'
+ CentimeterPerMinute = 'CentimeterPerMinute'
"""
"""
- DecimeterPerMinute = 'decimeter_per_minute'
+ DecimeterPerMinute = 'DecimeterPerMinute'
"""
"""
- KilometerPerMinute = 'kilometer_per_minute'
+ KilometerPerMinute = 'KilometerPerMinute'
"""
"""
- MillimeterPerHour = 'millimeter_per_hour'
+ MillimeterPerHour = 'MillimeterPerHour'
"""
"""
- CentimeterPerHour = 'centimeter_per_hour'
+ CentimeterPerHour = 'CentimeterPerHour'
"""
"""
- KilometerPerHour = 'kilometer_per_hour'
+ KilometerPerHour = 'KilometerPerHour'
"""
"""
+class SpeedDto:
+ """
+ A DTO representation of a Speed
+
+ Attributes:
+ value (float): The value of the Speed.
+ unit (SpeedUnits): The specific unit that the Speed value is representing.
+ """
+
+ def __init__(self, value: float, unit: SpeedUnits):
+ """
+ Create a new DTO representation of a Speed
+
+ Parameters:
+ value (float): The value of the Speed.
+ unit (SpeedUnits): The specific unit that the Speed value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Speed
+ """
+ self.unit: SpeedUnits = unit
+ """
+ The specific unit that the Speed value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Speed DTO JSON object representing the current unit.
+
+ :return: JSON object represents Speed DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Speed DTO from a json representation.
+
+ :param data: The Speed DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterPerSecond"}
+ :return: A new instance of SpeedDto.
+ :rtype: SpeedDto
+ """
+ return SpeedDto(value=data["value"], unit=SpeedUnits(data["unit"]))
+
+
class Speed(AbstractMeasure):
"""
In everyday use and in kinematics, the speed of an object is the magnitude of its velocity (the rate of change of its position); it is thus a scalar quantity.[1] The average speed of an object in an interval of time is the distance travelled by the object divided by the duration of the interval;[2] the instantaneous speed is the limit of the average speed as the duration of the time interval approaches zero.
@@ -261,6 +311,54 @@ def __init__(self, value: float, from_unit: SpeedUnits = SpeedUnits.MeterPerSeco
def convert(self, unit: SpeedUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: SpeedUnits = SpeedUnits.MeterPerSecond) -> SpeedDto:
+ """
+ Get a new instance of Speed DTO representing the current unit.
+
+ :param hold_in_unit: The specific Speed unit to store the Speed value in the DTO representation.
+ :type hold_in_unit: SpeedUnits
+ :return: A new instance of SpeedDto.
+ :rtype: SpeedDto
+ """
+ return SpeedDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: SpeedUnits = SpeedUnits.MeterPerSecond):
+ """
+ Get a Speed DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Speed unit to store the Speed value in the DTO representation.
+ :type hold_in_unit: SpeedUnits
+ :return: JSON object represents Speed DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(speed_dto: SpeedDto):
+ """
+ Obtain a new instance of Speed from a DTO unit object.
+
+ :param speed_dto: The Speed DTO representation.
+ :type speed_dto: SpeedDto
+ :return: A new instance of Speed.
+ :rtype: Speed
+ """
+ return Speed(speed_dto.value, speed_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Speed from a DTO unit json representation.
+
+ :param data: The Speed DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterPerSecond"}
+ :return: A new instance of Speed.
+ :rtype: Speed
+ """
+ return Speed.from_dto(SpeedDto.from_json(data))
+
def __convert_from_base(self, from_unit: SpeedUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/standard_volume_flow.py b/unitsnet_py/units/standard_volume_flow.py
index 83ecc6a..8493887 100644
--- a/unitsnet_py/units/standard_volume_flow.py
+++ b/unitsnet_py/units/standard_volume_flow.py
@@ -10,52 +10,102 @@ class StandardVolumeFlowUnits(Enum):
StandardVolumeFlowUnits enumeration
"""
- StandardCubicMeterPerSecond = 'standard_cubic_meter_per_second'
+ StandardCubicMeterPerSecond = 'StandardCubicMeterPerSecond'
"""
"""
- StandardCubicMeterPerMinute = 'standard_cubic_meter_per_minute'
+ StandardCubicMeterPerMinute = 'StandardCubicMeterPerMinute'
"""
"""
- StandardCubicMeterPerHour = 'standard_cubic_meter_per_hour'
+ StandardCubicMeterPerHour = 'StandardCubicMeterPerHour'
"""
"""
- StandardCubicMeterPerDay = 'standard_cubic_meter_per_day'
+ StandardCubicMeterPerDay = 'StandardCubicMeterPerDay'
"""
"""
- StandardCubicCentimeterPerMinute = 'standard_cubic_centimeter_per_minute'
+ StandardCubicCentimeterPerMinute = 'StandardCubicCentimeterPerMinute'
"""
"""
- StandardLiterPerMinute = 'standard_liter_per_minute'
+ StandardLiterPerMinute = 'StandardLiterPerMinute'
"""
"""
- StandardCubicFootPerSecond = 'standard_cubic_foot_per_second'
+ StandardCubicFootPerSecond = 'StandardCubicFootPerSecond'
"""
"""
- StandardCubicFootPerMinute = 'standard_cubic_foot_per_minute'
+ StandardCubicFootPerMinute = 'StandardCubicFootPerMinute'
"""
"""
- StandardCubicFootPerHour = 'standard_cubic_foot_per_hour'
+ StandardCubicFootPerHour = 'StandardCubicFootPerHour'
"""
"""
+class StandardVolumeFlowDto:
+ """
+ A DTO representation of a StandardVolumeFlow
+
+ Attributes:
+ value (float): The value of the StandardVolumeFlow.
+ unit (StandardVolumeFlowUnits): The specific unit that the StandardVolumeFlow value is representing.
+ """
+
+ def __init__(self, value: float, unit: StandardVolumeFlowUnits):
+ """
+ Create a new DTO representation of a StandardVolumeFlow
+
+ Parameters:
+ value (float): The value of the StandardVolumeFlow.
+ unit (StandardVolumeFlowUnits): The specific unit that the StandardVolumeFlow value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the StandardVolumeFlow
+ """
+ self.unit: StandardVolumeFlowUnits = unit
+ """
+ The specific unit that the StandardVolumeFlow value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a StandardVolumeFlow DTO JSON object representing the current unit.
+
+ :return: JSON object represents StandardVolumeFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "StandardCubicMeterPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of StandardVolumeFlow DTO from a json representation.
+
+ :param data: The StandardVolumeFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "StandardCubicMeterPerSecond"}
+ :return: A new instance of StandardVolumeFlowDto.
+ :rtype: StandardVolumeFlowDto
+ """
+ return StandardVolumeFlowDto(value=data["value"], unit=StandardVolumeFlowUnits(data["unit"]))
+
+
class StandardVolumeFlow(AbstractMeasure):
"""
The molar flow rate of a gas corrected to standardized conditions of temperature and pressure thus representing a fixed number of moles of gas regardless of composition and actual flow conditions.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: StandardVolumeFlowUnits = StandardVo
def convert(self, unit: StandardVolumeFlowUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: StandardVolumeFlowUnits = StandardVolumeFlowUnits.StandardCubicMeterPerSecond) -> StandardVolumeFlowDto:
+ """
+ Get a new instance of StandardVolumeFlow DTO representing the current unit.
+
+ :param hold_in_unit: The specific StandardVolumeFlow unit to store the StandardVolumeFlow value in the DTO representation.
+ :type hold_in_unit: StandardVolumeFlowUnits
+ :return: A new instance of StandardVolumeFlowDto.
+ :rtype: StandardVolumeFlowDto
+ """
+ return StandardVolumeFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: StandardVolumeFlowUnits = StandardVolumeFlowUnits.StandardCubicMeterPerSecond):
+ """
+ Get a StandardVolumeFlow DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific StandardVolumeFlow unit to store the StandardVolumeFlow value in the DTO representation.
+ :type hold_in_unit: StandardVolumeFlowUnits
+ :return: JSON object represents StandardVolumeFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "StandardCubicMeterPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(standard_volume_flow_dto: StandardVolumeFlowDto):
+ """
+ Obtain a new instance of StandardVolumeFlow from a DTO unit object.
+
+ :param standard_volume_flow_dto: The StandardVolumeFlow DTO representation.
+ :type standard_volume_flow_dto: StandardVolumeFlowDto
+ :return: A new instance of StandardVolumeFlow.
+ :rtype: StandardVolumeFlow
+ """
+ return StandardVolumeFlow(standard_volume_flow_dto.value, standard_volume_flow_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of StandardVolumeFlow from a DTO unit json representation.
+
+ :param data: The StandardVolumeFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "StandardCubicMeterPerSecond"}
+ :return: A new instance of StandardVolumeFlow.
+ :rtype: StandardVolumeFlow
+ """
+ return StandardVolumeFlow.from_dto(StandardVolumeFlowDto.from_json(data))
+
def __convert_from_base(self, from_unit: StandardVolumeFlowUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/temperature.py b/unitsnet_py/units/temperature.py
index 53b2120..61eebc8 100644
--- a/unitsnet_py/units/temperature.py
+++ b/unitsnet_py/units/temperature.py
@@ -10,57 +10,107 @@ class TemperatureUnits(Enum):
TemperatureUnits enumeration
"""
- Kelvin = 'kelvin'
+ Kelvin = 'Kelvin'
"""
"""
- DegreeCelsius = 'degree_celsius'
+ DegreeCelsius = 'DegreeCelsius'
"""
"""
- MillidegreeCelsius = 'millidegree_celsius'
+ MillidegreeCelsius = 'MillidegreeCelsius'
"""
"""
- DegreeDelisle = 'degree_delisle'
+ DegreeDelisle = 'DegreeDelisle'
"""
"""
- DegreeFahrenheit = 'degree_fahrenheit'
+ DegreeFahrenheit = 'DegreeFahrenheit'
"""
"""
- DegreeNewton = 'degree_newton'
+ DegreeNewton = 'DegreeNewton'
"""
"""
- DegreeRankine = 'degree_rankine'
+ DegreeRankine = 'DegreeRankine'
"""
"""
- DegreeReaumur = 'degree_reaumur'
+ DegreeReaumur = 'DegreeReaumur'
"""
"""
- DegreeRoemer = 'degree_roemer'
+ DegreeRoemer = 'DegreeRoemer'
"""
"""
- SolarTemperature = 'solar_temperature'
+ SolarTemperature = 'SolarTemperature'
"""
"""
+class TemperatureDto:
+ """
+ A DTO representation of a Temperature
+
+ Attributes:
+ value (float): The value of the Temperature.
+ unit (TemperatureUnits): The specific unit that the Temperature value is representing.
+ """
+
+ def __init__(self, value: float, unit: TemperatureUnits):
+ """
+ Create a new DTO representation of a Temperature
+
+ Parameters:
+ value (float): The value of the Temperature.
+ unit (TemperatureUnits): The specific unit that the Temperature value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Temperature
+ """
+ self.unit: TemperatureUnits = unit
+ """
+ The specific unit that the Temperature value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Temperature DTO JSON object representing the current unit.
+
+ :return: JSON object represents Temperature DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Kelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Temperature DTO from a json representation.
+
+ :param data: The Temperature DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Kelvin"}
+ :return: A new instance of TemperatureDto.
+ :rtype: TemperatureDto
+ """
+ return TemperatureDto(value=data["value"], unit=TemperatureUnits(data["unit"]))
+
+
class Temperature(AbstractMeasure):
"""
A temperature is a numerical measure of hot or cold. Its measurement is by detection of heat radiation or particle velocity or kinetic energy, or by the bulk behavior of a thermometric material. It may be calibrated in any of various temperature scales, Celsius, Fahrenheit, Kelvin, etc. The fundamental physical definition of temperature is provided by thermodynamics.
@@ -100,6 +150,54 @@ def __init__(self, value: float, from_unit: TemperatureUnits = TemperatureUnits.
def convert(self, unit: TemperatureUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: TemperatureUnits = TemperatureUnits.Kelvin) -> TemperatureDto:
+ """
+ Get a new instance of Temperature DTO representing the current unit.
+
+ :param hold_in_unit: The specific Temperature unit to store the Temperature value in the DTO representation.
+ :type hold_in_unit: TemperatureUnits
+ :return: A new instance of TemperatureDto.
+ :rtype: TemperatureDto
+ """
+ return TemperatureDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: TemperatureUnits = TemperatureUnits.Kelvin):
+ """
+ Get a Temperature DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Temperature unit to store the Temperature value in the DTO representation.
+ :type hold_in_unit: TemperatureUnits
+ :return: JSON object represents Temperature DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Kelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(temperature_dto: TemperatureDto):
+ """
+ Obtain a new instance of Temperature from a DTO unit object.
+
+ :param temperature_dto: The Temperature DTO representation.
+ :type temperature_dto: TemperatureDto
+ :return: A new instance of Temperature.
+ :rtype: Temperature
+ """
+ return Temperature(temperature_dto.value, temperature_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Temperature from a DTO unit json representation.
+
+ :param data: The Temperature DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Kelvin"}
+ :return: A new instance of Temperature.
+ :rtype: Temperature
+ """
+ return Temperature.from_dto(TemperatureDto.from_json(data))
+
def __convert_from_base(self, from_unit: TemperatureUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/temperature_change_rate.py b/unitsnet_py/units/temperature_change_rate.py
index 7af796b..fea8fe1 100644
--- a/unitsnet_py/units/temperature_change_rate.py
+++ b/unitsnet_py/units/temperature_change_rate.py
@@ -10,57 +10,107 @@ class TemperatureChangeRateUnits(Enum):
TemperatureChangeRateUnits enumeration
"""
- DegreeCelsiusPerSecond = 'degree_celsius_per_second'
+ DegreeCelsiusPerSecond = 'DegreeCelsiusPerSecond'
"""
"""
- DegreeCelsiusPerMinute = 'degree_celsius_per_minute'
+ DegreeCelsiusPerMinute = 'DegreeCelsiusPerMinute'
"""
"""
- NanodegreeCelsiusPerSecond = 'nanodegree_celsius_per_second'
+ NanodegreeCelsiusPerSecond = 'NanodegreeCelsiusPerSecond'
"""
"""
- MicrodegreeCelsiusPerSecond = 'microdegree_celsius_per_second'
+ MicrodegreeCelsiusPerSecond = 'MicrodegreeCelsiusPerSecond'
"""
"""
- MillidegreeCelsiusPerSecond = 'millidegree_celsius_per_second'
+ MillidegreeCelsiusPerSecond = 'MillidegreeCelsiusPerSecond'
"""
"""
- CentidegreeCelsiusPerSecond = 'centidegree_celsius_per_second'
+ CentidegreeCelsiusPerSecond = 'CentidegreeCelsiusPerSecond'
"""
"""
- DecidegreeCelsiusPerSecond = 'decidegree_celsius_per_second'
+ DecidegreeCelsiusPerSecond = 'DecidegreeCelsiusPerSecond'
"""
"""
- DecadegreeCelsiusPerSecond = 'decadegree_celsius_per_second'
+ DecadegreeCelsiusPerSecond = 'DecadegreeCelsiusPerSecond'
"""
"""
- HectodegreeCelsiusPerSecond = 'hectodegree_celsius_per_second'
+ HectodegreeCelsiusPerSecond = 'HectodegreeCelsiusPerSecond'
"""
"""
- KilodegreeCelsiusPerSecond = 'kilodegree_celsius_per_second'
+ KilodegreeCelsiusPerSecond = 'KilodegreeCelsiusPerSecond'
"""
"""
+class TemperatureChangeRateDto:
+ """
+ A DTO representation of a TemperatureChangeRate
+
+ Attributes:
+ value (float): The value of the TemperatureChangeRate.
+ unit (TemperatureChangeRateUnits): The specific unit that the TemperatureChangeRate value is representing.
+ """
+
+ def __init__(self, value: float, unit: TemperatureChangeRateUnits):
+ """
+ Create a new DTO representation of a TemperatureChangeRate
+
+ Parameters:
+ value (float): The value of the TemperatureChangeRate.
+ unit (TemperatureChangeRateUnits): The specific unit that the TemperatureChangeRate value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the TemperatureChangeRate
+ """
+ self.unit: TemperatureChangeRateUnits = unit
+ """
+ The specific unit that the TemperatureChangeRate value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a TemperatureChangeRate DTO JSON object representing the current unit.
+
+ :return: JSON object represents TemperatureChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DegreeCelsiusPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of TemperatureChangeRate DTO from a json representation.
+
+ :param data: The TemperatureChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DegreeCelsiusPerSecond"}
+ :return: A new instance of TemperatureChangeRateDto.
+ :rtype: TemperatureChangeRateDto
+ """
+ return TemperatureChangeRateDto(value=data["value"], unit=TemperatureChangeRateUnits(data["unit"]))
+
+
class TemperatureChangeRate(AbstractMeasure):
"""
Temperature change rate is the ratio of the temperature change to the time during which the change occurred (value of temperature changes per unit time).
@@ -100,6 +150,54 @@ def __init__(self, value: float, from_unit: TemperatureChangeRateUnits = Tempera
def convert(self, unit: TemperatureChangeRateUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: TemperatureChangeRateUnits = TemperatureChangeRateUnits.DegreeCelsiusPerSecond) -> TemperatureChangeRateDto:
+ """
+ Get a new instance of TemperatureChangeRate DTO representing the current unit.
+
+ :param hold_in_unit: The specific TemperatureChangeRate unit to store the TemperatureChangeRate value in the DTO representation.
+ :type hold_in_unit: TemperatureChangeRateUnits
+ :return: A new instance of TemperatureChangeRateDto.
+ :rtype: TemperatureChangeRateDto
+ """
+ return TemperatureChangeRateDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: TemperatureChangeRateUnits = TemperatureChangeRateUnits.DegreeCelsiusPerSecond):
+ """
+ Get a TemperatureChangeRate DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific TemperatureChangeRate unit to store the TemperatureChangeRate value in the DTO representation.
+ :type hold_in_unit: TemperatureChangeRateUnits
+ :return: JSON object represents TemperatureChangeRate DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DegreeCelsiusPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(temperature_change_rate_dto: TemperatureChangeRateDto):
+ """
+ Obtain a new instance of TemperatureChangeRate from a DTO unit object.
+
+ :param temperature_change_rate_dto: The TemperatureChangeRate DTO representation.
+ :type temperature_change_rate_dto: TemperatureChangeRateDto
+ :return: A new instance of TemperatureChangeRate.
+ :rtype: TemperatureChangeRate
+ """
+ return TemperatureChangeRate(temperature_change_rate_dto.value, temperature_change_rate_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of TemperatureChangeRate from a DTO unit json representation.
+
+ :param data: The TemperatureChangeRate DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DegreeCelsiusPerSecond"}
+ :return: A new instance of TemperatureChangeRate.
+ :rtype: TemperatureChangeRate
+ """
+ return TemperatureChangeRate.from_dto(TemperatureChangeRateDto.from_json(data))
+
def __convert_from_base(self, from_unit: TemperatureChangeRateUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/temperature_delta.py b/unitsnet_py/units/temperature_delta.py
index ee2fae5..969112e 100644
--- a/unitsnet_py/units/temperature_delta.py
+++ b/unitsnet_py/units/temperature_delta.py
@@ -10,52 +10,102 @@ class TemperatureDeltaUnits(Enum):
TemperatureDeltaUnits enumeration
"""
- Kelvin = 'kelvin'
+ Kelvin = 'Kelvin'
"""
"""
- DegreeCelsius = 'degree_celsius'
+ DegreeCelsius = 'DegreeCelsius'
"""
"""
- DegreeDelisle = 'degree_delisle'
+ DegreeDelisle = 'DegreeDelisle'
"""
"""
- DegreeFahrenheit = 'degree_fahrenheit'
+ DegreeFahrenheit = 'DegreeFahrenheit'
"""
"""
- DegreeNewton = 'degree_newton'
+ DegreeNewton = 'DegreeNewton'
"""
"""
- DegreeRankine = 'degree_rankine'
+ DegreeRankine = 'DegreeRankine'
"""
"""
- DegreeReaumur = 'degree_reaumur'
+ DegreeReaumur = 'DegreeReaumur'
"""
"""
- DegreeRoemer = 'degree_roemer'
+ DegreeRoemer = 'DegreeRoemer'
"""
"""
- MillidegreeCelsius = 'millidegree_celsius'
+ MillidegreeCelsius = 'MillidegreeCelsius'
"""
"""
+class TemperatureDeltaDto:
+ """
+ A DTO representation of a TemperatureDelta
+
+ Attributes:
+ value (float): The value of the TemperatureDelta.
+ unit (TemperatureDeltaUnits): The specific unit that the TemperatureDelta value is representing.
+ """
+
+ def __init__(self, value: float, unit: TemperatureDeltaUnits):
+ """
+ Create a new DTO representation of a TemperatureDelta
+
+ Parameters:
+ value (float): The value of the TemperatureDelta.
+ unit (TemperatureDeltaUnits): The specific unit that the TemperatureDelta value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the TemperatureDelta
+ """
+ self.unit: TemperatureDeltaUnits = unit
+ """
+ The specific unit that the TemperatureDelta value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a TemperatureDelta DTO JSON object representing the current unit.
+
+ :return: JSON object represents TemperatureDelta DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Kelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of TemperatureDelta DTO from a json representation.
+
+ :param data: The TemperatureDelta DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Kelvin"}
+ :return: A new instance of TemperatureDeltaDto.
+ :rtype: TemperatureDeltaDto
+ """
+ return TemperatureDeltaDto(value=data["value"], unit=TemperatureDeltaUnits(data["unit"]))
+
+
class TemperatureDelta(AbstractMeasure):
"""
Difference between two temperatures. The conversions are different than for Temperature.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: TemperatureDeltaUnits = TemperatureD
def convert(self, unit: TemperatureDeltaUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: TemperatureDeltaUnits = TemperatureDeltaUnits.Kelvin) -> TemperatureDeltaDto:
+ """
+ Get a new instance of TemperatureDelta DTO representing the current unit.
+
+ :param hold_in_unit: The specific TemperatureDelta unit to store the TemperatureDelta value in the DTO representation.
+ :type hold_in_unit: TemperatureDeltaUnits
+ :return: A new instance of TemperatureDeltaDto.
+ :rtype: TemperatureDeltaDto
+ """
+ return TemperatureDeltaDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: TemperatureDeltaUnits = TemperatureDeltaUnits.Kelvin):
+ """
+ Get a TemperatureDelta DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific TemperatureDelta unit to store the TemperatureDelta value in the DTO representation.
+ :type hold_in_unit: TemperatureDeltaUnits
+ :return: JSON object represents TemperatureDelta DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "Kelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(temperature_delta_dto: TemperatureDeltaDto):
+ """
+ Obtain a new instance of TemperatureDelta from a DTO unit object.
+
+ :param temperature_delta_dto: The TemperatureDelta DTO representation.
+ :type temperature_delta_dto: TemperatureDeltaDto
+ :return: A new instance of TemperatureDelta.
+ :rtype: TemperatureDelta
+ """
+ return TemperatureDelta(temperature_delta_dto.value, temperature_delta_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of TemperatureDelta from a DTO unit json representation.
+
+ :param data: The TemperatureDelta DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "Kelvin"}
+ :return: A new instance of TemperatureDelta.
+ :rtype: TemperatureDelta
+ """
+ return TemperatureDelta.from_dto(TemperatureDeltaDto.from_json(data))
+
def __convert_from_base(self, from_unit: TemperatureDeltaUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/temperature_gradient.py b/unitsnet_py/units/temperature_gradient.py
index dea4e3d..9996875 100644
--- a/unitsnet_py/units/temperature_gradient.py
+++ b/unitsnet_py/units/temperature_gradient.py
@@ -10,27 +10,77 @@ class TemperatureGradientUnits(Enum):
TemperatureGradientUnits enumeration
"""
- KelvinPerMeter = 'kelvin_per_meter'
+ KelvinPerMeter = 'KelvinPerMeter'
"""
"""
- DegreeCelsiusPerMeter = 'degree_celsius_per_meter'
+ DegreeCelsiusPerMeter = 'DegreeCelsiusPerMeter'
"""
"""
- DegreeFahrenheitPerFoot = 'degree_fahrenheit_per_foot'
+ DegreeFahrenheitPerFoot = 'DegreeFahrenheitPerFoot'
"""
"""
- DegreeCelsiusPerKilometer = 'degree_celsius_per_kilometer'
+ DegreeCelsiusPerKilometer = 'DegreeCelsiusPerKilometer'
"""
"""
+class TemperatureGradientDto:
+ """
+ A DTO representation of a TemperatureGradient
+
+ Attributes:
+ value (float): The value of the TemperatureGradient.
+ unit (TemperatureGradientUnits): The specific unit that the TemperatureGradient value is representing.
+ """
+
+ def __init__(self, value: float, unit: TemperatureGradientUnits):
+ """
+ Create a new DTO representation of a TemperatureGradient
+
+ Parameters:
+ value (float): The value of the TemperatureGradient.
+ unit (TemperatureGradientUnits): The specific unit that the TemperatureGradient value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the TemperatureGradient
+ """
+ self.unit: TemperatureGradientUnits = unit
+ """
+ The specific unit that the TemperatureGradient value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a TemperatureGradient DTO JSON object representing the current unit.
+
+ :return: JSON object represents TemperatureGradient DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KelvinPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of TemperatureGradient DTO from a json representation.
+
+ :param data: The TemperatureGradient DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KelvinPerMeter"}
+ :return: A new instance of TemperatureGradientDto.
+ :rtype: TemperatureGradientDto
+ """
+ return TemperatureGradientDto(value=data["value"], unit=TemperatureGradientUnits(data["unit"]))
+
+
class TemperatureGradient(AbstractMeasure):
"""
None
@@ -58,6 +108,54 @@ def __init__(self, value: float, from_unit: TemperatureGradientUnits = Temperatu
def convert(self, unit: TemperatureGradientUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: TemperatureGradientUnits = TemperatureGradientUnits.KelvinPerMeter) -> TemperatureGradientDto:
+ """
+ Get a new instance of TemperatureGradient DTO representing the current unit.
+
+ :param hold_in_unit: The specific TemperatureGradient unit to store the TemperatureGradient value in the DTO representation.
+ :type hold_in_unit: TemperatureGradientUnits
+ :return: A new instance of TemperatureGradientDto.
+ :rtype: TemperatureGradientDto
+ """
+ return TemperatureGradientDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: TemperatureGradientUnits = TemperatureGradientUnits.KelvinPerMeter):
+ """
+ Get a TemperatureGradient DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific TemperatureGradient unit to store the TemperatureGradient value in the DTO representation.
+ :type hold_in_unit: TemperatureGradientUnits
+ :return: JSON object represents TemperatureGradient DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "KelvinPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(temperature_gradient_dto: TemperatureGradientDto):
+ """
+ Obtain a new instance of TemperatureGradient from a DTO unit object.
+
+ :param temperature_gradient_dto: The TemperatureGradient DTO representation.
+ :type temperature_gradient_dto: TemperatureGradientDto
+ :return: A new instance of TemperatureGradient.
+ :rtype: TemperatureGradient
+ """
+ return TemperatureGradient(temperature_gradient_dto.value, temperature_gradient_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of TemperatureGradient from a DTO unit json representation.
+
+ :param data: The TemperatureGradient DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "KelvinPerMeter"}
+ :return: A new instance of TemperatureGradient.
+ :rtype: TemperatureGradient
+ """
+ return TemperatureGradient.from_dto(TemperatureGradientDto.from_json(data))
+
def __convert_from_base(self, from_unit: TemperatureGradientUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/thermal_conductivity.py b/unitsnet_py/units/thermal_conductivity.py
index 2f4a289..485d610 100644
--- a/unitsnet_py/units/thermal_conductivity.py
+++ b/unitsnet_py/units/thermal_conductivity.py
@@ -10,17 +10,67 @@ class ThermalConductivityUnits(Enum):
ThermalConductivityUnits enumeration
"""
- WattPerMeterKelvin = 'watt_per_meter_kelvin'
+ WattPerMeterKelvin = 'WattPerMeterKelvin'
"""
"""
- BtuPerHourFootFahrenheit = 'btu_per_hour_foot_fahrenheit'
+ BtuPerHourFootFahrenheit = 'BtuPerHourFootFahrenheit'
"""
"""
+class ThermalConductivityDto:
+ """
+ A DTO representation of a ThermalConductivity
+
+ Attributes:
+ value (float): The value of the ThermalConductivity.
+ unit (ThermalConductivityUnits): The specific unit that the ThermalConductivity value is representing.
+ """
+
+ def __init__(self, value: float, unit: ThermalConductivityUnits):
+ """
+ Create a new DTO representation of a ThermalConductivity
+
+ Parameters:
+ value (float): The value of the ThermalConductivity.
+ unit (ThermalConductivityUnits): The specific unit that the ThermalConductivity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ThermalConductivity
+ """
+ self.unit: ThermalConductivityUnits = unit
+ """
+ The specific unit that the ThermalConductivity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ThermalConductivity DTO JSON object representing the current unit.
+
+ :return: JSON object represents ThermalConductivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerMeterKelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ThermalConductivity DTO from a json representation.
+
+ :param data: The ThermalConductivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerMeterKelvin"}
+ :return: A new instance of ThermalConductivityDto.
+ :rtype: ThermalConductivityDto
+ """
+ return ThermalConductivityDto(value=data["value"], unit=ThermalConductivityUnits(data["unit"]))
+
+
class ThermalConductivity(AbstractMeasure):
"""
Thermal conductivity is the property of a material to conduct heat.
@@ -44,6 +94,54 @@ def __init__(self, value: float, from_unit: ThermalConductivityUnits = ThermalCo
def convert(self, unit: ThermalConductivityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ThermalConductivityUnits = ThermalConductivityUnits.WattPerMeterKelvin) -> ThermalConductivityDto:
+ """
+ Get a new instance of ThermalConductivity DTO representing the current unit.
+
+ :param hold_in_unit: The specific ThermalConductivity unit to store the ThermalConductivity value in the DTO representation.
+ :type hold_in_unit: ThermalConductivityUnits
+ :return: A new instance of ThermalConductivityDto.
+ :rtype: ThermalConductivityDto
+ """
+ return ThermalConductivityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ThermalConductivityUnits = ThermalConductivityUnits.WattPerMeterKelvin):
+ """
+ Get a ThermalConductivity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ThermalConductivity unit to store the ThermalConductivity value in the DTO representation.
+ :type hold_in_unit: ThermalConductivityUnits
+ :return: JSON object represents ThermalConductivity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "WattPerMeterKelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(thermal_conductivity_dto: ThermalConductivityDto):
+ """
+ Obtain a new instance of ThermalConductivity from a DTO unit object.
+
+ :param thermal_conductivity_dto: The ThermalConductivity DTO representation.
+ :type thermal_conductivity_dto: ThermalConductivityDto
+ :return: A new instance of ThermalConductivity.
+ :rtype: ThermalConductivity
+ """
+ return ThermalConductivity(thermal_conductivity_dto.value, thermal_conductivity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ThermalConductivity from a DTO unit json representation.
+
+ :param data: The ThermalConductivity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "WattPerMeterKelvin"}
+ :return: A new instance of ThermalConductivity.
+ :rtype: ThermalConductivity
+ """
+ return ThermalConductivity.from_dto(ThermalConductivityDto.from_json(data))
+
def __convert_from_base(self, from_unit: ThermalConductivityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/thermal_resistance.py b/unitsnet_py/units/thermal_resistance.py
index 1cbce7d..53d25e7 100644
--- a/unitsnet_py/units/thermal_resistance.py
+++ b/unitsnet_py/units/thermal_resistance.py
@@ -10,37 +10,87 @@ class ThermalResistanceUnits(Enum):
ThermalResistanceUnits enumeration
"""
- SquareMeterKelvinPerKilowatt = 'square_meter_kelvin_per_kilowatt'
+ SquareMeterKelvinPerKilowatt = 'SquareMeterKelvinPerKilowatt'
"""
"""
- SquareMeterKelvinPerWatt = 'square_meter_kelvin_per_watt'
+ SquareMeterKelvinPerWatt = 'SquareMeterKelvinPerWatt'
"""
"""
- SquareMeterDegreeCelsiusPerWatt = 'square_meter_degree_celsius_per_watt'
+ SquareMeterDegreeCelsiusPerWatt = 'SquareMeterDegreeCelsiusPerWatt'
"""
"""
- SquareCentimeterKelvinPerWatt = 'square_centimeter_kelvin_per_watt'
+ SquareCentimeterKelvinPerWatt = 'SquareCentimeterKelvinPerWatt'
"""
"""
- SquareCentimeterHourDegreeCelsiusPerKilocalorie = 'square_centimeter_hour_degree_celsius_per_kilocalorie'
+ SquareCentimeterHourDegreeCelsiusPerKilocalorie = 'SquareCentimeterHourDegreeCelsiusPerKilocalorie'
"""
"""
- HourSquareFeetDegreeFahrenheitPerBtu = 'hour_square_feet_degree_fahrenheit_per_btu'
+ HourSquareFeetDegreeFahrenheitPerBtu = 'HourSquareFeetDegreeFahrenheitPerBtu'
"""
"""
+class ThermalResistanceDto:
+ """
+ A DTO representation of a ThermalResistance
+
+ Attributes:
+ value (float): The value of the ThermalResistance.
+ unit (ThermalResistanceUnits): The specific unit that the ThermalResistance value is representing.
+ """
+
+ def __init__(self, value: float, unit: ThermalResistanceUnits):
+ """
+ Create a new DTO representation of a ThermalResistance
+
+ Parameters:
+ value (float): The value of the ThermalResistance.
+ unit (ThermalResistanceUnits): The specific unit that the ThermalResistance value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the ThermalResistance
+ """
+ self.unit: ThermalResistanceUnits = unit
+ """
+ The specific unit that the ThermalResistance value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a ThermalResistance DTO JSON object representing the current unit.
+
+ :return: JSON object represents ThermalResistance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeterKelvinPerKilowatt"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of ThermalResistance DTO from a json representation.
+
+ :param data: The ThermalResistance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeterKelvinPerKilowatt"}
+ :return: A new instance of ThermalResistanceDto.
+ :rtype: ThermalResistanceDto
+ """
+ return ThermalResistanceDto(value=data["value"], unit=ThermalResistanceUnits(data["unit"]))
+
+
class ThermalResistance(AbstractMeasure):
"""
Heat Transfer Coefficient or Thermal conductivity - indicates a materials ability to conduct heat.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: ThermalResistanceUnits = ThermalResi
def convert(self, unit: ThermalResistanceUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: ThermalResistanceUnits = ThermalResistanceUnits.SquareMeterKelvinPerKilowatt) -> ThermalResistanceDto:
+ """
+ Get a new instance of ThermalResistance DTO representing the current unit.
+
+ :param hold_in_unit: The specific ThermalResistance unit to store the ThermalResistance value in the DTO representation.
+ :type hold_in_unit: ThermalResistanceUnits
+ :return: A new instance of ThermalResistanceDto.
+ :rtype: ThermalResistanceDto
+ """
+ return ThermalResistanceDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: ThermalResistanceUnits = ThermalResistanceUnits.SquareMeterKelvinPerKilowatt):
+ """
+ Get a ThermalResistance DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific ThermalResistance unit to store the ThermalResistance value in the DTO representation.
+ :type hold_in_unit: ThermalResistanceUnits
+ :return: JSON object represents ThermalResistance DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "SquareMeterKelvinPerKilowatt"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(thermal_resistance_dto: ThermalResistanceDto):
+ """
+ Obtain a new instance of ThermalResistance from a DTO unit object.
+
+ :param thermal_resistance_dto: The ThermalResistance DTO representation.
+ :type thermal_resistance_dto: ThermalResistanceDto
+ :return: A new instance of ThermalResistance.
+ :rtype: ThermalResistance
+ """
+ return ThermalResistance(thermal_resistance_dto.value, thermal_resistance_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of ThermalResistance from a DTO unit json representation.
+
+ :param data: The ThermalResistance DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "SquareMeterKelvinPerKilowatt"}
+ :return: A new instance of ThermalResistance.
+ :rtype: ThermalResistance
+ """
+ return ThermalResistance.from_dto(ThermalResistanceDto.from_json(data))
+
def __convert_from_base(self, from_unit: ThermalResistanceUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/torque.py b/unitsnet_py/units/torque.py
index 2e44708..0d79850 100644
--- a/unitsnet_py/units/torque.py
+++ b/unitsnet_py/units/torque.py
@@ -10,132 +10,182 @@ class TorqueUnits(Enum):
TorqueUnits enumeration
"""
- NewtonMillimeter = 'newton_millimeter'
+ NewtonMillimeter = 'NewtonMillimeter'
"""
"""
- NewtonCentimeter = 'newton_centimeter'
+ NewtonCentimeter = 'NewtonCentimeter'
"""
"""
- NewtonMeter = 'newton_meter'
+ NewtonMeter = 'NewtonMeter'
"""
"""
- PoundalFoot = 'poundal_foot'
+ PoundalFoot = 'PoundalFoot'
"""
"""
- PoundForceInch = 'pound_force_inch'
+ PoundForceInch = 'PoundForceInch'
"""
"""
- PoundForceFoot = 'pound_force_foot'
+ PoundForceFoot = 'PoundForceFoot'
"""
"""
- GramForceMillimeter = 'gram_force_millimeter'
+ GramForceMillimeter = 'GramForceMillimeter'
"""
"""
- GramForceCentimeter = 'gram_force_centimeter'
+ GramForceCentimeter = 'GramForceCentimeter'
"""
"""
- GramForceMeter = 'gram_force_meter'
+ GramForceMeter = 'GramForceMeter'
"""
"""
- KilogramForceMillimeter = 'kilogram_force_millimeter'
+ KilogramForceMillimeter = 'KilogramForceMillimeter'
"""
"""
- KilogramForceCentimeter = 'kilogram_force_centimeter'
+ KilogramForceCentimeter = 'KilogramForceCentimeter'
"""
"""
- KilogramForceMeter = 'kilogram_force_meter'
+ KilogramForceMeter = 'KilogramForceMeter'
"""
"""
- TonneForceMillimeter = 'tonne_force_millimeter'
+ TonneForceMillimeter = 'TonneForceMillimeter'
"""
"""
- TonneForceCentimeter = 'tonne_force_centimeter'
+ TonneForceCentimeter = 'TonneForceCentimeter'
"""
"""
- TonneForceMeter = 'tonne_force_meter'
+ TonneForceMeter = 'TonneForceMeter'
"""
"""
- KilonewtonMillimeter = 'kilonewton_millimeter'
+ KilonewtonMillimeter = 'KilonewtonMillimeter'
"""
"""
- MeganewtonMillimeter = 'meganewton_millimeter'
+ MeganewtonMillimeter = 'MeganewtonMillimeter'
"""
"""
- KilonewtonCentimeter = 'kilonewton_centimeter'
+ KilonewtonCentimeter = 'KilonewtonCentimeter'
"""
"""
- MeganewtonCentimeter = 'meganewton_centimeter'
+ MeganewtonCentimeter = 'MeganewtonCentimeter'
"""
"""
- KilonewtonMeter = 'kilonewton_meter'
+ KilonewtonMeter = 'KilonewtonMeter'
"""
"""
- MeganewtonMeter = 'meganewton_meter'
+ MeganewtonMeter = 'MeganewtonMeter'
"""
"""
- KilopoundForceInch = 'kilopound_force_inch'
+ KilopoundForceInch = 'KilopoundForceInch'
"""
"""
- MegapoundForceInch = 'megapound_force_inch'
+ MegapoundForceInch = 'MegapoundForceInch'
"""
"""
- KilopoundForceFoot = 'kilopound_force_foot'
+ KilopoundForceFoot = 'KilopoundForceFoot'
"""
"""
- MegapoundForceFoot = 'megapound_force_foot'
+ MegapoundForceFoot = 'MegapoundForceFoot'
"""
"""
+class TorqueDto:
+ """
+ A DTO representation of a Torque
+
+ Attributes:
+ value (float): The value of the Torque.
+ unit (TorqueUnits): The specific unit that the Torque value is representing.
+ """
+
+ def __init__(self, value: float, unit: TorqueUnits):
+ """
+ Create a new DTO representation of a Torque
+
+ Parameters:
+ value (float): The value of the Torque.
+ unit (TorqueUnits): The specific unit that the Torque value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Torque
+ """
+ self.unit: TorqueUnits = unit
+ """
+ The specific unit that the Torque value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Torque DTO JSON object representing the current unit.
+
+ :return: JSON object represents Torque DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Torque DTO from a json representation.
+
+ :param data: The Torque DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeter"}
+ :return: A new instance of TorqueDto.
+ :rtype: TorqueDto
+ """
+ return TorqueDto(value=data["value"], unit=TorqueUnits(data["unit"]))
+
+
class Torque(AbstractMeasure):
"""
Torque, moment or moment of force (see the terminology below), is the tendency of a force to rotate an object about an axis,[1] fulcrum, or pivot. Just as a force is a push or a pull, a torque can be thought of as a twist to an object. Mathematically, torque is defined as the cross product of the lever-arm distance and force, which tends to produce rotation. Loosely speaking, torque is a measure of the turning force on an object such as a bolt or a flywheel. For example, pushing or pulling the handle of a wrench connected to a nut or bolt produces a torque (turning force) that loosens or tightens the nut or bolt.
@@ -205,6 +255,54 @@ def __init__(self, value: float, from_unit: TorqueUnits = TorqueUnits.NewtonMete
def convert(self, unit: TorqueUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: TorqueUnits = TorqueUnits.NewtonMeter) -> TorqueDto:
+ """
+ Get a new instance of Torque DTO representing the current unit.
+
+ :param hold_in_unit: The specific Torque unit to store the Torque value in the DTO representation.
+ :type hold_in_unit: TorqueUnits
+ :return: A new instance of TorqueDto.
+ :rtype: TorqueDto
+ """
+ return TorqueDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: TorqueUnits = TorqueUnits.NewtonMeter):
+ """
+ Get a Torque DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Torque unit to store the Torque value in the DTO representation.
+ :type hold_in_unit: TorqueUnits
+ :return: JSON object represents Torque DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(torque_dto: TorqueDto):
+ """
+ Obtain a new instance of Torque from a DTO unit object.
+
+ :param torque_dto: The Torque DTO representation.
+ :type torque_dto: TorqueDto
+ :return: A new instance of Torque.
+ :rtype: Torque
+ """
+ return Torque(torque_dto.value, torque_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Torque from a DTO unit json representation.
+
+ :param data: The Torque DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeter"}
+ :return: A new instance of Torque.
+ :rtype: Torque
+ """
+ return Torque.from_dto(TorqueDto.from_json(data))
+
def __convert_from_base(self, from_unit: TorqueUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/torque_per_length.py b/unitsnet_py/units/torque_per_length.py
index 3870354..7a291ba 100644
--- a/unitsnet_py/units/torque_per_length.py
+++ b/unitsnet_py/units/torque_per_length.py
@@ -10,112 +10,162 @@ class TorquePerLengthUnits(Enum):
TorquePerLengthUnits enumeration
"""
- NewtonMillimeterPerMeter = 'newton_millimeter_per_meter'
+ NewtonMillimeterPerMeter = 'NewtonMillimeterPerMeter'
"""
"""
- NewtonCentimeterPerMeter = 'newton_centimeter_per_meter'
+ NewtonCentimeterPerMeter = 'NewtonCentimeterPerMeter'
"""
"""
- NewtonMeterPerMeter = 'newton_meter_per_meter'
+ NewtonMeterPerMeter = 'NewtonMeterPerMeter'
"""
"""
- PoundForceInchPerFoot = 'pound_force_inch_per_foot'
+ PoundForceInchPerFoot = 'PoundForceInchPerFoot'
"""
"""
- PoundForceFootPerFoot = 'pound_force_foot_per_foot'
+ PoundForceFootPerFoot = 'PoundForceFootPerFoot'
"""
"""
- KilogramForceMillimeterPerMeter = 'kilogram_force_millimeter_per_meter'
+ KilogramForceMillimeterPerMeter = 'KilogramForceMillimeterPerMeter'
"""
"""
- KilogramForceCentimeterPerMeter = 'kilogram_force_centimeter_per_meter'
+ KilogramForceCentimeterPerMeter = 'KilogramForceCentimeterPerMeter'
"""
"""
- KilogramForceMeterPerMeter = 'kilogram_force_meter_per_meter'
+ KilogramForceMeterPerMeter = 'KilogramForceMeterPerMeter'
"""
"""
- TonneForceMillimeterPerMeter = 'tonne_force_millimeter_per_meter'
+ TonneForceMillimeterPerMeter = 'TonneForceMillimeterPerMeter'
"""
"""
- TonneForceCentimeterPerMeter = 'tonne_force_centimeter_per_meter'
+ TonneForceCentimeterPerMeter = 'TonneForceCentimeterPerMeter'
"""
"""
- TonneForceMeterPerMeter = 'tonne_force_meter_per_meter'
+ TonneForceMeterPerMeter = 'TonneForceMeterPerMeter'
"""
"""
- KilonewtonMillimeterPerMeter = 'kilonewton_millimeter_per_meter'
+ KilonewtonMillimeterPerMeter = 'KilonewtonMillimeterPerMeter'
"""
"""
- MeganewtonMillimeterPerMeter = 'meganewton_millimeter_per_meter'
+ MeganewtonMillimeterPerMeter = 'MeganewtonMillimeterPerMeter'
"""
"""
- KilonewtonCentimeterPerMeter = 'kilonewton_centimeter_per_meter'
+ KilonewtonCentimeterPerMeter = 'KilonewtonCentimeterPerMeter'
"""
"""
- MeganewtonCentimeterPerMeter = 'meganewton_centimeter_per_meter'
+ MeganewtonCentimeterPerMeter = 'MeganewtonCentimeterPerMeter'
"""
"""
- KilonewtonMeterPerMeter = 'kilonewton_meter_per_meter'
+ KilonewtonMeterPerMeter = 'KilonewtonMeterPerMeter'
"""
"""
- MeganewtonMeterPerMeter = 'meganewton_meter_per_meter'
+ MeganewtonMeterPerMeter = 'MeganewtonMeterPerMeter'
"""
"""
- KilopoundForceInchPerFoot = 'kilopound_force_inch_per_foot'
+ KilopoundForceInchPerFoot = 'KilopoundForceInchPerFoot'
"""
"""
- MegapoundForceInchPerFoot = 'megapound_force_inch_per_foot'
+ MegapoundForceInchPerFoot = 'MegapoundForceInchPerFoot'
"""
"""
- KilopoundForceFootPerFoot = 'kilopound_force_foot_per_foot'
+ KilopoundForceFootPerFoot = 'KilopoundForceFootPerFoot'
"""
"""
- MegapoundForceFootPerFoot = 'megapound_force_foot_per_foot'
+ MegapoundForceFootPerFoot = 'MegapoundForceFootPerFoot'
"""
"""
+class TorquePerLengthDto:
+ """
+ A DTO representation of a TorquePerLength
+
+ Attributes:
+ value (float): The value of the TorquePerLength.
+ unit (TorquePerLengthUnits): The specific unit that the TorquePerLength value is representing.
+ """
+
+ def __init__(self, value: float, unit: TorquePerLengthUnits):
+ """
+ Create a new DTO representation of a TorquePerLength
+
+ Parameters:
+ value (float): The value of the TorquePerLength.
+ unit (TorquePerLengthUnits): The specific unit that the TorquePerLength value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the TorquePerLength
+ """
+ self.unit: TorquePerLengthUnits = unit
+ """
+ The specific unit that the TorquePerLength value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a TorquePerLength DTO JSON object representing the current unit.
+
+ :return: JSON object represents TorquePerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeterPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of TorquePerLength DTO from a json representation.
+
+ :param data: The TorquePerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeterPerMeter"}
+ :return: A new instance of TorquePerLengthDto.
+ :rtype: TorquePerLengthDto
+ """
+ return TorquePerLengthDto(value=data["value"], unit=TorquePerLengthUnits(data["unit"]))
+
+
class TorquePerLength(AbstractMeasure):
"""
The magnitude of torque per unit length.
@@ -177,6 +227,54 @@ def __init__(self, value: float, from_unit: TorquePerLengthUnits = TorquePerLeng
def convert(self, unit: TorquePerLengthUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: TorquePerLengthUnits = TorquePerLengthUnits.NewtonMeterPerMeter) -> TorquePerLengthDto:
+ """
+ Get a new instance of TorquePerLength DTO representing the current unit.
+
+ :param hold_in_unit: The specific TorquePerLength unit to store the TorquePerLength value in the DTO representation.
+ :type hold_in_unit: TorquePerLengthUnits
+ :return: A new instance of TorquePerLengthDto.
+ :rtype: TorquePerLengthDto
+ """
+ return TorquePerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: TorquePerLengthUnits = TorquePerLengthUnits.NewtonMeterPerMeter):
+ """
+ Get a TorquePerLength DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific TorquePerLength unit to store the TorquePerLength value in the DTO representation.
+ :type hold_in_unit: TorquePerLengthUnits
+ :return: JSON object represents TorquePerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NewtonMeterPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(torque_per_length_dto: TorquePerLengthDto):
+ """
+ Obtain a new instance of TorquePerLength from a DTO unit object.
+
+ :param torque_per_length_dto: The TorquePerLength DTO representation.
+ :type torque_per_length_dto: TorquePerLengthDto
+ :return: A new instance of TorquePerLength.
+ :rtype: TorquePerLength
+ """
+ return TorquePerLength(torque_per_length_dto.value, torque_per_length_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of TorquePerLength from a DTO unit json representation.
+
+ :param data: The TorquePerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NewtonMeterPerMeter"}
+ :return: A new instance of TorquePerLength.
+ :rtype: TorquePerLength
+ """
+ return TorquePerLength.from_dto(TorquePerLengthDto.from_json(data))
+
def __convert_from_base(self, from_unit: TorquePerLengthUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/turbidity.py b/unitsnet_py/units/turbidity.py
index 0a0240a..c307e2d 100644
--- a/unitsnet_py/units/turbidity.py
+++ b/unitsnet_py/units/turbidity.py
@@ -10,12 +10,62 @@ class TurbidityUnits(Enum):
TurbidityUnits enumeration
"""
- NTU = 'ntu'
+ NTU = 'NTU'
"""
"""
+class TurbidityDto:
+ """
+ A DTO representation of a Turbidity
+
+ Attributes:
+ value (float): The value of the Turbidity.
+ unit (TurbidityUnits): The specific unit that the Turbidity value is representing.
+ """
+
+ def __init__(self, value: float, unit: TurbidityUnits):
+ """
+ Create a new DTO representation of a Turbidity
+
+ Parameters:
+ value (float): The value of the Turbidity.
+ unit (TurbidityUnits): The specific unit that the Turbidity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Turbidity
+ """
+ self.unit: TurbidityUnits = unit
+ """
+ The specific unit that the Turbidity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Turbidity DTO JSON object representing the current unit.
+
+ :return: JSON object represents Turbidity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NTU"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Turbidity DTO from a json representation.
+
+ :param data: The Turbidity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NTU"}
+ :return: A new instance of TurbidityDto.
+ :rtype: TurbidityDto
+ """
+ return TurbidityDto(value=data["value"], unit=TurbidityUnits(data["unit"]))
+
+
class Turbidity(AbstractMeasure):
"""
Turbidity is the cloudiness or haziness of a fluid caused by large numbers of individual particles that are generally invisible to the naked eye, similar to smoke in air. The measurement of turbidity is a key test of water quality.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: TurbidityUnits = TurbidityUnits.NTU)
def convert(self, unit: TurbidityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: TurbidityUnits = TurbidityUnits.NTU) -> TurbidityDto:
+ """
+ Get a new instance of Turbidity DTO representing the current unit.
+
+ :param hold_in_unit: The specific Turbidity unit to store the Turbidity value in the DTO representation.
+ :type hold_in_unit: TurbidityUnits
+ :return: A new instance of TurbidityDto.
+ :rtype: TurbidityDto
+ """
+ return TurbidityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: TurbidityUnits = TurbidityUnits.NTU):
+ """
+ Get a Turbidity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Turbidity unit to store the Turbidity value in the DTO representation.
+ :type hold_in_unit: TurbidityUnits
+ :return: JSON object represents Turbidity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "NTU"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(turbidity_dto: TurbidityDto):
+ """
+ Obtain a new instance of Turbidity from a DTO unit object.
+
+ :param turbidity_dto: The Turbidity DTO representation.
+ :type turbidity_dto: TurbidityDto
+ :return: A new instance of Turbidity.
+ :rtype: Turbidity
+ """
+ return Turbidity(turbidity_dto.value, turbidity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Turbidity from a DTO unit json representation.
+
+ :param data: The Turbidity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "NTU"}
+ :return: A new instance of Turbidity.
+ :rtype: Turbidity
+ """
+ return Turbidity.from_dto(TurbidityDto.from_json(data))
+
def __convert_from_base(self, from_unit: TurbidityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/vitamin_a.py b/unitsnet_py/units/vitamin_a.py
index 38f9d10..c06c004 100644
--- a/unitsnet_py/units/vitamin_a.py
+++ b/unitsnet_py/units/vitamin_a.py
@@ -10,12 +10,62 @@ class VitaminAUnits(Enum):
VitaminAUnits enumeration
"""
- InternationalUnit = 'international_unit'
+ InternationalUnit = 'InternationalUnit'
"""
"""
+class VitaminADto:
+ """
+ A DTO representation of a VitaminA
+
+ Attributes:
+ value (float): The value of the VitaminA.
+ unit (VitaminAUnits): The specific unit that the VitaminA value is representing.
+ """
+
+ def __init__(self, value: float, unit: VitaminAUnits):
+ """
+ Create a new DTO representation of a VitaminA
+
+ Parameters:
+ value (float): The value of the VitaminA.
+ unit (VitaminAUnits): The specific unit that the VitaminA value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the VitaminA
+ """
+ self.unit: VitaminAUnits = unit
+ """
+ The specific unit that the VitaminA value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a VitaminA DTO JSON object representing the current unit.
+
+ :return: JSON object represents VitaminA DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InternationalUnit"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of VitaminA DTO from a json representation.
+
+ :param data: The VitaminA DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InternationalUnit"}
+ :return: A new instance of VitaminADto.
+ :rtype: VitaminADto
+ """
+ return VitaminADto(value=data["value"], unit=VitaminAUnits(data["unit"]))
+
+
class VitaminA(AbstractMeasure):
"""
Vitamin A: 1 IU is the biological equivalent of 0.3 µg retinol, or of 0.6 µg beta-carotene.
@@ -37,6 +87,54 @@ def __init__(self, value: float, from_unit: VitaminAUnits = VitaminAUnits.Intern
def convert(self, unit: VitaminAUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: VitaminAUnits = VitaminAUnits.InternationalUnit) -> VitaminADto:
+ """
+ Get a new instance of VitaminA DTO representing the current unit.
+
+ :param hold_in_unit: The specific VitaminA unit to store the VitaminA value in the DTO representation.
+ :type hold_in_unit: VitaminAUnits
+ :return: A new instance of VitaminADto.
+ :rtype: VitaminADto
+ """
+ return VitaminADto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: VitaminAUnits = VitaminAUnits.InternationalUnit):
+ """
+ Get a VitaminA DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific VitaminA unit to store the VitaminA value in the DTO representation.
+ :type hold_in_unit: VitaminAUnits
+ :return: JSON object represents VitaminA DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "InternationalUnit"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(vitamin_a_dto: VitaminADto):
+ """
+ Obtain a new instance of VitaminA from a DTO unit object.
+
+ :param vitamin_a_dto: The VitaminA DTO representation.
+ :type vitamin_a_dto: VitaminADto
+ :return: A new instance of VitaminA.
+ :rtype: VitaminA
+ """
+ return VitaminA(vitamin_a_dto.value, vitamin_a_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of VitaminA from a DTO unit json representation.
+
+ :param data: The VitaminA DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "InternationalUnit"}
+ :return: A new instance of VitaminA.
+ :rtype: VitaminA
+ """
+ return VitaminA.from_dto(VitaminADto.from_json(data))
+
def __convert_from_base(self, from_unit: VitaminAUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/volume.py b/unitsnet_py/units/volume.py
index 8492d12..d3acf13 100644
--- a/unitsnet_py/units/volume.py
+++ b/unitsnet_py/units/volume.py
@@ -10,277 +10,327 @@ class VolumeUnits(Enum):
VolumeUnits enumeration
"""
- Liter = 'liter'
+ Liter = 'Liter'
"""
"""
- CubicMeter = 'cubic_meter'
+ CubicMeter = 'CubicMeter'
"""
"""
- CubicKilometer = 'cubic_kilometer'
+ CubicKilometer = 'CubicKilometer'
"""
"""
- CubicHectometer = 'cubic_hectometer'
+ CubicHectometer = 'CubicHectometer'
"""
"""
- CubicDecimeter = 'cubic_decimeter'
+ CubicDecimeter = 'CubicDecimeter'
"""
"""
- CubicCentimeter = 'cubic_centimeter'
+ CubicCentimeter = 'CubicCentimeter'
"""
"""
- CubicMillimeter = 'cubic_millimeter'
+ CubicMillimeter = 'CubicMillimeter'
"""
"""
- CubicMicrometer = 'cubic_micrometer'
+ CubicMicrometer = 'CubicMicrometer'
"""
"""
- CubicMile = 'cubic_mile'
+ CubicMile = 'CubicMile'
"""
"""
- CubicYard = 'cubic_yard'
+ CubicYard = 'CubicYard'
"""
"""
- CubicFoot = 'cubic_foot'
+ CubicFoot = 'CubicFoot'
"""
"""
- CubicInch = 'cubic_inch'
+ CubicInch = 'CubicInch'
"""
"""
- ImperialGallon = 'imperial_gallon'
+ ImperialGallon = 'ImperialGallon'
"""
The British imperial gallon (frequently called simply "gallon") is defined as exactly 4.54609 litres.
"""
- ImperialOunce = 'imperial_ounce'
+ ImperialOunce = 'ImperialOunce'
"""
"""
- UsGallon = 'us_gallon'
+ UsGallon = 'UsGallon'
"""
The US liquid gallon (frequently called simply "gallon") is legally defined as 231 cubic inches, which is exactly 3.785411784 litres.
"""
- UsOunce = 'us_ounce'
+ UsOunce = 'UsOunce'
"""
"""
- UsTablespoon = 'us_tablespoon'
+ UsTablespoon = 'UsTablespoon'
"""
"""
- AuTablespoon = 'au_tablespoon'
+ AuTablespoon = 'AuTablespoon'
"""
"""
- UkTablespoon = 'uk_tablespoon'
+ UkTablespoon = 'UkTablespoon'
"""
"""
- MetricTeaspoon = 'metric_teaspoon'
+ MetricTeaspoon = 'MetricTeaspoon'
"""
"""
- UsTeaspoon = 'us_teaspoon'
+ UsTeaspoon = 'UsTeaspoon'
"""
"""
- MetricCup = 'metric_cup'
+ MetricCup = 'MetricCup'
"""
"""
- UsCustomaryCup = 'us_customary_cup'
+ UsCustomaryCup = 'UsCustomaryCup'
"""
"""
- UsLegalCup = 'us_legal_cup'
+ UsLegalCup = 'UsLegalCup'
"""
"""
- OilBarrel = 'oil_barrel'
+ OilBarrel = 'OilBarrel'
"""
"""
- UsBeerBarrel = 'us_beer_barrel'
+ UsBeerBarrel = 'UsBeerBarrel'
"""
"""
- ImperialBeerBarrel = 'imperial_beer_barrel'
+ ImperialBeerBarrel = 'ImperialBeerBarrel'
"""
"""
- UsQuart = 'us_quart'
+ UsQuart = 'UsQuart'
"""
"""
- ImperialQuart = 'imperial_quart'
+ ImperialQuart = 'ImperialQuart'
"""
"""
- UsPint = 'us_pint'
+ UsPint = 'UsPint'
"""
"""
- AcreFoot = 'acre_foot'
+ AcreFoot = 'AcreFoot'
"""
"""
- ImperialPint = 'imperial_pint'
+ ImperialPint = 'ImperialPint'
"""
"""
- BoardFoot = 'board_foot'
+ BoardFoot = 'BoardFoot'
"""
"""
- Nanoliter = 'nanoliter'
+ Nanoliter = 'Nanoliter'
"""
"""
- Microliter = 'microliter'
+ Microliter = 'Microliter'
"""
"""
- Milliliter = 'milliliter'
+ Milliliter = 'Milliliter'
"""
"""
- Centiliter = 'centiliter'
+ Centiliter = 'Centiliter'
"""
"""
- Deciliter = 'deciliter'
+ Deciliter = 'Deciliter'
"""
"""
- Decaliter = 'decaliter'
+ Decaliter = 'Decaliter'
"""
"""
- Hectoliter = 'hectoliter'
+ Hectoliter = 'Hectoliter'
"""
"""
- Kiloliter = 'kiloliter'
+ Kiloliter = 'Kiloliter'
"""
"""
- Megaliter = 'megaliter'
+ Megaliter = 'Megaliter'
"""
"""
- HectocubicMeter = 'hectocubic_meter'
+ HectocubicMeter = 'HectocubicMeter'
"""
"""
- KilocubicMeter = 'kilocubic_meter'
+ KilocubicMeter = 'KilocubicMeter'
"""
"""
- HectocubicFoot = 'hectocubic_foot'
+ HectocubicFoot = 'HectocubicFoot'
"""
"""
- KilocubicFoot = 'kilocubic_foot'
+ KilocubicFoot = 'KilocubicFoot'
"""
"""
- MegacubicFoot = 'megacubic_foot'
+ MegacubicFoot = 'MegacubicFoot'
"""
"""
- KiloimperialGallon = 'kiloimperial_gallon'
+ KiloimperialGallon = 'KiloimperialGallon'
"""
"""
- MegaimperialGallon = 'megaimperial_gallon'
+ MegaimperialGallon = 'MegaimperialGallon'
"""
"""
- DecausGallon = 'decaus_gallon'
+ DecausGallon = 'DecausGallon'
"""
"""
- DeciusGallon = 'decius_gallon'
+ DeciusGallon = 'DeciusGallon'
"""
"""
- HectousGallon = 'hectous_gallon'
+ HectousGallon = 'HectousGallon'
"""
"""
- KilousGallon = 'kilous_gallon'
+ KilousGallon = 'KilousGallon'
"""
"""
- MegausGallon = 'megaus_gallon'
+ MegausGallon = 'MegausGallon'
"""
"""
+class VolumeDto:
+ """
+ A DTO representation of a Volume
+
+ Attributes:
+ value (float): The value of the Volume.
+ unit (VolumeUnits): The specific unit that the Volume value is representing.
+ """
+
+ def __init__(self, value: float, unit: VolumeUnits):
+ """
+ Create a new DTO representation of a Volume
+
+ Parameters:
+ value (float): The value of the Volume.
+ unit (VolumeUnits): The specific unit that the Volume value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the Volume
+ """
+ self.unit: VolumeUnits = unit
+ """
+ The specific unit that the Volume value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a Volume DTO JSON object representing the current unit.
+
+ :return: JSON object represents Volume DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of Volume DTO from a json representation.
+
+ :param data: The Volume DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeter"}
+ :return: A new instance of VolumeDto.
+ :rtype: VolumeDto
+ """
+ return VolumeDto(value=data["value"], unit=VolumeUnits(data["unit"]))
+
+
class Volume(AbstractMeasure):
"""
Volume is the quantity of three-dimensional space enclosed by some closed boundary, for example, the space that a substance (solid, liquid, gas, or plasma) or shape occupies or contains.[1] Volume is often quantified numerically using the SI derived unit, the cubic metre. The volume of a container is generally understood to be the capacity of the container, i. e. the amount of fluid (gas or liquid) that the container could hold, rather than the amount of space the container itself displaces.
@@ -408,6 +458,54 @@ def __init__(self, value: float, from_unit: VolumeUnits = VolumeUnits.CubicMeter
def convert(self, unit: VolumeUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: VolumeUnits = VolumeUnits.CubicMeter) -> VolumeDto:
+ """
+ Get a new instance of Volume DTO representing the current unit.
+
+ :param hold_in_unit: The specific Volume unit to store the Volume value in the DTO representation.
+ :type hold_in_unit: VolumeUnits
+ :return: A new instance of VolumeDto.
+ :rtype: VolumeDto
+ """
+ return VolumeDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: VolumeUnits = VolumeUnits.CubicMeter):
+ """
+ Get a Volume DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific Volume unit to store the Volume value in the DTO representation.
+ :type hold_in_unit: VolumeUnits
+ :return: JSON object represents Volume DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(volume_dto: VolumeDto):
+ """
+ Obtain a new instance of Volume from a DTO unit object.
+
+ :param volume_dto: The Volume DTO representation.
+ :type volume_dto: VolumeDto
+ :return: A new instance of Volume.
+ :rtype: Volume
+ """
+ return Volume(volume_dto.value, volume_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of Volume from a DTO unit json representation.
+
+ :param data: The Volume DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeter"}
+ :return: A new instance of Volume.
+ :rtype: Volume
+ """
+ return Volume.from_dto(VolumeDto.from_json(data))
+
def __convert_from_base(self, from_unit: VolumeUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/volume_concentration.py b/unitsnet_py/units/volume_concentration.py
index facd426..a77817f 100644
--- a/unitsnet_py/units/volume_concentration.py
+++ b/unitsnet_py/units/volume_concentration.py
@@ -10,107 +10,157 @@ class VolumeConcentrationUnits(Enum):
VolumeConcentrationUnits enumeration
"""
- DecimalFraction = 'decimal_fraction'
+ DecimalFraction = 'DecimalFraction'
"""
"""
- LitersPerLiter = 'liters_per_liter'
+ LitersPerLiter = 'LitersPerLiter'
"""
"""
- LitersPerMililiter = 'liters_per_mililiter'
+ LitersPerMililiter = 'LitersPerMililiter'
"""
"""
- Percent = 'percent'
+ Percent = 'Percent'
"""
"""
- PartPerThousand = 'part_per_thousand'
+ PartPerThousand = 'PartPerThousand'
"""
"""
- PartPerMillion = 'part_per_million'
+ PartPerMillion = 'PartPerMillion'
"""
"""
- PartPerBillion = 'part_per_billion'
+ PartPerBillion = 'PartPerBillion'
"""
"""
- PartPerTrillion = 'part_per_trillion'
+ PartPerTrillion = 'PartPerTrillion'
"""
"""
- PicolitersPerLiter = 'picoliters_per_liter'
+ PicolitersPerLiter = 'PicolitersPerLiter'
"""
"""
- NanolitersPerLiter = 'nanoliters_per_liter'
+ NanolitersPerLiter = 'NanolitersPerLiter'
"""
"""
- MicrolitersPerLiter = 'microliters_per_liter'
+ MicrolitersPerLiter = 'MicrolitersPerLiter'
"""
"""
- MillilitersPerLiter = 'milliliters_per_liter'
+ MillilitersPerLiter = 'MillilitersPerLiter'
"""
"""
- CentilitersPerLiter = 'centiliters_per_liter'
+ CentilitersPerLiter = 'CentilitersPerLiter'
"""
"""
- DecilitersPerLiter = 'deciliters_per_liter'
+ DecilitersPerLiter = 'DecilitersPerLiter'
"""
"""
- PicolitersPerMililiter = 'picoliters_per_mililiter'
+ PicolitersPerMililiter = 'PicolitersPerMililiter'
"""
"""
- NanolitersPerMililiter = 'nanoliters_per_mililiter'
+ NanolitersPerMililiter = 'NanolitersPerMililiter'
"""
"""
- MicrolitersPerMililiter = 'microliters_per_mililiter'
+ MicrolitersPerMililiter = 'MicrolitersPerMililiter'
"""
"""
- MillilitersPerMililiter = 'milliliters_per_mililiter'
+ MillilitersPerMililiter = 'MillilitersPerMililiter'
"""
"""
- CentilitersPerMililiter = 'centiliters_per_mililiter'
+ CentilitersPerMililiter = 'CentilitersPerMililiter'
"""
"""
- DecilitersPerMililiter = 'deciliters_per_mililiter'
+ DecilitersPerMililiter = 'DecilitersPerMililiter'
"""
"""
+class VolumeConcentrationDto:
+ """
+ A DTO representation of a VolumeConcentration
+
+ Attributes:
+ value (float): The value of the VolumeConcentration.
+ unit (VolumeConcentrationUnits): The specific unit that the VolumeConcentration value is representing.
+ """
+
+ def __init__(self, value: float, unit: VolumeConcentrationUnits):
+ """
+ Create a new DTO representation of a VolumeConcentration
+
+ Parameters:
+ value (float): The value of the VolumeConcentration.
+ unit (VolumeConcentrationUnits): The specific unit that the VolumeConcentration value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the VolumeConcentration
+ """
+ self.unit: VolumeConcentrationUnits = unit
+ """
+ The specific unit that the VolumeConcentration value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a VolumeConcentration DTO JSON object representing the current unit.
+
+ :return: JSON object represents VolumeConcentration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFraction"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of VolumeConcentration DTO from a json representation.
+
+ :param data: The VolumeConcentration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFraction"}
+ :return: A new instance of VolumeConcentrationDto.
+ :rtype: VolumeConcentrationDto
+ """
+ return VolumeConcentrationDto(value=data["value"], unit=VolumeConcentrationUnits(data["unit"]))
+
+
class VolumeConcentration(AbstractMeasure):
"""
The volume concentration (not to be confused with volume fraction) is defined as the volume of a constituent divided by the total volume of the mixture.
@@ -170,6 +220,54 @@ def __init__(self, value: float, from_unit: VolumeConcentrationUnits = VolumeCon
def convert(self, unit: VolumeConcentrationUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: VolumeConcentrationUnits = VolumeConcentrationUnits.DecimalFraction) -> VolumeConcentrationDto:
+ """
+ Get a new instance of VolumeConcentration DTO representing the current unit.
+
+ :param hold_in_unit: The specific VolumeConcentration unit to store the VolumeConcentration value in the DTO representation.
+ :type hold_in_unit: VolumeConcentrationUnits
+ :return: A new instance of VolumeConcentrationDto.
+ :rtype: VolumeConcentrationDto
+ """
+ return VolumeConcentrationDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: VolumeConcentrationUnits = VolumeConcentrationUnits.DecimalFraction):
+ """
+ Get a VolumeConcentration DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific VolumeConcentration unit to store the VolumeConcentration value in the DTO representation.
+ :type hold_in_unit: VolumeConcentrationUnits
+ :return: JSON object represents VolumeConcentration DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "DecimalFraction"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(volume_concentration_dto: VolumeConcentrationDto):
+ """
+ Obtain a new instance of VolumeConcentration from a DTO unit object.
+
+ :param volume_concentration_dto: The VolumeConcentration DTO representation.
+ :type volume_concentration_dto: VolumeConcentrationDto
+ :return: A new instance of VolumeConcentration.
+ :rtype: VolumeConcentration
+ """
+ return VolumeConcentration(volume_concentration_dto.value, volume_concentration_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of VolumeConcentration from a DTO unit json representation.
+
+ :param data: The VolumeConcentration DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "DecimalFraction"}
+ :return: A new instance of VolumeConcentration.
+ :rtype: VolumeConcentration
+ """
+ return VolumeConcentration.from_dto(VolumeConcentrationDto.from_json(data))
+
def __convert_from_base(self, from_unit: VolumeConcentrationUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/volume_flow.py b/unitsnet_py/units/volume_flow.py
index 191dcd7..6e0f54f 100644
--- a/unitsnet_py/units/volume_flow.py
+++ b/unitsnet_py/units/volume_flow.py
@@ -10,382 +10,432 @@ class VolumeFlowUnits(Enum):
VolumeFlowUnits enumeration
"""
- CubicMeterPerSecond = 'cubic_meter_per_second'
+ CubicMeterPerSecond = 'CubicMeterPerSecond'
"""
"""
- CubicMeterPerMinute = 'cubic_meter_per_minute'
+ CubicMeterPerMinute = 'CubicMeterPerMinute'
"""
"""
- CubicMeterPerHour = 'cubic_meter_per_hour'
+ CubicMeterPerHour = 'CubicMeterPerHour'
"""
"""
- CubicMeterPerDay = 'cubic_meter_per_day'
+ CubicMeterPerDay = 'CubicMeterPerDay'
"""
"""
- CubicFootPerSecond = 'cubic_foot_per_second'
+ CubicFootPerSecond = 'CubicFootPerSecond'
"""
"""
- CubicFootPerMinute = 'cubic_foot_per_minute'
+ CubicFootPerMinute = 'CubicFootPerMinute'
"""
"""
- CubicFootPerHour = 'cubic_foot_per_hour'
+ CubicFootPerHour = 'CubicFootPerHour'
"""
"""
- CubicYardPerSecond = 'cubic_yard_per_second'
+ CubicYardPerSecond = 'CubicYardPerSecond'
"""
"""
- CubicYardPerMinute = 'cubic_yard_per_minute'
+ CubicYardPerMinute = 'CubicYardPerMinute'
"""
"""
- CubicYardPerHour = 'cubic_yard_per_hour'
+ CubicYardPerHour = 'CubicYardPerHour'
"""
"""
- CubicYardPerDay = 'cubic_yard_per_day'
+ CubicYardPerDay = 'CubicYardPerDay'
"""
"""
- MillionUsGallonPerDay = 'million_us_gallon_per_day'
+ MillionUsGallonPerDay = 'MillionUsGallonPerDay'
"""
"""
- UsGallonPerDay = 'us_gallon_per_day'
+ UsGallonPerDay = 'UsGallonPerDay'
"""
"""
- LiterPerSecond = 'liter_per_second'
+ LiterPerSecond = 'LiterPerSecond'
"""
"""
- LiterPerMinute = 'liter_per_minute'
+ LiterPerMinute = 'LiterPerMinute'
"""
"""
- LiterPerHour = 'liter_per_hour'
+ LiterPerHour = 'LiterPerHour'
"""
"""
- LiterPerDay = 'liter_per_day'
+ LiterPerDay = 'LiterPerDay'
"""
"""
- UsGallonPerSecond = 'us_gallon_per_second'
+ UsGallonPerSecond = 'UsGallonPerSecond'
"""
"""
- UsGallonPerMinute = 'us_gallon_per_minute'
+ UsGallonPerMinute = 'UsGallonPerMinute'
"""
"""
- UkGallonPerDay = 'uk_gallon_per_day'
+ UkGallonPerDay = 'UkGallonPerDay'
"""
"""
- UkGallonPerHour = 'uk_gallon_per_hour'
+ UkGallonPerHour = 'UkGallonPerHour'
"""
"""
- UkGallonPerMinute = 'uk_gallon_per_minute'
+ UkGallonPerMinute = 'UkGallonPerMinute'
"""
"""
- UkGallonPerSecond = 'uk_gallon_per_second'
+ UkGallonPerSecond = 'UkGallonPerSecond'
"""
"""
- KilousGallonPerMinute = 'kilous_gallon_per_minute'
+ KilousGallonPerMinute = 'KilousGallonPerMinute'
"""
"""
- UsGallonPerHour = 'us_gallon_per_hour'
+ UsGallonPerHour = 'UsGallonPerHour'
"""
"""
- CubicDecimeterPerMinute = 'cubic_decimeter_per_minute'
+ CubicDecimeterPerMinute = 'CubicDecimeterPerMinute'
"""
"""
- OilBarrelPerDay = 'oil_barrel_per_day'
+ OilBarrelPerDay = 'OilBarrelPerDay'
"""
"""
- OilBarrelPerMinute = 'oil_barrel_per_minute'
+ OilBarrelPerMinute = 'OilBarrelPerMinute'
"""
"""
- OilBarrelPerHour = 'oil_barrel_per_hour'
+ OilBarrelPerHour = 'OilBarrelPerHour'
"""
"""
- OilBarrelPerSecond = 'oil_barrel_per_second'
+ OilBarrelPerSecond = 'OilBarrelPerSecond'
"""
"""
- CubicMillimeterPerSecond = 'cubic_millimeter_per_second'
+ CubicMillimeterPerSecond = 'CubicMillimeterPerSecond'
"""
"""
- AcreFootPerSecond = 'acre_foot_per_second'
+ AcreFootPerSecond = 'AcreFootPerSecond'
"""
"""
- AcreFootPerMinute = 'acre_foot_per_minute'
+ AcreFootPerMinute = 'AcreFootPerMinute'
"""
"""
- AcreFootPerHour = 'acre_foot_per_hour'
+ AcreFootPerHour = 'AcreFootPerHour'
"""
"""
- AcreFootPerDay = 'acre_foot_per_day'
+ AcreFootPerDay = 'AcreFootPerDay'
"""
"""
- CubicCentimeterPerMinute = 'cubic_centimeter_per_minute'
+ CubicCentimeterPerMinute = 'CubicCentimeterPerMinute'
"""
"""
- MegausGallonPerDay = 'megaus_gallon_per_day'
+ MegausGallonPerDay = 'MegausGallonPerDay'
"""
"""
- NanoliterPerSecond = 'nanoliter_per_second'
+ NanoliterPerSecond = 'NanoliterPerSecond'
"""
"""
- MicroliterPerSecond = 'microliter_per_second'
+ MicroliterPerSecond = 'MicroliterPerSecond'
"""
"""
- MilliliterPerSecond = 'milliliter_per_second'
+ MilliliterPerSecond = 'MilliliterPerSecond'
"""
"""
- CentiliterPerSecond = 'centiliter_per_second'
+ CentiliterPerSecond = 'CentiliterPerSecond'
"""
"""
- DeciliterPerSecond = 'deciliter_per_second'
+ DeciliterPerSecond = 'DeciliterPerSecond'
"""
"""
- DecaliterPerSecond = 'decaliter_per_second'
+ DecaliterPerSecond = 'DecaliterPerSecond'
"""
"""
- HectoliterPerSecond = 'hectoliter_per_second'
+ HectoliterPerSecond = 'HectoliterPerSecond'
"""
"""
- KiloliterPerSecond = 'kiloliter_per_second'
+ KiloliterPerSecond = 'KiloliterPerSecond'
"""
"""
- MegaliterPerSecond = 'megaliter_per_second'
+ MegaliterPerSecond = 'MegaliterPerSecond'
"""
"""
- NanoliterPerMinute = 'nanoliter_per_minute'
+ NanoliterPerMinute = 'NanoliterPerMinute'
"""
"""
- MicroliterPerMinute = 'microliter_per_minute'
+ MicroliterPerMinute = 'MicroliterPerMinute'
"""
"""
- MilliliterPerMinute = 'milliliter_per_minute'
+ MilliliterPerMinute = 'MilliliterPerMinute'
"""
"""
- CentiliterPerMinute = 'centiliter_per_minute'
+ CentiliterPerMinute = 'CentiliterPerMinute'
"""
"""
- DeciliterPerMinute = 'deciliter_per_minute'
+ DeciliterPerMinute = 'DeciliterPerMinute'
"""
"""
- DecaliterPerMinute = 'decaliter_per_minute'
+ DecaliterPerMinute = 'DecaliterPerMinute'
"""
"""
- HectoliterPerMinute = 'hectoliter_per_minute'
+ HectoliterPerMinute = 'HectoliterPerMinute'
"""
"""
- KiloliterPerMinute = 'kiloliter_per_minute'
+ KiloliterPerMinute = 'KiloliterPerMinute'
"""
"""
- MegaliterPerMinute = 'megaliter_per_minute'
+ MegaliterPerMinute = 'MegaliterPerMinute'
"""
"""
- NanoliterPerHour = 'nanoliter_per_hour'
+ NanoliterPerHour = 'NanoliterPerHour'
"""
"""
- MicroliterPerHour = 'microliter_per_hour'
+ MicroliterPerHour = 'MicroliterPerHour'
"""
"""
- MilliliterPerHour = 'milliliter_per_hour'
+ MilliliterPerHour = 'MilliliterPerHour'
"""
"""
- CentiliterPerHour = 'centiliter_per_hour'
+ CentiliterPerHour = 'CentiliterPerHour'
"""
"""
- DeciliterPerHour = 'deciliter_per_hour'
+ DeciliterPerHour = 'DeciliterPerHour'
"""
"""
- DecaliterPerHour = 'decaliter_per_hour'
+ DecaliterPerHour = 'DecaliterPerHour'
"""
"""
- HectoliterPerHour = 'hectoliter_per_hour'
+ HectoliterPerHour = 'HectoliterPerHour'
"""
"""
- KiloliterPerHour = 'kiloliter_per_hour'
+ KiloliterPerHour = 'KiloliterPerHour'
"""
"""
- MegaliterPerHour = 'megaliter_per_hour'
+ MegaliterPerHour = 'MegaliterPerHour'
"""
"""
- NanoliterPerDay = 'nanoliter_per_day'
+ NanoliterPerDay = 'NanoliterPerDay'
"""
"""
- MicroliterPerDay = 'microliter_per_day'
+ MicroliterPerDay = 'MicroliterPerDay'
"""
"""
- MilliliterPerDay = 'milliliter_per_day'
+ MilliliterPerDay = 'MilliliterPerDay'
"""
"""
- CentiliterPerDay = 'centiliter_per_day'
+ CentiliterPerDay = 'CentiliterPerDay'
"""
"""
- DeciliterPerDay = 'deciliter_per_day'
+ DeciliterPerDay = 'DeciliterPerDay'
"""
"""
- DecaliterPerDay = 'decaliter_per_day'
+ DecaliterPerDay = 'DecaliterPerDay'
"""
"""
- HectoliterPerDay = 'hectoliter_per_day'
+ HectoliterPerDay = 'HectoliterPerDay'
"""
"""
- KiloliterPerDay = 'kiloliter_per_day'
+ KiloliterPerDay = 'KiloliterPerDay'
"""
"""
- MegaliterPerDay = 'megaliter_per_day'
+ MegaliterPerDay = 'MegaliterPerDay'
"""
"""
- MegaukGallonPerDay = 'megauk_gallon_per_day'
+ MegaukGallonPerDay = 'MegaukGallonPerDay'
"""
"""
- MegaukGallonPerSecond = 'megauk_gallon_per_second'
+ MegaukGallonPerSecond = 'MegaukGallonPerSecond'
"""
"""
+class VolumeFlowDto:
+ """
+ A DTO representation of a VolumeFlow
+
+ Attributes:
+ value (float): The value of the VolumeFlow.
+ unit (VolumeFlowUnits): The specific unit that the VolumeFlow value is representing.
+ """
+
+ def __init__(self, value: float, unit: VolumeFlowUnits):
+ """
+ Create a new DTO representation of a VolumeFlow
+
+ Parameters:
+ value (float): The value of the VolumeFlow.
+ unit (VolumeFlowUnits): The specific unit that the VolumeFlow value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the VolumeFlow
+ """
+ self.unit: VolumeFlowUnits = unit
+ """
+ The specific unit that the VolumeFlow value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a VolumeFlow DTO JSON object representing the current unit.
+
+ :return: JSON object represents VolumeFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerSecond"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of VolumeFlow DTO from a json representation.
+
+ :param data: The VolumeFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerSecond"}
+ :return: A new instance of VolumeFlowDto.
+ :rtype: VolumeFlowDto
+ """
+ return VolumeFlowDto(value=data["value"], unit=VolumeFlowUnits(data["unit"]))
+
+
class VolumeFlow(AbstractMeasure):
"""
In physics and engineering, in particular fluid dynamics and hydrometry, the volumetric flow rate, (also known as volume flow rate, rate of fluid flow or volume velocity) is the volume of fluid which passes through a given surface per unit time. The SI unit is m³/s (cubic meters per second). In US Customary Units and British Imperial Units, volumetric flow rate is often expressed as ft³/s (cubic feet per second). It is usually represented by the symbol Q.
@@ -555,6 +605,54 @@ def __init__(self, value: float, from_unit: VolumeFlowUnits = VolumeFlowUnits.Cu
def convert(self, unit: VolumeFlowUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: VolumeFlowUnits = VolumeFlowUnits.CubicMeterPerSecond) -> VolumeFlowDto:
+ """
+ Get a new instance of VolumeFlow DTO representing the current unit.
+
+ :param hold_in_unit: The specific VolumeFlow unit to store the VolumeFlow value in the DTO representation.
+ :type hold_in_unit: VolumeFlowUnits
+ :return: A new instance of VolumeFlowDto.
+ :rtype: VolumeFlowDto
+ """
+ return VolumeFlowDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: VolumeFlowUnits = VolumeFlowUnits.CubicMeterPerSecond):
+ """
+ Get a VolumeFlow DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific VolumeFlow unit to store the VolumeFlow value in the DTO representation.
+ :type hold_in_unit: VolumeFlowUnits
+ :return: JSON object represents VolumeFlow DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerSecond"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(volume_flow_dto: VolumeFlowDto):
+ """
+ Obtain a new instance of VolumeFlow from a DTO unit object.
+
+ :param volume_flow_dto: The VolumeFlow DTO representation.
+ :type volume_flow_dto: VolumeFlowDto
+ :return: A new instance of VolumeFlow.
+ :rtype: VolumeFlow
+ """
+ return VolumeFlow(volume_flow_dto.value, volume_flow_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of VolumeFlow from a DTO unit json representation.
+
+ :param data: The VolumeFlow DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerSecond"}
+ :return: A new instance of VolumeFlow.
+ :rtype: VolumeFlow
+ """
+ return VolumeFlow.from_dto(VolumeFlowDto.from_json(data))
+
def __convert_from_base(self, from_unit: VolumeFlowUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/volume_flow_per_area.py b/unitsnet_py/units/volume_flow_per_area.py
index cf974a7..32f2b13 100644
--- a/unitsnet_py/units/volume_flow_per_area.py
+++ b/unitsnet_py/units/volume_flow_per_area.py
@@ -10,17 +10,67 @@ class VolumeFlowPerAreaUnits(Enum):
VolumeFlowPerAreaUnits enumeration
"""
- CubicMeterPerSecondPerSquareMeter = 'cubic_meter_per_second_per_square_meter'
+ CubicMeterPerSecondPerSquareMeter = 'CubicMeterPerSecondPerSquareMeter'
"""
"""
- CubicFootPerMinutePerSquareFoot = 'cubic_foot_per_minute_per_square_foot'
+ CubicFootPerMinutePerSquareFoot = 'CubicFootPerMinutePerSquareFoot'
"""
"""
+class VolumeFlowPerAreaDto:
+ """
+ A DTO representation of a VolumeFlowPerArea
+
+ Attributes:
+ value (float): The value of the VolumeFlowPerArea.
+ unit (VolumeFlowPerAreaUnits): The specific unit that the VolumeFlowPerArea value is representing.
+ """
+
+ def __init__(self, value: float, unit: VolumeFlowPerAreaUnits):
+ """
+ Create a new DTO representation of a VolumeFlowPerArea
+
+ Parameters:
+ value (float): The value of the VolumeFlowPerArea.
+ unit (VolumeFlowPerAreaUnits): The specific unit that the VolumeFlowPerArea value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the VolumeFlowPerArea
+ """
+ self.unit: VolumeFlowPerAreaUnits = unit
+ """
+ The specific unit that the VolumeFlowPerArea value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a VolumeFlowPerArea DTO JSON object representing the current unit.
+
+ :return: JSON object represents VolumeFlowPerArea DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerSecondPerSquareMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of VolumeFlowPerArea DTO from a json representation.
+
+ :param data: The VolumeFlowPerArea DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerSecondPerSquareMeter"}
+ :return: A new instance of VolumeFlowPerAreaDto.
+ :rtype: VolumeFlowPerAreaDto
+ """
+ return VolumeFlowPerAreaDto(value=data["value"], unit=VolumeFlowPerAreaUnits(data["unit"]))
+
+
class VolumeFlowPerArea(AbstractMeasure):
"""
None
@@ -44,6 +94,54 @@ def __init__(self, value: float, from_unit: VolumeFlowPerAreaUnits = VolumeFlowP
def convert(self, unit: VolumeFlowPerAreaUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: VolumeFlowPerAreaUnits = VolumeFlowPerAreaUnits.CubicMeterPerSecondPerSquareMeter) -> VolumeFlowPerAreaDto:
+ """
+ Get a new instance of VolumeFlowPerArea DTO representing the current unit.
+
+ :param hold_in_unit: The specific VolumeFlowPerArea unit to store the VolumeFlowPerArea value in the DTO representation.
+ :type hold_in_unit: VolumeFlowPerAreaUnits
+ :return: A new instance of VolumeFlowPerAreaDto.
+ :rtype: VolumeFlowPerAreaDto
+ """
+ return VolumeFlowPerAreaDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: VolumeFlowPerAreaUnits = VolumeFlowPerAreaUnits.CubicMeterPerSecondPerSquareMeter):
+ """
+ Get a VolumeFlowPerArea DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific VolumeFlowPerArea unit to store the VolumeFlowPerArea value in the DTO representation.
+ :type hold_in_unit: VolumeFlowPerAreaUnits
+ :return: JSON object represents VolumeFlowPerArea DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerSecondPerSquareMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(volume_flow_per_area_dto: VolumeFlowPerAreaDto):
+ """
+ Obtain a new instance of VolumeFlowPerArea from a DTO unit object.
+
+ :param volume_flow_per_area_dto: The VolumeFlowPerArea DTO representation.
+ :type volume_flow_per_area_dto: VolumeFlowPerAreaDto
+ :return: A new instance of VolumeFlowPerArea.
+ :rtype: VolumeFlowPerArea
+ """
+ return VolumeFlowPerArea(volume_flow_per_area_dto.value, volume_flow_per_area_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of VolumeFlowPerArea from a DTO unit json representation.
+
+ :param data: The VolumeFlowPerArea DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerSecondPerSquareMeter"}
+ :return: A new instance of VolumeFlowPerArea.
+ :rtype: VolumeFlowPerArea
+ """
+ return VolumeFlowPerArea.from_dto(VolumeFlowPerAreaDto.from_json(data))
+
def __convert_from_base(self, from_unit: VolumeFlowPerAreaUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/volume_per_length.py b/unitsnet_py/units/volume_per_length.py
index 2a7f919..0d91825 100644
--- a/unitsnet_py/units/volume_per_length.py
+++ b/unitsnet_py/units/volume_per_length.py
@@ -10,52 +10,102 @@ class VolumePerLengthUnits(Enum):
VolumePerLengthUnits enumeration
"""
- CubicMeterPerMeter = 'cubic_meter_per_meter'
+ CubicMeterPerMeter = 'CubicMeterPerMeter'
"""
"""
- LiterPerMeter = 'liter_per_meter'
+ LiterPerMeter = 'LiterPerMeter'
"""
"""
- LiterPerKilometer = 'liter_per_kilometer'
+ LiterPerKilometer = 'LiterPerKilometer'
"""
"""
- LiterPerMillimeter = 'liter_per_millimeter'
+ LiterPerMillimeter = 'LiterPerMillimeter'
"""
"""
- OilBarrelPerFoot = 'oil_barrel_per_foot'
+ OilBarrelPerFoot = 'OilBarrelPerFoot'
"""
"""
- CubicYardPerFoot = 'cubic_yard_per_foot'
+ CubicYardPerFoot = 'CubicYardPerFoot'
"""
"""
- CubicYardPerUsSurveyFoot = 'cubic_yard_per_us_survey_foot'
+ CubicYardPerUsSurveyFoot = 'CubicYardPerUsSurveyFoot'
"""
"""
- UsGallonPerMile = 'us_gallon_per_mile'
+ UsGallonPerMile = 'UsGallonPerMile'
"""
"""
- ImperialGallonPerMile = 'imperial_gallon_per_mile'
+ ImperialGallonPerMile = 'ImperialGallonPerMile'
"""
"""
+class VolumePerLengthDto:
+ """
+ A DTO representation of a VolumePerLength
+
+ Attributes:
+ value (float): The value of the VolumePerLength.
+ unit (VolumePerLengthUnits): The specific unit that the VolumePerLength value is representing.
+ """
+
+ def __init__(self, value: float, unit: VolumePerLengthUnits):
+ """
+ Create a new DTO representation of a VolumePerLength
+
+ Parameters:
+ value (float): The value of the VolumePerLength.
+ unit (VolumePerLengthUnits): The specific unit that the VolumePerLength value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the VolumePerLength
+ """
+ self.unit: VolumePerLengthUnits = unit
+ """
+ The specific unit that the VolumePerLength value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a VolumePerLength DTO JSON object representing the current unit.
+
+ :return: JSON object represents VolumePerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerMeter"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of VolumePerLength DTO from a json representation.
+
+ :param data: The VolumePerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerMeter"}
+ :return: A new instance of VolumePerLengthDto.
+ :rtype: VolumePerLengthDto
+ """
+ return VolumePerLengthDto(value=data["value"], unit=VolumePerLengthUnits(data["unit"]))
+
+
class VolumePerLength(AbstractMeasure):
"""
Volume, typically of fluid, that a container can hold within a unit of length.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: VolumePerLengthUnits = VolumePerLeng
def convert(self, unit: VolumePerLengthUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: VolumePerLengthUnits = VolumePerLengthUnits.CubicMeterPerMeter) -> VolumePerLengthDto:
+ """
+ Get a new instance of VolumePerLength DTO representing the current unit.
+
+ :param hold_in_unit: The specific VolumePerLength unit to store the VolumePerLength value in the DTO representation.
+ :type hold_in_unit: VolumePerLengthUnits
+ :return: A new instance of VolumePerLengthDto.
+ :rtype: VolumePerLengthDto
+ """
+ return VolumePerLengthDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: VolumePerLengthUnits = VolumePerLengthUnits.CubicMeterPerMeter):
+ """
+ Get a VolumePerLength DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific VolumePerLength unit to store the VolumePerLength value in the DTO representation.
+ :type hold_in_unit: VolumePerLengthUnits
+ :return: JSON object represents VolumePerLength DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "CubicMeterPerMeter"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(volume_per_length_dto: VolumePerLengthDto):
+ """
+ Obtain a new instance of VolumePerLength from a DTO unit object.
+
+ :param volume_per_length_dto: The VolumePerLength DTO representation.
+ :type volume_per_length_dto: VolumePerLengthDto
+ :return: A new instance of VolumePerLength.
+ :rtype: VolumePerLength
+ """
+ return VolumePerLength(volume_per_length_dto.value, volume_per_length_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of VolumePerLength from a DTO unit json representation.
+
+ :param data: The VolumePerLength DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "CubicMeterPerMeter"}
+ :return: A new instance of VolumePerLength.
+ :rtype: VolumePerLength
+ """
+ return VolumePerLength.from_dto(VolumePerLengthDto.from_json(data))
+
def __convert_from_base(self, from_unit: VolumePerLengthUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/volumetric_heat_capacity.py b/unitsnet_py/units/volumetric_heat_capacity.py
index 3c6a4e1..8388e61 100644
--- a/unitsnet_py/units/volumetric_heat_capacity.py
+++ b/unitsnet_py/units/volumetric_heat_capacity.py
@@ -10,52 +10,102 @@ class VolumetricHeatCapacityUnits(Enum):
VolumetricHeatCapacityUnits enumeration
"""
- JoulePerCubicMeterKelvin = 'joule_per_cubic_meter_kelvin'
+ JoulePerCubicMeterKelvin = 'JoulePerCubicMeterKelvin'
"""
"""
- JoulePerCubicMeterDegreeCelsius = 'joule_per_cubic_meter_degree_celsius'
+ JoulePerCubicMeterDegreeCelsius = 'JoulePerCubicMeterDegreeCelsius'
"""
"""
- CaloriePerCubicCentimeterDegreeCelsius = 'calorie_per_cubic_centimeter_degree_celsius'
+ CaloriePerCubicCentimeterDegreeCelsius = 'CaloriePerCubicCentimeterDegreeCelsius'
"""
"""
- BtuPerCubicFootDegreeFahrenheit = 'btu_per_cubic_foot_degree_fahrenheit'
+ BtuPerCubicFootDegreeFahrenheit = 'BtuPerCubicFootDegreeFahrenheit'
"""
"""
- KilojoulePerCubicMeterKelvin = 'kilojoule_per_cubic_meter_kelvin'
+ KilojoulePerCubicMeterKelvin = 'KilojoulePerCubicMeterKelvin'
"""
"""
- MegajoulePerCubicMeterKelvin = 'megajoule_per_cubic_meter_kelvin'
+ MegajoulePerCubicMeterKelvin = 'MegajoulePerCubicMeterKelvin'
"""
"""
- KilojoulePerCubicMeterDegreeCelsius = 'kilojoule_per_cubic_meter_degree_celsius'
+ KilojoulePerCubicMeterDegreeCelsius = 'KilojoulePerCubicMeterDegreeCelsius'
"""
"""
- MegajoulePerCubicMeterDegreeCelsius = 'megajoule_per_cubic_meter_degree_celsius'
+ MegajoulePerCubicMeterDegreeCelsius = 'MegajoulePerCubicMeterDegreeCelsius'
"""
"""
- KilocaloriePerCubicCentimeterDegreeCelsius = 'kilocalorie_per_cubic_centimeter_degree_celsius'
+ KilocaloriePerCubicCentimeterDegreeCelsius = 'KilocaloriePerCubicCentimeterDegreeCelsius'
"""
"""
+class VolumetricHeatCapacityDto:
+ """
+ A DTO representation of a VolumetricHeatCapacity
+
+ Attributes:
+ value (float): The value of the VolumetricHeatCapacity.
+ unit (VolumetricHeatCapacityUnits): The specific unit that the VolumetricHeatCapacity value is representing.
+ """
+
+ def __init__(self, value: float, unit: VolumetricHeatCapacityUnits):
+ """
+ Create a new DTO representation of a VolumetricHeatCapacity
+
+ Parameters:
+ value (float): The value of the VolumetricHeatCapacity.
+ unit (VolumetricHeatCapacityUnits): The specific unit that the VolumetricHeatCapacity value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the VolumetricHeatCapacity
+ """
+ self.unit: VolumetricHeatCapacityUnits = unit
+ """
+ The specific unit that the VolumetricHeatCapacity value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a VolumetricHeatCapacity DTO JSON object representing the current unit.
+
+ :return: JSON object represents VolumetricHeatCapacity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerCubicMeterKelvin"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of VolumetricHeatCapacity DTO from a json representation.
+
+ :param data: The VolumetricHeatCapacity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerCubicMeterKelvin"}
+ :return: A new instance of VolumetricHeatCapacityDto.
+ :rtype: VolumetricHeatCapacityDto
+ """
+ return VolumetricHeatCapacityDto(value=data["value"], unit=VolumetricHeatCapacityUnits(data["unit"]))
+
+
class VolumetricHeatCapacity(AbstractMeasure):
"""
The volumetric heat capacity is the amount of energy that must be added, in the form of heat, to one unit of volume of the material in order to cause an increase of one unit in its temperature.
@@ -93,6 +143,54 @@ def __init__(self, value: float, from_unit: VolumetricHeatCapacityUnits = Volume
def convert(self, unit: VolumetricHeatCapacityUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: VolumetricHeatCapacityUnits = VolumetricHeatCapacityUnits.JoulePerCubicMeterKelvin) -> VolumetricHeatCapacityDto:
+ """
+ Get a new instance of VolumetricHeatCapacity DTO representing the current unit.
+
+ :param hold_in_unit: The specific VolumetricHeatCapacity unit to store the VolumetricHeatCapacity value in the DTO representation.
+ :type hold_in_unit: VolumetricHeatCapacityUnits
+ :return: A new instance of VolumetricHeatCapacityDto.
+ :rtype: VolumetricHeatCapacityDto
+ """
+ return VolumetricHeatCapacityDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: VolumetricHeatCapacityUnits = VolumetricHeatCapacityUnits.JoulePerCubicMeterKelvin):
+ """
+ Get a VolumetricHeatCapacity DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific VolumetricHeatCapacity unit to store the VolumetricHeatCapacity value in the DTO representation.
+ :type hold_in_unit: VolumetricHeatCapacityUnits
+ :return: JSON object represents VolumetricHeatCapacity DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "JoulePerCubicMeterKelvin"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(volumetric_heat_capacity_dto: VolumetricHeatCapacityDto):
+ """
+ Obtain a new instance of VolumetricHeatCapacity from a DTO unit object.
+
+ :param volumetric_heat_capacity_dto: The VolumetricHeatCapacity DTO representation.
+ :type volumetric_heat_capacity_dto: VolumetricHeatCapacityDto
+ :return: A new instance of VolumetricHeatCapacity.
+ :rtype: VolumetricHeatCapacity
+ """
+ return VolumetricHeatCapacity(volumetric_heat_capacity_dto.value, volumetric_heat_capacity_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of VolumetricHeatCapacity from a DTO unit json representation.
+
+ :param data: The VolumetricHeatCapacity DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "JoulePerCubicMeterKelvin"}
+ :return: A new instance of VolumetricHeatCapacity.
+ :rtype: VolumetricHeatCapacity
+ """
+ return VolumetricHeatCapacity.from_dto(VolumetricHeatCapacityDto.from_json(data))
+
def __convert_from_base(self, from_unit: VolumetricHeatCapacityUnits) -> float:
value = self._value
diff --git a/unitsnet_py/units/warping_moment_of_inertia.py b/unitsnet_py/units/warping_moment_of_inertia.py
index 24783b6..cebe882 100644
--- a/unitsnet_py/units/warping_moment_of_inertia.py
+++ b/unitsnet_py/units/warping_moment_of_inertia.py
@@ -10,37 +10,87 @@ class WarpingMomentOfInertiaUnits(Enum):
WarpingMomentOfInertiaUnits enumeration
"""
- MeterToTheSixth = 'meter_to_the_sixth'
+ MeterToTheSixth = 'MeterToTheSixth'
"""
"""
- DecimeterToTheSixth = 'decimeter_to_the_sixth'
+ DecimeterToTheSixth = 'DecimeterToTheSixth'
"""
"""
- CentimeterToTheSixth = 'centimeter_to_the_sixth'
+ CentimeterToTheSixth = 'CentimeterToTheSixth'
"""
"""
- MillimeterToTheSixth = 'millimeter_to_the_sixth'
+ MillimeterToTheSixth = 'MillimeterToTheSixth'
"""
"""
- FootToTheSixth = 'foot_to_the_sixth'
+ FootToTheSixth = 'FootToTheSixth'
"""
"""
- InchToTheSixth = 'inch_to_the_sixth'
+ InchToTheSixth = 'InchToTheSixth'
"""
"""
+class WarpingMomentOfInertiaDto:
+ """
+ A DTO representation of a WarpingMomentOfInertia
+
+ Attributes:
+ value (float): The value of the WarpingMomentOfInertia.
+ unit (WarpingMomentOfInertiaUnits): The specific unit that the WarpingMomentOfInertia value is representing.
+ """
+
+ def __init__(self, value: float, unit: WarpingMomentOfInertiaUnits):
+ """
+ Create a new DTO representation of a WarpingMomentOfInertia
+
+ Parameters:
+ value (float): The value of the WarpingMomentOfInertia.
+ unit (WarpingMomentOfInertiaUnits): The specific unit that the WarpingMomentOfInertia value is representing.
+ """
+ self.value: float = value
+ """
+ The value of the WarpingMomentOfInertia
+ """
+ self.unit: WarpingMomentOfInertiaUnits = unit
+ """
+ The specific unit that the WarpingMomentOfInertia value is representing
+ """
+
+ def to_json(self):
+ """
+ Get a WarpingMomentOfInertia DTO JSON object representing the current unit.
+
+ :return: JSON object represents WarpingMomentOfInertia DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterToTheSixth"}
+ """
+ return {"value": self.value, "unit": self.unit.value}
+
+ @staticmethod
+ def from_json(data):
+ """
+ Obtain a new instance of WarpingMomentOfInertia DTO from a json representation.
+
+ :param data: The WarpingMomentOfInertia DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterToTheSixth"}
+ :return: A new instance of WarpingMomentOfInertiaDto.
+ :rtype: WarpingMomentOfInertiaDto
+ """
+ return WarpingMomentOfInertiaDto(value=data["value"], unit=WarpingMomentOfInertiaUnits(data["unit"]))
+
+
class WarpingMomentOfInertia(AbstractMeasure):
"""
A geometric property of an area that is used to determine the warping stress.
@@ -72,6 +122,54 @@ def __init__(self, value: float, from_unit: WarpingMomentOfInertiaUnits = Warpin
def convert(self, unit: WarpingMomentOfInertiaUnits) -> float:
return self.__convert_from_base(unit)
+ def to_dto(self, hold_in_unit: WarpingMomentOfInertiaUnits = WarpingMomentOfInertiaUnits.MeterToTheSixth) -> WarpingMomentOfInertiaDto:
+ """
+ Get a new instance of WarpingMomentOfInertia DTO representing the current unit.
+
+ :param hold_in_unit: The specific WarpingMomentOfInertia unit to store the WarpingMomentOfInertia value in the DTO representation.
+ :type hold_in_unit: WarpingMomentOfInertiaUnits
+ :return: A new instance of WarpingMomentOfInertiaDto.
+ :rtype: WarpingMomentOfInertiaDto
+ """
+ return WarpingMomentOfInertiaDto(value=self.convert(hold_in_unit), unit=hold_in_unit)
+
+ def to_dto_json(self, hold_in_unit: WarpingMomentOfInertiaUnits = WarpingMomentOfInertiaUnits.MeterToTheSixth):
+ """
+ Get a WarpingMomentOfInertia DTO JSON object representing the current unit.
+
+ :param hold_in_unit: The specific WarpingMomentOfInertia unit to store the WarpingMomentOfInertia value in the DTO representation.
+ :type hold_in_unit: WarpingMomentOfInertiaUnits
+ :return: JSON object represents WarpingMomentOfInertia DTO.
+ :rtype: dict
+ :example return: {"value": 100, "unit": "MeterToTheSixth"}
+ """
+ return self.to_dto(hold_in_unit).to_json()
+
+ @staticmethod
+ def from_dto(warping_moment_of_inertia_dto: WarpingMomentOfInertiaDto):
+ """
+ Obtain a new instance of WarpingMomentOfInertia from a DTO unit object.
+
+ :param warping_moment_of_inertia_dto: The WarpingMomentOfInertia DTO representation.
+ :type warping_moment_of_inertia_dto: WarpingMomentOfInertiaDto
+ :return: A new instance of WarpingMomentOfInertia.
+ :rtype: WarpingMomentOfInertia
+ """
+ return WarpingMomentOfInertia(warping_moment_of_inertia_dto.value, warping_moment_of_inertia_dto.unit)
+
+ @staticmethod
+ def from_dto_json(data: dict):
+ """
+ Obtain a new instance of WarpingMomentOfInertia from a DTO unit json representation.
+
+ :param data: The WarpingMomentOfInertia DTO in JSON representation.
+ :type data: dict
+ :example data: {"value": 100, "unit": "MeterToTheSixth"}
+ :return: A new instance of WarpingMomentOfInertia.
+ :rtype: WarpingMomentOfInertia
+ """
+ return WarpingMomentOfInertia.from_dto(WarpingMomentOfInertiaDto.from_json(data))
+
def __convert_from_base(self, from_unit: WarpingMomentOfInertiaUnits) -> float:
value = self._value