kodexa 7.4.417153383425__py3-none-any.whl → 7.4.417158523961__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.
kodexa/platform/client.py CHANGED
@@ -1298,12 +1298,6 @@ class TasksEndpoint(EntitiesEndpoint):
1298
1298
  response = self.client.post(url, create_body)
1299
1299
  process_response(response)
1300
1300
 
1301
- try:
1302
- logger.info(f"create_with_template response: {response}")
1303
- logger.info(f"create_with_template response.json(): {response.json()}")
1304
- except Exception as e:
1305
- logger.error(f"Error logging create_with_template response: {e}")
1306
-
1307
1301
  return TaskEndpoint.model_validate(response.json()).set_client(self.client)
1308
1302
 
1309
1303
  class TaskTemplateEndpoint(EntityEndpoint, TaskTemplate):
@@ -6461,15 +6455,9 @@ class TaxonomiesEndpoint(ComponentEndpoint, ClientEndpoint, OrganizationOwned):
6461
6455
  def process_response(response) -> requests.Response:
6462
6456
  """
6463
6457
  This function processes the server response. It checks the status code of the response and raises an exception with
6464
- a specific message depending on the status code. If the status code is 401, it raises an "Unauthorized" exception.
6465
- If the status code is 404, it raises a "Not found" exception.
6466
- If the status code is 405, it raises a "Method not allowed" exception.
6467
- If the status code is 500, it raises an "Internal server error" exception.
6468
- If the status code is 400, it checks if the response has a JSON body with an "errors" field.
6469
- If so, it raises an exception with a message containing all the errors.
6470
- If not, it raises a "Bad request" exception.
6471
- If the status code is anything other than 200, it raises an "Unexpected response" exception.
6472
- If the status code is 200, it returns the response as is.
6458
+ a specific message depending on the status code.
6459
+ If the status code is anything other than 20X, it raises an exception.
6460
+ If the status code is 20X, it returns the response as is.
6473
6461
 
6474
6462
  Args:
6475
6463
  response (requests.Response): The server response to process.
@@ -6480,16 +6468,39 @@ def process_response(response) -> requests.Response:
6480
6468
  Raises:
6481
6469
  Exception: If the status code is not 200, an exception is raised with a message specific to the status code.
6482
6470
  """
6471
+ if response.status_code in [301, 302]:
6472
+ raise Exception(f"Redirected ({response.text})")
6473
+
6483
6474
  if response.status_code == 401:
6484
6475
  raise Exception(f"Unauthorized ({response.text})")
6476
+
6477
+ if response.status_code == 403:
6478
+ raise Exception(f"Forbidden ({response.text})")
6479
+
6485
6480
  if response.status_code == 404:
6486
6481
  raise Exception(f"Not found ({response.text})")
6487
- if response.status_code in [301, 302]:
6488
- raise Exception(f"Redirected ({response.text})")
6482
+
6489
6483
  if response.status_code == 405:
6490
6484
  raise Exception("Method not allowed")
6485
+
6486
+ if response.status_code == 409:
6487
+ raise Exception(f"Conflict ({response.text})")
6488
+
6489
+ if response.status_code == 422:
6490
+ raise Exception(f"Unprocessable entity ({response.text})")
6491
+
6491
6492
  if response.status_code == 500:
6492
6493
  raise Exception("Internal server error: \n" + response.text)
6494
+
6495
+ if response.status_code == 502:
6496
+ raise Exception(f"Bad gateway ({response.text})")
6497
+
6498
+ if response.status_code == 503:
6499
+ raise Exception(f"Service unavailable ({response.text})")
6500
+
6501
+ if response.status_code == 504:
6502
+ raise Exception(f"Gateway timeout ({response.text})")
6503
+
6493
6504
  if response.status_code == 400:
6494
6505
  if response.json() and response.json().get("errors"):
6495
6506
  messages = []
@@ -6497,7 +6508,7 @@ def process_response(response) -> requests.Response:
6497
6508
  messages.append(f"{key}: {value}")
6498
6509
  raise Exception(", ".join(messages))
6499
6510
 
6500
- raise Exception("Bad request " + response.text)
6511
+ raise Exception(f"Bad request {response.text}")
6501
6512
 
6502
6513
  return response
6503
6514
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kodexa
3
- Version: 7.4.417153383425
3
+ Version: 7.4.417158523961
4
4
  Summary: Python SDK for the Kodexa Platform
5
5
  Author: Austin Redenbaugh
6
6
  Author-email: austin@kodexa.com
@@ -19,7 +19,7 @@ kodexa/model/utils.py,sha256=YEG3f8YzBil06D0P3_dfx2S9GnHREzyrjnlWwQ7oPlU,3038
19
19
  kodexa/pipeline/__init__.py,sha256=sA7f5D6qkdMrpp2xTIeefnrUBI6xxEEWostvxfX_1Cs,236
20
20
  kodexa/pipeline/pipeline.py,sha256=zyNEpA7KlGhPs_l-vgV6m-OCb16dbxQhl8QezeylugA,25540
21
21
  kodexa/platform/__init__.py,sha256=1O3oiWMg292NPL_NacKDnK1T3_R6cMorrPRue_9e-O4,216
22
- kodexa/platform/client.py,sha256=H8Jr2-dJnr-EryADaS4PKsPOIeLuxabIu_ebQGUP1Ag,240444
22
+ kodexa/platform/client.py,sha256=RzhfzDiQlpLUkUE2Vt63u_zHqI2MUoiQonEWU-B9s9c,240275
23
23
  kodexa/platform/interaction.py,sha256=6zpcwXKNZstUGNS6m4JsoRXAqCZPJHWI-ZN3co8nnF0,1055
24
24
  kodexa/platform/kodexa.py,sha256=2s7Ez7_o-ywpNwbTRhtOUaQKtB9hKsDC_oJHaskXw-I,35315
25
25
  kodexa/platform/manifest.py,sha256=ThjQOk0xbP0qACcpS8NM6-zQL_Emd_bv4QAW2FpbUWk,19454
@@ -45,7 +45,7 @@ kodexa/testing/test_utils.py,sha256=v44p__gE7ia67W7WeHN2HBFCWSCUrCZt7G4xBNCmwf8,
45
45
  kodexa/training/__init__.py,sha256=xs2L62YpRkIRfslQwtQZ5Yxjhm7sLzX2TrVX6EuBnZQ,52
46
46
  kodexa/training/train_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  kodexa/utils/__init__.py,sha256=Pnim1o9_db5YEnNvDTxpM7HG-qTlL6n8JwFwOafU9wo,5928
48
- kodexa-7.4.417153383425.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
49
- kodexa-7.4.417153383425.dist-info/METADATA,sha256=B8MyA4_s2EY7C9pNQJZlz9OP-_9LAqrMRAzN_rvOS3s,2916
50
- kodexa-7.4.417153383425.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
51
- kodexa-7.4.417153383425.dist-info/RECORD,,
48
+ kodexa-7.4.417158523961.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
49
+ kodexa-7.4.417158523961.dist-info/METADATA,sha256=ZGsZ_eOBpWQG6Xttzc6PG2h-bEeOr18x2rRrH8tUZ2c,2916
50
+ kodexa-7.4.417158523961.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
51
+ kodexa-7.4.417158523961.dist-info/RECORD,,