Skip to content

Commit

Permalink
Excavator: Upgrade API Version (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-excavator-bot authored Dec 17, 2024
1 parent b2a5e82 commit e69a925
Show file tree
Hide file tree
Showing 82 changed files with 2,625 additions and 74 deletions.
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ initializing the `UserTokenAuth`:

```python
import foundry
import foundry.v2

foundry_client = foundry.v2.FoundryClient(
auth=foundry.UserTokenAuth(token=os.environ["BEARER_TOKEN"]),
Expand Down Expand Up @@ -165,6 +166,7 @@ Want to learn more about this Foundry SDK library? Review the following sections

[Error handling](#errors): Learn more about HTTP & data validation error handling
[Pagination](#pagination): Learn how to work with paginated endpoints in the SDK
[Streaming](#binary-streaming): Learn how to stream binary data from Foundry
[Static type analysis](#static-types): Learn about the static type analysis capabilities of this library

## Error handling
Expand Down Expand Up @@ -234,18 +236,42 @@ for branch in foundry_client.datasets.Dataset.Branch.list(dataset_rid):
print(branch)
```

This will automatically fetch and iterate through all the pages of data from the specified API endpoint. For more granular control, you can manually fetch each page using the associated page methods.
This will automatically fetch and iterate through all the pages of data from the specified API endpoint. For more granular control, you can manually fetch each page using the `next_page_token`.

```python
page = foundry_client.datasets.Dataset.Branch.page(dataset_rid)
page = foundry_client.datasets.Dataset.Branch.list(dataset_rid)
while page.next_page_token:
for branch in page.data:
print(branch)

page = foundry_client.datasets.Dataset.Branch.page(dataset_rid, page_token=page.next_page_token)
page = foundry_client.datasets.Dataset.Branch.list(dataset_rid, page_token=page.next_page_token)
```


<a id="binary-streaming"></a>
## Streaming
This SDK supports optionally streaming binary data using a flag in the method definition.

```python
# Non-streaming response
with open("profile_picture.png", "rb") as f:
f.write(foundry_client.admin.User.profile_picture(user_id))

# Streaming response
with open("profile_picture.png", "rb") as f:
for chunk in foundry_client.admin.User.profile_picture(user_id, stream=True):
f.write(chunk)
```

This flag is available on all endpoints which return binary data. Additionally, you can set a desired `chunk_size` to read into memory before
the next chunk is given to you. By default, this value is set to None and chunks will be returned to you as they are received from the host.

```python
with open("profile_picture.png", "rb") as f:
for chunk in foundry_client.admin.User.profile_picture(user_id, stream=True, chunk_size=1024):
f.write(chunk)
```

<a id="static-types"></a>
## Static type analysis
This library uses [Pydantic](https://docs.pydantic.dev) for creating and validating data models which you will see in the
Expand Down Expand Up @@ -685,6 +711,8 @@ Namespace | Resource | Operation | HTTP request |
- [JdbcImportConfigDict](docs/v2/models/JdbcImportConfigDict.md)
- [ListFileImportsResponse](docs/v2/models/ListFileImportsResponse.md)
- [ListFileImportsResponseDict](docs/v2/models/ListFileImportsResponseDict.md)
- [ListTableImportsResponse](docs/v2/models/ListTableImportsResponse.md)
- [ListTableImportsResponseDict](docs/v2/models/ListTableImportsResponseDict.md)
- [MicrosoftAccessImportConfig](docs/v2/models/MicrosoftAccessImportConfig.md)
- [MicrosoftAccessImportConfigDict](docs/v2/models/MicrosoftAccessImportConfigDict.md)
- [MicrosoftSqlServerImportConfig](docs/v2/models/MicrosoftSqlServerImportConfig.md)
Expand Down
4 changes: 4 additions & 0 deletions docs/v1/Datasets/Branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**dataset_rid** | DatasetRid | datasetRid | |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |

### Return type
**ResourceIterator[Branch]**
Expand All @@ -217,12 +218,15 @@ foundry_client = FoundryClient(
dataset_rid = "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da"
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
for branch in foundry_client.datasets.Dataset.Branch.list(
dataset_rid,
page_size=page_size,
page_token=page_token,
):
pprint(branch)
except foundry.PalantirRPCException as e:
Expand Down
4 changes: 4 additions & 0 deletions docs/v1/Datasets/File.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Name | Type | Description | Notes |
**branch_id** | Optional[BranchId] | branchId | [optional] |
**end_transaction_rid** | Optional[TransactionRid] | endTransactionRid | [optional] |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |
**start_transaction_rid** | Optional[TransactionRid] | startTransactionRid | [optional] |

### Return type
Expand All @@ -240,6 +241,8 @@ branch_id = None
end_transaction_rid = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[TransactionRid] | startTransactionRid
start_transaction_rid = None

Expand All @@ -250,6 +253,7 @@ try:
branch_id=branch_id,
end_transaction_rid=end_transaction_rid,
page_size=page_size,
page_token=page_token,
start_transaction_rid=start_transaction_rid,
):
pprint(file)
Expand Down
4 changes: 4 additions & 0 deletions docs/v1/Ontologies/ActionType.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**ontology_rid** | OntologyRid | ontologyRid | |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |

### Return type
**ResourceIterator[ActionType]**
Expand All @@ -98,12 +99,15 @@ foundry_client = FoundryClient(
ontology_rid = "ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367"
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
for action_type in foundry_client.ontologies.Ontology.ActionType.list(
ontology_rid,
page_size=page_size,
page_token=page_token,
):
pprint(action_type)
except foundry.PalantirRPCException as e:
Expand Down
8 changes: 8 additions & 0 deletions docs/v1/Ontologies/ObjectType.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**ontology_rid** | OntologyRid | ontologyRid | |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |

### Return type
**ResourceIterator[ObjectType]**
Expand All @@ -165,12 +166,15 @@ foundry_client = FoundryClient(
ontology_rid = "ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367"
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
for object_type in foundry_client.ontologies.Ontology.ObjectType.list(
ontology_rid,
page_size=page_size,
page_token=page_token,
):
pprint(object_type)
except foundry.PalantirRPCException as e:
Expand Down Expand Up @@ -205,6 +209,7 @@ Name | Type | Description | Notes |
**ontology_rid** | OntologyRid | ontologyRid | |
**object_type** | ObjectTypeApiName | objectType | |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |

### Return type
**ResourceIterator[LinkTypeSide]**
Expand All @@ -226,13 +231,16 @@ ontology_rid = "ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367"
object_type = "Flight"
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
for object_type in foundry_client.ontologies.Ontology.ObjectType.list_outgoing_link_types(
ontology_rid,
object_type,
page_size=page_size,
page_token=page_token,
):
pprint(object_type)
except foundry.PalantirRPCException as e:
Expand Down
16 changes: 12 additions & 4 deletions docs/v1/Ontologies/OntologyObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ See [README](../../../README.md#authorization)
Lists the objects for the given Ontology and object type.

This endpoint supports filtering objects.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/object-basics/#filtering-objects) for details.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/ontology-object-basics#filter-objects) for details.

Note that this endpoint does not guarantee consistency. Changes to the data could result in missing or
repeated objects in the response pages.
Expand All @@ -261,6 +261,7 @@ Name | Type | Description | Notes |
**object_type** | ObjectTypeApiName | objectType | |
**order_by** | Optional[OrderBy] | orderBy | [optional] |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |
**properties** | Optional[List[SelectedPropertyApiName]] | properties | [optional] |

### Return type
Expand All @@ -285,6 +286,8 @@ object_type = "employee"
order_by = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[List[SelectedPropertyApiName]] | properties
properties = None

Expand All @@ -295,6 +298,7 @@ try:
object_type,
order_by=order_by,
page_size=page_size,
page_token=page_token,
properties=properties,
):
pprint(ontology_object)
Expand All @@ -320,7 +324,7 @@ See [README](../../../README.md#authorization)
Lists the linked objects for a specific object and the given link type.

This endpoint supports filtering objects.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/object-basics/#filtering-objects) for details.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/ontology-object-basics#filter-objects) for details.

Note that this endpoint does not guarantee consistency. Changes to the data could result in missing or
repeated objects in the response pages.
Expand All @@ -347,6 +351,7 @@ Name | Type | Description | Notes |
**link_type** | LinkTypeApiName | linkType | |
**order_by** | Optional[OrderBy] | orderBy | [optional] |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |
**properties** | Optional[List[SelectedPropertyApiName]] | properties | [optional] |

### Return type
Expand Down Expand Up @@ -375,6 +380,8 @@ link_type = "directReport"
order_by = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[List[SelectedPropertyApiName]] | properties
properties = None

Expand All @@ -387,6 +394,7 @@ try:
link_type,
order_by=order_by,
page_size=page_size,
page_token=page_token,
properties=properties,
):
pprint(ontology_object)
Expand All @@ -412,7 +420,7 @@ See [README](../../../README.md#authorization)
Lists the objects for the given Ontology and object type.

This endpoint supports filtering objects.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/object-basics/#filtering-objects) for details.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/ontology-object-basics#filter-objects) for details.

Note that this endpoint does not guarantee consistency. Changes to the data could result in missing or
repeated objects in the response pages.
Expand Down Expand Up @@ -501,7 +509,7 @@ See [README](../../../README.md#authorization)
Lists the linked objects for a specific object and the given link type.

This endpoint supports filtering objects.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/object-basics/#filtering-objects) for details.
See the [Filtering Objects documentation](/docs/foundry/api/ontology-resources/objects/ontology-object-basics#filter-objects) for details.

Note that this endpoint does not guarantee consistency. Changes to the data could result in missing or
repeated objects in the response pages.
Expand Down
4 changes: 4 additions & 0 deletions docs/v1/Ontologies/QueryType.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**ontology_rid** | OntologyRid | ontologyRid | |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |

### Return type
**ResourceIterator[QueryType]**
Expand All @@ -98,12 +99,15 @@ foundry_client = FoundryClient(
ontology_rid = "ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367"
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
for query_type in foundry_client.ontologies.Ontology.QueryType.list(
ontology_rid,
page_size=page_size,
page_token=page_token,
):
pprint(query_type)
except foundry.PalantirRPCException as e:
Expand Down
4 changes: 4 additions & 0 deletions docs/v2/Admin/Group.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ This is a paged endpoint. Each page may be smaller or larger than the requested
Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |

### Return type
**ResourceIterator[Group]**
Expand All @@ -265,11 +266,14 @@ foundry_client = FoundryClient(

# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None


try:
for group in foundry_client.admin.Group.list(
page_size=page_size,
page_token=page_token,
):
pprint(group)
except foundry.PalantirRPCException as e:
Expand Down
22 changes: 18 additions & 4 deletions docs/v2/Admin/GroupMember.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,22 @@ See [README](../../../README.md#authorization)
[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v2-link) [[Back to Model list]](../../../README.md#models-v2-link) [[Back to README]](../../../README.md)

# **list**
Lists all GroupMembers.
Lists all members (which can be a User or a Group) of a given Group.

This is a paged endpoint. Each page may be smaller or larger than the requested page size. However,
it is guaranteed that if there are more results available, the `nextPageToken` field will be populated.
To get the next page, make the same request again, but set the value of the `pageToken` query parameter
to be value of the `nextPageToken` value of the previous response. If there is no `nextPageToken` field
in the response, you are on the last page.

This is a paged endpoint. Each page may be smaller or larger than the requested page size. However, it is guaranteed that if there are more results available, the `nextPageToken` field will be populated. To get the next page, make the same request again, but set the value of the `pageToken` query parameter to be value of the `nextPageToken` value of the previous response. If there is no `nextPageToken` field in the response, you are on the last page.

### Parameters

Name | Type | Description | Notes |
------------- | ------------- | ------------- | ------------- |
**group_id** | PrincipalId | groupId | |
**page_size** | Optional[PageSize] | pageSize | [optional] |
**page_token** | Optional[PageToken] | pageToken | [optional] |
**transitive** | Optional[pydantic.StrictBool] | transitive | [optional] |

### Return type
Expand All @@ -97,6 +103,8 @@ foundry_client = FoundryClient(
group_id = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[pydantic.StrictBool] | transitive
transitive = None

Expand All @@ -105,6 +113,7 @@ try:
for group_member in foundry_client.admin.Group.GroupMember.list(
group_id,
page_size=page_size,
page_token=page_token,
transitive=transitive,
):
pprint(group_member)
Expand All @@ -127,9 +136,14 @@ See [README](../../../README.md#authorization)
[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v2-link) [[Back to Model list]](../../../README.md#models-v2-link) [[Back to README]](../../../README.md)

# **page**
Lists all GroupMembers.
Lists all members (which can be a User or a Group) of a given Group.

This is a paged endpoint. Each page may be smaller or larger than the requested page size. However,
it is guaranteed that if there are more results available, the `nextPageToken` field will be populated.
To get the next page, make the same request again, but set the value of the `pageToken` query parameter
to be value of the `nextPageToken` value of the previous response. If there is no `nextPageToken` field
in the response, you are on the last page.

This is a paged endpoint. Each page may be smaller or larger than the requested page size. However, it is guaranteed that if there are more results available, the `nextPageToken` field will be populated. To get the next page, make the same request again, but set the value of the `pageToken` query parameter to be value of the `nextPageToken` value of the previous response. If there is no `nextPageToken` field in the response, you are on the last page.

### Parameters

Expand Down
Loading

0 comments on commit e69a925

Please sign in to comment.