rixl 1.0.0__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.
- rixl-1.0.0/LICENSE +21 -0
- rixl-1.0.0/PKG-INFO +183 -0
- rixl-1.0.0/README.md +172 -0
- rixl-1.0.0/feeds/feeds_request_builder.py +38 -0
- rixl-1.0.0/feeds/item/creators/creators_request_builder.py +38 -0
- rixl-1.0.0/feeds/item/creators/item/with_creator_item_request_builder.py +94 -0
- rixl-1.0.0/feeds/item/item/with_post_item_request_builder.py +82 -0
- rixl-1.0.0/feeds/item/with_feed_item_request_builder.py +119 -0
- rixl-1.0.0/images/images_request_builder.py +127 -0
- rixl-1.0.0/images/item/with_image_item_request_builder.py +125 -0
- rixl-1.0.0/images/upload/complete/complete_request_builder.py +93 -0
- rixl-1.0.0/images/upload/init/init_request_builder.py +92 -0
- rixl-1.0.0/images/upload/upload_request_builder.py +43 -0
- rixl-1.0.0/models/audio_track.py +79 -0
- rixl-1.0.0/models/audio_track_delete.py +51 -0
- rixl-1.0.0/models/chapter.py +59 -0
- rixl-1.0.0/models/file.py +86 -0
- rixl-1.0.0/models/file_status.py +10 -0
- rixl-1.0.0/models/github_com_rixlhq_api_db_sqlc/plan_type.py +8 -0
- rixl-1.0.0/models/github_com_rixlhq_api_db_sqlc/video_quality.py +7 -0
- rixl-1.0.0/models/github_com_rixlhq_api_internal_errors/error_response.py +65 -0
- rixl-1.0.0/models/github_com_rixlhq_api_internal_videos/video_response.py +107 -0
- rixl-1.0.0/models/github_com_rixlhq_api_internal_videos_handler_upload/complete_request.py +50 -0
- rixl-1.0.0/models/github_com_rixlhq_api_internal_videos_handler_upload/init_response.py +63 -0
- rixl-1.0.0/models/github_com_rixlhq_api_internal_videos_types/chapter_input.py +51 -0
- rixl-1.0.0/models/image.py +74 -0
- rixl-1.0.0/models/internal_images_handler/complete_request.py +54 -0
- rixl-1.0.0/models/internal_images_handler/init_response.py +55 -0
- rixl-1.0.0/models/internal_images_handler/upload_init_request.py +54 -0
- rixl-1.0.0/models/internal_videos_handler_subtitles/language_response.py +51 -0
- rixl-1.0.0/models/pagination/paginated_response_image.py +61 -0
- rixl-1.0.0/models/pagination/paginated_response_post.py +61 -0
- rixl-1.0.0/models/pagination/paginated_response_video.py +61 -0
- rixl-1.0.0/models/pagination/pagination.py +58 -0
- rixl-1.0.0/models/post.py +99 -0
- rixl-1.0.0/models/post_type.py +6 -0
- rixl-1.0.0/models/subtitle.py +75 -0
- rixl-1.0.0/models/subtitle_delete.py +51 -0
- rixl-1.0.0/models/update_chapters_request.py +57 -0
- rixl-1.0.0/models/update_chapters_response.py +58 -0
- rixl-1.0.0/models/video.py +107 -0
- rixl-1.0.0/models/video_upload_init_request.py +65 -0
- rixl-1.0.0/pyproject.toml +22 -0
- rixl-1.0.0/rixl.egg-info/PKG-INFO +183 -0
- rixl-1.0.0/rixl.egg-info/SOURCES.txt +64 -0
- rixl-1.0.0/rixl.egg-info/dependency_links.txt +1 -0
- rixl-1.0.0/rixl.egg-info/requires.txt +1 -0
- rixl-1.0.0/rixl.egg-info/top_level.txt +5 -0
- rixl-1.0.0/rixl_client.py +70 -0
- rixl-1.0.0/setup.cfg +4 -0
- rixl-1.0.0/videos/item/audio_tracks/audio_tracks_request_builder.py +90 -0
- rixl-1.0.0/videos/item/audio_tracks/item/with_lang_code_item_request_builder.py +117 -0
- rixl-1.0.0/videos/item/audio_tracks/item/with_lang_code_put_request_body.py +51 -0
- rixl-1.0.0/videos/item/chapters/chapters_request_builder.py +134 -0
- rixl-1.0.0/videos/item/delete/delete_request_builder.py +82 -0
- rixl-1.0.0/videos/item/subtitles/item/with_lang_code_item_request_builder.py +117 -0
- rixl-1.0.0/videos/item/subtitles/item/with_lang_code_put_request_body.py +51 -0
- rixl-1.0.0/videos/item/subtitles/subtitles_request_builder.py +90 -0
- rixl-1.0.0/videos/item/thumbnail/thumbnail_put_request_body.py +47 -0
- rixl-1.0.0/videos/item/thumbnail/thumbnail_request_builder.py +93 -0
- rixl-1.0.0/videos/item/with_video_item_request_builder.py +135 -0
- rixl-1.0.0/videos/languages/languages_request_builder.py +75 -0
- rixl-1.0.0/videos/upload/complete/complete_request_builder.py +93 -0
- rixl-1.0.0/videos/upload/init/init_request_builder.py +92 -0
- rixl-1.0.0/videos/upload/upload_request_builder.py +43 -0
- rixl-1.0.0/videos/videos_request_builder.py +137 -0
rixl-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 RIXL Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
rixl-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rixl
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python client for the RIXL API.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: microsoft-kiota-bundle==1.5.0
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
# rixl-python
|
|
13
|
+
|
|
14
|
+
Python client for the [RIXL](https://rixl.com) API.
|
|
15
|
+
|
|
16
|
+
[](https://pypi.org/project/rixl/)
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install rixl
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Requires Python 3.10+. `microsoft-kiota-bundle` is pulled in transitively (HTTP transport, serializers, request adapter).
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
import asyncio
|
|
30
|
+
from kiota_abstractions.authentication.api_key_authentication_provider import (
|
|
31
|
+
ApiKeyAuthenticationProvider, KeyLocation,
|
|
32
|
+
)
|
|
33
|
+
from kiota_http.httpx_request_adapter import HttpxRequestAdapter
|
|
34
|
+
from rixl_client import RixlClient
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
async def main():
|
|
38
|
+
auth = ApiKeyAuthenticationProvider(
|
|
39
|
+
api_key="YOUR_RIXL_API_KEY",
|
|
40
|
+
parameter_name="X-API-Key",
|
|
41
|
+
key_location=KeyLocation.Header,
|
|
42
|
+
)
|
|
43
|
+
adapter = HttpxRequestAdapter(auth)
|
|
44
|
+
client = RixlClient(adapter)
|
|
45
|
+
|
|
46
|
+
image = await client.images.by_image_id("PS5IMKoFLm").get()
|
|
47
|
+
print(image.id, image.width, image.height)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
asyncio.run(main())
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Default base URL: `https://api.rixl.com`. Override with `adapter.base_url = "..."`.
|
|
54
|
+
|
|
55
|
+
## Authentication
|
|
56
|
+
|
|
57
|
+
API key:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from kiota_abstractions.authentication.api_key_authentication_provider import (
|
|
61
|
+
ApiKeyAuthenticationProvider, KeyLocation,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
auth = ApiKeyAuthenticationProvider(
|
|
65
|
+
"YOUR_RIXL_API_KEY", "X-API-Key", KeyLocation.Header,
|
|
66
|
+
)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Bearer token: implement `AccessTokenProvider`, then wrap with `BaseBearerTokenAuthenticationProvider` from `kiota_abstractions.authentication.base_bearer_token_authentication_provider`.
|
|
70
|
+
|
|
71
|
+
## Feeds
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
posts = await client.feeds.by_feed_id("FD4y3QB38S").get()
|
|
75
|
+
for post in posts.data:
|
|
76
|
+
print(post.id)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Images
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
page = await client.images.get()
|
|
83
|
+
image = await client.images.by_image_id("PS5IMKoFLm").get()
|
|
84
|
+
await client.images.by_image_id("PS5IMKoFLm").delete()
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Upload (init → PUT bytes → complete):
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
import httpx
|
|
91
|
+
from models.internal_images_handler.upload_init_request import UploadInitRequest
|
|
92
|
+
from models.internal_images_handler.complete_request import CompleteRequest
|
|
93
|
+
|
|
94
|
+
init_req = UploadInitRequest()
|
|
95
|
+
init_req.name = "photo.jpg"
|
|
96
|
+
init_req.format = "jpeg"
|
|
97
|
+
init_res = await client.images.upload.init.post(init_req)
|
|
98
|
+
|
|
99
|
+
async with httpx.AsyncClient() as c:
|
|
100
|
+
await c.put(init_res.presigned_url, content=image_bytes,
|
|
101
|
+
headers={"Content-Type": "image/jpeg"})
|
|
102
|
+
|
|
103
|
+
complete_req = CompleteRequest()
|
|
104
|
+
complete_req.image_id = init_res.image_id
|
|
105
|
+
complete_req.attached_to_video = False
|
|
106
|
+
image = await client.images.upload.complete.post(complete_req)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Videos
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
videos = await client.videos.get()
|
|
113
|
+
video = await client.videos.by_video_id("VI9VXQxWXQ").get()
|
|
114
|
+
tracks = await client.videos.by_video_id("VI9VXQxWXQ").subtitles.get()
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Upload returns presigned URLs for both the video and a poster image:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from models.video_upload_init_request import VideoUploadInitRequest
|
|
121
|
+
from models.github_com_rixlhq_api_internal_videos_handler_upload.complete_request \
|
|
122
|
+
import CompleteRequest as VideoCompleteRequest
|
|
123
|
+
|
|
124
|
+
init_req = VideoUploadInitRequest()
|
|
125
|
+
init_req.file_name = "clip.mp4"
|
|
126
|
+
init_req.image_format = "jpeg"
|
|
127
|
+
init_res = await client.videos.upload.init.post(init_req)
|
|
128
|
+
# PUT bytes to init_res.video_presigned_url and init_res.poster_presigned_url
|
|
129
|
+
|
|
130
|
+
complete_req = VideoCompleteRequest()
|
|
131
|
+
complete_req.video_id = init_res.video_id
|
|
132
|
+
video = await client.videos.upload.complete.post(complete_req)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Pagination
|
|
136
|
+
|
|
137
|
+
List endpoints take `limit`, `offset`, `sort`, `order`:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from kiota_abstractions.base_request_configuration import RequestConfiguration
|
|
141
|
+
from rixl_sdk.images.images_request_builder import ImagesRequestBuilder
|
|
142
|
+
|
|
143
|
+
limit, offset = 50, 0
|
|
144
|
+
while True:
|
|
145
|
+
params = ImagesRequestBuilder.ImagesRequestBuilderGetQueryParameters(
|
|
146
|
+
limit=limit, offset=offset,
|
|
147
|
+
)
|
|
148
|
+
page = await client.images.get(
|
|
149
|
+
request_configuration=RequestConfiguration(query_parameters=params),
|
|
150
|
+
)
|
|
151
|
+
if offset + len(page.data) >= page.pagination.total:
|
|
152
|
+
break
|
|
153
|
+
offset += limit
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Errors
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from rixl_sdk.models.github_com_rixlhq_api_internal_errors.error_response import ErrorResponse
|
|
160
|
+
|
|
161
|
+
try:
|
|
162
|
+
image = await client.images.by_image_id("PS5IMKoFLm").get()
|
|
163
|
+
except ErrorResponse as e:
|
|
164
|
+
print(f"HTTP {e.code}: {e.error}")
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Network failures raise `httpx` exceptions.
|
|
168
|
+
|
|
169
|
+
## Examples
|
|
170
|
+
|
|
171
|
+
Runnable demos in [examples/](./examples):
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
cd examples
|
|
175
|
+
pip install -r requirements.txt
|
|
176
|
+
export RIXL_API_KEY=<key>
|
|
177
|
+
python basic/images/main.py
|
|
178
|
+
python advanced/videos/main.py
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Issues
|
|
182
|
+
|
|
183
|
+
[github.com/rixlhq/rixl-python/issues](https://github.com/rixlhq/rixl-python/issues)
|
rixl-1.0.0/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# rixl-python
|
|
2
|
+
|
|
3
|
+
Python client for the [RIXL](https://rixl.com) API.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/rixl/)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install rixl
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Python 3.10+. `microsoft-kiota-bundle` is pulled in transitively (HTTP transport, serializers, request adapter).
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import asyncio
|
|
19
|
+
from kiota_abstractions.authentication.api_key_authentication_provider import (
|
|
20
|
+
ApiKeyAuthenticationProvider, KeyLocation,
|
|
21
|
+
)
|
|
22
|
+
from kiota_http.httpx_request_adapter import HttpxRequestAdapter
|
|
23
|
+
from rixl_client import RixlClient
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
async def main():
|
|
27
|
+
auth = ApiKeyAuthenticationProvider(
|
|
28
|
+
api_key="YOUR_RIXL_API_KEY",
|
|
29
|
+
parameter_name="X-API-Key",
|
|
30
|
+
key_location=KeyLocation.Header,
|
|
31
|
+
)
|
|
32
|
+
adapter = HttpxRequestAdapter(auth)
|
|
33
|
+
client = RixlClient(adapter)
|
|
34
|
+
|
|
35
|
+
image = await client.images.by_image_id("PS5IMKoFLm").get()
|
|
36
|
+
print(image.id, image.width, image.height)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
asyncio.run(main())
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Default base URL: `https://api.rixl.com`. Override with `adapter.base_url = "..."`.
|
|
43
|
+
|
|
44
|
+
## Authentication
|
|
45
|
+
|
|
46
|
+
API key:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from kiota_abstractions.authentication.api_key_authentication_provider import (
|
|
50
|
+
ApiKeyAuthenticationProvider, KeyLocation,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
auth = ApiKeyAuthenticationProvider(
|
|
54
|
+
"YOUR_RIXL_API_KEY", "X-API-Key", KeyLocation.Header,
|
|
55
|
+
)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Bearer token: implement `AccessTokenProvider`, then wrap with `BaseBearerTokenAuthenticationProvider` from `kiota_abstractions.authentication.base_bearer_token_authentication_provider`.
|
|
59
|
+
|
|
60
|
+
## Feeds
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
posts = await client.feeds.by_feed_id("FD4y3QB38S").get()
|
|
64
|
+
for post in posts.data:
|
|
65
|
+
print(post.id)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Images
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
page = await client.images.get()
|
|
72
|
+
image = await client.images.by_image_id("PS5IMKoFLm").get()
|
|
73
|
+
await client.images.by_image_id("PS5IMKoFLm").delete()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Upload (init → PUT bytes → complete):
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import httpx
|
|
80
|
+
from models.internal_images_handler.upload_init_request import UploadInitRequest
|
|
81
|
+
from models.internal_images_handler.complete_request import CompleteRequest
|
|
82
|
+
|
|
83
|
+
init_req = UploadInitRequest()
|
|
84
|
+
init_req.name = "photo.jpg"
|
|
85
|
+
init_req.format = "jpeg"
|
|
86
|
+
init_res = await client.images.upload.init.post(init_req)
|
|
87
|
+
|
|
88
|
+
async with httpx.AsyncClient() as c:
|
|
89
|
+
await c.put(init_res.presigned_url, content=image_bytes,
|
|
90
|
+
headers={"Content-Type": "image/jpeg"})
|
|
91
|
+
|
|
92
|
+
complete_req = CompleteRequest()
|
|
93
|
+
complete_req.image_id = init_res.image_id
|
|
94
|
+
complete_req.attached_to_video = False
|
|
95
|
+
image = await client.images.upload.complete.post(complete_req)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Videos
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
videos = await client.videos.get()
|
|
102
|
+
video = await client.videos.by_video_id("VI9VXQxWXQ").get()
|
|
103
|
+
tracks = await client.videos.by_video_id("VI9VXQxWXQ").subtitles.get()
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Upload returns presigned URLs for both the video and a poster image:
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from models.video_upload_init_request import VideoUploadInitRequest
|
|
110
|
+
from models.github_com_rixlhq_api_internal_videos_handler_upload.complete_request \
|
|
111
|
+
import CompleteRequest as VideoCompleteRequest
|
|
112
|
+
|
|
113
|
+
init_req = VideoUploadInitRequest()
|
|
114
|
+
init_req.file_name = "clip.mp4"
|
|
115
|
+
init_req.image_format = "jpeg"
|
|
116
|
+
init_res = await client.videos.upload.init.post(init_req)
|
|
117
|
+
# PUT bytes to init_res.video_presigned_url and init_res.poster_presigned_url
|
|
118
|
+
|
|
119
|
+
complete_req = VideoCompleteRequest()
|
|
120
|
+
complete_req.video_id = init_res.video_id
|
|
121
|
+
video = await client.videos.upload.complete.post(complete_req)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Pagination
|
|
125
|
+
|
|
126
|
+
List endpoints take `limit`, `offset`, `sort`, `order`:
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from kiota_abstractions.base_request_configuration import RequestConfiguration
|
|
130
|
+
from rixl_sdk.images.images_request_builder import ImagesRequestBuilder
|
|
131
|
+
|
|
132
|
+
limit, offset = 50, 0
|
|
133
|
+
while True:
|
|
134
|
+
params = ImagesRequestBuilder.ImagesRequestBuilderGetQueryParameters(
|
|
135
|
+
limit=limit, offset=offset,
|
|
136
|
+
)
|
|
137
|
+
page = await client.images.get(
|
|
138
|
+
request_configuration=RequestConfiguration(query_parameters=params),
|
|
139
|
+
)
|
|
140
|
+
if offset + len(page.data) >= page.pagination.total:
|
|
141
|
+
break
|
|
142
|
+
offset += limit
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Errors
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
from rixl_sdk.models.github_com_rixlhq_api_internal_errors.error_response import ErrorResponse
|
|
149
|
+
|
|
150
|
+
try:
|
|
151
|
+
image = await client.images.by_image_id("PS5IMKoFLm").get()
|
|
152
|
+
except ErrorResponse as e:
|
|
153
|
+
print(f"HTTP {e.code}: {e.error}")
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Network failures raise `httpx` exceptions.
|
|
157
|
+
|
|
158
|
+
## Examples
|
|
159
|
+
|
|
160
|
+
Runnable demos in [examples/](./examples):
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
cd examples
|
|
164
|
+
pip install -r requirements.txt
|
|
165
|
+
export RIXL_API_KEY=<key>
|
|
166
|
+
python basic/images/main.py
|
|
167
|
+
python advanced/videos/main.py
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Issues
|
|
171
|
+
|
|
172
|
+
[github.com/rixlhq/rixl-python/issues](https://github.com/rixlhq/rixl-python/issues)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from kiota_abstractions.base_request_builder import BaseRequestBuilder
|
|
4
|
+
from kiota_abstractions.get_path_parameters import get_path_parameters
|
|
5
|
+
from kiota_abstractions.request_adapter import RequestAdapter
|
|
6
|
+
from typing import Any, Optional, TYPE_CHECKING, Union
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from .item.with_feed_item_request_builder import WithFeedItemRequestBuilder
|
|
10
|
+
|
|
11
|
+
class FeedsRequestBuilder(BaseRequestBuilder):
|
|
12
|
+
"""
|
|
13
|
+
Builds and executes requests for operations under /feeds
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
|
|
16
|
+
"""
|
|
17
|
+
Instantiates a new FeedsRequestBuilder and sets the default values.
|
|
18
|
+
param path_parameters: The raw url or the url-template parameters for the request.
|
|
19
|
+
param request_adapter: The request adapter to use to execute the requests.
|
|
20
|
+
Returns: None
|
|
21
|
+
"""
|
|
22
|
+
super().__init__(request_adapter, "{+baseurl}/feeds", path_parameters)
|
|
23
|
+
|
|
24
|
+
def by_feed_id(self,feed_id: str) -> WithFeedItemRequestBuilder:
|
|
25
|
+
"""
|
|
26
|
+
Gets an item from the rixl_sdk.feeds.item collection
|
|
27
|
+
param feed_id: Feed ID
|
|
28
|
+
Returns: WithFeedItemRequestBuilder
|
|
29
|
+
"""
|
|
30
|
+
if feed_id is None:
|
|
31
|
+
raise TypeError("feed_id cannot be null.")
|
|
32
|
+
from .item.with_feed_item_request_builder import WithFeedItemRequestBuilder
|
|
33
|
+
|
|
34
|
+
url_tpl_params = get_path_parameters(self.path_parameters)
|
|
35
|
+
url_tpl_params["feedId"] = feed_id
|
|
36
|
+
return WithFeedItemRequestBuilder(self.request_adapter, url_tpl_params)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from kiota_abstractions.base_request_builder import BaseRequestBuilder
|
|
4
|
+
from kiota_abstractions.get_path_parameters import get_path_parameters
|
|
5
|
+
from kiota_abstractions.request_adapter import RequestAdapter
|
|
6
|
+
from typing import Any, Optional, TYPE_CHECKING, Union
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from .item.with_creator_item_request_builder import WithCreatorItemRequestBuilder
|
|
10
|
+
|
|
11
|
+
class CreatorsRequestBuilder(BaseRequestBuilder):
|
|
12
|
+
"""
|
|
13
|
+
Builds and executes requests for operations under /feeds/{feedId}/creators
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
|
|
16
|
+
"""
|
|
17
|
+
Instantiates a new CreatorsRequestBuilder and sets the default values.
|
|
18
|
+
param path_parameters: The raw url or the url-template parameters for the request.
|
|
19
|
+
param request_adapter: The request adapter to use to execute the requests.
|
|
20
|
+
Returns: None
|
|
21
|
+
"""
|
|
22
|
+
super().__init__(request_adapter, "{+baseurl}/feeds/{feedId}/creators", path_parameters)
|
|
23
|
+
|
|
24
|
+
def by_creator_id(self,creator_id: str) -> WithCreatorItemRequestBuilder:
|
|
25
|
+
"""
|
|
26
|
+
Gets an item from the rixl_sdk.feeds.item.creators.item collection
|
|
27
|
+
param creator_id: Creator ID
|
|
28
|
+
Returns: WithCreatorItemRequestBuilder
|
|
29
|
+
"""
|
|
30
|
+
if creator_id is None:
|
|
31
|
+
raise TypeError("creator_id cannot be null.")
|
|
32
|
+
from .item.with_creator_item_request_builder import WithCreatorItemRequestBuilder
|
|
33
|
+
|
|
34
|
+
url_tpl_params = get_path_parameters(self.path_parameters)
|
|
35
|
+
url_tpl_params["creatorId"] = creator_id
|
|
36
|
+
return WithCreatorItemRequestBuilder(self.request_adapter, url_tpl_params)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from kiota_abstractions.base_request_builder import BaseRequestBuilder
|
|
5
|
+
from kiota_abstractions.base_request_configuration import RequestConfiguration
|
|
6
|
+
from kiota_abstractions.default_query_parameters import QueryParameters
|
|
7
|
+
from kiota_abstractions.get_path_parameters import get_path_parameters
|
|
8
|
+
from kiota_abstractions.method import Method
|
|
9
|
+
from kiota_abstractions.request_adapter import RequestAdapter
|
|
10
|
+
from kiota_abstractions.request_information import RequestInformation
|
|
11
|
+
from kiota_abstractions.request_option import RequestOption
|
|
12
|
+
from kiota_abstractions.serialization import Parsable, ParsableFactory
|
|
13
|
+
from typing import Any, Optional, TYPE_CHECKING, Union
|
|
14
|
+
from warnings import warn
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from .....models.github_com_rixlhq_api_internal_errors.error_response import ErrorResponse
|
|
18
|
+
from .....models.pagination.paginated_response_post import PaginatedResponsePost
|
|
19
|
+
|
|
20
|
+
class WithCreatorItemRequestBuilder(BaseRequestBuilder):
|
|
21
|
+
"""
|
|
22
|
+
Builds and executes requests for operations under /feeds/{feedId}/creators/{creatorId}
|
|
23
|
+
"""
|
|
24
|
+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
|
|
25
|
+
"""
|
|
26
|
+
Instantiates a new WithCreatorItemRequestBuilder and sets the default values.
|
|
27
|
+
param path_parameters: The raw url or the url-template parameters for the request.
|
|
28
|
+
param request_adapter: The request adapter to use to execute the requests.
|
|
29
|
+
Returns: None
|
|
30
|
+
"""
|
|
31
|
+
super().__init__(request_adapter, "{+baseurl}/feeds/{feedId}/creators/{creatorId}{?limit*,offset*}", path_parameters)
|
|
32
|
+
|
|
33
|
+
async def get(self,request_configuration: Optional[RequestConfiguration[WithCreatorItemRequestBuilderGetQueryParameters]] = None) -> Optional[PaginatedResponsePost]:
|
|
34
|
+
"""
|
|
35
|
+
Retrieve posts in a feed by a specific creator, with pagination.
|
|
36
|
+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
|
|
37
|
+
Returns: Optional[PaginatedResponsePost]
|
|
38
|
+
"""
|
|
39
|
+
request_info = self.to_get_request_information(
|
|
40
|
+
request_configuration
|
|
41
|
+
)
|
|
42
|
+
from .....models.github_com_rixlhq_api_internal_errors.error_response import ErrorResponse
|
|
43
|
+
|
|
44
|
+
error_mapping: dict[str, type[ParsableFactory]] = {
|
|
45
|
+
"400": ErrorResponse,
|
|
46
|
+
"500": ErrorResponse,
|
|
47
|
+
}
|
|
48
|
+
if not self.request_adapter:
|
|
49
|
+
raise Exception("Http core is null")
|
|
50
|
+
from .....models.pagination.paginated_response_post import PaginatedResponsePost
|
|
51
|
+
|
|
52
|
+
return await self.request_adapter.send_async(request_info, PaginatedResponsePost, error_mapping)
|
|
53
|
+
|
|
54
|
+
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[WithCreatorItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
|
|
55
|
+
"""
|
|
56
|
+
Retrieve posts in a feed by a specific creator, with pagination.
|
|
57
|
+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
|
|
58
|
+
Returns: RequestInformation
|
|
59
|
+
"""
|
|
60
|
+
request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
|
|
61
|
+
request_info.configure(request_configuration)
|
|
62
|
+
request_info.headers.try_add("Accept", "application/json")
|
|
63
|
+
return request_info
|
|
64
|
+
|
|
65
|
+
def with_url(self,raw_url: str) -> WithCreatorItemRequestBuilder:
|
|
66
|
+
"""
|
|
67
|
+
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
|
68
|
+
param raw_url: The raw URL to use for the request builder.
|
|
69
|
+
Returns: WithCreatorItemRequestBuilder
|
|
70
|
+
"""
|
|
71
|
+
if raw_url is None:
|
|
72
|
+
raise TypeError("raw_url cannot be null.")
|
|
73
|
+
return WithCreatorItemRequestBuilder(self.request_adapter, raw_url)
|
|
74
|
+
|
|
75
|
+
@dataclass
|
|
76
|
+
class WithCreatorItemRequestBuilderGetQueryParameters():
|
|
77
|
+
"""
|
|
78
|
+
Retrieve posts in a feed by a specific creator, with pagination.
|
|
79
|
+
"""
|
|
80
|
+
# Maximum number of items to return in a single request. <br> **Default:** `25`
|
|
81
|
+
limit: Optional[int] = None
|
|
82
|
+
|
|
83
|
+
# Starting point of the result set. <br>To get page 2 with a limit of 25, set `offset` to `25`. <br> **Default:** `0`
|
|
84
|
+
offset: Optional[int] = None
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@dataclass
|
|
88
|
+
class WithCreatorItemRequestBuilderGetRequestConfiguration(RequestConfiguration[WithCreatorItemRequestBuilderGetQueryParameters]):
|
|
89
|
+
"""
|
|
90
|
+
Configuration for the request such as headers, query parameters, and middleware options.
|
|
91
|
+
"""
|
|
92
|
+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from kiota_abstractions.base_request_builder import BaseRequestBuilder
|
|
5
|
+
from kiota_abstractions.base_request_configuration import RequestConfiguration
|
|
6
|
+
from kiota_abstractions.default_query_parameters import QueryParameters
|
|
7
|
+
from kiota_abstractions.get_path_parameters import get_path_parameters
|
|
8
|
+
from kiota_abstractions.method import Method
|
|
9
|
+
from kiota_abstractions.request_adapter import RequestAdapter
|
|
10
|
+
from kiota_abstractions.request_information import RequestInformation
|
|
11
|
+
from kiota_abstractions.request_option import RequestOption
|
|
12
|
+
from kiota_abstractions.serialization import Parsable, ParsableFactory
|
|
13
|
+
from typing import Any, Optional, TYPE_CHECKING, Union
|
|
14
|
+
from warnings import warn
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ....models.github_com_rixlhq_api_internal_errors.error_response import ErrorResponse
|
|
18
|
+
from ....models.post import Post
|
|
19
|
+
|
|
20
|
+
class WithPostItemRequestBuilder(BaseRequestBuilder):
|
|
21
|
+
"""
|
|
22
|
+
Builds and executes requests for operations under /feeds/{feedId}/{postId}
|
|
23
|
+
"""
|
|
24
|
+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
|
|
25
|
+
"""
|
|
26
|
+
Instantiates a new WithPostItemRequestBuilder and sets the default values.
|
|
27
|
+
param path_parameters: The raw url or the url-template parameters for the request.
|
|
28
|
+
param request_adapter: The request adapter to use to execute the requests.
|
|
29
|
+
Returns: None
|
|
30
|
+
"""
|
|
31
|
+
super().__init__(request_adapter, "{+baseurl}/feeds/{feedId}/{postId}", path_parameters)
|
|
32
|
+
|
|
33
|
+
async def get(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[Post]:
|
|
34
|
+
"""
|
|
35
|
+
Retrieve a post from feed by its ID
|
|
36
|
+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
|
|
37
|
+
Returns: Optional[Post]
|
|
38
|
+
"""
|
|
39
|
+
request_info = self.to_get_request_information(
|
|
40
|
+
request_configuration
|
|
41
|
+
)
|
|
42
|
+
from ....models.github_com_rixlhq_api_internal_errors.error_response import ErrorResponse
|
|
43
|
+
|
|
44
|
+
error_mapping: dict[str, type[ParsableFactory]] = {
|
|
45
|
+
"400": ErrorResponse,
|
|
46
|
+
"404": ErrorResponse,
|
|
47
|
+
}
|
|
48
|
+
if not self.request_adapter:
|
|
49
|
+
raise Exception("Http core is null")
|
|
50
|
+
from ....models.post import Post
|
|
51
|
+
|
|
52
|
+
return await self.request_adapter.send_async(request_info, Post, error_mapping)
|
|
53
|
+
|
|
54
|
+
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
|
|
55
|
+
"""
|
|
56
|
+
Retrieve a post from feed by its ID
|
|
57
|
+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
|
|
58
|
+
Returns: RequestInformation
|
|
59
|
+
"""
|
|
60
|
+
request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
|
|
61
|
+
request_info.configure(request_configuration)
|
|
62
|
+
request_info.headers.try_add("Accept", "application/json")
|
|
63
|
+
return request_info
|
|
64
|
+
|
|
65
|
+
def with_url(self,raw_url: str) -> WithPostItemRequestBuilder:
|
|
66
|
+
"""
|
|
67
|
+
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
|
68
|
+
param raw_url: The raw URL to use for the request builder.
|
|
69
|
+
Returns: WithPostItemRequestBuilder
|
|
70
|
+
"""
|
|
71
|
+
if raw_url is None:
|
|
72
|
+
raise TypeError("raw_url cannot be null.")
|
|
73
|
+
return WithPostItemRequestBuilder(self.request_adapter, raw_url)
|
|
74
|
+
|
|
75
|
+
@dataclass
|
|
76
|
+
class WithPostItemRequestBuilderGetRequestConfiguration(RequestConfiguration[QueryParameters]):
|
|
77
|
+
"""
|
|
78
|
+
Configuration for the request such as headers, query parameters, and middleware options.
|
|
79
|
+
"""
|
|
80
|
+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
|
|
81
|
+
|
|
82
|
+
|