cloudraker 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cloudraker-0.1.1/.gitignore +5 -0
- cloudraker-0.1.1/PKG-INFO +49 -0
- cloudraker-0.1.1/README.md +39 -0
- cloudraker-0.1.1/pyproject.toml +19 -0
- cloudraker-0.1.1/src/cloudraker/.fern/metadata.json +12 -0
- cloudraker-0.1.1/src/cloudraker/CONTRIBUTING.md +125 -0
- cloudraker-0.1.1/src/cloudraker/README.md +184 -0
- cloudraker-0.1.1/src/cloudraker/__init__.py +189 -0
- cloudraker-0.1.1/src/cloudraker/_default_clients.py +30 -0
- cloudraker-0.1.1/src/cloudraker/actions/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/actions/client.py +575 -0
- cloudraker-0.1.1/src/cloudraker/actions/raw_client.py +625 -0
- cloudraker-0.1.1/src/cloudraker/authorization/__init__.py +58 -0
- cloudraker-0.1.1/src/cloudraker/authorization/client.py +1379 -0
- cloudraker-0.1.1/src/cloudraker/authorization/raw_client.py +1607 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/__init__.py +56 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/check_my_access_request_checks_item.py +27 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/create_grant_request_resource_type.py +5 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/create_grant_request_subject.py +28 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/delete_grant_request_resource_type.py +5 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/delete_grant_request_subject.py +28 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/list_resource_grants_request_assignment.py +5 -0
- cloudraker-0.1.1/src/cloudraker/authorization/types/list_resource_grants_request_resource_type.py +5 -0
- cloudraker-0.1.1/src/cloudraker/client.py +736 -0
- cloudraker-0.1.1/src/cloudraker/core/__init__.py +127 -0
- cloudraker-0.1.1/src/cloudraker/core/api_error.py +23 -0
- cloudraker-0.1.1/src/cloudraker/core/client_wrapper.py +144 -0
- cloudraker-0.1.1/src/cloudraker/core/datetime_utils.py +70 -0
- cloudraker-0.1.1/src/cloudraker/core/file.py +67 -0
- cloudraker-0.1.1/src/cloudraker/core/force_multipart.py +18 -0
- cloudraker-0.1.1/src/cloudraker/core/http_client.py +885 -0
- cloudraker-0.1.1/src/cloudraker/core/http_response.py +59 -0
- cloudraker-0.1.1/src/cloudraker/core/http_sse/__init__.py +42 -0
- cloudraker-0.1.1/src/cloudraker/core/http_sse/_api.py +455 -0
- cloudraker-0.1.1/src/cloudraker/core/http_sse/_decoders.py +74 -0
- cloudraker-0.1.1/src/cloudraker/core/http_sse/_exceptions.py +7 -0
- cloudraker-0.1.1/src/cloudraker/core/http_sse/_models.py +17 -0
- cloudraker-0.1.1/src/cloudraker/core/jsonable_encoder.py +120 -0
- cloudraker-0.1.1/src/cloudraker/core/logging.py +107 -0
- cloudraker-0.1.1/src/cloudraker/core/parse_error.py +36 -0
- cloudraker-0.1.1/src/cloudraker/core/pydantic_utilities.py +508 -0
- cloudraker-0.1.1/src/cloudraker/core/query_encoder.py +58 -0
- cloudraker-0.1.1/src/cloudraker/core/remove_none_from_dict.py +11 -0
- cloudraker-0.1.1/src/cloudraker/core/request_options.py +40 -0
- cloudraker-0.1.1/src/cloudraker/core/serialization.py +347 -0
- cloudraker-0.1.1/src/cloudraker/data_objects/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/data_objects/client.py +1557 -0
- cloudraker-0.1.1/src/cloudraker/data_objects/raw_client.py +2386 -0
- cloudraker-0.1.1/src/cloudraker/environment.py +7 -0
- cloudraker-0.1.1/src/cloudraker/errors/__init__.py +56 -0
- cloudraker-0.1.1/src/cloudraker/errors/bad_request_error.py +10 -0
- cloudraker-0.1.1/src/cloudraker/errors/conflict_error.py +10 -0
- cloudraker-0.1.1/src/cloudraker/errors/content_too_large_error.py +10 -0
- cloudraker-0.1.1/src/cloudraker/errors/forbidden_error.py +10 -0
- cloudraker-0.1.1/src/cloudraker/errors/gone_error.py +10 -0
- cloudraker-0.1.1/src/cloudraker/errors/not_found_error.py +10 -0
- cloudraker-0.1.1/src/cloudraker/errors/unprocessable_entity_error.py +10 -0
- cloudraker-0.1.1/src/cloudraker/files/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/files/client.py +397 -0
- cloudraker-0.1.1/src/cloudraker/files/raw_client.py +398 -0
- cloudraker-0.1.1/src/cloudraker/home/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/home/client.py +100 -0
- cloudraker-0.1.1/src/cloudraker/home/raw_client.py +99 -0
- cloudraker-0.1.1/src/cloudraker/me/__init__.py +34 -0
- cloudraker-0.1.1/src/cloudraker/me/client.py +249 -0
- cloudraker-0.1.1/src/cloudraker/me/raw_client.py +296 -0
- cloudraker-0.1.1/src/cloudraker/me/types/__init__.py +34 -0
- cloudraker-0.1.1/src/cloudraker/me/types/update_user_preferences_language.py +5 -0
- cloudraker-0.1.1/src/cloudraker/ontology/__init__.py +37 -0
- cloudraker-0.1.1/src/cloudraker/ontology/client.py +966 -0
- cloudraker-0.1.1/src/cloudraker/ontology/raw_client.py +953 -0
- cloudraker-0.1.1/src/cloudraker/ontology/types/__init__.py +38 -0
- cloudraker-0.1.1/src/cloudraker/ontology/types/search_org_ontology_request_types_item.py +7 -0
- cloudraker-0.1.1/src/cloudraker/ontology/types/search_space_ontology_request_types_item.py +7 -0
- cloudraker-0.1.1/src/cloudraker/organization_settings/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/organization_settings/client.py +688 -0
- cloudraker-0.1.1/src/cloudraker/organization_settings/raw_client.py +724 -0
- cloudraker-0.1.1/src/cloudraker/organization_templates/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/organization_templates/client.py +289 -0
- cloudraker-0.1.1/src/cloudraker/organization_templates/raw_client.py +282 -0
- cloudraker-0.1.1/src/cloudraker/playbooks/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/playbooks/client.py +1824 -0
- cloudraker-0.1.1/src/cloudraker/playbooks/raw_client.py +1931 -0
- cloudraker-0.1.1/src/cloudraker/raw_client.py +419 -0
- cloudraker-0.1.1/src/cloudraker/reference.md +9857 -0
- cloudraker-0.1.1/src/cloudraker/runs/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/runs/client.py +1101 -0
- cloudraker-0.1.1/src/cloudraker/runs/raw_client.py +1103 -0
- cloudraker-0.1.1/src/cloudraker/search/__init__.py +4 -0
- cloudraker-0.1.1/src/cloudraker/search/client.py +105 -0
- cloudraker-0.1.1/src/cloudraker/search/raw_client.py +88 -0
- cloudraker-0.1.1/src/cloudraker/spaces/__init__.py +37 -0
- cloudraker-0.1.1/src/cloudraker/spaces/client.py +537 -0
- cloudraker-0.1.1/src/cloudraker/spaces/raw_client.py +670 -0
- cloudraker-0.1.1/src/cloudraker/spaces/types/__init__.py +38 -0
- cloudraker-0.1.1/src/cloudraker/spaces/types/update_space_type_request_ontology.py +39 -0
- cloudraker-0.1.1/src/cloudraker/spaces/types/update_space_type_request_ontology_entities_item.py +20 -0
- cloudraker-0.1.1/src/cloudraker/tests/conftest.py +21 -0
- cloudraker-0.1.1/src/cloudraker/tests/test_aiohttp_autodetect.py +113 -0
- cloudraker-0.1.1/src/cloudraker/types/__init__.py +74 -0
- cloudraker-0.1.1/src/cloudraker/types/get_health_response.py +20 -0
- cloudraker-0.1.1/src/cloudraker/types/get_health_response_status.py +5 -0
- cloudraker-0.1.1/src/cloudraker/types/home.py +34 -0
- cloudraker-0.1.1/src/cloudraker/types/home_activity_item.py +31 -0
- cloudraker-0.1.1/src/cloudraker/types/home_activity_item_actor.py +23 -0
- cloudraker-0.1.1/src/cloudraker/types/home_activity_item_resource.py +21 -0
- cloudraker-0.1.1/src/cloudraker/types/home_pending_approvals_item.py +27 -0
- cloudraker-0.1.1/src/cloudraker/types/home_recent_spaces_item.py +24 -0
- cloudraker-0.1.1/src/cloudraker/types/home_summary.py +27 -0
- cloudraker-0.1.1/src/cloudraker/types/me.py +26 -0
- cloudraker-0.1.1/src/cloudraker/types/user_preferences.py +28 -0
- cloudraker-0.1.1/src/cloudraker/types/user_preferences_language.py +5 -0
- cloudraker-0.1.1/src/cloudraker/types/widget_token.py +19 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cloudraker
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Python SDK for the CloudRaker API
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Requires-Dist: httpx>=0.21.2
|
|
7
|
+
Requires-Dist: pydantic>=1.9.2
|
|
8
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# cloudraker
|
|
12
|
+
|
|
13
|
+
The official Python SDK for the [CloudRaker](https://cloudraker.com) API.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pip install cloudraker
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from cloudraker.client import CloudRaker
|
|
25
|
+
|
|
26
|
+
client = CloudRaker(token="YOUR_API_KEY")
|
|
27
|
+
spaces = client.spaces.list_spaces()
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Authenticate with an organization API key or a user access token as the
|
|
31
|
+
bearer `token`.
|
|
32
|
+
|
|
33
|
+
An async client is included:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from cloudraker.client import AsyncCloudRaker
|
|
37
|
+
|
|
38
|
+
client = AsyncCloudRaker(token="YOUR_API_KEY")
|
|
39
|
+
spaces = await client.spaces.list_spaces()
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Error handling
|
|
43
|
+
|
|
44
|
+
Failed requests raise `cloudraker.core.ApiError` with `status_code` and `body`.
|
|
45
|
+
|
|
46
|
+
## Reference
|
|
47
|
+
|
|
48
|
+
Per-endpoint documentation with usage snippets ships with the package —
|
|
49
|
+
see `reference.md` inside the installed `cloudraker` package.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# cloudraker
|
|
2
|
+
|
|
3
|
+
The official Python SDK for the [CloudRaker](https://cloudraker.com) API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pip install cloudraker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from cloudraker.client import CloudRaker
|
|
15
|
+
|
|
16
|
+
client = CloudRaker(token="YOUR_API_KEY")
|
|
17
|
+
spaces = client.spaces.list_spaces()
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Authenticate with an organization API key or a user access token as the
|
|
21
|
+
bearer `token`.
|
|
22
|
+
|
|
23
|
+
An async client is included:
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from cloudraker.client import AsyncCloudRaker
|
|
27
|
+
|
|
28
|
+
client = AsyncCloudRaker(token="YOUR_API_KEY")
|
|
29
|
+
spaces = await client.spaces.list_spaces()
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Error handling
|
|
33
|
+
|
|
34
|
+
Failed requests raise `cloudraker.core.ApiError` with `status_code` and `body`.
|
|
35
|
+
|
|
36
|
+
## Reference
|
|
37
|
+
|
|
38
|
+
Per-endpoint documentation with usage snippets ships with the package —
|
|
39
|
+
see `reference.md` inside the installed `cloudraker` package.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "cloudraker"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
description = "Python SDK for the CloudRaker API"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"httpx>=0.21.2",
|
|
9
|
+
"pydantic>=1.9.2",
|
|
10
|
+
"typing_extensions>=4.0.0",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[build-system]
|
|
14
|
+
requires = ["hatchling"]
|
|
15
|
+
build-backend = "hatchling.build"
|
|
16
|
+
|
|
17
|
+
[tool.hatch.build.targets.wheel]
|
|
18
|
+
packages = ["src/cloudraker"]
|
|
19
|
+
exclude = ["src/cloudraker/tests"]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cliVersion": "5.50.4",
|
|
3
|
+
"generatorName": "fernapi/fern-python-sdk",
|
|
4
|
+
"generatorVersion": "5.20.1",
|
|
5
|
+
"generatorConfig": {
|
|
6
|
+
"client_class_name": "CloudRaker"
|
|
7
|
+
},
|
|
8
|
+
"originGitCommit": "b37ad38fbe4a65fe4aa7c815fb2fc7a9a1ea3725",
|
|
9
|
+
"originGitCommitIsDirty": false,
|
|
10
|
+
"invokedBy": "ci",
|
|
11
|
+
"ciProvider": "github"
|
|
12
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Python 3.9+
|
|
10
|
+
- pip
|
|
11
|
+
- poetry
|
|
12
|
+
|
|
13
|
+
### Installation
|
|
14
|
+
|
|
15
|
+
Install the project dependencies:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
poetry install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Building
|
|
22
|
+
|
|
23
|
+
Build the project:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
poetry build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Testing
|
|
30
|
+
|
|
31
|
+
Run the test suite:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
poetry run pytest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Linting and Formatting
|
|
38
|
+
|
|
39
|
+
Check code style:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
poetry run ruff check .
|
|
43
|
+
poetry run ruff format .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Type Checking
|
|
47
|
+
|
|
48
|
+
Run the type checker:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
poetry run mypy .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## About Generated Code
|
|
55
|
+
|
|
56
|
+
**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.
|
|
57
|
+
|
|
58
|
+
### Generated Files
|
|
59
|
+
|
|
60
|
+
The following directories contain generated code:
|
|
61
|
+
- `src/` - API client classes and types
|
|
62
|
+
- Most Python files in the project
|
|
63
|
+
|
|
64
|
+
### How to Customize
|
|
65
|
+
|
|
66
|
+
If you need to customize the SDK, you have two options:
|
|
67
|
+
|
|
68
|
+
#### Option 1: Use `.fernignore`
|
|
69
|
+
|
|
70
|
+
For custom code that should persist across SDK regenerations:
|
|
71
|
+
|
|
72
|
+
1. Create a `.fernignore` file in the project root
|
|
73
|
+
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
|
|
74
|
+
3. Add your custom code to those files
|
|
75
|
+
|
|
76
|
+
Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.
|
|
77
|
+
|
|
78
|
+
For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).
|
|
79
|
+
|
|
80
|
+
#### Option 2: Contribute to the Generator
|
|
81
|
+
|
|
82
|
+
If you want to change how code is generated for all users of this SDK:
|
|
83
|
+
|
|
84
|
+
1. The Python SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
|
|
85
|
+
2. Generator code is located at `generators/python-v2/`
|
|
86
|
+
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
|
|
87
|
+
4. Submit a pull request with your changes to the generator
|
|
88
|
+
|
|
89
|
+
This approach is best for:
|
|
90
|
+
- Bug fixes in generated code
|
|
91
|
+
- New features that would benefit all users
|
|
92
|
+
- Improvements to code generation patterns
|
|
93
|
+
|
|
94
|
+
## Making Changes
|
|
95
|
+
|
|
96
|
+
### Workflow
|
|
97
|
+
|
|
98
|
+
1. Create a new branch for your changes
|
|
99
|
+
2. Make your modifications
|
|
100
|
+
3. Run tests to ensure nothing breaks: `poetry run pytest`
|
|
101
|
+
4. Run linting and formatting: `poetry run ruff check .` and `poetry run ruff format .`
|
|
102
|
+
5. Run type checking: `poetry run mypy .`
|
|
103
|
+
6. Build the project: `poetry build`
|
|
104
|
+
7. Commit your changes with a clear commit message
|
|
105
|
+
8. Push your branch and create a pull request
|
|
106
|
+
|
|
107
|
+
### Commit Messages
|
|
108
|
+
|
|
109
|
+
Write clear, descriptive commit messages that explain what changed and why.
|
|
110
|
+
|
|
111
|
+
### Code Style
|
|
112
|
+
|
|
113
|
+
This project uses automated code formatting and linting. Run `poetry run ruff format .` and `poetry run ruff check .` before committing to ensure your code meets the project's style guidelines.
|
|
114
|
+
|
|
115
|
+
## Questions or Issues?
|
|
116
|
+
|
|
117
|
+
If you have questions or run into issues:
|
|
118
|
+
|
|
119
|
+
1. Check the [Fern documentation](https://buildwithfern.com)
|
|
120
|
+
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
|
|
121
|
+
3. Open a new issue if your question hasn't been addressed
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Cloudraker Python Library
|
|
2
|
+
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Cloudraker%2FPython)
|
|
4
|
+
[](https://pypi.python.org/pypi/cloudraker)
|
|
5
|
+
|
|
6
|
+
The Cloudraker Python library provides convenient access to the Cloudraker APIs from Python.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [Reference](#reference)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [Environments](#environments)
|
|
14
|
+
- [Async Client](#async-client)
|
|
15
|
+
- [Exception Handling](#exception-handling)
|
|
16
|
+
- [Advanced](#advanced)
|
|
17
|
+
- [Access Raw Response Data](#access-raw-response-data)
|
|
18
|
+
- [Retries](#retries)
|
|
19
|
+
- [Timeouts](#timeouts)
|
|
20
|
+
- [Custom Client](#custom-client)
|
|
21
|
+
- [Contributing](#contributing)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pip install cloudraker
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Reference
|
|
30
|
+
|
|
31
|
+
A full reference for this library is available [here](./reference.md).
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
Instantiate and use the client with the following:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from cloudraker import CloudRaker
|
|
39
|
+
|
|
40
|
+
client = CloudRaker(
|
|
41
|
+
token="<token>",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
client.actions.install_action()
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Environments
|
|
48
|
+
|
|
49
|
+
This SDK allows you to configure different environments for API requests.
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from cloudraker import CloudRaker
|
|
53
|
+
from cloudraker.environment import CloudRakerEnvironment
|
|
54
|
+
|
|
55
|
+
client = CloudRaker(
|
|
56
|
+
environment=CloudRakerEnvironment.PRODUCTION,
|
|
57
|
+
)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Async Client
|
|
61
|
+
|
|
62
|
+
The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
import asyncio
|
|
66
|
+
|
|
67
|
+
from cloudraker import AsyncCloudRaker
|
|
68
|
+
|
|
69
|
+
client = AsyncCloudRaker(
|
|
70
|
+
token="<token>",
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
async def main() -> None:
|
|
75
|
+
await client.actions.install_action()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
asyncio.run(main())
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Exception Handling
|
|
82
|
+
|
|
83
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
84
|
+
will be thrown.
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from cloudraker.core.api_error import ApiError
|
|
88
|
+
|
|
89
|
+
try:
|
|
90
|
+
client.actions.install_action()
|
|
91
|
+
except ApiError as e:
|
|
92
|
+
print(e.status_code)
|
|
93
|
+
print(e.body)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Advanced
|
|
97
|
+
|
|
98
|
+
### Access Raw Response Data
|
|
99
|
+
|
|
100
|
+
The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
|
|
101
|
+
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from cloudraker import CloudRaker
|
|
105
|
+
|
|
106
|
+
client = CloudRaker(...)
|
|
107
|
+
response = client.actions.with_raw_response.install_action()
|
|
108
|
+
print(response.headers) # access the response headers
|
|
109
|
+
print(response.status_code) # access the response status code
|
|
110
|
+
print(response.data) # access the underlying object
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Retries
|
|
114
|
+
|
|
115
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
116
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
117
|
+
retry limit (default: 2).
|
|
118
|
+
|
|
119
|
+
Which status codes are retried depends on the `retryStatusCodes` generator configuration:
|
|
120
|
+
|
|
121
|
+
**`legacy`** (current default): retries on
|
|
122
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
123
|
+
- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
|
|
124
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
125
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
|
|
126
|
+
|
|
127
|
+
**`recommended`**: retries on
|
|
128
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
129
|
+
- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
|
|
130
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
131
|
+
- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
|
|
132
|
+
- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
|
|
133
|
+
- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
|
|
134
|
+
|
|
135
|
+
Use the `max_retries` request option to configure this behavior.
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
client.actions.install_action(request_options={
|
|
139
|
+
"max_retries": 1
|
|
140
|
+
})
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Timeouts
|
|
144
|
+
|
|
145
|
+
The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
from cloudraker import CloudRaker
|
|
149
|
+
|
|
150
|
+
client = CloudRaker(..., timeout=20.0)
|
|
151
|
+
|
|
152
|
+
# Override timeout for a specific method
|
|
153
|
+
client.actions.install_action(request_options={
|
|
154
|
+
"timeout": 1
|
|
155
|
+
})
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Custom Client
|
|
159
|
+
|
|
160
|
+
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
|
|
161
|
+
and transports.
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
import httpx
|
|
165
|
+
from cloudraker import CloudRaker
|
|
166
|
+
|
|
167
|
+
client = CloudRaker(
|
|
168
|
+
...,
|
|
169
|
+
httpx_client=httpx.Client(
|
|
170
|
+
proxy="http://my.test.proxy.example.com",
|
|
171
|
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
|
172
|
+
),
|
|
173
|
+
)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Contributing
|
|
177
|
+
|
|
178
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
179
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
180
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
181
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
182
|
+
an issue first to discuss with us!
|
|
183
|
+
|
|
184
|
+
On the other hand, contributions to the README are always very welcome!
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import (
|
|
10
|
+
GetHealthResponse,
|
|
11
|
+
GetHealthResponseStatus,
|
|
12
|
+
Home,
|
|
13
|
+
HomeActivityItem,
|
|
14
|
+
HomeActivityItemActor,
|
|
15
|
+
HomeActivityItemResource,
|
|
16
|
+
HomePendingApprovalsItem,
|
|
17
|
+
HomeRecentSpacesItem,
|
|
18
|
+
HomeSummary,
|
|
19
|
+
Me,
|
|
20
|
+
UserPreferences,
|
|
21
|
+
UserPreferencesLanguage,
|
|
22
|
+
WidgetToken,
|
|
23
|
+
)
|
|
24
|
+
from .errors import (
|
|
25
|
+
BadRequestError,
|
|
26
|
+
ConflictError,
|
|
27
|
+
ContentTooLargeError,
|
|
28
|
+
ForbiddenError,
|
|
29
|
+
GoneError,
|
|
30
|
+
NotFoundError,
|
|
31
|
+
UnprocessableEntityError,
|
|
32
|
+
)
|
|
33
|
+
from . import (
|
|
34
|
+
actions,
|
|
35
|
+
authorization,
|
|
36
|
+
data_objects,
|
|
37
|
+
files,
|
|
38
|
+
home,
|
|
39
|
+
me,
|
|
40
|
+
ontology,
|
|
41
|
+
organization_settings,
|
|
42
|
+
organization_templates,
|
|
43
|
+
playbooks,
|
|
44
|
+
runs,
|
|
45
|
+
search,
|
|
46
|
+
spaces,
|
|
47
|
+
)
|
|
48
|
+
from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
|
|
49
|
+
from .authorization import (
|
|
50
|
+
CheckMyAccessRequestChecksItem,
|
|
51
|
+
CreateGrantRequestResourceType,
|
|
52
|
+
CreateGrantRequestSubject,
|
|
53
|
+
DeleteGrantRequestResourceType,
|
|
54
|
+
DeleteGrantRequestSubject,
|
|
55
|
+
ListResourceGrantsRequestAssignment,
|
|
56
|
+
ListResourceGrantsRequestResourceType,
|
|
57
|
+
)
|
|
58
|
+
from .client import AsyncCloudRaker, CloudRaker
|
|
59
|
+
from .environment import CloudRakerEnvironment
|
|
60
|
+
from .me import UpdateUserPreferencesLanguage
|
|
61
|
+
from .ontology import SearchOrgOntologyRequestTypesItem, SearchSpaceOntologyRequestTypesItem
|
|
62
|
+
from .spaces import UpdateSpaceTypeRequestOntology, UpdateSpaceTypeRequestOntologyEntitiesItem
|
|
63
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
64
|
+
"AsyncCloudRaker": ".client",
|
|
65
|
+
"BadRequestError": ".errors",
|
|
66
|
+
"CheckMyAccessRequestChecksItem": ".authorization",
|
|
67
|
+
"CloudRaker": ".client",
|
|
68
|
+
"CloudRakerEnvironment": ".environment",
|
|
69
|
+
"ConflictError": ".errors",
|
|
70
|
+
"ContentTooLargeError": ".errors",
|
|
71
|
+
"CreateGrantRequestResourceType": ".authorization",
|
|
72
|
+
"CreateGrantRequestSubject": ".authorization",
|
|
73
|
+
"DefaultAioHttpClient": "._default_clients",
|
|
74
|
+
"DefaultAsyncHttpxClient": "._default_clients",
|
|
75
|
+
"DeleteGrantRequestResourceType": ".authorization",
|
|
76
|
+
"DeleteGrantRequestSubject": ".authorization",
|
|
77
|
+
"ForbiddenError": ".errors",
|
|
78
|
+
"GetHealthResponse": ".types",
|
|
79
|
+
"GetHealthResponseStatus": ".types",
|
|
80
|
+
"GoneError": ".errors",
|
|
81
|
+
"Home": ".types",
|
|
82
|
+
"HomeActivityItem": ".types",
|
|
83
|
+
"HomeActivityItemActor": ".types",
|
|
84
|
+
"HomeActivityItemResource": ".types",
|
|
85
|
+
"HomePendingApprovalsItem": ".types",
|
|
86
|
+
"HomeRecentSpacesItem": ".types",
|
|
87
|
+
"HomeSummary": ".types",
|
|
88
|
+
"ListResourceGrantsRequestAssignment": ".authorization",
|
|
89
|
+
"ListResourceGrantsRequestResourceType": ".authorization",
|
|
90
|
+
"Me": ".types",
|
|
91
|
+
"NotFoundError": ".errors",
|
|
92
|
+
"SearchOrgOntologyRequestTypesItem": ".ontology",
|
|
93
|
+
"SearchSpaceOntologyRequestTypesItem": ".ontology",
|
|
94
|
+
"UnprocessableEntityError": ".errors",
|
|
95
|
+
"UpdateSpaceTypeRequestOntology": ".spaces",
|
|
96
|
+
"UpdateSpaceTypeRequestOntologyEntitiesItem": ".spaces",
|
|
97
|
+
"UpdateUserPreferencesLanguage": ".me",
|
|
98
|
+
"UserPreferences": ".types",
|
|
99
|
+
"UserPreferencesLanguage": ".types",
|
|
100
|
+
"WidgetToken": ".types",
|
|
101
|
+
"actions": ".actions",
|
|
102
|
+
"authorization": ".authorization",
|
|
103
|
+
"data_objects": ".data_objects",
|
|
104
|
+
"files": ".files",
|
|
105
|
+
"home": ".home",
|
|
106
|
+
"me": ".me",
|
|
107
|
+
"ontology": ".ontology",
|
|
108
|
+
"organization_settings": ".organization_settings",
|
|
109
|
+
"organization_templates": ".organization_templates",
|
|
110
|
+
"playbooks": ".playbooks",
|
|
111
|
+
"runs": ".runs",
|
|
112
|
+
"search": ".search",
|
|
113
|
+
"spaces": ".spaces",
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
118
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
119
|
+
if module_name is None:
|
|
120
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
121
|
+
try:
|
|
122
|
+
module = import_module(module_name, __package__)
|
|
123
|
+
if module_name == f".{attr_name}":
|
|
124
|
+
return module
|
|
125
|
+
else:
|
|
126
|
+
return getattr(module, attr_name)
|
|
127
|
+
except ImportError as e:
|
|
128
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
129
|
+
except AttributeError as e:
|
|
130
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def __dir__():
|
|
134
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
135
|
+
return sorted(lazy_attrs)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
__all__ = [
|
|
139
|
+
"AsyncCloudRaker",
|
|
140
|
+
"BadRequestError",
|
|
141
|
+
"CheckMyAccessRequestChecksItem",
|
|
142
|
+
"CloudRaker",
|
|
143
|
+
"CloudRakerEnvironment",
|
|
144
|
+
"ConflictError",
|
|
145
|
+
"ContentTooLargeError",
|
|
146
|
+
"CreateGrantRequestResourceType",
|
|
147
|
+
"CreateGrantRequestSubject",
|
|
148
|
+
"DefaultAioHttpClient",
|
|
149
|
+
"DefaultAsyncHttpxClient",
|
|
150
|
+
"DeleteGrantRequestResourceType",
|
|
151
|
+
"DeleteGrantRequestSubject",
|
|
152
|
+
"ForbiddenError",
|
|
153
|
+
"GetHealthResponse",
|
|
154
|
+
"GetHealthResponseStatus",
|
|
155
|
+
"GoneError",
|
|
156
|
+
"Home",
|
|
157
|
+
"HomeActivityItem",
|
|
158
|
+
"HomeActivityItemActor",
|
|
159
|
+
"HomeActivityItemResource",
|
|
160
|
+
"HomePendingApprovalsItem",
|
|
161
|
+
"HomeRecentSpacesItem",
|
|
162
|
+
"HomeSummary",
|
|
163
|
+
"ListResourceGrantsRequestAssignment",
|
|
164
|
+
"ListResourceGrantsRequestResourceType",
|
|
165
|
+
"Me",
|
|
166
|
+
"NotFoundError",
|
|
167
|
+
"SearchOrgOntologyRequestTypesItem",
|
|
168
|
+
"SearchSpaceOntologyRequestTypesItem",
|
|
169
|
+
"UnprocessableEntityError",
|
|
170
|
+
"UpdateSpaceTypeRequestOntology",
|
|
171
|
+
"UpdateSpaceTypeRequestOntologyEntitiesItem",
|
|
172
|
+
"UpdateUserPreferencesLanguage",
|
|
173
|
+
"UserPreferences",
|
|
174
|
+
"UserPreferencesLanguage",
|
|
175
|
+
"WidgetToken",
|
|
176
|
+
"actions",
|
|
177
|
+
"authorization",
|
|
178
|
+
"data_objects",
|
|
179
|
+
"files",
|
|
180
|
+
"home",
|
|
181
|
+
"me",
|
|
182
|
+
"ontology",
|
|
183
|
+
"organization_settings",
|
|
184
|
+
"organization_templates",
|
|
185
|
+
"playbooks",
|
|
186
|
+
"runs",
|
|
187
|
+
"search",
|
|
188
|
+
"spaces",
|
|
189
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
SDK_DEFAULT_TIMEOUT = 60
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import httpx_aiohttp # type: ignore[import-not-found]
|
|
11
|
+
except ImportError:
|
|
12
|
+
|
|
13
|
+
class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
|
|
14
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
15
|
+
raise RuntimeError("To use the aiohttp client, install the aiohttp extra: pip install cloudraker[aiohttp]")
|
|
16
|
+
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
|
|
20
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
21
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
22
|
+
kwargs.setdefault("follow_redirects", True)
|
|
23
|
+
super().__init__(**kwargs)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class DefaultAsyncHttpxClient(httpx.AsyncClient):
|
|
27
|
+
def __init__(self, **kwargs: typing.Any) -> None:
|
|
28
|
+
kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
|
|
29
|
+
kwargs.setdefault("follow_redirects", True)
|
|
30
|
+
super().__init__(**kwargs)
|