diff --git a/monday-code-example/main.py b/monday-code-example/main.py deleted file mode 100644 index bae0877..0000000 --- a/monday-code-example/main.py +++ /dev/null @@ -1,107 +0,0 @@ -import sys - -# append the full absolute path of parent folder into path using pathlib -from pathlib import Path - -sys.path.append(str(Path(__file__).resolve().parents[1])) - - -import os - -from flask import Flask - -import monday_sdk -from monday_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost:59999 -# See configuration.py for a list of all supported configuration parameters. -configuration = monday_sdk.Configuration() - -app = Flask(__name__) - - -@app.route("/") -def hello_world(): - print(os.environ) - name = os.environ.get("NAME", "World") - return f"Hello from Python {name}!" - - -@app.route("/set-secure-storage-string") -def set_secure_storage_string(): - with monday_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = monday_sdk.SecureStorageApi(api_client) - key = "string_key" # str | - storage_data_contract = ( - monday_sdk.StorageDataContract() - ) # StorageDataContract | - storage_data_contract["value"] = "some_secret" - print(storage_data_contract) - try: - api_instance.put_secure_storage(key, storage_data_contract) - except Exception as e: - print( - "Exception when calling SecureStorageApi->put_secure_storage: %s\n" % e - ) - - -@app.route("/get-secure-storage-string") -def get_secure_storage_string(): - with monday_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = monday_sdk.SecureStorageApi(api_client) - key = "string_key" # str | - - try: - api_response = api_instance.get_secure_storage(key) - print("The response of SecureStorageApi->get_secure_storage:\n") - pprint(api_response) - except Exception as e: - print( - "Exception when calling SecureStorageApi->get_secure_storage: %s\n" % e - ) - - -@app.route("/set-secure-storage-object") -def set_secure_storage_object(): - with monday_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = monday_sdk.SecureStorageApi(api_client) - key = "object_key" # str | - storage_data_contract = monday_sdk.StorageDataContract( - value={"some_secret_key": "some_secret_value"} - ) - - try: - api_instance.put_secure_storage(key, storage_data_contract) - # return suceess - return "success" - - except Exception as e: - print( - "Exception when calling SecureStorageApi->put_secure_storage: %s\n" % e - ) - - -@app.route("/get-secure-storage-object") -def get_secure_storage_object(): - with monday_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = monday_sdk.SecureStorageApi(api_client) - key = "object_key" # str | - - try: - api_response = api_instance.get_secure_storage(key) - print("The response of SecureStorageApi->get_secure_storage:\n") - pprint(api_response) - return api_response.value - except Exception as e: - print( - "Exception when calling SecureStorageApi->get_secure_storage: %s\n" % e - ) - - -if __name__ == "__main__": - app.run(debug=True, host="0.0.0.0", port=int(os.environ.get("PORT", 8080))) diff --git a/monday-code-example/requirements.txt b/monday-code-example/requirements.txt deleted file mode 100644 index d0e9443..0000000 --- a/monday-code-example/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -Flask==3.0.0 -gunicorn==20.1.0 -Werkzeug==3.0.1 \ No newline at end of file diff --git a/monday-code-example/run.sh b/monday-code-example/run.sh deleted file mode 100755 index 8e1daf3..0000000 --- a/monday-code-example/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -# cp all previous folder into curent folder bash -cp -r ../**/* ./ -rm -rf monday-code-example -pip3 install -r requirements.txt -python3 main.py