neris-api-client 1.3.0__tar.gz → 1.3.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: neris_api_client
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: NERIS API Client
5
5
  Author-email: Ben Coleman <ben.coleman@ul.org>, Tommy Messbauer <thomas.messbauer@ul.org>, Joseph Pagani <joseph.pagani@ul.org>
6
6
  Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
@@ -97,6 +97,14 @@ client = NerisApiClient()
97
97
  entity = client.get_entity("FD24027240")
98
98
  ```
99
99
 
100
+ ## Additional config parameters
101
+
102
+ | Parameter | Description |
103
+ | --------- | ----------------------------------------------------------- |
104
+ | debug | Controls whether the application outputs debug information. |
105
+ | validate | Controls whether the client performs model validations. |
106
+
107
+
100
108
  ## Disclaimer
101
109
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
102
110
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to
@@ -80,6 +80,14 @@ client = NerisApiClient()
80
80
  entity = client.get_entity("FD24027240")
81
81
  ```
82
82
 
83
+ ## Additional config parameters
84
+
85
+ | Parameter | Description |
86
+ | --------- | ----------------------------------------------------------- |
87
+ | debug | Controls whether the application outputs debug information. |
88
+ | validate | Controls whether the client performs model validations. |
89
+
90
+
83
91
  ## Disclaimer
84
92
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
85
93
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "neris_api_client"
7
- version = "1.3.0"
7
+ version = "1.3.1"
8
8
  authors = [
9
9
  { name="Ben Coleman", email="ben.coleman@ul.org" },
10
10
  { name="Tommy Messbauer", email="thomas.messbauer@ul.org" },
@@ -161,7 +161,7 @@ class _NerisApiClient:
161
161
  self._update_auth()
162
162
  self._session.headers.update({"Authorization": f"Bearer {self.tokens.access_token}"})
163
163
 
164
- if model:
164
+ if self.config.validate and model:
165
165
  if isinstance(data, str):
166
166
  data = model.model_validate_json(data).model_dump(mode="json", by_alias=True)
167
167
  if isinstance(data, dict):
@@ -16,11 +16,13 @@ class Config:
16
16
  client_id: str | None = None
17
17
  client_secret: str | None = None
18
18
  grant_type: GrantType | None = None
19
+ validate: bool | None = None
19
20
 
20
21
  def __post_init__(self):
21
22
  # env var handling
22
23
  self.base_url = self.base_url or os.getenv("NERIS_BASE_URL")
23
24
  self.debug = self.debug if self.debug is not None else os.getenv("NERIS_DEBUG") == "true"
25
+ self.validate = self.validate if self.validate is not None else os.getenv("NERIS_VALIDATE") == "true"
24
26
 
25
27
  match os.getenv("NERIS_GRANT_TYPE"):
26
28
  case GrantType.PASSWORD:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: neris_api_client
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: NERIS API Client
5
5
  Author-email: Ben Coleman <ben.coleman@ul.org>, Tommy Messbauer <thomas.messbauer@ul.org>, Joseph Pagani <joseph.pagani@ul.org>
6
6
  Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
@@ -97,6 +97,14 @@ client = NerisApiClient()
97
97
  entity = client.get_entity("FD24027240")
98
98
  ```
99
99
 
100
+ ## Additional config parameters
101
+
102
+ | Parameter | Description |
103
+ | --------- | ----------------------------------------------------------- |
104
+ | debug | Controls whether the application outputs debug information. |
105
+ | validate | Controls whether the client performs model validations. |
106
+
107
+
100
108
  ## Disclaimer
101
109
  The models in this package are generated using [`datamodel-code-generator`](https://github.com/koxudaxi/datamodel-code-generator) and are not guaranteed
102
110
  to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to