Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,46 @@ def run_black_on_python():
except Exception as e:
print(f"Exception when running Black on Python files: {e}")

def run_blacken_docs():
"""
Run blacken-docs on the generated markdown documentation files in the src/docs/ directory.
This normalizes Python code blocks in markdown to use double quotes (Black style).
"""
try:
docs_dir = "src/docs"

if not os.path.exists(docs_dir):
print(f"Documentation directory {docs_dir} not found. Skipping blacken-docs.")
return

print(f"Running blacken-docs on markdown documentation in {docs_dir}...")

subprocess.run([
"python3", "-m", "pip", "install", "blacken-docs"
])

md_files = [
os.path.join(docs_dir, f)
for f in os.listdir(docs_dir)
if f.endswith(".md")
]

if md_files:
subprocess.run(["python3", "-m", "blacken_docs"] + md_files)

print("blacken-docs formatting completed successfully.")
except Exception as e:
print(f"Exception when running blacken-docs: {e}")


def format_code():
"""
Format both Python and Markdown files in the repository.
"""
run_black_on_python()
run_blacken_docs()
run_prettier_on_docs()
print("All code formatting completed.")
print("All code formatting completed.")

def generate_and_format():
"""
Expand All @@ -210,10 +243,10 @@ def generate_and_format():
if __name__ == "__main__":
if len(sys.argv) != 2:
print(
"Usage: python3 scripts.py [download_python_template | "
"Usage: python3 scripts.py [download_python_template | "
"generate_package | build_distro_package | "
"remove_deprecated_parameters | run_prettier_on_docs | "
"run_black_on_python | format_code | generate_and_format]"
"run_black_on_python | run_blacken_docs | format_code | generate_and_format]"
)
sys.exit(1)

Expand All @@ -230,6 +263,8 @@ def generate_and_format():
run_prettier_on_docs()
elif script_to_run == "run_black_on_python":
run_black_on_python()
elif script_to_run == "run_blacken_docs":
run_blacken_docs()
elif script_to_run == "format_code":
format_code()
elif script_to_run == "generate_and_format":
Expand Down
4 changes: 3 additions & 1 deletion src/docs/AddDeviceToFleetsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ print(AddDeviceToFleetsRequest.to_json())
# convert the object into a dict
add_device_to_fleets_request_dict = add_device_to_fleets_request_instance.to_dict()
# create an instance of AddDeviceToFleetsRequest from a dict
add_device_to_fleets_request_from_dict = AddDeviceToFleetsRequest.from_dict(add_device_to_fleets_request_dict)
add_device_to_fleets_request_from_dict = AddDeviceToFleetsRequest.from_dict(
add_device_to_fleets_request_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)
19 changes: 11 additions & 8 deletions src/docs/AlertApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,24 @@ from notehub_py.models.get_alerts200_response import GetAlerts200Response
from notehub_py.rest import ApiException
from pprint import pprint

configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.AlertApi(api_client)
project_or_product_uid = 'app:2606f411-dea6-44a0-9743-1130f57d77d8' # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
monitor_uid = 'monitor_uid_example' # str | (optional)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
monitor_uid = "monitor_uid_example" # str | (optional)

try:
api_response = api_instance.get_alerts(project_or_product_uid, page_size=page_size, page_num=page_num, monitor_uid=monitor_uid)
api_response = api_instance.get_alerts(
project_or_product_uid,
page_size=page_size,
page_num=page_num,
monitor_uid=monitor_uid,
)
print("The response of AlertApi->get_alerts:\n")
pprint(api_response)
except Exception as e:
Expand Down
4 changes: 3 additions & 1 deletion src/docs/AlertNotificationsInner.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ print(AlertNotificationsInner.to_json())
# convert the object into a dict
alert_notifications_inner_dict = alert_notifications_inner_instance.to_dict()
# create an instance of AlertNotificationsInner from a dict
alert_notifications_inner_from_dict = AlertNotificationsInner.from_dict(alert_notifications_inner_dict)
alert_notifications_inner_from_dict = AlertNotificationsInner.from_dict(
alert_notifications_inner_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)
22 changes: 15 additions & 7 deletions src/docs/AuthorizationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ from pprint import pprint
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.AuthorizationApi(api_client)
login_request = {"password":"test-password","username":"name@example.com"} # LoginRequest |
login_request = {
"password": "test-password",
"username": "name@example.com",
} # LoginRequest |

try:
api_response = api_instance.login(login_request)
Expand Down Expand Up @@ -77,18 +80,23 @@ from pprint import pprint
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.AuthorizationApi(api_client)
client_id = 'client_id_example' # str |
client_secret = 'client_secret_example' # str |
grant_type = 'grant_type_example' # str |
scope = 'scope_example' # str | Space-delimited scopes. (optional)
client_id = "client_id_example" # str |
client_secret = "client_secret_example" # str |
grant_type = "grant_type_example" # str |
scope = "scope_example" # str | Space-delimited scopes. (optional)

try:
# Issue an OAuth 2.0 access token (Client Credentials)
api_response = api_instance.o_auth2_client_credentials(client_id, client_secret, grant_type, scope=scope)
api_response = api_instance.o_auth2_client_credentials(
client_id, client_secret, grant_type, scope=scope
)
print("The response of AuthorizationApi->o_auth2_client_credentials:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AuthorizationApi->o_auth2_client_credentials: %s\n" % e)
print(
"Exception when calling AuthorizationApi->o_auth2_client_credentials: %s\n"
% e
)
```

### Parameters
Expand Down
49 changes: 29 additions & 20 deletions src/docs/BillingAccountApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ Get Billing Account Information

```python
import notehub_py
from notehub_py.models.get_billing_account200_response import GetBillingAccount200Response
from notehub_py.models.get_billing_account200_response import (
GetBillingAccount200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint

configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.BillingAccountApi(api_client)
billing_account_uid = '00000000-0000-0000-000000000001' # str |
billing_account_uid = "00000000-0000-0000-000000000001" # str |

try:
api_response = api_instance.get_billing_account(billing_account_uid)
Expand Down Expand Up @@ -73,28 +73,35 @@ Get Billing Account Balance history, only enterprise supported

```python
import notehub_py
from notehub_py.models.get_billing_account_balance_history200_response import GetBillingAccountBalanceHistory200Response
from notehub_py.models.get_billing_account_balance_history200_response import (
GetBillingAccountBalanceHistory200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint

configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.BillingAccountApi(api_client)
billing_account_uid = '00000000-0000-0000-000000000001' # str |
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
billing_account_uid = "00000000-0000-0000-000000000001" # str |
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)

try:
api_response = api_instance.get_billing_account_balance_history(billing_account_uid, start_date=start_date, end_date=end_date)
print("The response of BillingAccountApi->get_billing_account_balance_history:\n")
api_response = api_instance.get_billing_account_balance_history(
billing_account_uid, start_date=start_date, end_date=end_date
)
print(
"The response of BillingAccountApi->get_billing_account_balance_history:\n"
)
pprint(api_response)
except Exception as e:
print("Exception when calling BillingAccountApi->get_billing_account_balance_history: %s\n" % e)
print(
"Exception when calling BillingAccountApi->get_billing_account_balance_history: %s\n"
% e
)
```

### Parameters
Expand Down Expand Up @@ -130,13 +137,13 @@ Get Billing Accounts accessible by the api_key

```python
import notehub_py
from notehub_py.models.get_billing_accounts200_response import GetBillingAccounts200Response
from notehub_py.models.get_billing_accounts200_response import (
GetBillingAccounts200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint

configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")

# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
Expand All @@ -148,7 +155,9 @@ with notehub_py.ApiClient(configuration) as api_client:
print("The response of BillingAccountApi->get_billing_accounts:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BillingAccountApi->get_billing_accounts: %s\n" % e)
print(
"Exception when calling BillingAccountApi->get_billing_accounts: %s\n" % e
)
```

### Parameters
Expand Down
4 changes: 3 additions & 1 deletion src/docs/CancelJobRun200Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ print(CancelJobRun200Response.to_json())
# convert the object into a dict
cancel_job_run200_response_dict = cancel_job_run200_response_instance.to_dict()
# create an instance of CancelJobRun200Response from a dict
cancel_job_run200_response_from_dict = CancelJobRun200Response.from_dict(cancel_job_run200_response_dict)
cancel_job_run200_response_from_dict = CancelJobRun200Response.from_dict(
cancel_job_run200_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)
4 changes: 3 additions & 1 deletion src/docs/CloneProjectRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ print(CloneProjectRequest.to_json())
# convert the object into a dict
clone_project_request_dict = clone_project_request_instance.to_dict()
# create an instance of CloneProjectRequest from a dict
clone_project_request_from_dict = CloneProjectRequest.from_dict(clone_project_request_dict)
clone_project_request_from_dict = CloneProjectRequest.from_dict(
clone_project_request_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)
4 changes: 3 additions & 1 deletion src/docs/CreateJob201Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ print(CreateJob201Response.to_json())
# convert the object into a dict
create_job201_response_dict = create_job201_response_instance.to_dict()
# create an instance of CreateJob201Response from a dict
create_job201_response_from_dict = CreateJob201Response.from_dict(create_job201_response_dict)
create_job201_response_from_dict = CreateJob201Response.from_dict(
create_job201_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)
4 changes: 3 additions & 1 deletion src/docs/CreateProductRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ print(CreateProductRequest.to_json())
# convert the object into a dict
create_product_request_dict = create_product_request_instance.to_dict()
# create an instance of CreateProductRequest from a dict
create_product_request_from_dict = CreateProductRequest.from_dict(create_product_request_dict)
create_product_request_from_dict = CreateProductRequest.from_dict(
create_product_request_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)
4 changes: 3 additions & 1 deletion src/docs/CreateProjectRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ print(CreateProjectRequest.to_json())
# convert the object into a dict
create_project_request_dict = create_project_request_instance.to_dict()
# create an instance of CreateProjectRequest from a dict
create_project_request_from_dict = CreateProjectRequest.from_dict(create_project_request_dict)
create_project_request_from_dict = CreateProjectRequest.from_dict(
create_project_request_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)
4 changes: 3 additions & 1 deletion src/docs/CreateUpdateRepository.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ print(CreateUpdateRepository.to_json())
# convert the object into a dict
create_update_repository_dict = create_update_repository_instance.to_dict()
# create an instance of CreateUpdateRepository from a dict
create_update_repository_from_dict = CreateUpdateRepository.from_dict(create_update_repository_dict)
create_update_repository_from_dict = CreateUpdateRepository.from_dict(
create_update_repository_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)
16 changes: 12 additions & 4 deletions src/docs/DeleteDeviceFromFleetsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@
## Example

```python
from notehub_py.models.delete_device_from_fleets_request import DeleteDeviceFromFleetsRequest
from notehub_py.models.delete_device_from_fleets_request import (
DeleteDeviceFromFleetsRequest,
)

# TODO update the JSON string below
json = "{}"
# create an instance of DeleteDeviceFromFleetsRequest from a JSON string
delete_device_from_fleets_request_instance = DeleteDeviceFromFleetsRequest.from_json(json)
delete_device_from_fleets_request_instance = DeleteDeviceFromFleetsRequest.from_json(
json
)
# print the JSON string representation of the object
print(DeleteDeviceFromFleetsRequest.to_json())

# convert the object into a dict
delete_device_from_fleets_request_dict = delete_device_from_fleets_request_instance.to_dict()
delete_device_from_fleets_request_dict = (
delete_device_from_fleets_request_instance.to_dict()
)
# create an instance of DeleteDeviceFromFleetsRequest from a dict
delete_device_from_fleets_request_from_dict = DeleteDeviceFromFleetsRequest.from_dict(delete_device_from_fleets_request_dict)
delete_device_from_fleets_request_from_dict = DeleteDeviceFromFleetsRequest.from_dict(
delete_device_from_fleets_request_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)
4 changes: 3 additions & 1 deletion src/docs/DeleteJob200Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ print(DeleteJob200Response.to_json())
# convert the object into a dict
delete_job200_response_dict = delete_job200_response_instance.to_dict()
# create an instance of DeleteJob200Response from a dict
delete_job200_response_from_dict = DeleteJob200Response.from_dict(delete_job200_response_dict)
delete_job200_response_from_dict = DeleteJob200Response.from_dict(
delete_job200_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)
4 changes: 3 additions & 1 deletion src/docs/DeleteNotefilesRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ print(DeleteNotefilesRequest.to_json())
# convert the object into a dict
delete_notefiles_request_dict = delete_notefiles_request_instance.to_dict()
# create an instance of DeleteNotefilesRequest from a dict
delete_notefiles_request_from_dict = DeleteNotefilesRequest.from_dict(delete_notefiles_request_dict)
delete_notefiles_request_from_dict = DeleteNotefilesRequest.from_dict(
delete_notefiles_request_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)
Loading
Loading