Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenAPI Specification #47

Merged
merged 2 commits into from
Jun 28, 2024
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
6 changes: 6 additions & 0 deletions .konfig/changesets/stupid-bobcats-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
python: patch
typescript: patch
---

Regenerate SDKs
6 changes: 3 additions & 3 deletions STATISTICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

| SDK Name | Lines of Code |
| -------- | ------------- |
| python | 44386 |
| typescript | 15095 |
| **Total** | 59481 |
| python | 44895 |
| typescript | 15218 |
| **Total** | 60113 |
42 changes: 42 additions & 0 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ paths:
required: true
schema:
type: integer
- name: filter
description: Only documents with names that contain the filter string will be returned in the results.
in: query
required: false
schema:
type: string
- name: sort
description: The document attribute that will be used to sort the results.
in: query
required: false
schema:
$ref: "#/components/schemas/Sort"
- name: sortOrder
description: The order in which to sort the results. A value for sort must also be set.
in: query
required: false
schema:
$ref: "#/components/schemas/SortOrder"
- name: n
description: The maximum number of returned documents. Accepts 1-100 with a default of 20.
in: query
Expand Down Expand Up @@ -995,6 +1013,10 @@ components:
$ref: "#/components/schemas/ProcessingStatus"
statusMessage:
type: string
xrayUrl:
type: string
description: Document X-Ray results
format: uri
DocumentRemoteUploadRequest:
type: object
required:
Expand Down Expand Up @@ -1183,13 +1205,21 @@ components:
DocumentLookupResponse:
type: object
properties:
count:
type: integer
example: 20
description: The number of results returned in the current response
documents:
type: array
items:
$ref: '#/components/schemas/DocumentResponse'
nextToken:
type: string
example: The method you used is not supported for this query
total:
type: integer
example: 30
description: The total number of results found
example:
message: The method you used is not supported for this query
WebsiteCrawlRequest:
Expand Down Expand Up @@ -1227,6 +1257,18 @@ components:
type: string
format: uri
example: https://my.website.com
Sort:
description: The attribute to use to sort results
type: string
enum:
- name
- created
SortOrder:
description: The order in which to sort results
type: string
enum:
- asc
- desc
MessageResponse:
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/.konfig/generate-id.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aa6b411c-8aa7-4761-9d08-2443e52b527d
9de6281a-0842-4f0f-871a-eca7055af170
30 changes: 24 additions & 6 deletions sdks/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ from pprint import pprint
from groundx import Groundx, ApiException

groundx = Groundx(
api_key="YOUR_API_KEY",

api_key = 'YOUR_API_KEY',
)

try:
Expand All @@ -93,14 +94,15 @@ except ApiException as e:
`async` support is available by prepending `a` to any method.

```python

import asyncio
from pprint import pprint
from groundx import Groundx, ApiException

groundx = Groundx(
api_key="YOUR_API_KEY",
)

api_key = 'YOUR_API_KEY',
)

async def main():
try:
Expand All @@ -121,7 +123,6 @@ async def main():
pprint(e.reason)
pprint(e.round_trip_time)


asyncio.run(main())
```

Expand Down Expand Up @@ -358,7 +359,9 @@ Interact with the "Request Body" below to explore the arguments of this function

```python
delete_response = groundx.documents.delete(
document_ids=["documentIds_example"],
document_ids=[
"documentIds_example"
],
)
```

