pydiagral 1.1.0__py3-none-any.whl → 1.1.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pydiagral/api.py CHANGED
@@ -134,7 +134,7 @@ class DiagralAPI:
134
134
  method (str): The HTTP method to use for the request (e.g., 'GET', 'POST').
135
135
  endpoint (str): The API endpoint to send the request to.
136
136
  timeout (float, optional): The timeout for the request in seconds. Defaults to 30.
137
- **kwargs: Additional keyword arguments to pass to the request.
137
+ **kwargs (any): Additional keyword arguments to pass to the request.
138
138
 
139
139
  Returns:
140
140
  tuple[dict[str, Any], int]: A tuple containing:
@@ -589,7 +589,6 @@ class DiagralAPI:
589
589
  Raises:
590
590
  ConfigurationError: If the action is not one of the allowed actions.
591
591
  AuthenticationError: If the API key, secret key, or PIN code is missing.
592
- All other exceptions from _request function are propagated.
593
592
 
594
593
  """
595
594
 
@@ -643,7 +642,8 @@ class DiagralAPI:
643
642
  SystemStatus: An instance of SystemStatus containing the system status after starting the system.
644
643
 
645
644
  Raises:
646
- All exceptions from __system_action function are propagated.
645
+ ConfigurationError: If the action is not one of the allowed actions.
646
+ AuthenticationError: If the API key, secret key, or PIN code is missing.
647
647
 
648
648
  """
649
649
 
@@ -658,7 +658,8 @@ class DiagralAPI:
658
658
  SystemStatus: An instance of SystemStatus containing the system status after stopping the system.
659
659
 
660
660
  Raises:
661
- All exceptions from __system_action function are propagated.
661
+ ConfigurationError: If the action is not one of the allowed actions.
662
+ AuthenticationError: If the API key, secret key, or PIN code is missing.
662
663
 
663
664
  """
664
665
 
@@ -671,7 +672,8 @@ class DiagralAPI:
671
672
  SystemStatus: An instance of SystemStatus containing the system status after starting the system in presence mode.
672
673
 
673
674
  Raises:
674
- All exceptions from __system_action function are propagated.
675
+ ConfigurationError: If the action is not one of the allowed actions.
676
+ AuthenticationError: If the API key, secret key, or PIN code is missing.
675
677
 
676
678
  """
677
679
 
@@ -688,7 +690,6 @@ class DiagralAPI:
688
690
 
689
691
  Raises:
690
692
  ConfigurationError: If the provided ID is not 1 or 2.
691
- All other exceptions from __system_action function are propagated.
692
693
 
693
694
  """
694
695
 
@@ -714,7 +715,6 @@ class DiagralAPI:
714
715
  Raises:
715
716
  ConfigurationError: If the action is not 'activate_group' or 'disable_group', or if the groups are invalid.
716
717
  AuthenticationError: If the API key, secret key, or PIN code is not provided.
717
- All other exceptions from _request function are propagated.
718
718
 
719
719
  """
720
720
 
@@ -783,7 +783,7 @@ class DiagralAPI:
783
783
 
784
784
  Raises:
785
785
  ConfigurationError: If the action is not one of the allowed actions.
786
- All other exceptions from __action_group_system function are propagated.
786
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
787
787
 
788
788
  """
789
789
 
@@ -805,7 +805,7 @@ class DiagralAPI:
805
805
 
806
806
  Raises:
807
807
  ConfigurationError: If the action is not one of the allowed actions.
808
- All other exceptions from __action_group_system function are propagated.
808
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
809
809
 
810
810
  """
811
811
 
@@ -834,7 +834,6 @@ class DiagralAPI:
834
834
  Raises:
835
835
  ConfigurationError: If the action is not 'enable' or 'disable', or if the product type is invalid.
836
836
  AuthenticationError: If the API key, secret key, or PIN code is not provided.
837
- All other exceptions from _request function are propagated.
838
837
 
839
838
  """
840
839
 
@@ -888,7 +887,8 @@ class DiagralAPI:
888
887
  SystemStatus: An instance of SystemStatus containing the system status after enabling the product.
889
888
 
890
889
  Raises:
891
- All exceptions from __action_product function are propagated.
890
+ ConfigurationError: If the action is not 'enable'
891
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
892
892
 
893
893
  """
