From e09f894d2b53da97fc408883262a152cb9d43b4e Mon Sep 17 00:00:00 2001 From: Ori Lael Date: Sun, 30 Jun 2024 19:23:59 +0300 Subject: [PATCH 1/4] Add new json data contract --- README.md | 9 +- docs/EnvironmentVariablesApi.md | 5 +- docs/IncrementCounter200Response.md | 32 +++ docs/IncrementCounter200ResponseAnyOf.md | 32 +++ docs/IncrementCounter200ResponseAnyOf1.md | 32 +++ docs/JsonDataContract.md | 29 +++ docs/JsonValue.md | 28 --- docs/SecureStorageApi.md | 18 +- docs/SecureStorageDataContract.md | 29 --- docs/StorageApi.md | 18 +- docs/StorageDataContract.md | 2 +- docs/UpsertByKeyFromStorage200Response.md | 31 +++ .../UpsertByKeyFromStorage200ResponseAnyOf.md | 31 +++ ...UpsertByKeyFromStorage200ResponseAnyOf1.md | 31 +++ monday_code/__init__.py | 9 +- monday_code/api/environment_variables_api.py | 13 +- monday_code/api/secure_storage_api.py | 55 +++-- monday_code/api/storage_api.py | 55 ++--- monday_code/models/__init__.py | 9 +- .../models/increment_counter200_response.py | 134 ++++++++++++ .../increment_counter200_response_any_of.py | 103 +++++++++ .../increment_counter200_response_any_of1.py | 98 +++++++++ ...data_contract.py => json_data_contract.py} | 8 +- monday_code/models/json_value.py | 197 ------------------ monday_code/models/storage_data_contract.py | 8 +- .../upsert_by_key_from_storage200_response.py | 134 ++++++++++++ ..._by_key_from_storage200_response_any_of.py | 96 +++++++++ ...by_key_from_storage200_response_any_of1.py | 96 +++++++++ setup.py | 19 +- test/test_increment_counter200_response.py | 58 ++++++ ...st_increment_counter200_response_any_of.py | 56 +++++ ...t_increment_counter200_response_any_of1.py | 57 +++++ ...on_value.py => test_json_data_contract.py} | 24 ++- test/test_secure_storage_data_contract.py | 52 ----- ..._upsert_by_key_from_storage200_response.py | 56 +++++ ..._by_key_from_storage200_response_any_of.py | 55 +++++ ...by_key_from_storage200_response_any_of1.py | 55 +++++ 37 files changed, 1348 insertions(+), 426 deletions(-) create mode 100644 docs/IncrementCounter200Response.md create mode 100644 docs/IncrementCounter200ResponseAnyOf.md create mode 100644 docs/IncrementCounter200ResponseAnyOf1.md create mode 100644 docs/JsonDataContract.md delete mode 100644 docs/JsonValue.md delete mode 100644 docs/SecureStorageDataContract.md create mode 100644 docs/UpsertByKeyFromStorage200Response.md create mode 100644 docs/UpsertByKeyFromStorage200ResponseAnyOf.md create mode 100644 docs/UpsertByKeyFromStorage200ResponseAnyOf1.md create mode 100644 monday_code/models/increment_counter200_response.py create mode 100644 monday_code/models/increment_counter200_response_any_of.py create mode 100644 monday_code/models/increment_counter200_response_any_of1.py rename monday_code/models/{secure_storage_data_contract.py => json_data_contract.py} (91%) delete mode 100644 monday_code/models/json_value.py create mode 100644 monday_code/models/upsert_by_key_from_storage200_response.py create mode 100644 monday_code/models/upsert_by_key_from_storage200_response_any_of.py create mode 100644 monday_code/models/upsert_by_key_from_storage200_response_any_of1.py create mode 100644 test/test_increment_counter200_response.py create mode 100644 test/test_increment_counter200_response_any_of.py create mode 100644 test/test_increment_counter200_response_any_of1.py rename test/{test_json_value.py => test_json_data_contract.py} (60%) delete mode 100644 test/test_secure_storage_data_contract.py create mode 100644 test/test_upsert_by_key_from_storage200_response.py create mode 100644 test/test_upsert_by_key_from_storage200_response_any_of.py create mode 100644 test/test_upsert_by_key_from_storage200_response_any_of1.py diff --git a/README.md b/README.md index 905d14b..1a1dc5f 100644 --- a/README.md +++ b/README.md @@ -64,14 +64,19 @@ Class | Method | HTTP request | Description - [GetByKeyFromStorage404Response](docs/GetByKeyFromStorage404Response.md) - [GetByKeyFromStorage500Response](docs/GetByKeyFromStorage500Response.md) + - [IncrementCounter200Response](docs/IncrementCounter200Response.md) + - [IncrementCounter200ResponseAnyOf](docs/IncrementCounter200ResponseAnyOf.md) + - [IncrementCounter200ResponseAnyOf1](docs/IncrementCounter200ResponseAnyOf1.md) - [IncrementCounterParams](docs/IncrementCounterParams.md) - - [JsonValue](docs/JsonValue.md) + - [JsonDataContract](docs/JsonDataContract.md) - [LogMethods](docs/LogMethods.md) - [Period](docs/Period.md) - [PublishMessageParams](docs/PublishMessageParams.md) - [PublishMessageResponse](docs/PublishMessageResponse.md) - - [SecureStorageDataContract](docs/SecureStorageDataContract.md) - [StorageDataContract](docs/StorageDataContract.md) + - [UpsertByKeyFromStorage200Response](docs/UpsertByKeyFromStorage200Response.md) + - [UpsertByKeyFromStorage200ResponseAnyOf](docs/UpsertByKeyFromStorage200ResponseAnyOf.md) + - [UpsertByKeyFromStorage200ResponseAnyOf1](docs/UpsertByKeyFromStorage200ResponseAnyOf1.md) - [ValidateSecretParams](docs/ValidateSecretParams.md) - [ValidateSecretResponse](docs/ValidateSecretResponse.md) - [WriteLogRequestBody](docs/WriteLogRequestBody.md) diff --git a/docs/EnvironmentVariablesApi.md b/docs/EnvironmentVariablesApi.md index 7f1e27b..fc6ac9a 100644 --- a/docs/EnvironmentVariablesApi.md +++ b/docs/EnvironmentVariablesApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **get_environment_variable** -> JsonValue get_environment_variable(name) +> object get_environment_variable(name) @@ -18,7 +18,6 @@ Method | HTTP request | Description ```python import monday_code -from monday_code.models.json_value import JsonValue from monday_code.rest import ApiException from pprint import pprint @@ -54,7 +53,7 @@ Name | Type | Description | Notes ### Return type -[**JsonValue**](JsonValue.md) +**object** ### Authorization diff --git a/docs/IncrementCounter200Response.md b/docs/IncrementCounter200Response.md new file mode 100644 index 0000000..c955d28 --- /dev/null +++ b/docs/IncrementCounter200Response.md @@ -0,0 +1,32 @@ +# IncrementCounter200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new_counter_value** | **float** | | +**message** | **str** | | +**success** | **bool** | | +**error** | **object** | | + +## Example + +```python +from monday_code.models.increment_counter200_response import IncrementCounter200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of IncrementCounter200Response from a JSON string +increment_counter200_response_instance = IncrementCounter200Response.from_json(json) +# print the JSON string representation of the object +print(IncrementCounter200Response.to_json()) + +# convert the object into a dict +increment_counter200_response_dict = increment_counter200_response_instance.to_dict() +# create an instance of IncrementCounter200Response from a dict +increment_counter200_response_from_dict = IncrementCounter200Response.from_dict(increment_counter200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IncrementCounter200ResponseAnyOf.md b/docs/IncrementCounter200ResponseAnyOf.md new file mode 100644 index 0000000..9fb4c23 --- /dev/null +++ b/docs/IncrementCounter200ResponseAnyOf.md @@ -0,0 +1,32 @@ +# IncrementCounter200ResponseAnyOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new_counter_value** | **object** | | [optional] +**message** | **object** | | [optional] +**success** | **bool** | | +**error** | **str** | | + +## Example + +```python +from monday_code.models.increment_counter200_response_any_of import IncrementCounter200ResponseAnyOf + +# TODO update the JSON string below +json = "{}" +# create an instance of IncrementCounter200ResponseAnyOf from a JSON string +increment_counter200_response_any_of_instance = IncrementCounter200ResponseAnyOf.from_json(json) +# print the JSON string representation of the object +print(IncrementCounter200ResponseAnyOf.to_json()) + +# convert the object into a dict +increment_counter200_response_any_of_dict = increment_counter200_response_any_of_instance.to_dict() +# create an instance of IncrementCounter200ResponseAnyOf from a dict +increment_counter200_response_any_of_from_dict = IncrementCounter200ResponseAnyOf.from_dict(increment_counter200_response_any_of_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IncrementCounter200ResponseAnyOf1.md b/docs/IncrementCounter200ResponseAnyOf1.md new file mode 100644 index 0000000..e74d74d --- /dev/null +++ b/docs/IncrementCounter200ResponseAnyOf1.md @@ -0,0 +1,32 @@ +# IncrementCounter200ResponseAnyOf1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **object** | | [optional] +**success** | **bool** | | +**new_counter_value** | **float** | | +**message** | **str** | | + +## Example + +```python +from monday_code.models.increment_counter200_response_any_of1 import IncrementCounter200ResponseAnyOf1 + +# TODO update the JSON string below +json = "{}" +# create an instance of IncrementCounter200ResponseAnyOf1 from a JSON string +increment_counter200_response_any_of1_instance = IncrementCounter200ResponseAnyOf1.from_json(json) +# print the JSON string representation of the object +print(IncrementCounter200ResponseAnyOf1.to_json()) + +# convert the object into a dict +increment_counter200_response_any_of1_dict = increment_counter200_response_any_of1_instance.to_dict() +# create an instance of IncrementCounter200ResponseAnyOf1 from a dict +increment_counter200_response_any_of1_from_dict = IncrementCounter200ResponseAnyOf1.from_dict(increment_counter200_response_any_of1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/JsonDataContract.md b/docs/JsonDataContract.md new file mode 100644 index 0000000..a14e8f8 --- /dev/null +++ b/docs/JsonDataContract.md @@ -0,0 +1,29 @@ +# JsonDataContract + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **object** | | + +## Example + +```python +from monday_code.models.json_data_contract import JsonDataContract + +# TODO update the JSON string below +json = "{}" +# create an instance of JsonDataContract from a JSON string +json_data_contract_instance = JsonDataContract.from_json(json) +# print the JSON string representation of the object +print(JsonDataContract.to_json()) + +# convert the object into a dict +json_data_contract_dict = json_data_contract_instance.to_dict() +# create an instance of JsonDataContract from a dict +json_data_contract_from_dict = JsonDataContract.from_dict(json_data_contract_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/JsonValue.md b/docs/JsonValue.md deleted file mode 100644 index b912403..0000000 --- a/docs/JsonValue.md +++ /dev/null @@ -1,28 +0,0 @@ -# JsonValue - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Example - -```python -from monday_code.models.json_value import JsonValue - -# TODO update the JSON string below -json = "{}" -# create an instance of JsonValue from a JSON string -json_value_instance = JsonValue.from_json(json) -# print the JSON string representation of the object -print(JsonValue.to_json()) - -# convert the object into a dict -json_value_dict = json_value_instance.to_dict() -# create an instance of JsonValue from a dict -json_value_from_dict = JsonValue.from_dict(json_value_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SecureStorageApi.md b/docs/SecureStorageApi.md index 711a26b..b24fc5a 100644 --- a/docs/SecureStorageApi.md +++ b/docs/SecureStorageApi.md @@ -72,7 +72,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_secure_storage** -> SecureStorageDataContract get_secure_storage(key) +> JsonDataContract get_secure_storage(key) @@ -81,7 +81,7 @@ No authorization required ```python import monday_code -from monday_code.models.secure_storage_data_contract import SecureStorageDataContract +from monday_code.models.json_data_contract import JsonDataContract from monday_code.rest import ApiException from pprint import pprint @@ -117,7 +117,7 @@ Name | Type | Description | Notes ### Return type -[**SecureStorageDataContract**](SecureStorageDataContract.md) +[**JsonDataContract**](JsonDataContract.md) ### Authorization @@ -138,7 +138,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **put_secure_storage** -> object put_secure_storage(key, secure_storage_data_contract) +> bool put_secure_storage(key, json_data_contract) @@ -147,7 +147,7 @@ No authorization required ```python import monday_code -from monday_code.models.secure_storage_data_contract import SecureStorageDataContract +from monday_code.models.json_data_contract import JsonDataContract from monday_code.rest import ApiException from pprint import pprint @@ -163,10 +163,10 @@ with monday_code.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = monday_code.SecureStorageApi(api_client) key = 'key_example' # str | - secure_storage_data_contract = monday_code.SecureStorageDataContract() # SecureStorageDataContract | + json_data_contract = monday_code.JsonDataContract() # JsonDataContract | try: - api_response = api_instance.put_secure_storage(key, secure_storage_data_contract) + api_response = api_instance.put_secure_storage(key, json_data_contract) print("The response of SecureStorageApi->put_secure_storage:\n") pprint(api_response) except Exception as e: @@ -181,11 +181,11 @@ with monday_code.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **key** | **str**| | - **secure_storage_data_contract** | [**SecureStorageDataContract**](SecureStorageDataContract.md)| | + **json_data_contract** | [**JsonDataContract**](JsonDataContract.md)| | ### Return type -**object** +**bool** ### Authorization diff --git a/docs/SecureStorageDataContract.md b/docs/SecureStorageDataContract.md deleted file mode 100644 index f4502b1..0000000 --- a/docs/SecureStorageDataContract.md +++ /dev/null @@ -1,29 +0,0 @@ -# SecureStorageDataContract - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **object** | | - -## Example - -```python -from monday_code.models.secure_storage_data_contract import SecureStorageDataContract - -# TODO update the JSON string below -json = "{}" -# create an instance of SecureStorageDataContract from a JSON string -secure_storage_data_contract_instance = SecureStorageDataContract.from_json(json) -# print the JSON string representation of the object -print(SecureStorageDataContract.to_json()) - -# convert the object into a dict -secure_storage_data_contract_dict = secure_storage_data_contract_instance.to_dict() -# create an instance of SecureStorageDataContract from a dict -secure_storage_data_contract_from_dict = SecureStorageDataContract.from_dict(secure_storage_data_contract_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/StorageApi.md b/docs/StorageApi.md index 0e5fc1f..8cb6b94 100644 --- a/docs/StorageApi.md +++ b/docs/StorageApi.md @@ -146,7 +146,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **increment_counter** -> object increment_counter(x_monday_access_token, increment_counter_params) +> IncrementCounter200Response increment_counter(x_monday_access_token, increment_counter_params) @@ -155,6 +155,7 @@ No authorization required ```python import monday_code +from monday_code.models.increment_counter200_response import IncrementCounter200Response from monday_code.models.increment_counter_params import IncrementCounterParams from monday_code.rest import ApiException from pprint import pprint @@ -193,7 +194,7 @@ Name | Type | Description | Notes ### Return type -**object** +[**IncrementCounter200Response**](IncrementCounter200Response.md) ### Authorization @@ -213,7 +214,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upsert_by_key_from_storage** -> object upsert_by_key_from_storage(key, x_monday_access_token, storage_data_contract, shared=shared, previous_version=previous_version) +> UpsertByKeyFromStorage200Response upsert_by_key_from_storage(key, x_monday_access_token, json_data_contract, shared=shared, previous_version=previous_version) @@ -222,7 +223,8 @@ No authorization required ```python import monday_code -from monday_code.models.storage_data_contract import StorageDataContract +from monday_code.models.json_data_contract import JsonDataContract +from monday_code.models.upsert_by_key_from_storage200_response import UpsertByKeyFromStorage200Response from monday_code.rest import ApiException from pprint import pprint @@ -239,12 +241,12 @@ with monday_code.ApiClient(configuration) as api_client: api_instance = monday_code.StorageApi(api_client) key = 'key_example' # str | x_monday_access_token = 'x_monday_access_token_example' # str | - storage_data_contract = monday_code.StorageDataContract() # StorageDataContract | + json_data_contract = monday_code.JsonDataContract() # JsonDataContract | shared = True # bool | (optional) previous_version = 'previous_version_example' # str | (optional) try: - api_response = api_instance.upsert_by_key_from_storage(key, x_monday_access_token, storage_data_contract, shared=shared, previous_version=previous_version) + api_response = api_instance.upsert_by_key_from_storage(key, x_monday_access_token, json_data_contract, shared=shared, previous_version=previous_version) print("The response of StorageApi->upsert_by_key_from_storage:\n") pprint(api_response) except Exception as e: @@ -260,13 +262,13 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **key** | **str**| | **x_monday_access_token** | **str**| | - **storage_data_contract** | [**StorageDataContract**](StorageDataContract.md)| | + **json_data_contract** | [**JsonDataContract**](JsonDataContract.md)| | **shared** | **bool**| | [optional] **previous_version** | **str**| | [optional] ### Return type -**object** +[**UpsertByKeyFromStorage200Response**](UpsertByKeyFromStorage200Response.md) ### Authorization diff --git a/docs/StorageDataContract.md b/docs/StorageDataContract.md index 39634ed..cdc81b5 100644 --- a/docs/StorageDataContract.md +++ b/docs/StorageDataContract.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **version** | **str** | | -**value** | [**JsonValue**](JsonValue.md) | | +**value** | **object** | | ## Example diff --git a/docs/UpsertByKeyFromStorage200Response.md b/docs/UpsertByKeyFromStorage200Response.md new file mode 100644 index 0000000..c7e7312 --- /dev/null +++ b/docs/UpsertByKeyFromStorage200Response.md @@ -0,0 +1,31 @@ +# UpsertByKeyFromStorage200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | +**success** | **bool** | | +**version** | **object** | | + +## Example + +```python +from monday_code.models.upsert_by_key_from_storage200_response import UpsertByKeyFromStorage200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of UpsertByKeyFromStorage200Response from a JSON string +upsert_by_key_from_storage200_response_instance = UpsertByKeyFromStorage200Response.from_json(json) +# print the JSON string representation of the object +print(UpsertByKeyFromStorage200Response.to_json()) + +# convert the object into a dict +upsert_by_key_from_storage200_response_dict = upsert_by_key_from_storage200_response_instance.to_dict() +# create an instance of UpsertByKeyFromStorage200Response from a dict +upsert_by_key_from_storage200_response_from_dict = UpsertByKeyFromStorage200Response.from_dict(upsert_by_key_from_storage200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpsertByKeyFromStorage200ResponseAnyOf.md b/docs/UpsertByKeyFromStorage200ResponseAnyOf.md new file mode 100644 index 0000000..6aceea4 --- /dev/null +++ b/docs/UpsertByKeyFromStorage200ResponseAnyOf.md @@ -0,0 +1,31 @@ +# UpsertByKeyFromStorage200ResponseAnyOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **object** | | [optional] +**success** | **bool** | | +**version** | **str** | | + +## Example + +```python +from monday_code.models.upsert_by_key_from_storage200_response_any_of import UpsertByKeyFromStorage200ResponseAnyOf + +# TODO update the JSON string below +json = "{}" +# create an instance of UpsertByKeyFromStorage200ResponseAnyOf from a JSON string +upsert_by_key_from_storage200_response_any_of_instance = UpsertByKeyFromStorage200ResponseAnyOf.from_json(json) +# print the JSON string representation of the object +print(UpsertByKeyFromStorage200ResponseAnyOf.to_json()) + +# convert the object into a dict +upsert_by_key_from_storage200_response_any_of_dict = upsert_by_key_from_storage200_response_any_of_instance.to_dict() +# create an instance of UpsertByKeyFromStorage200ResponseAnyOf from a dict +upsert_by_key_from_storage200_response_any_of_from_dict = UpsertByKeyFromStorage200ResponseAnyOf.from_dict(upsert_by_key_from_storage200_response_any_of_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpsertByKeyFromStorage200ResponseAnyOf1.md b/docs/UpsertByKeyFromStorage200ResponseAnyOf1.md new file mode 100644 index 0000000..4082040 --- /dev/null +++ b/docs/UpsertByKeyFromStorage200ResponseAnyOf1.md @@ -0,0 +1,31 @@ +# UpsertByKeyFromStorage200ResponseAnyOf1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **object** | | [optional] +**success** | **bool** | | +**error** | **str** | | + +## Example + +```python +from monday_code.models.upsert_by_key_from_storage200_response_any_of1 import UpsertByKeyFromStorage200ResponseAnyOf1 + +# TODO update the JSON string below +json = "{}" +# create an instance of UpsertByKeyFromStorage200ResponseAnyOf1 from a JSON string +upsert_by_key_from_storage200_response_any_of1_instance = UpsertByKeyFromStorage200ResponseAnyOf1.from_json(json) +# print the JSON string representation of the object +print(UpsertByKeyFromStorage200ResponseAnyOf1.to_json()) + +# convert the object into a dict +upsert_by_key_from_storage200_response_any_of1_dict = upsert_by_key_from_storage200_response_any_of1_instance.to_dict() +# create an instance of UpsertByKeyFromStorage200ResponseAnyOf1 from a dict +upsert_by_key_from_storage200_response_any_of1_from_dict = UpsertByKeyFromStorage200ResponseAnyOf1.from_dict(upsert_by_key_from_storage200_response_any_of1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/monday_code/__init__.py b/monday_code/__init__.py index d91c074..fe3aba2 100644 --- a/monday_code/__init__.py +++ b/monday_code/__init__.py @@ -38,14 +38,19 @@ # import models into sdk package from monday_code.models.get_by_key_from_storage404_response import GetByKeyFromStorage404Response from monday_code.models.get_by_key_from_storage500_response import GetByKeyFromStorage500Response +from monday_code.models.increment_counter200_response import IncrementCounter200Response +from monday_code.models.increment_counter200_response_any_of import IncrementCounter200ResponseAnyOf +from monday_code.models.increment_counter200_response_any_of1 import IncrementCounter200ResponseAnyOf1 from monday_code.models.increment_counter_params import IncrementCounterParams -from monday_code.models.json_value import JsonValue +from monday_code.models.json_data_contract import JsonDataContract from monday_code.models.log_methods import LogMethods from monday_code.models.period import Period from monday_code.models.publish_message_params import PublishMessageParams from monday_code.models.publish_message_response import PublishMessageResponse -from monday_code.models.secure_storage_data_contract import SecureStorageDataContract from monday_code.models.storage_data_contract import StorageDataContract +from monday_code.models.upsert_by_key_from_storage200_response import UpsertByKeyFromStorage200Response +from monday_code.models.upsert_by_key_from_storage200_response_any_of import UpsertByKeyFromStorage200ResponseAnyOf +from monday_code.models.upsert_by_key_from_storage200_response_any_of1 import UpsertByKeyFromStorage200ResponseAnyOf1 from monday_code.models.validate_secret_params import ValidateSecretParams from monday_code.models.validate_secret_response import ValidateSecretResponse from monday_code.models.write_log_request_body import WriteLogRequestBody diff --git a/monday_code/api/environment_variables_api.py b/monday_code/api/environment_variables_api.py index 255745c..bac9ed2 100644 --- a/monday_code/api/environment_variables_api.py +++ b/monday_code/api/environment_variables_api.py @@ -17,8 +17,7 @@ from typing_extensions import Annotated from pydantic import StrictStr -from typing import List -from monday_code.models.json_value import JsonValue +from typing import Any, List from monday_code.api_client import ApiClient, RequestSerialized from monday_code.api_response import ApiResponse @@ -54,7 +53,7 @@ def get_environment_variable( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> JsonValue: + ) -> object: """get_environment_variable @@ -91,7 +90,7 @@ def get_environment_variable( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "JsonValue", + '200': "object", '404': "GetByKeyFromStorage404Response", } response_data = self.api_client.call_api( @@ -121,7 +120,7 @@ def get_environment_variable_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[JsonValue]: + ) -> ApiResponse[object]: """get_environment_variable @@ -158,7 +157,7 @@ def get_environment_variable_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "JsonValue", + '200': "object", '404': "GetByKeyFromStorage404Response", } response_data = self.api_client.call_api( @@ -225,7 +224,7 @@ def get_environment_variable_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "JsonValue", + '200': "object", '404': "GetByKeyFromStorage404Response", } response_data = self.api_client.call_api( diff --git a/monday_code/api/secure_storage_api.py b/monday_code/api/secure_storage_api.py index 2fff6d4..d35d17f 100644 --- a/monday_code/api/secure_storage_api.py +++ b/monday_code/api/secure_storage_api.py @@ -16,9 +16,8 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr -from typing import Any -from monday_code.models.secure_storage_data_contract import SecureStorageDataContract +from pydantic import StrictBool, StrictStr +from monday_code.models.json_data_contract import JsonDataContract from monday_code.api_client import ApiClient, RequestSerialized from monday_code.api_response import ApiResponse @@ -302,7 +301,7 @@ def get_secure_storage( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SecureStorageDataContract: + ) -> JsonDataContract: """get_secure_storage @@ -339,7 +338,7 @@ def get_secure_storage( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SecureStorageDataContract", + '200': "JsonDataContract", '404': "GetByKeyFromStorage404Response", } response_data = self.api_client.call_api( @@ -369,7 +368,7 @@ def get_secure_storage_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SecureStorageDataContract]: + ) -> ApiResponse[JsonDataContract]: """get_secure_storage @@ -406,7 +405,7 @@ def get_secure_storage_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SecureStorageDataContract", + '200': "JsonDataContract", '404': "GetByKeyFromStorage404Response", } response_data = self.api_client.call_api( @@ -473,7 +472,7 @@ def get_secure_storage_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SecureStorageDataContract", + '200': "JsonDataContract", '404': "GetByKeyFromStorage404Response", } response_data = self.api_client.call_api( @@ -547,7 +546,7 @@ def _get_secure_storage_serialize( def put_secure_storage( self, key: StrictStr, - secure_storage_data_contract: SecureStorageDataContract, + json_data_contract: JsonDataContract, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -560,14 +559,14 @@ def put_secure_storage( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: + ) -> bool: """put_secure_storage :param key: (required) :type key: str - :param secure_storage_data_contract: (required) - :type secure_storage_data_contract: SecureStorageDataContract + :param json_data_contract: (required) + :type json_data_contract: JsonDataContract :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -592,7 +591,7 @@ def put_secure_storage( _param = self._put_secure_storage_serialize( key=key, - secure_storage_data_contract=secure_storage_data_contract, + json_data_contract=json_data_contract, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -600,7 +599,7 @@ def put_secure_storage( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "bool", } response_data = self.api_client.call_api( *_param, @@ -617,7 +616,7 @@ def put_secure_storage( def put_secure_storage_with_http_info( self, key: StrictStr, - secure_storage_data_contract: SecureStorageDataContract, + json_data_contract: JsonDataContract, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -630,14 +629,14 @@ def put_secure_storage_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: + ) -> ApiResponse[bool]: """put_secure_storage :param key: (required) :type key: str - :param secure_storage_data_contract: (required) - :type secure_storage_data_contract: SecureStorageDataContract + :param json_data_contract: (required) + :type json_data_contract: JsonDataContract :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -662,7 +661,7 @@ def put_secure_storage_with_http_info( _param = self._put_secure_storage_serialize( key=key, - secure_storage_data_contract=secure_storage_data_contract, + json_data_contract=json_data_contract, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -670,7 +669,7 @@ def put_secure_storage_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "bool", } response_data = self.api_client.call_api( *_param, @@ -687,7 +686,7 @@ def put_secure_storage_with_http_info( def put_secure_storage_without_preload_content( self, key: StrictStr, - secure_storage_data_contract: SecureStorageDataContract, + json_data_contract: JsonDataContract, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -706,8 +705,8 @@ def put_secure_storage_without_preload_content( :param key: (required) :type key: str - :param secure_storage_data_contract: (required) - :type secure_storage_data_contract: SecureStorageDataContract + :param json_data_contract: (required) + :type json_data_contract: JsonDataContract :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -732,7 +731,7 @@ def put_secure_storage_without_preload_content( _param = self._put_secure_storage_serialize( key=key, - secure_storage_data_contract=secure_storage_data_contract, + json_data_contract=json_data_contract, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -740,7 +739,7 @@ def put_secure_storage_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "bool", } response_data = self.api_client.call_api( *_param, @@ -752,7 +751,7 @@ def put_secure_storage_without_preload_content( def _put_secure_storage_serialize( self, key, - secure_storage_data_contract, + json_data_contract, _request_auth, _content_type, _headers, @@ -778,8 +777,8 @@ def _put_secure_storage_serialize( # process the header parameters # process the form parameters # process the body parameter - if secure_storage_data_contract is not None: - _body_params = secure_storage_data_contract + if json_data_contract is not None: + _body_params = json_data_contract # set the HTTP header `Accept` diff --git a/monday_code/api/storage_api.py b/monday_code/api/storage_api.py index e939430..7874ba4 100644 --- a/monday_code/api/storage_api.py +++ b/monday_code/api/storage_api.py @@ -17,9 +17,12 @@ from typing_extensions import Annotated from pydantic import StrictBool, StrictStr -from typing import Any, Optional +from typing import Optional +from monday_code.models.increment_counter200_response import IncrementCounter200Response from monday_code.models.increment_counter_params import IncrementCounterParams +from monday_code.models.json_data_contract import JsonDataContract from monday_code.models.storage_data_contract import StorageDataContract +from monday_code.models.upsert_by_key_from_storage200_response import UpsertByKeyFromStorage200Response from monday_code.api_client import ApiClient, RequestSerialized from monday_code.api_response import ApiResponse @@ -611,7 +614,7 @@ def increment_counter( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: + ) -> IncrementCounter200Response: """increment_counter @@ -651,7 +654,7 @@ def increment_counter( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "IncrementCounter200Response", } response_data = self.api_client.call_api( *_param, @@ -681,7 +684,7 @@ def increment_counter_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: + ) -> ApiResponse[IncrementCounter200Response]: """increment_counter @@ -721,7 +724,7 @@ def increment_counter_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "IncrementCounter200Response", } response_data = self.api_client.call_api( *_param, @@ -791,7 +794,7 @@ def increment_counter_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "IncrementCounter200Response", } response_data = self.api_client.call_api( *_param, @@ -881,7 +884,7 @@ def upsert_by_key_from_storage( self, key: StrictStr, x_monday_access_token: StrictStr, - storage_data_contract: StorageDataContract, + json_data_contract: JsonDataContract, shared: Optional[StrictBool] = None, previous_version: Optional[StrictStr] = None, _request_timeout: Union[ @@ -896,7 +899,7 @@ def upsert_by_key_from_storage( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> object: + ) -> UpsertByKeyFromStorage200Response: """upsert_by_key_from_storage @@ -904,8 +907,8 @@ def upsert_by_key_from_storage( :type key: str :param x_monday_access_token: (required) :type x_monday_access_token: str - :param storage_data_contract: (required) - :type storage_data_contract: StorageDataContract + :param json_data_contract: (required) + :type json_data_contract: JsonDataContract :param shared: :type shared: bool :param previous_version: @@ -935,7 +938,7 @@ def upsert_by_key_from_storage( _param = self._upsert_by_key_from_storage_serialize( key=key, x_monday_access_token=x_monday_access_token, - storage_data_contract=storage_data_contract, + json_data_contract=json_data_contract, shared=shared, previous_version=previous_version, _request_auth=_request_auth, @@ -945,7 +948,7 @@ def upsert_by_key_from_storage( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "UpsertByKeyFromStorage200Response", } response_data = self.api_client.call_api( *_param, @@ -963,7 +966,7 @@ def upsert_by_key_from_storage_with_http_info( self, key: StrictStr, x_monday_access_token: StrictStr, - storage_data_contract: StorageDataContract, + json_data_contract: JsonDataContract, shared: Optional[StrictBool] = None, previous_version: Optional[StrictStr] = None, _request_timeout: Union[ @@ -978,7 +981,7 @@ def upsert_by_key_from_storage_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[object]: + ) -> ApiResponse[UpsertByKeyFromStorage200Response]: """upsert_by_key_from_storage @@ -986,8 +989,8 @@ def upsert_by_key_from_storage_with_http_info( :type key: str :param x_monday_access_token: (required) :type x_monday_access_token: str - :param storage_data_contract: (required) - :type storage_data_contract: StorageDataContract + :param json_data_contract: (required) + :type json_data_contract: JsonDataContract :param shared: :type shared: bool :param previous_version: @@ -1017,7 +1020,7 @@ def upsert_by_key_from_storage_with_http_info( _param = self._upsert_by_key_from_storage_serialize( key=key, x_monday_access_token=x_monday_access_token, - storage_data_contract=storage_data_contract, + json_data_contract=json_data_contract, shared=shared, previous_version=previous_version, _request_auth=_request_auth, @@ -1027,7 +1030,7 @@ def upsert_by_key_from_storage_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "UpsertByKeyFromStorage200Response", } response_data = self.api_client.call_api( *_param, @@ -1045,7 +1048,7 @@ def upsert_by_key_from_storage_without_preload_content( self, key: StrictStr, x_monday_access_token: StrictStr, - storage_data_contract: StorageDataContract, + json_data_contract: JsonDataContract, shared: Optional[StrictBool] = None, previous_version: Optional[StrictStr] = None, _request_timeout: Union[ @@ -1068,8 +1071,8 @@ def upsert_by_key_from_storage_without_preload_content( :type key: str :param x_monday_access_token: (required) :type x_monday_access_token: str - :param storage_data_contract: (required) - :type storage_data_contract: StorageDataContract + :param json_data_contract: (required) + :type json_data_contract: JsonDataContract :param shared: :type shared: bool :param previous_version: @@ -1099,7 +1102,7 @@ def upsert_by_key_from_storage_without_preload_content( _param = self._upsert_by_key_from_storage_serialize( key=key, x_monday_access_token=x_monday_access_token, - storage_data_contract=storage_data_contract, + json_data_contract=json_data_contract, shared=shared, previous_version=previous_version, _request_auth=_request_auth, @@ -1109,7 +1112,7 @@ def upsert_by_key_from_storage_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", + '200': "UpsertByKeyFromStorage200Response", } response_data = self.api_client.call_api( *_param, @@ -1122,7 +1125,7 @@ def _upsert_by_key_from_storage_serialize( self, key, x_monday_access_token, - storage_data_contract, + json_data_contract, shared, previous_version, _request_auth, @@ -1160,8 +1163,8 @@ def _upsert_by_key_from_storage_serialize( _header_params['x-monday-access-token'] = x_monday_access_token # process the form parameters # process the body parameter - if storage_data_contract is not None: - _body_params = storage_data_contract + if json_data_contract is not None: + _body_params = json_data_contract # set the HTTP header `Accept` diff --git a/monday_code/models/__init__.py b/monday_code/models/__init__.py index 66a733b..80ca731 100644 --- a/monday_code/models/__init__.py +++ b/monday_code/models/__init__.py @@ -16,14 +16,19 @@ # import models into model package from monday_code.models.get_by_key_from_storage404_response import GetByKeyFromStorage404Response from monday_code.models.get_by_key_from_storage500_response import GetByKeyFromStorage500Response +from monday_code.models.increment_counter200_response import IncrementCounter200Response +from monday_code.models.increment_counter200_response_any_of import IncrementCounter200ResponseAnyOf +from monday_code.models.increment_counter200_response_any_of1 import IncrementCounter200ResponseAnyOf1 from monday_code.models.increment_counter_params import IncrementCounterParams -from monday_code.models.json_value import JsonValue +from monday_code.models.json_data_contract import JsonDataContract from monday_code.models.log_methods import LogMethods from monday_code.models.period import Period from monday_code.models.publish_message_params import PublishMessageParams from monday_code.models.publish_message_response import PublishMessageResponse -from monday_code.models.secure_storage_data_contract import SecureStorageDataContract from monday_code.models.storage_data_contract import StorageDataContract +from monday_code.models.upsert_by_key_from_storage200_response import UpsertByKeyFromStorage200Response +from monday_code.models.upsert_by_key_from_storage200_response_any_of import UpsertByKeyFromStorage200ResponseAnyOf +from monday_code.models.upsert_by_key_from_storage200_response_any_of1 import UpsertByKeyFromStorage200ResponseAnyOf1 from monday_code.models.validate_secret_params import ValidateSecretParams from monday_code.models.validate_secret_response import ValidateSecretResponse from monday_code.models.write_log_request_body import WriteLogRequestBody diff --git a/monday_code/models/increment_counter200_response.py b/monday_code/models/increment_counter200_response.py new file mode 100644 index 0000000..8c8cc9b --- /dev/null +++ b/monday_code/models/increment_counter200_response.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from monday_code.models.increment_counter200_response_any_of import IncrementCounter200ResponseAnyOf +from monday_code.models.increment_counter200_response_any_of1 import IncrementCounter200ResponseAnyOf1 +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +INCREMENTCOUNTER200RESPONSE_ANY_OF_SCHEMAS = ["IncrementCounter200ResponseAnyOf", "IncrementCounter200ResponseAnyOf1"] + +class IncrementCounter200Response(BaseModel): + """ + IncrementCounter200Response + """ + + # data type: IncrementCounter200ResponseAnyOf + anyof_schema_1_validator: Optional[IncrementCounter200ResponseAnyOf] = None + # data type: IncrementCounter200ResponseAnyOf1 + anyof_schema_2_validator: Optional[IncrementCounter200ResponseAnyOf1] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[IncrementCounter200ResponseAnyOf, IncrementCounter200ResponseAnyOf1]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "IncrementCounter200ResponseAnyOf", "IncrementCounter200ResponseAnyOf1" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = IncrementCounter200Response.model_construct() + error_messages = [] + # validate data type: IncrementCounter200ResponseAnyOf + if not isinstance(v, IncrementCounter200ResponseAnyOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `IncrementCounter200ResponseAnyOf`") + else: + return v + + # validate data type: IncrementCounter200ResponseAnyOf1 + if not isinstance(v, IncrementCounter200ResponseAnyOf1): + error_messages.append(f"Error! Input type `{type(v)}` is not `IncrementCounter200ResponseAnyOf1`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in IncrementCounter200Response with anyOf schemas: IncrementCounter200ResponseAnyOf, IncrementCounter200ResponseAnyOf1. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[IncrementCounter200ResponseAnyOf] = None + try: + instance.actual_instance = IncrementCounter200ResponseAnyOf.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[IncrementCounter200ResponseAnyOf1] = None + try: + instance.actual_instance = IncrementCounter200ResponseAnyOf1.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into IncrementCounter200Response with anyOf schemas: IncrementCounter200ResponseAnyOf, IncrementCounter200ResponseAnyOf1. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], IncrementCounter200ResponseAnyOf, IncrementCounter200ResponseAnyOf1]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/monday_code/models/increment_counter200_response_any_of.py b/monday_code/models/increment_counter200_response_any_of.py new file mode 100644 index 0000000..650db85 --- /dev/null +++ b/monday_code/models/increment_counter200_response_any_of.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class IncrementCounter200ResponseAnyOf(BaseModel): + """ + IncrementCounter200ResponseAnyOf + """ # noqa: E501 + new_counter_value: Optional[Any] = Field(default=None, alias="newCounterValue") + message: Optional[Any] = None + success: StrictBool + error: StrictStr + __properties: ClassVar[List[str]] = ["newCounterValue", "message", "success", "error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IncrementCounter200ResponseAnyOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if new_counter_value (nullable) is None + # and model_fields_set contains the field + if self.new_counter_value is None and "new_counter_value" in self.model_fields_set: + _dict['newCounterValue'] = None + + # set to None if message (nullable) is None + # and model_fields_set contains the field + if self.message is None and "message" in self.model_fields_set: + _dict['message'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IncrementCounter200ResponseAnyOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "newCounterValue": obj.get("newCounterValue"), + "message": obj.get("message"), + "success": obj.get("success"), + "error": obj.get("error") + }) + return _obj + + diff --git a/monday_code/models/increment_counter200_response_any_of1.py b/monday_code/models/increment_counter200_response_any_of1.py new file mode 100644 index 0000000..2422eb6 --- /dev/null +++ b/monday_code/models/increment_counter200_response_any_of1.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class IncrementCounter200ResponseAnyOf1(BaseModel): + """ + IncrementCounter200ResponseAnyOf1 + """ # noqa: E501 + error: Optional[Any] = None + success: StrictBool + new_counter_value: Union[StrictFloat, StrictInt] = Field(alias="newCounterValue") + message: StrictStr + __properties: ClassVar[List[str]] = ["error", "success", "newCounterValue", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IncrementCounter200ResponseAnyOf1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IncrementCounter200ResponseAnyOf1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "success": obj.get("success"), + "newCounterValue": obj.get("newCounterValue"), + "message": obj.get("message") + }) + return _obj + + diff --git a/monday_code/models/secure_storage_data_contract.py b/monday_code/models/json_data_contract.py similarity index 91% rename from monday_code/models/secure_storage_data_contract.py rename to monday_code/models/json_data_contract.py index d4bd0fc..9cf30dc 100644 --- a/monday_code/models/secure_storage_data_contract.py +++ b/monday_code/models/json_data_contract.py @@ -22,9 +22,9 @@ from typing import Optional, Set from typing_extensions import Self -class SecureStorageDataContract(BaseModel): +class JsonDataContract(BaseModel): """ - SecureStorageDataContract + JsonDataContract """ # noqa: E501 value: Optional[Any] __properties: ClassVar[List[str]] = ["value"] @@ -47,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SecureStorageDataContract from a JSON string""" + """Create an instance of JsonDataContract from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SecureStorageDataContract from a dict""" + """Create an instance of JsonDataContract from a dict""" if obj is None: return None diff --git a/monday_code/models/json_value.py b/monday_code/models/json_value.py deleted file mode 100644 index e13c3ab..0000000 --- a/monday_code/models/json_value.py +++ /dev/null @@ -1,197 +0,0 @@ -# coding: utf-8 - -""" - mcode-sdk-api - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: 0.0.1 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator -from typing import Dict, List, Optional, Union -from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict -from typing_extensions import Literal, Self -from pydantic import Field - -JSONVALUE_ANY_OF_SCHEMAS = ["Dict[str, JsonValue]", "List[JsonValue]", "bool", "float", "str"] - -class JsonValue(BaseModel): - """ - JsonValue - """ - - # data type: str - anyof_schema_1_validator: Optional[StrictStr] = None - # data type: float - anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None - # data type: bool - anyof_schema_3_validator: Optional[StrictBool] = None - # data type: List[JsonValue] - anyof_schema_4_validator: Optional[List[Optional[JsonValue]]] = None - # data type: Dict[str, JsonValue] - anyof_schema_5_validator: Optional[Dict[str, Optional[JsonValue]]] = None - if TYPE_CHECKING: - actual_instance: Optional[Union[Dict[str, JsonValue], List[JsonValue], bool, float, str]] = None - else: - actual_instance: Any = None - any_of_schemas: Set[str] = { "Dict[str, JsonValue]", "List[JsonValue]", "bool", "float", "str" } - - model_config = { - "validate_assignment": True, - "protected_namespaces": (), - } - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator('actual_instance') - def actual_instance_must_validate_anyof(cls, v): - if v is None: - return v - - instance = JsonValue.model_construct() - error_messages = [] - # validate data type: str - try: - instance.anyof_schema_1_validator = v - return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: float - try: - instance.anyof_schema_2_validator = v - return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: bool - try: - instance.anyof_schema_3_validator = v - return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: List[JsonValue] - try: - instance.anyof_schema_4_validator = v - return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: Dict[str, JsonValue] - try: - instance.anyof_schema_5_validator = v - return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if error_messages: - # no match - raise ValueError("No match found when setting the actual_instance in JsonValue with anyOf schemas: Dict[str, JsonValue], List[JsonValue], bool, float, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - if json_str is None: - return instance - - error_messages = [] - # deserialize data into str - try: - # validation - instance.anyof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_1_validator - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into float - try: - # validation - instance.anyof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_2_validator - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into bool - try: - # validation - instance.anyof_schema_3_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_3_validator - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into List[JsonValue] - try: - # validation - instance.anyof_schema_4_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_4_validator - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into Dict[str, JsonValue] - try: - # validation - instance.anyof_schema_5_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_5_validator - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if error_messages: - # no match - raise ValueError("No match found when deserializing the JSON string into JsonValue with anyOf schemas: Dict[str, JsonValue], List[JsonValue], bool, float, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, JsonValue], List[JsonValue], bool, float, str]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) - -# TODO: Rewrite to not use raise_errors -JsonValue.model_rebuild(raise_errors=False) - diff --git a/monday_code/models/storage_data_contract.py b/monday_code/models/storage_data_contract.py index 914027a..2a0fa04 100644 --- a/monday_code/models/storage_data_contract.py +++ b/monday_code/models/storage_data_contract.py @@ -19,7 +19,6 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from monday_code.models.json_value import JsonValue from typing import Optional, Set from typing_extensions import Self @@ -28,7 +27,7 @@ class StorageDataContract(BaseModel): StorageDataContract """ # noqa: E501 version: StrictStr - value: Optional[JsonValue] + value: Optional[Any] __properties: ClassVar[List[str]] = ["version", "value"] model_config = ConfigDict( @@ -70,9 +69,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of value - if self.value: - _dict['value'] = self.value.to_dict() # set to None if value (nullable) is None # and model_fields_set contains the field if self.value is None and "value" in self.model_fields_set: @@ -91,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "version": obj.get("version"), - "value": JsonValue.from_dict(obj["value"]) if obj.get("value") is not None else None + "value": obj.get("value") }) return _obj diff --git a/monday_code/models/upsert_by_key_from_storage200_response.py b/monday_code/models/upsert_by_key_from_storage200_response.py new file mode 100644 index 0000000..8fd5f37 --- /dev/null +++ b/monday_code/models/upsert_by_key_from_storage200_response.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from monday_code.models.upsert_by_key_from_storage200_response_any_of import UpsertByKeyFromStorage200ResponseAnyOf +from monday_code.models.upsert_by_key_from_storage200_response_any_of1 import UpsertByKeyFromStorage200ResponseAnyOf1 +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +UPSERTBYKEYFROMSTORAGE200RESPONSE_ANY_OF_SCHEMAS = ["UpsertByKeyFromStorage200ResponseAnyOf", "UpsertByKeyFromStorage200ResponseAnyOf1"] + +class UpsertByKeyFromStorage200Response(BaseModel): + """ + UpsertByKeyFromStorage200Response + """ + + # data type: UpsertByKeyFromStorage200ResponseAnyOf + anyof_schema_1_validator: Optional[UpsertByKeyFromStorage200ResponseAnyOf] = None + # data type: UpsertByKeyFromStorage200ResponseAnyOf1 + anyof_schema_2_validator: Optional[UpsertByKeyFromStorage200ResponseAnyOf1] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[UpsertByKeyFromStorage200ResponseAnyOf, UpsertByKeyFromStorage200ResponseAnyOf1]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "UpsertByKeyFromStorage200ResponseAnyOf", "UpsertByKeyFromStorage200ResponseAnyOf1" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = UpsertByKeyFromStorage200Response.model_construct() + error_messages = [] + # validate data type: UpsertByKeyFromStorage200ResponseAnyOf + if not isinstance(v, UpsertByKeyFromStorage200ResponseAnyOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpsertByKeyFromStorage200ResponseAnyOf`") + else: + return v + + # validate data type: UpsertByKeyFromStorage200ResponseAnyOf1 + if not isinstance(v, UpsertByKeyFromStorage200ResponseAnyOf1): + error_messages.append(f"Error! Input type `{type(v)}` is not `UpsertByKeyFromStorage200ResponseAnyOf1`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in UpsertByKeyFromStorage200Response with anyOf schemas: UpsertByKeyFromStorage200ResponseAnyOf, UpsertByKeyFromStorage200ResponseAnyOf1. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[UpsertByKeyFromStorage200ResponseAnyOf] = None + try: + instance.actual_instance = UpsertByKeyFromStorage200ResponseAnyOf.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[UpsertByKeyFromStorage200ResponseAnyOf1] = None + try: + instance.actual_instance = UpsertByKeyFromStorage200ResponseAnyOf1.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into UpsertByKeyFromStorage200Response with anyOf schemas: UpsertByKeyFromStorage200ResponseAnyOf, UpsertByKeyFromStorage200ResponseAnyOf1. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], UpsertByKeyFromStorage200ResponseAnyOf, UpsertByKeyFromStorage200ResponseAnyOf1]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/monday_code/models/upsert_by_key_from_storage200_response_any_of.py b/monday_code/models/upsert_by_key_from_storage200_response_any_of.py new file mode 100644 index 0000000..e3b3fda --- /dev/null +++ b/monday_code/models/upsert_by_key_from_storage200_response_any_of.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpsertByKeyFromStorage200ResponseAnyOf(BaseModel): + """ + UpsertByKeyFromStorage200ResponseAnyOf + """ # noqa: E501 + error: Optional[Any] = None + success: StrictBool + version: StrictStr + __properties: ClassVar[List[str]] = ["error", "success", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpsertByKeyFromStorage200ResponseAnyOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpsertByKeyFromStorage200ResponseAnyOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "success": obj.get("success"), + "version": obj.get("version") + }) + return _obj + + diff --git a/monday_code/models/upsert_by_key_from_storage200_response_any_of1.py b/monday_code/models/upsert_by_key_from_storage200_response_any_of1.py new file mode 100644 index 0000000..6af1931 --- /dev/null +++ b/monday_code/models/upsert_by_key_from_storage200_response_any_of1.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpsertByKeyFromStorage200ResponseAnyOf1(BaseModel): + """ + UpsertByKeyFromStorage200ResponseAnyOf1 + """ # noqa: E501 + version: Optional[Any] = None + success: StrictBool + error: StrictStr + __properties: ClassVar[List[str]] = ["version", "success", "error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpsertByKeyFromStorage200ResponseAnyOf1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if version (nullable) is None + # and model_fields_set contains the field + if self.version is None and "version" in self.model_fields_set: + _dict['version'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpsertByKeyFromStorage200ResponseAnyOf1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "version": obj.get("version"), + "success": obj.get("success"), + "error": obj.get("error") + }) + return _obj + + diff --git a/setup.py b/setup.py index 8dd88ff..a115c1d 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "monday-code" -VERSION = "0.0.7" +VERSION = "0.0.1" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", @@ -29,25 +29,22 @@ "pydantic >= 2", "typing-extensions >= 4.7.1", ] -# read the contents of your README file -from pathlib import Path - -this_directory = Path(__file__).parent -long_description = (this_directory / "README_FOR_PYPI.md").read_text() setup( name=NAME, version=VERSION, description="mcode-sdk-api", - author="Monday.Com", - author_email="support@monday.com", + author="OpenAPI Generator community", + author_email="team@openapitools.org", url="", - keywords=["monday-code"], + keywords=["OpenAPI", "OpenAPI-Generator", "mcode-sdk-api"], install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="MIT", - long_description=long_description, - long_description_content_type="text/markdown", + long_description_content_type='text/markdown', + long_description="""\ + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + """, # noqa: E501 package_data={"monday_code": ["py.typed"]}, ) diff --git a/test/test_increment_counter200_response.py b/test/test_increment_counter200_response.py new file mode 100644 index 0000000..156a82b --- /dev/null +++ b/test/test_increment_counter200_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from monday_code.models.increment_counter200_response import IncrementCounter200Response + +class TestIncrementCounter200Response(unittest.TestCase): + """IncrementCounter200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IncrementCounter200Response: + """Test IncrementCounter200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `IncrementCounter200Response` + """ + model = IncrementCounter200Response() + if include_optional: + return IncrementCounter200Response( + new_counter_value = 1.337, + message = '', + success = True, + error = monday_code.models.error.error() + ) + else: + return IncrementCounter200Response( + new_counter_value = 1.337, + message = '', + success = True, + error = monday_code.models.error.error(), + ) + """ + + def testIncrementCounter200Response(self): + """Test IncrementCounter200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_increment_counter200_response_any_of.py b/test/test_increment_counter200_response_any_of.py new file mode 100644 index 0000000..234295a --- /dev/null +++ b/test/test_increment_counter200_response_any_of.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from monday_code.models.increment_counter200_response_any_of import IncrementCounter200ResponseAnyOf + +class TestIncrementCounter200ResponseAnyOf(unittest.TestCase): + """IncrementCounter200ResponseAnyOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IncrementCounter200ResponseAnyOf: + """Test IncrementCounter200ResponseAnyOf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `IncrementCounter200ResponseAnyOf` + """ + model = IncrementCounter200ResponseAnyOf() + if include_optional: + return IncrementCounter200ResponseAnyOf( + new_counter_value = None, + message = None, + success = True, + error = '' + ) + else: + return IncrementCounter200ResponseAnyOf( + success = True, + error = '', + ) + """ + + def testIncrementCounter200ResponseAnyOf(self): + """Test IncrementCounter200ResponseAnyOf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_increment_counter200_response_any_of1.py b/test/test_increment_counter200_response_any_of1.py new file mode 100644 index 0000000..03bb813 --- /dev/null +++ b/test/test_increment_counter200_response_any_of1.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from monday_code.models.increment_counter200_response_any_of1 import IncrementCounter200ResponseAnyOf1 + +class TestIncrementCounter200ResponseAnyOf1(unittest.TestCase): + """IncrementCounter200ResponseAnyOf1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IncrementCounter200ResponseAnyOf1: + """Test IncrementCounter200ResponseAnyOf1 + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `IncrementCounter200ResponseAnyOf1` + """ + model = IncrementCounter200ResponseAnyOf1() + if include_optional: + return IncrementCounter200ResponseAnyOf1( + error = None, + success = True, + new_counter_value = 1.337, + message = '' + ) + else: + return IncrementCounter200ResponseAnyOf1( + success = True, + new_counter_value = 1.337, + message = '', + ) + """ + + def testIncrementCounter200ResponseAnyOf1(self): + """Test IncrementCounter200ResponseAnyOf1""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_json_value.py b/test/test_json_data_contract.py similarity index 60% rename from test/test_json_value.py rename to test/test_json_data_contract.py index 3234959..d3b6aec 100644 --- a/test/test_json_value.py +++ b/test/test_json_data_contract.py @@ -14,10 +14,10 @@ import unittest -from monday_code.models.json_value import JsonValue +from monday_code.models.json_data_contract import JsonDataContract -class TestJsonValue(unittest.TestCase): - """JsonValue unit test stubs""" +class TestJsonDataContract(unittest.TestCase): + """JsonDataContract unit test stubs""" def setUp(self): pass @@ -25,24 +25,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> JsonValue: - """Test JsonValue + def make_instance(self, include_optional) -> JsonDataContract: + """Test JsonDataContract include_option is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `JsonValue` + # uncomment below to create an instance of `JsonDataContract` """ - model = JsonValue() + model = JsonDataContract() if include_optional: - return JsonValue( + return JsonDataContract( + value = None ) else: - return JsonValue( + return JsonDataContract( + value = None, ) """ - def testJsonValue(self): - """Test JsonValue""" + def testJsonDataContract(self): + """Test JsonDataContract""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_secure_storage_data_contract.py b/test/test_secure_storage_data_contract.py deleted file mode 100644 index 90ee29b..0000000 --- a/test/test_secure_storage_data_contract.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - mcode-sdk-api - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: 0.0.1 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from monday_code.models.secure_storage_data_contract import SecureStorageDataContract - -class TestSecureStorageDataContract(unittest.TestCase): - """SecureStorageDataContract unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> SecureStorageDataContract: - """Test SecureStorageDataContract - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `SecureStorageDataContract` - """ - model = SecureStorageDataContract() - if include_optional: - return SecureStorageDataContract( - value = None - ) - else: - return SecureStorageDataContract( - value = None, - ) - """ - - def testSecureStorageDataContract(self): - """Test SecureStorageDataContract""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_upsert_by_key_from_storage200_response.py b/test/test_upsert_by_key_from_storage200_response.py new file mode 100644 index 0000000..bac09b4 --- /dev/null +++ b/test/test_upsert_by_key_from_storage200_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from monday_code.models.upsert_by_key_from_storage200_response import UpsertByKeyFromStorage200Response + +class TestUpsertByKeyFromStorage200Response(unittest.TestCase): + """UpsertByKeyFromStorage200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpsertByKeyFromStorage200Response: + """Test UpsertByKeyFromStorage200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpsertByKeyFromStorage200Response` + """ + model = UpsertByKeyFromStorage200Response() + if include_optional: + return UpsertByKeyFromStorage200Response( + error = '', + success = True, + version = monday_code.models.version.version() + ) + else: + return UpsertByKeyFromStorage200Response( + error = '', + success = True, + version = monday_code.models.version.version(), + ) + """ + + def testUpsertByKeyFromStorage200Response(self): + """Test UpsertByKeyFromStorage200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_upsert_by_key_from_storage200_response_any_of.py b/test/test_upsert_by_key_from_storage200_response_any_of.py new file mode 100644 index 0000000..feb1cdf --- /dev/null +++ b/test/test_upsert_by_key_from_storage200_response_any_of.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from monday_code.models.upsert_by_key_from_storage200_response_any_of import UpsertByKeyFromStorage200ResponseAnyOf + +class TestUpsertByKeyFromStorage200ResponseAnyOf(unittest.TestCase): + """UpsertByKeyFromStorage200ResponseAnyOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpsertByKeyFromStorage200ResponseAnyOf: + """Test UpsertByKeyFromStorage200ResponseAnyOf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpsertByKeyFromStorage200ResponseAnyOf` + """ + model = UpsertByKeyFromStorage200ResponseAnyOf() + if include_optional: + return UpsertByKeyFromStorage200ResponseAnyOf( + error = None, + success = True, + version = '' + ) + else: + return UpsertByKeyFromStorage200ResponseAnyOf( + success = True, + version = '', + ) + """ + + def testUpsertByKeyFromStorage200ResponseAnyOf(self): + """Test UpsertByKeyFromStorage200ResponseAnyOf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_upsert_by_key_from_storage200_response_any_of1.py b/test/test_upsert_by_key_from_storage200_response_any_of1.py new file mode 100644 index 0000000..3752039 --- /dev/null +++ b/test/test_upsert_by_key_from_storage200_response_any_of1.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + mcode-sdk-api + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.0.1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from monday_code.models.upsert_by_key_from_storage200_response_any_of1 import UpsertByKeyFromStorage200ResponseAnyOf1 + +class TestUpsertByKeyFromStorage200ResponseAnyOf1(unittest.TestCase): + """UpsertByKeyFromStorage200ResponseAnyOf1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpsertByKeyFromStorage200ResponseAnyOf1: + """Test UpsertByKeyFromStorage200ResponseAnyOf1 + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpsertByKeyFromStorage200ResponseAnyOf1` + """ + model = UpsertByKeyFromStorage200ResponseAnyOf1() + if include_optional: + return UpsertByKeyFromStorage200ResponseAnyOf1( + version = None, + success = True, + error = '' + ) + else: + return UpsertByKeyFromStorage200ResponseAnyOf1( + success = True, + error = '', + ) + """ + + def testUpsertByKeyFromStorage200ResponseAnyOf1(self): + """Test UpsertByKeyFromStorage200ResponseAnyOf1""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() From 4b1f0c461cdff206ec64d7c4d9df3897547907d4 Mon Sep 17 00:00:00 2001 From: Ori Lael Date: Mon, 1 Jul 2024 08:20:30 +0300 Subject: [PATCH 2/4] Bump version --- .gitignore | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 43995bd..cf1c84e 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,10 @@ target/ #Ipython Notebook .ipynb_checkpoints + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +.idea/ \ No newline at end of file diff --git a/setup.py b/setup.py index a115c1d..aab97a5 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "monday-code" -VERSION = "0.0.1" +VERSION = "0.1.0" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", From 39c1716d7d3de8abbca5c7c67130c131ce4165ca Mon Sep 17 00:00:00 2001 From: Ori Lael Date: Sun, 7 Jul 2024 12:15:28 +0300 Subject: [PATCH 3/4] Make version optional on StorageDataContract --- docs/StorageDataContract.md | 2 +- monday_code/models/storage_data_contract.py | 2 +- test/test_storage_data_contract.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/StorageDataContract.md b/docs/StorageDataContract.md index cdc81b5..36351ab 100644 --- a/docs/StorageDataContract.md +++ b/docs/StorageDataContract.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**version** | **str** | | +**version** | **str** | | [optional] **value** | **object** | | ## Example diff --git a/monday_code/models/storage_data_contract.py b/monday_code/models/storage_data_contract.py index 2a0fa04..564fc44 100644 --- a/monday_code/models/storage_data_contract.py +++ b/monday_code/models/storage_data_contract.py @@ -26,7 +26,7 @@ class StorageDataContract(BaseModel): """ StorageDataContract """ # noqa: E501 - version: StrictStr + version: Optional[StrictStr] = None value: Optional[Any] __properties: ClassVar[List[str]] = ["version", "value"] diff --git a/test/test_storage_data_contract.py b/test/test_storage_data_contract.py index 9b47ace..7792134 100644 --- a/test/test_storage_data_contract.py +++ b/test/test_storage_data_contract.py @@ -40,7 +40,6 @@ def make_instance(self, include_optional) -> StorageDataContract: ) else: return StorageDataContract( - version = '', value = None, ) """ From 32cde19ba714f774951c49967aef6d08d89f647d Mon Sep 17 00:00:00 2001 From: Ori Lael Date: Sun, 7 Jul 2024 12:21:04 +0300 Subject: [PATCH 4/4] Revert setup.py changes --- setup.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index aab97a5..3601b5f 100644 --- a/setup.py +++ b/setup.py @@ -29,22 +29,25 @@ "pydantic >= 2", "typing-extensions >= 4.7.1", ] +# read the contents of your README file +from pathlib import Path + +this_directory = Path(__file__).parent +long_description = (this_directory / "README_FOR_PYPI.md").read_text() setup( name=NAME, version=VERSION, description="mcode-sdk-api", - author="OpenAPI Generator community", - author_email="team@openapitools.org", + author="Monday.Com", + author_email="support@monday.com", url="", - keywords=["OpenAPI", "OpenAPI-Generator", "mcode-sdk-api"], + keywords=["monday-code"], install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="MIT", - long_description_content_type='text/markdown', - long_description="""\ - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - """, # noqa: E501 + long_description=long_description, + long_description_content_type="text/markdown", package_data={"monday_code": ["py.typed"]}, )