Expand Down Expand Up @@ -534,6 +537,9 @@ Interact with the "Request Body" below to explore the arguments of this function
```python
lookup_response = groundx.documents.lookup(
id=1,
filter="string_example",
sort="name",
sort_order="asc",
n=1,
next_token="string_example",
)
Expand All @@ -545,6 +551,18 @@ lookup_response = groundx.documents.lookup(

a processId, bucketId, or projectId

##### filter: `str`<a id="filter-str"></a>

Only documents with names that contain the filter string will be returned in the results.

##### sort: [`Sort`](./groundx/type/.py)<a id="sort-sortgroundxtypepy"></a>

The document attribute that will be used to sort the results.

##### sort_order: [`SortOrder`](./groundx/type/.py)<a id="sort_order-sortordergroundxtypepy"></a>

The order in which to sort the results. A value for sort must also be set.

##### n: `int`<a id="n-int"></a>

The maximum number of returned documents. Accepts 1-100 with a default of 20.
Expand Down Expand Up @@ -578,7 +596,7 @@ Interact with the "Request Body" below to explore the arguments of this function
upload_local_response = groundx.documents.upload_local(
body=[
{
"blob": open("/path/to/file", "rb"),
"blob": open('/path/to/file', 'rb'),
"metadata": {
"bucket_id": 1234,
"file_name": "my_file.txt",
Expand Down
1 change: 1 addition & 0 deletions sdks/python/groundx/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
unset,
)


@dataclass
class MappedArgs:
body: typing.Any = None
Expand Down
24 changes: 22 additions & 2 deletions sdks/python/groundx/model/document_lookup_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DocumentLookupResponse(
class MetaOapg:

class properties:
count = schemas.IntSchema


class documents(
Expand Down Expand Up @@ -62,51 +63,70 @@ def __new__(
def __getitem__(self, i: int) -> 'DocumentResponse':
return super().__getitem__(i)
nextToken = schemas.StrSchema
total = schemas.IntSchema
__annotations__ = {
"count": count,
"documents": documents,
"nextToken": nextToken,
"total": total,
}

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["count"]) -> MetaOapg.properties.count: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["documents"]) -> MetaOapg.properties.documents: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["nextToken"]) -> MetaOapg.properties.nextToken: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ...

@typing.overload
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...

def __getitem__(self, name: typing.Union[typing_extensions.Literal["documents", "nextToken", ], str]):
def __getitem__(self, name: typing.Union[typing_extensions.Literal["count", "documents", "nextToken", "total", ], str]):
# dict_instance[name] accessor
return super().__getitem__(name)


@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["count"]) -> typing.Union[MetaOapg.properties.count, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["documents"]) -> typing.Union[MetaOapg.properties.documents, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["nextToken"]) -> typing.Union[MetaOapg.properties.nextToken, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["total"]) -> typing.Union[MetaOapg.properties.total, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...

def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["documents", "nextToken", ], str]):
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["count", "documents", "nextToken", "total", ], str]):
return super().get_item_oapg(name)


def __new__(
cls,
*args: typing.Union[dict, frozendict.frozendict, ],
count: typing.Union[MetaOapg.properties.count, decimal.Decimal, int, schemas.Unset] = schemas.unset,
documents: typing.Union[MetaOapg.properties.documents, list, tuple, schemas.Unset] = schemas.unset,
nextToken: typing.Union[MetaOapg.properties.nextToken, str, schemas.Unset] = schemas.unset,
total: typing.Union[MetaOapg.properties.total, decimal.Decimal, int, schemas.Unset] = schemas.unset,
_configuration: typing.Optional[schemas.Configuration] = None,
**kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes],
) -> 'DocumentLookupResponse':
return super().__new__(
cls,
*args,
count=count,
documents=documents,
nextToken=nextToken,
total=total,
_configuration=_configuration,
**kwargs,
)
Expand Down
24 changes: 22 additions & 2 deletions sdks/python/groundx/model/document_lookup_response.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DocumentLookupResponse(
class MetaOapg:

class properties:
count = schemas.IntSchema


class documents(
Expand Down Expand Up @@ -62,51 +63,70 @@ class DocumentLookupResponse(
def __getitem__(self, i: int) -> 'DocumentResponse':
return super().__getitem__(i)
nextToken = schemas.StrSchema
total = schemas.IntSchema
__annotations__ = {
"count": count,
"documents": documents,
"nextToken": nextToken,
"total": total,
}

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["count"]) -> MetaOapg.properties.count: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["documents"]) -> MetaOapg.properties.documents: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["nextToken"]) -> MetaOapg.properties.nextToken: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["total"]) -> MetaOapg.properties.total: ...

@typing.overload
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...

def __getitem__(self, name: typing.Union[typing_extensions.Literal["documents", "nextToken", ], str]):
def __getitem__(self, name: typing.Union[typing_extensions.Literal["count", "documents", "nextToken", "total", ], str]):
# dict_instance[name] accessor
return super().__getitem__(name)


@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["count"]) -> typing.Union[MetaOapg.properties.count, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["documents"]) -> typing.Union[MetaOapg.properties.documents, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["nextToken"]) -> typing.Union[MetaOapg.properties.nextToken, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["total"]) -> typing.Union[MetaOapg.properties.total, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...

def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["documents", "nextToken", ], str]):
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["count", "documents", "nextToken", "total", ], str]):
return super().get_item_oapg(name)


def __new__(
cls,
*args: typing.Union[dict, frozendict.frozendict, ],
count: typing.Union[MetaOapg.properties.count, decimal.Decimal, int, schemas.Unset] = schemas.unset,
documents: typing.Union[MetaOapg.properties.documents, list, tuple, schemas.Unset] = schemas.unset,
nextToken: typing.Union[MetaOapg.properties.nextToken, str, schemas.Unset] = schemas.unset,
total: typing.Union[MetaOapg.properties.total, decimal.Decimal, int, schemas.Unset] = schemas.unset,
_configuration: typing.Optional[schemas.Configuration] = None,
**kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes],
) -> 'DocumentLookupResponse':
return super().__new__(
cls,
*args,
count=count,
documents=documents,
nextToken=nextToken,
total=total,
_configuration=_configuration,
**kwargs,
)
Expand Down
Loading