894
894
  return await self.__action_product(
@@ -908,7 +908,8 @@ class DiagralAPI:
908
908
  SystemStatus: An instance of SystemStatus containing the system status after disabling the product.
909
909
 
910
910
  Raises:
911
- All exceptions from __action_product function are propagated.
911
+ ConfigurationError: If the action is not 'disable'
912
+ AuthenticationError: If the API key, secret key, or PIN code is not provided.
912
913
 
913
914
  """
914
915
  return await self.__action_product(
@@ -980,7 +981,6 @@ class DiagralAPI:
980
981
 
981
982
  Raises:
982
983
  AuthenticationError: If the API key or secret key is not provided.
983
- All other exceptions from _request function are propagated.
984
984
 
985
985
  """
986
986
 
pydiagral/models.py CHANGED
@@ -90,7 +90,7 @@ class CamelCaseModel:
90
90
  return result
91
91
 
92
92
  @classmethod
93
- def _from_dict_recursive(cls, data: dict, target_cls: type[T]) -> T:
93
+ def _from_dict_recursive(cls: type[T], data: dict, target_cls: type[T]) -> T:
94
94
  """Recursively converts a dictionary to an instance of the specified target class.
95
95
 
96
96
  This method handles nested dictionaries and lists, converting them to the appropriate
@@ -98,7 +98,7 @@ class CamelCaseModel:
98
98
  by handling `Union` types and removing `None` from the type hints.
99
99
 
100
100
  Args:
101
- cls: The class that this method is a part of.
101
+ cls (type[T]): The class that this method is a part of.
102
102
  data (dict): The dictionary to convert.
103
103
  target_cls (type[T]): The target class to convert the dictionary to.
104
104
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydiagral
3
- Version: 1.1.0
3
+ Version: 1.1.0b1
4
4
  Summary: A Python library for interacting with Diagral systems
5
5
  Project-URL: Homepage, https://github.com/mguyard/pydiagral
6
6
  Project-URL: Documentation, https://github.com/mguyard/pydiagral
@@ -0,0 +1,10 @@
1
+ pydiagral/__init__.py,sha256=4uM-RD2GQ6JYJkxu-D6wj3XpqfY5gN2hP8NF6WvRI9k,576
2
+ pydiagral/api.py,sha256=sX46Fct3Bwei5yKKQ5PnGDKl261BBqZ0CYMFUnXZ5Mw,46753
3
+ pydiagral/constants.py,sha256=2B0TdKxQHA3cpIBxojo43bMW44wN9xKYsHbBRHWsaBk,119
4
+ pydiagral/exceptions.py,sha256=PLo85XJ55q4_dzsyaMYXLIaX8Ws7HH6vDUWNWodzCpM,1013
5
+ pydiagral/models.py,sha256=shnAf7ojh6y5fGp3l5RbGdp4qpuEyOZI-0ePrWAg2l0,54120
6
+ pydiagral/utils.py,sha256=weccW18dseD_Ypwe4dKvNz6TlZPA7BQbf5l5qk3GXOg,444
7
+ pydiagral-1.1.0b1.dist-info/METADATA,sha256=SKmB2a_o7gXGzt2ld9fgmwAPCS_guXTb8hn8k3SOk7w,46570
8
+ pydiagral-1.1.0b1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ pydiagral-1.1.0b1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
+ pydiagral-1.1.0b1.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- pydiagral/__init__.py,sha256=4uM-RD2GQ6JYJkxu-D6wj3XpqfY5gN2hP8NF6WvRI9k,576
2
- pydiagral/api.py,sha256=hBN2r0OcuPRL9UZJKpaNjF1lozwvZjRL6_QOxB73nY4,46668
3
- pydiagral/constants.py,sha256=2B0TdKxQHA3cpIBxojo43bMW44wN9xKYsHbBRHWsaBk,119
4
- pydiagral/exceptions.py,sha256=PLo85XJ55q4_dzsyaMYXLIaX8Ws7HH6vDUWNWodzCpM,1013
5
- pydiagral/models.py,sha256=pZkEVuvt33rCDm7fUBGFM5jVCwgASzMxNXKAztuqsJ0,54101
6
- pydiagral/utils.py,sha256=weccW18dseD_Ypwe4dKvNz6TlZPA7BQbf5l5qk3GXOg,444
7
- pydiagral-1.1.0.dist-info/METADATA,sha256=XPou_Ztx31hTCSOfwy1A_hxCS2Wup7uQdNRhMzVizW0,46568
8
- pydiagral-1.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- pydiagral-1.1.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
10
- pydiagral-1.1.0.dist-info/RECORD,,