Skip to content

Commit 5589611

Browse files
minor!: correctly model fields (#222)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent cfcee68 commit 5589611

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1131
-510
lines changed

.fern/metadata.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"cliVersion": "3.5.0",
3+
"generatorName": "fernapi/fern-python-sdk",
4+
"generatorVersion": "4.38.4",
5+
"generatorConfig": {
6+
"client_class_name": "Lattice",
7+
"package_name": "anduril"
8+
}
9+
}

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: ci
2-
32
on: [push]
43
jobs:
54
compile:
@@ -10,7 +9,7 @@ jobs:
109
- name: Set up python
1110
uses: actions/setup-python@v4
1211
with:
13-
python-version: 3.8
12+
python-version: 3.9
1413
- name: Bootstrap poetry
1514
run: |
1615
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
@@ -26,15 +25,15 @@ jobs:
2625
- name: Set up python
2726
uses: actions/setup-python@v4
2827
with:
29-
python-version: 3.8
28+
python-version: 3.9
3029
- name: Bootstrap poetry
3130
run: |
3231
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
3332
- name: Install dependencies
3433
run: poetry install
3534

3635
- name: Test
37-
run: poetry run pytest -rP .
36+
run: poetry run pytest -rP -n auto .
3837

3938
publish:
4039
needs: [compile, test]
@@ -46,7 +45,7 @@ jobs:
4645
- name: Set up python
4746
uses: actions/setup-python@v4
4847
with:
49-
python-version: 3.8
48+
python-version: 3.9
5049
- name: Bootstrap poetry
5150
run: |
5251
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1

README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66

77
The Lattice SDK Python library provides convenient access to the Lattice SDK APIs from Python.
88

9+
## Table of Contents
10+
11+
- [Documentation](#documentation)
12+
- [Requirements](#requirements)
13+
- [Installation](#installation)
14+
- [Support](#support)
15+
- [Reference](#reference)
16+
- [Usage](#usage)
17+
- [Async Client](#async-client)
18+
- [Exception Handling](#exception-handling)
19+
- [Streaming](#streaming)
20+
- [Pagination](#pagination)
21+
- [Advanced](#advanced)
22+
- [Access Raw Response Data](#access-raw-response-data)
23+
- [Retries](#retries)
24+
- [Timeouts](#timeouts)
25+
- [Custom Client](#custom-client)
26+
927
## Documentation
1028

1129
API reference documentation is available [here](https://developer.anduril.com/).
@@ -103,28 +121,28 @@ for chunk in response.data:
103121
Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.
104122

105123
```python
106-
import datetime
107-
108124
from anduril import Lattice
109125

110126
client = Lattice(
111127
token="YOUR_TOKEN",
112128
)
113-
response = client.objects.list_objects(
114-
prefix="prefix",
115-
since_timestamp=datetime.datetime.fromisoformat(
116-
"2024-01-15 09:30:00+00:00",
117-
),
118-
page_token="pageToken",
119-
all_objects_in_mesh=True,
120-
)
129+
response = client.objects.list_objects()
121130
for item in response:
122131
yield item
123132
# alternatively, you can paginate page-by-page
124133
for page in response.iter_pages():
125134
yield page
126135
```
127136

137+
```python
138+
# You can also iterate through pages and access the typed response per page
139+
pager = client.objects.list_objects(...)
140+
for page in pager.iter_pages():
141+
print(page.response) # access the typed response for each page
142+
for item in page:
143+
print(item)
144+
```
145+
128146
## Advanced
129147

130148
### Access Raw Response Data
@@ -142,11 +160,11 @@ response = client.entities.with_raw_response.long_poll_entity_events(...)
142160
print(response.headers) # access the response headers
143161
print(response.data) # access the underlying object
144162
pager = client.objects.list_objects(...)
145-
print(pager.response.headers) # access the response headers for the first page
163+
print(pager.response) # access the typed response for the first page
146164
for item in pager:
147165
print(item) # access the underlying object(s)
148166
for page in pager.iter_pages():
149-
print(page.response.headers) # access the response headers for each page
167+
print(page.response) # access the typed response for each page
150168
for item in page:
151169
print(item) # access the underlying object(s)
152170
with client.entities.with_raw_response.stream_entities(...) as response:

poetry.lock

Lines changed: 41 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "anduril-lattice-sdk"
33

44
[tool.poetry]
55
name = "anduril-lattice-sdk"
6-
version = "3.0.0"
6+
version = "4.0.0"
77
description = "HTTP clients for the Anduril Lattice SDK"
88
readme = "README.md"
99
authors = [
@@ -35,7 +35,7 @@ packages = [
3535
{ include = "anduril", from = "src"}
3636
]
3737

38-
[project.urls]
38+
[tool.poetry.urls]
3939
Documentation = 'https://developer.anduril.com'
4040
Homepage = 'https://www.anduril.com/lattice-sdk/'
4141
Repository = 'https://github.com/anduril/lattice-sdk-python'
@@ -51,6 +51,7 @@ typing_extensions = ">= 4.0.0"
5151
mypy = "==1.13.0"
5252
pytest = "^7.4.0"
5353
pytest-asyncio = "^0.23.5"
54+
pytest-xdist = "^3.6.1"
5455
python-dateutil = "^2.9.0"
5556
types-python-dateutil = "^2.9.0.20240316"
5657
ruff = "==0.11.5"

0 commit comments

Comments
 (0)