From 89b061094b58eb74b36c433f9e41b12f3f94d85d Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:13:35 -0800 Subject: [PATCH] Excavator: Upgrade API Version (#92) --- README.md | 33 +++++ docs/v2/Orchestration/Build.md | 124 +++++++++++++++++ docs/v2/core/models/FilterBinaryTypeDict.md | 11 ++ docs/v2/core/models/FilterBooleanTypeDict.md | 11 ++ docs/v2/core/models/FilterDateTimeTypeDict.md | 11 ++ docs/v2/core/models/FilterDateTypeDict.md | 11 ++ docs/v2/core/models/FilterDoubleTypeDict.md | 11 ++ docs/v2/core/models/FilterEnumTypeDict.md | 12 ++ docs/v2/core/models/FilterFloatTypeDict.md | 11 ++ docs/v2/core/models/FilterIntegerTypeDict.md | 11 ++ docs/v2/core/models/FilterLongTypeDict.md | 11 ++ docs/v2/core/models/FilterRidTypeDict.md | 11 ++ docs/v2/core/models/FilterStringTypeDict.md | 11 ++ docs/v2/core/models/FilterTypeDict.md | 26 ++++ docs/v2/core/models/FilterUuidTypeDict.md | 11 ++ docs/v2/core/models/OrderByDirection.md | 11 ++ .../GetBuildsBatchRequestElementDict.md | 11 ++ .../models/GetBuildsBatchResponse.md | 11 ++ .../models/GetBuildsBatchResponseDict.md | 11 ++ .../models/SearchBuildsAndFilterDict.md | 12 ++ .../models/SearchBuildsEqualsFilterDict.md | 13 ++ .../models/SearchBuildsEqualsFilterField.md | 13 ++ .../models/SearchBuildsFilterDict.md | 20 +++ .../models/SearchBuildsGteFilterDict.md | 13 ++ .../models/SearchBuildsGteFilterField.md | 11 ++ .../models/SearchBuildsLtFilterDict.md | 13 ++ .../models/SearchBuildsLtFilterField.md | 11 ++ .../models/SearchBuildsNotFilterDict.md | 12 ++ .../models/SearchBuildsOrFilterDict.md | 12 ++ .../models/SearchBuildsOrderByDict.md | 11 ++ .../models/SearchBuildsOrderByField.md | 11 ++ .../models/SearchBuildsOrderByItemDict.md | 12 ++ .../models/SearchBuildsResponse.md | 12 ++ .../models/SearchBuildsResponseDict.md | 12 ++ foundry/_versions.py | 2 +- foundry/v2/cli.py | 55 ++++++++ foundry/v2/core/errors/__init__.py | 6 + foundry/v2/core/errors/_invalid_and_filter.py | 40 ++++++ .../v2/core/errors/_invalid_filter_value.py | 48 +++++++ foundry/v2/core/errors/_invalid_or_filter.py | 40 ++++++ foundry/v2/core/models/__init__.py | 28 ++++ .../core/models/_filter_binary_type_dict.py | 28 ++++ .../core/models/_filter_boolean_type_dict.py | 28 ++++ .../models/_filter_date_time_type_dict.py | 28 ++++ .../v2/core/models/_filter_date_type_dict.py | 28 ++++ .../core/models/_filter_double_type_dict.py | 28 ++++ .../v2/core/models/_filter_enum_type_dict.py | 32 +++++ .../v2/core/models/_filter_float_type_dict.py | 28 ++++ .../core/models/_filter_integer_type_dict.py | 28 ++++ .../v2/core/models/_filter_long_type_dict.py | 28 ++++ .../v2/core/models/_filter_rid_type_dict.py | 28 ++++ .../core/models/_filter_string_type_dict.py | 28 ++++ foundry/v2/core/models/_filter_type_dict.py | 53 ++++++++ .../v2/core/models/_filter_uuid_type_dict.py | 28 ++++ foundry/v2/core/models/_order_by_direction.py | 21 +++ foundry/v2/orchestration/build.py | 125 ++++++++++++++++++ foundry/v2/orchestration/errors/__init__.py | 4 + .../_search_builds_permission_denied.py | 40 ++++++ foundry/v2/orchestration/models/__init__.py | 70 ++++++++++ .../_get_builds_batch_request_element_dict.py | 29 ++++ .../models/_get_builds_batch_response.py | 39 ++++++ .../models/_get_builds_batch_response_dict.py | 31 +++++ .../models/_search_builds_and_filter_dict.py | 35 +++++ .../_search_builds_equals_filter_dict.py | 37 ++++++ .../_search_builds_equals_filter_field.py | 21 +++ .../models/_search_builds_filter_dict.py | 78 +++++++++++ .../models/_search_builds_gte_filter_dict.py | 37 ++++++ .../models/_search_builds_gte_filter_field.py | 21 +++ .../models/_search_builds_lt_filter_dict.py | 37 ++++++ .../models/_search_builds_lt_filter_field.py | 21 +++ .../models/_search_builds_not_filter_dict.py | 34 +++++ .../models/_search_builds_or_filter_dict.py | 35 +++++ .../models/_search_builds_order_by_dict.py | 32 +++++ .../models/_search_builds_order_by_field.py | 21 +++ .../_search_builds_order_by_item_dict.py | 33 +++++ .../models/_search_builds_response.py | 42 ++++++ .../models/_search_builds_response_dict.py | 34 +++++ 77 files changed, 2036 insertions(+), 1 deletion(-) create mode 100644 docs/v2/core/models/FilterBinaryTypeDict.md create mode 100644 docs/v2/core/models/FilterBooleanTypeDict.md create mode 100644 docs/v2/core/models/FilterDateTimeTypeDict.md create mode 100644 docs/v2/core/models/FilterDateTypeDict.md create mode 100644 docs/v2/core/models/FilterDoubleTypeDict.md create mode 100644 docs/v2/core/models/FilterEnumTypeDict.md create mode 100644 docs/v2/core/models/FilterFloatTypeDict.md create mode 100644 docs/v2/core/models/FilterIntegerTypeDict.md create mode 100644 docs/v2/core/models/FilterLongTypeDict.md create mode 100644 docs/v2/core/models/FilterRidTypeDict.md create mode 100644 docs/v2/core/models/FilterStringTypeDict.md create mode 100644 docs/v2/core/models/FilterTypeDict.md create mode 100644 docs/v2/core/models/FilterUuidTypeDict.md create mode 100644 docs/v2/core/models/OrderByDirection.md create mode 100644 docs/v2/orchestration/models/GetBuildsBatchRequestElementDict.md create mode 100644 docs/v2/orchestration/models/GetBuildsBatchResponse.md create mode 100644 docs/v2/orchestration/models/GetBuildsBatchResponseDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsAndFilterDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsEqualsFilterDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsEqualsFilterField.md create mode 100644 docs/v2/orchestration/models/SearchBuildsFilterDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsGteFilterDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsGteFilterField.md create mode 100644 docs/v2/orchestration/models/SearchBuildsLtFilterDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsLtFilterField.md create mode 100644 docs/v2/orchestration/models/SearchBuildsNotFilterDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsOrFilterDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsOrderByDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsOrderByField.md create mode 100644 docs/v2/orchestration/models/SearchBuildsOrderByItemDict.md create mode 100644 docs/v2/orchestration/models/SearchBuildsResponse.md create mode 100644 docs/v2/orchestration/models/SearchBuildsResponseDict.md create mode 100644 foundry/v2/core/errors/_invalid_and_filter.py create mode 100644 foundry/v2/core/errors/_invalid_filter_value.py create mode 100644 foundry/v2/core/errors/_invalid_or_filter.py create mode 100644 foundry/v2/core/models/_filter_binary_type_dict.py create mode 100644 foundry/v2/core/models/_filter_boolean_type_dict.py create mode 100644 foundry/v2/core/models/_filter_date_time_type_dict.py create mode 100644 foundry/v2/core/models/_filter_date_type_dict.py create mode 100644 foundry/v2/core/models/_filter_double_type_dict.py create mode 100644 foundry/v2/core/models/_filter_enum_type_dict.py create mode 100644 foundry/v2/core/models/_filter_float_type_dict.py create mode 100644 foundry/v2/core/models/_filter_integer_type_dict.py create mode 100644 foundry/v2/core/models/_filter_long_type_dict.py create mode 100644 foundry/v2/core/models/_filter_rid_type_dict.py create mode 100644 foundry/v2/core/models/_filter_string_type_dict.py create mode 100644 foundry/v2/core/models/_filter_type_dict.py create mode 100644 foundry/v2/core/models/_filter_uuid_type_dict.py create mode 100644 foundry/v2/core/models/_order_by_direction.py create mode 100644 foundry/v2/orchestration/errors/_search_builds_permission_denied.py create mode 100644 foundry/v2/orchestration/models/_get_builds_batch_request_element_dict.py create mode 100644 foundry/v2/orchestration/models/_get_builds_batch_response.py create mode 100644 foundry/v2/orchestration/models/_get_builds_batch_response_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_and_filter_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_equals_filter_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_equals_filter_field.py create mode 100644 foundry/v2/orchestration/models/_search_builds_filter_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_gte_filter_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_gte_filter_field.py create mode 100644 foundry/v2/orchestration/models/_search_builds_lt_filter_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_lt_filter_field.py create mode 100644 foundry/v2/orchestration/models/_search_builds_not_filter_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_or_filter_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_order_by_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_order_by_field.py create mode 100644 foundry/v2/orchestration/models/_search_builds_order_by_item_dict.py create mode 100644 foundry/v2/orchestration/models/_search_builds_response.py create mode 100644 foundry/v2/orchestration/models/_search_builds_response_dict.py diff --git a/README.md b/README.md index 9b4bd119..dbb78905 100644 --- a/README.md +++ b/README.md @@ -441,6 +441,7 @@ Namespace | Resource | Operation | HTTP request | **Orchestration** | Build | [**cancel**](docs/v2/Orchestration/Build.md#cancel) | **POST** /v2/orchestration/builds/{buildRid}/cancel | **Orchestration** | Build | [**create**](docs/v2/Orchestration/Build.md#create) | **POST** /v2/orchestration/builds/create | **Orchestration** | Build | [**get**](docs/v2/Orchestration/Build.md#get) | **GET** /v2/orchestration/builds/{buildRid} | +**Orchestration** | Build | [**get_batch**](docs/v2/Orchestration/Build.md#get_batch) | **POST** /v2/orchestration/builds/getBatch | **Orchestration** | Schedule | [**create**](docs/v2/Orchestration/Schedule.md#create) | **POST** /v2/orchestration/schedules | **Orchestration** | Schedule | [**delete**](docs/v2/Orchestration/Schedule.md#delete) | **DELETE** /v2/orchestration/schedules/{scheduleRid} | **Orchestration** | Schedule | [**get**](docs/v2/Orchestration/Schedule.md#get) | **GET** /v2/orchestration/schedules/{scheduleRid} | @@ -781,6 +782,19 @@ Namespace | Resource | Operation | HTTP request | - [FieldSchemaDict](docs/v2/models/FieldSchemaDict.md) - [Filename](docs/v2/models/Filename.md) - [FilePath](docs/v2/models/FilePath.md) +- [FilterBinaryTypeDict](docs/v2/models/FilterBinaryTypeDict.md) +- [FilterBooleanTypeDict](docs/v2/models/FilterBooleanTypeDict.md) +- [FilterDateTimeTypeDict](docs/v2/models/FilterDateTimeTypeDict.md) +- [FilterDateTypeDict](docs/v2/models/FilterDateTypeDict.md) +- [FilterDoubleTypeDict](docs/v2/models/FilterDoubleTypeDict.md) +- [FilterEnumTypeDict](docs/v2/models/FilterEnumTypeDict.md) +- [FilterFloatTypeDict](docs/v2/models/FilterFloatTypeDict.md) +- [FilterIntegerTypeDict](docs/v2/models/FilterIntegerTypeDict.md) +- [FilterLongTypeDict](docs/v2/models/FilterLongTypeDict.md) +- [FilterRidTypeDict](docs/v2/models/FilterRidTypeDict.md) +- [FilterStringTypeDict](docs/v2/models/FilterStringTypeDict.md) +- [FilterTypeDict](docs/v2/models/FilterTypeDict.md) +- [FilterUuidTypeDict](docs/v2/models/FilterUuidTypeDict.md) - [FloatType](docs/v2/models/FloatType.md) - [FloatTypeDict](docs/v2/models/FloatTypeDict.md) - [FullRowChangeDataCaptureConfiguration](docs/v2/models/FullRowChangeDataCaptureConfiguration.md) @@ -807,6 +821,7 @@ Namespace | Resource | Operation | HTTP request | - [MediaType](docs/v2/models/MediaType.md) - [NullType](docs/v2/models/NullType.md) - [NullTypeDict](docs/v2/models/NullTypeDict.md) +- [OrderByDirection](docs/v2/models/OrderByDirection.md) - [OrganizationRid](docs/v2/models/OrganizationRid.md) - [PageSize](docs/v2/models/PageSize.md) - [PageToken](docs/v2/models/PageToken.md) @@ -1358,6 +1373,9 @@ Namespace | Resource | Operation | HTTP request | - [DatasetUpdatedTriggerDict](docs/v2/models/DatasetUpdatedTriggerDict.md) - [FallbackBranches](docs/v2/models/FallbackBranches.md) - [ForceBuild](docs/v2/models/ForceBuild.md) +- [GetBuildsBatchRequestElementDict](docs/v2/models/GetBuildsBatchRequestElementDict.md) +- [GetBuildsBatchResponse](docs/v2/models/GetBuildsBatchResponse.md) +- [GetBuildsBatchResponseDict](docs/v2/models/GetBuildsBatchResponseDict.md) - [JobSucceededTrigger](docs/v2/models/JobSucceededTrigger.md) - [JobSucceededTriggerDict](docs/v2/models/JobSucceededTriggerDict.md) - [ListRunsOfScheduleResponse](docs/v2/models/ListRunsOfScheduleResponse.md) @@ -1407,6 +1425,21 @@ Namespace | Resource | Operation | HTTP request | - [ScheduleVersionRid](docs/v2/models/ScheduleVersionRid.md) - [ScopeMode](docs/v2/models/ScopeMode.md) - [ScopeModeDict](docs/v2/models/ScopeModeDict.md) +- [SearchBuildsAndFilterDict](docs/v2/models/SearchBuildsAndFilterDict.md) +- [SearchBuildsEqualsFilterDict](docs/v2/models/SearchBuildsEqualsFilterDict.md) +- [SearchBuildsEqualsFilterField](docs/v2/models/SearchBuildsEqualsFilterField.md) +- [SearchBuildsFilterDict](docs/v2/models/SearchBuildsFilterDict.md) +- [SearchBuildsGteFilterDict](docs/v2/models/SearchBuildsGteFilterDict.md) +- [SearchBuildsGteFilterField](docs/v2/models/SearchBuildsGteFilterField.md) +- [SearchBuildsLtFilterDict](docs/v2/models/SearchBuildsLtFilterDict.md) +- [SearchBuildsLtFilterField](docs/v2/models/SearchBuildsLtFilterField.md) +- [SearchBuildsNotFilterDict](docs/v2/models/SearchBuildsNotFilterDict.md) +- [SearchBuildsOrderByDict](docs/v2/models/SearchBuildsOrderByDict.md) +- [SearchBuildsOrderByField](docs/v2/models/SearchBuildsOrderByField.md) +- [SearchBuildsOrderByItemDict](docs/v2/models/SearchBuildsOrderByItemDict.md) +- [SearchBuildsOrFilterDict](docs/v2/models/SearchBuildsOrFilterDict.md) +- [SearchBuildsResponse](docs/v2/models/SearchBuildsResponse.md) +- [SearchBuildsResponseDict](docs/v2/models/SearchBuildsResponseDict.md) - [TimeTrigger](docs/v2/models/TimeTrigger.md) - [TimeTriggerDict](docs/v2/models/TimeTriggerDict.md) - [Trigger](docs/v2/models/Trigger.md) diff --git a/docs/v2/Orchestration/Build.md b/docs/v2/Orchestration/Build.md index 1573c1bf..b1a1326c 100644 --- a/docs/v2/Orchestration/Build.md +++ b/docs/v2/Orchestration/Build.md @@ -5,6 +5,7 @@ Method | HTTP request | [**cancel**](#cancel) | **POST** /v2/orchestration/builds/{buildRid}/cancel | [**create**](#create) | **POST** /v2/orchestration/builds/create | [**get**](#get) | **GET** /v2/orchestration/builds/{buildRid} | +[**get_batch**](#get_batch) | **POST** /v2/orchestration/builds/getBatch | # **cancel** Request a cancellation for all unfinished jobs in a build. The build's status will not update immediately. This endpoint is asynchronous and a success response indicates that the cancellation request has been acknowledged and the build is expected to be canceled soon. If the build has already finished or finishes shortly after the request and before the cancellation, the build will not change. @@ -200,3 +201,126 @@ 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) +# **get_batch** +Execute multiple get requests on Build. + +The maximum batch size for this endpoint is 100. + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**body** | Annotated[List[GetBuildsBatchRequestElementDict], Len(min_length=1, max_length=100)] | Body of the request | | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**GetBuildsBatchResponse** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# Annotated[List[GetBuildsBatchRequestElementDict], Len(min_length=1, max_length=100)] | Body of the request +body = [{"buildRid": "ri.foundry.main.build.a4386b7e-d546-49be-8a36-eefc355f5c58"}] +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.orchestration.Build.get_batch( + body, + preview=preview, + ) + print("The get_batch response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Build.get_batch: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | GetBuildsBatchResponse | | application/json | + +[[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) + +Search for Builds. + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**where** | SearchBuildsFilterDict | | | +**order_by** | Optional[SearchBuildsOrderByDict] | | [optional] | +**page_size** | Optional[PageSize] | The page size for the search request. If no value is provided, a default of `100` will be used. | [optional] | +**page_token** | Optional[PageToken] | | [optional] | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**SearchBuildsResponse** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# SearchBuildsFilterDict | +where = None +# Optional[SearchBuildsOrderByDict] | +order_by = {"fields": [{"field": "STARTED_TIME", "direction": "ASC"}]} +# Optional[PageSize] | The page size for the search request. If no value is provided, a default of `100` will be used. +page_size = 100 +# Optional[PageToken] | +page_token = "v1.QnVpbGQgdGhlIEZ1dHVyZTogaHR0cHM6Ly93d3cucGFsYW50aXIuY29tL2NhcmVlcnMvP2xldmVyLXNvdXJjZSU1YiU1ZD1BUElEb2NzI29wZW4tcG9zaXRpb25z" +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.orchestration.Build.search( + where=where, + order_by=order_by, + page_size=page_size, + page_token=page_token, + preview=preview, + ) + print("The search response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Build.search: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | SearchBuildsResponse | | application/json | + +[[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) + diff --git a/docs/v2/core/models/FilterBinaryTypeDict.md b/docs/v2/core/models/FilterBinaryTypeDict.md new file mode 100644 index 00000000..8adfe8fa --- /dev/null +++ b/docs/v2/core/models/FilterBinaryTypeDict.md @@ -0,0 +1,11 @@ +# FilterBinaryTypeDict + +FilterBinaryType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["binary"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterBooleanTypeDict.md b/docs/v2/core/models/FilterBooleanTypeDict.md new file mode 100644 index 00000000..2ff116bc --- /dev/null +++ b/docs/v2/core/models/FilterBooleanTypeDict.md @@ -0,0 +1,11 @@ +# FilterBooleanTypeDict + +FilterBooleanType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["boolean"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterDateTimeTypeDict.md b/docs/v2/core/models/FilterDateTimeTypeDict.md new file mode 100644 index 00000000..f5aa1b29 --- /dev/null +++ b/docs/v2/core/models/FilterDateTimeTypeDict.md @@ -0,0 +1,11 @@ +# FilterDateTimeTypeDict + +FilterDateTimeType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["dateTime"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterDateTypeDict.md b/docs/v2/core/models/FilterDateTypeDict.md new file mode 100644 index 00000000..1fc24a7e --- /dev/null +++ b/docs/v2/core/models/FilterDateTypeDict.md @@ -0,0 +1,11 @@ +# FilterDateTypeDict + +FilterDateType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["date"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterDoubleTypeDict.md b/docs/v2/core/models/FilterDoubleTypeDict.md new file mode 100644 index 00000000..ee15805c --- /dev/null +++ b/docs/v2/core/models/FilterDoubleTypeDict.md @@ -0,0 +1,11 @@ +# FilterDoubleTypeDict + +FilterDoubleType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["double"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterEnumTypeDict.md b/docs/v2/core/models/FilterEnumTypeDict.md new file mode 100644 index 00000000..daad294f --- /dev/null +++ b/docs/v2/core/models/FilterEnumTypeDict.md @@ -0,0 +1,12 @@ +# FilterEnumTypeDict + +FilterEnumType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**values** | List[str] | Yes | The values allowed by the enum type. | +**type** | Literal["enum"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterFloatTypeDict.md b/docs/v2/core/models/FilterFloatTypeDict.md new file mode 100644 index 00000000..25ab94de --- /dev/null +++ b/docs/v2/core/models/FilterFloatTypeDict.md @@ -0,0 +1,11 @@ +# FilterFloatTypeDict + +FilterFloatType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["float"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterIntegerTypeDict.md b/docs/v2/core/models/FilterIntegerTypeDict.md new file mode 100644 index 00000000..4a57c55e --- /dev/null +++ b/docs/v2/core/models/FilterIntegerTypeDict.md @@ -0,0 +1,11 @@ +# FilterIntegerTypeDict + +FilterIntegerType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["integer"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterLongTypeDict.md b/docs/v2/core/models/FilterLongTypeDict.md new file mode 100644 index 00000000..0dccfb88 --- /dev/null +++ b/docs/v2/core/models/FilterLongTypeDict.md @@ -0,0 +1,11 @@ +# FilterLongTypeDict + +FilterLongType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["long"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterRidTypeDict.md b/docs/v2/core/models/FilterRidTypeDict.md new file mode 100644 index 00000000..0d2198c3 --- /dev/null +++ b/docs/v2/core/models/FilterRidTypeDict.md @@ -0,0 +1,11 @@ +# FilterRidTypeDict + +FilterRidType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["rid"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterStringTypeDict.md b/docs/v2/core/models/FilterStringTypeDict.md new file mode 100644 index 00000000..4828df3d --- /dev/null +++ b/docs/v2/core/models/FilterStringTypeDict.md @@ -0,0 +1,11 @@ +# FilterStringTypeDict + +FilterStringType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["string"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterTypeDict.md b/docs/v2/core/models/FilterTypeDict.md new file mode 100644 index 00000000..c97ac802 --- /dev/null +++ b/docs/v2/core/models/FilterTypeDict.md @@ -0,0 +1,26 @@ +# FilterTypeDict + +FilterType + +This is a discriminator type and does not contain any fields. Instead, it is a union +of of the models listed below. + +This discriminator class uses the `type` field to differentiate between classes. + +| Class | Value +| ------------ | ------------- +FilterDateTimeTypeDict | dateTime +FilterDateTypeDict | date +FilterBooleanTypeDict | boolean +FilterStringTypeDict | string +FilterDoubleTypeDict | double +FilterBinaryTypeDict | binary +FilterIntegerTypeDict | integer +FilterFloatTypeDict | float +FilterRidTypeDict | rid +FilterUuidTypeDict | uuid +FilterEnumTypeDict | enum +FilterLongTypeDict | long + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/FilterUuidTypeDict.md b/docs/v2/core/models/FilterUuidTypeDict.md new file mode 100644 index 00000000..4df50ba6 --- /dev/null +++ b/docs/v2/core/models/FilterUuidTypeDict.md @@ -0,0 +1,11 @@ +# FilterUuidTypeDict + +FilterUuidType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**type** | Literal["uuid"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/core/models/OrderByDirection.md b/docs/v2/core/models/OrderByDirection.md new file mode 100644 index 00000000..bb9a6070 --- /dev/null +++ b/docs/v2/core/models/OrderByDirection.md @@ -0,0 +1,11 @@ +# OrderByDirection + +Specifies the ordering direction (can be either `ASC` or `DESC`) + +| **Value** | +| --------- | +| `"ASC"` | +| `"DESC"` | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/GetBuildsBatchRequestElementDict.md b/docs/v2/orchestration/models/GetBuildsBatchRequestElementDict.md new file mode 100644 index 00000000..c9dc163b --- /dev/null +++ b/docs/v2/orchestration/models/GetBuildsBatchRequestElementDict.md @@ -0,0 +1,11 @@ +# GetBuildsBatchRequestElementDict + +GetBuildsBatchRequestElement + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**buildRid** | BuildRid | Yes | The RID of a build. | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/GetBuildsBatchResponse.md b/docs/v2/orchestration/models/GetBuildsBatchResponse.md new file mode 100644 index 00000000..622eda44 --- /dev/null +++ b/docs/v2/orchestration/models/GetBuildsBatchResponse.md @@ -0,0 +1,11 @@ +# GetBuildsBatchResponse + +GetBuildsBatchResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**data** | Dict[BuildRid, Build] | Yes | | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/GetBuildsBatchResponseDict.md b/docs/v2/orchestration/models/GetBuildsBatchResponseDict.md new file mode 100644 index 00000000..9632b5c8 --- /dev/null +++ b/docs/v2/orchestration/models/GetBuildsBatchResponseDict.md @@ -0,0 +1,11 @@ +# GetBuildsBatchResponseDict + +GetBuildsBatchResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**data** | Dict[BuildRid, BuildDict] | Yes | | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsAndFilterDict.md b/docs/v2/orchestration/models/SearchBuildsAndFilterDict.md new file mode 100644 index 00000000..df513df6 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsAndFilterDict.md @@ -0,0 +1,12 @@ +# SearchBuildsAndFilterDict + +Returns the Builds where every filter is satisfied. + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**items** | List[SearchBuildsFilterDict] | Yes | | +**type** | Literal["and"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsEqualsFilterDict.md b/docs/v2/orchestration/models/SearchBuildsEqualsFilterDict.md new file mode 100644 index 00000000..e2ebb843 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsEqualsFilterDict.md @@ -0,0 +1,13 @@ +# SearchBuildsEqualsFilterDict + +SearchBuildsEqualsFilter + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**field** | SearchBuildsEqualsFilterField | Yes | | +**value** | Any | Yes | | +**type** | Literal["eq"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsEqualsFilterField.md b/docs/v2/orchestration/models/SearchBuildsEqualsFilterField.md new file mode 100644 index 00000000..8f3001df --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsEqualsFilterField.md @@ -0,0 +1,13 @@ +# SearchBuildsEqualsFilterField + +SearchBuildsEqualsFilterField + +| **Value** | +| --------- | +| `"CREATED_BY"` | +| `"BRANCH_NAME"` | +| `"STATUS"` | +| `"RID"` | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsFilterDict.md b/docs/v2/orchestration/models/SearchBuildsFilterDict.md new file mode 100644 index 00000000..0d39af38 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsFilterDict.md @@ -0,0 +1,20 @@ +# SearchBuildsFilterDict + +SearchBuildsFilter + +This is a discriminator type and does not contain any fields. Instead, it is a union +of of the models listed below. + +This discriminator class uses the `type` field to differentiate between classes. + +| Class | Value +| ------------ | ------------- +SearchBuildsNotFilterDict | not +SearchBuildsOrFilterDict | or +SearchBuildsAndFilterDict | and +SearchBuildsLtFilterDict | lt +SearchBuildsGteFilterDict | gte +SearchBuildsEqualsFilterDict | eq + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsGteFilterDict.md b/docs/v2/orchestration/models/SearchBuildsGteFilterDict.md new file mode 100644 index 00000000..5ba43c27 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsGteFilterDict.md @@ -0,0 +1,13 @@ +# SearchBuildsGteFilterDict + +SearchBuildsGteFilter + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**field** | SearchBuildsGteFilterField | Yes | | +**value** | Any | Yes | | +**type** | Literal["gte"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsGteFilterField.md b/docs/v2/orchestration/models/SearchBuildsGteFilterField.md new file mode 100644 index 00000000..f9d3d2e8 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsGteFilterField.md @@ -0,0 +1,11 @@ +# SearchBuildsGteFilterField + +SearchBuildsGteFilterField + +| **Value** | +| --------- | +| `"STARTED_TIME"` | +| `"FINISHED_TIME"` | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsLtFilterDict.md b/docs/v2/orchestration/models/SearchBuildsLtFilterDict.md new file mode 100644 index 00000000..8f0dd2fc --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsLtFilterDict.md @@ -0,0 +1,13 @@ +# SearchBuildsLtFilterDict + +SearchBuildsLtFilter + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**field** | SearchBuildsLtFilterField | Yes | | +**value** | Any | Yes | | +**type** | Literal["lt"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsLtFilterField.md b/docs/v2/orchestration/models/SearchBuildsLtFilterField.md new file mode 100644 index 00000000..82c81b0c --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsLtFilterField.md @@ -0,0 +1,11 @@ +# SearchBuildsLtFilterField + +SearchBuildsLtFilterField + +| **Value** | +| --------- | +| `"STARTED_TIME"` | +| `"FINISHED_TIME"` | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsNotFilterDict.md b/docs/v2/orchestration/models/SearchBuildsNotFilterDict.md new file mode 100644 index 00000000..5f01dc11 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsNotFilterDict.md @@ -0,0 +1,12 @@ +# SearchBuildsNotFilterDict + +Returns the Builds where the filter is not satisfied. + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**value** | SearchBuildsFilterDict | Yes | | +**type** | Literal["not"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsOrFilterDict.md b/docs/v2/orchestration/models/SearchBuildsOrFilterDict.md new file mode 100644 index 00000000..45fde889 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsOrFilterDict.md @@ -0,0 +1,12 @@ +# SearchBuildsOrFilterDict + +Returns the Builds where at least one filter is satisfied. + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**items** | List[SearchBuildsFilterDict] | Yes | | +**type** | Literal["or"] | Yes | None | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsOrderByDict.md b/docs/v2/orchestration/models/SearchBuildsOrderByDict.md new file mode 100644 index 00000000..2f223326 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsOrderByDict.md @@ -0,0 +1,11 @@ +# SearchBuildsOrderByDict + +SearchBuildsOrderBy + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**fields** | List[SearchBuildsOrderByItemDict] | Yes | | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsOrderByField.md b/docs/v2/orchestration/models/SearchBuildsOrderByField.md new file mode 100644 index 00000000..e7792d6a --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsOrderByField.md @@ -0,0 +1,11 @@ +# SearchBuildsOrderByField + +SearchBuildsOrderByField + +| **Value** | +| --------- | +| `"STARTED_TIME"` | +| `"FINISHED_TIME"` | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsOrderByItemDict.md b/docs/v2/orchestration/models/SearchBuildsOrderByItemDict.md new file mode 100644 index 00000000..5750ebdd --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsOrderByItemDict.md @@ -0,0 +1,12 @@ +# SearchBuildsOrderByItemDict + +SearchBuildsOrderByItem + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**field** | SearchBuildsOrderByField | Yes | | +**direction** | OrderByDirection | Yes | | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsResponse.md b/docs/v2/orchestration/models/SearchBuildsResponse.md new file mode 100644 index 00000000..d559cf46 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsResponse.md @@ -0,0 +1,12 @@ +# SearchBuildsResponse + +SearchBuildsResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**data** | List[Build] | Yes | | +**next_page_token** | Optional[PageToken] | No | | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/docs/v2/orchestration/models/SearchBuildsResponseDict.md b/docs/v2/orchestration/models/SearchBuildsResponseDict.md new file mode 100644 index 00000000..65853316 --- /dev/null +++ b/docs/v2/orchestration/models/SearchBuildsResponseDict.md @@ -0,0 +1,12 @@ +# SearchBuildsResponseDict + +SearchBuildsResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**data** | List[BuildDict] | Yes | | +**nextPageToken** | NotRequired[PageToken] | No | | + + +[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) diff --git a/foundry/_versions.py b/foundry/_versions.py index 976abba7..a1504cc1 100644 --- a/foundry/_versions.py +++ b/foundry/_versions.py @@ -17,4 +17,4 @@ # using the autorelease bot __version__ = "0.0.0" -__openapi_document_version__ = "1.1022.0" +__openapi_document_version__ = "1.1023.0" diff --git a/foundry/v2/cli.py b/foundry/v2/cli.py index 1cec87ca..42edcb14 100644 --- a/foundry/v2/cli.py +++ b/foundry/v2/cli.py @@ -5127,6 +5127,61 @@ def orchestration_build_get( click.echo(repr(result)) +@orchestration_build.command("get_batch") +@click.argument("body", type=str, required=True) +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def orchestration_build_get_batch( + client: foundry.v2.FoundryClient, + body: str, + preview: Optional[bool], +): + """ + Execute multiple get requests on Build. + + The maximum batch size for this endpoint is 100. + """ + result = client.orchestration.Build.get_batch( + body=json.loads(body), + preview=preview, + ) + click.echo(repr(result)) + + +@orchestration_build.command("search") +@click.option("--where", type=str, required=True, help="""""") +@click.option("--order_by", type=str, required=False, help="""""") +@click.option( + "--page_size", + type=int, + required=False, + help="""The page size for the search request. If no value is provided, a default of `100` will be used. +""", +) +@click.option("--page_token", type=str, required=False, help="""""") +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def orchestration_build_search( + client: foundry.v2.FoundryClient, + where: str, + order_by: Optional[str], + page_size: Optional[int], + page_token: Optional[str], + preview: Optional[bool], +): + """ + Search for Builds. + """ + result = client.orchestration.Build.search( + where=json.loads(where), + order_by=None if order_by is None else json.loads(order_by), + page_size=page_size, + page_token=page_token, + preview=preview, + ) + click.echo(repr(result)) + + @cli.group("streams") def streams(): pass diff --git a/foundry/v2/core/errors/__init__.py b/foundry/v2/core/errors/__init__.py index 7020675d..72c2fba6 100644 --- a/foundry/v2/core/errors/__init__.py +++ b/foundry/v2/core/errors/__init__.py @@ -20,10 +20,13 @@ from foundry.v2.core.errors._get_space_resource_not_supported import ( GetSpaceResourceNotSupported, ) # NOQA +from foundry.v2.core.errors._invalid_and_filter import InvalidAndFilter from foundry.v2.core.errors._invalid_change_data_capture_configuration import ( InvalidChangeDataCaptureConfiguration, ) # NOQA from foundry.v2.core.errors._invalid_field_schema import InvalidFieldSchema +from foundry.v2.core.errors._invalid_filter_value import InvalidFilterValue +from foundry.v2.core.errors._invalid_or_filter import InvalidOrFilter from foundry.v2.core.errors._invalid_page_size import InvalidPageSize from foundry.v2.core.errors._invalid_page_token import InvalidPageToken from foundry.v2.core.errors._invalid_parameter_combination import ( @@ -39,8 +42,11 @@ "BatchRequestSizeExceededLimit", "GetRootFolderNotSupported", "GetSpaceResourceNotSupported", + "InvalidAndFilter", "InvalidChangeDataCaptureConfiguration", "InvalidFieldSchema", + "InvalidFilterValue", + "InvalidOrFilter", "InvalidPageSize", "InvalidPageToken", "InvalidParameterCombination", diff --git a/foundry/v2/core/errors/_invalid_and_filter.py b/foundry/v2/core/errors/_invalid_and_filter.py new file mode 100644 index 00000000..0414f1ef --- /dev/null +++ b/foundry/v2/core/errors/_invalid_and_filter.py @@ -0,0 +1,40 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Literal + +import pydantic +from typing_extensions import TypedDict + +from foundry._errors import PalantirRPCException + + +class InvalidAndFilterParameters(TypedDict): + """The provided AND filter should have at least one sub-filter.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + +@dataclass +class InvalidAndFilter(PalantirRPCException): + name: Literal["InvalidAndFilter"] + parameters: InvalidAndFilterParameters + error_instance_id: str + + +__all__ = ["InvalidAndFilter"] diff --git a/foundry/v2/core/errors/_invalid_filter_value.py b/foundry/v2/core/errors/_invalid_filter_value.py new file mode 100644 index 00000000..ac10b2fd --- /dev/null +++ b/foundry/v2/core/errors/_invalid_filter_value.py @@ -0,0 +1,48 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any +from typing import Literal + +import pydantic +from typing_extensions import TypedDict + +from foundry._errors import PalantirRPCException +from foundry.v2.core.models._filter_type_dict import FilterTypeDict + + +class InvalidFilterValueParameters(TypedDict): + """The provided filter value is invalid.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + field: str + + value: Any + + expectedType: FilterTypeDict + + +@dataclass +class InvalidFilterValue(PalantirRPCException): + name: Literal["InvalidFilterValue"] + parameters: InvalidFilterValueParameters + error_instance_id: str + + +__all__ = ["InvalidFilterValue"] diff --git a/foundry/v2/core/errors/_invalid_or_filter.py b/foundry/v2/core/errors/_invalid_or_filter.py new file mode 100644 index 00000000..0028c2c8 --- /dev/null +++ b/foundry/v2/core/errors/_invalid_or_filter.py @@ -0,0 +1,40 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Literal + +import pydantic +from typing_extensions import TypedDict + +from foundry._errors import PalantirRPCException + + +class InvalidOrFilterParameters(TypedDict): + """The provided OR filter should have at least one sub-filter.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + +@dataclass +class InvalidOrFilter(PalantirRPCException): + name: Literal["InvalidOrFilter"] + parameters: InvalidOrFilterParameters + error_instance_id: str + + +__all__ = ["InvalidOrFilter"] diff --git a/foundry/v2/core/models/__init__.py b/foundry/v2/core/models/__init__.py index 0f2b074b..5ee68b96 100644 --- a/foundry/v2/core/models/__init__.py +++ b/foundry/v2/core/models/__init__.py @@ -58,6 +58,19 @@ from foundry.v2.core.models._field_schema_dict import FieldSchemaDict from foundry.v2.core.models._file_path import FilePath from foundry.v2.core.models._filename import Filename +from foundry.v2.core.models._filter_binary_type_dict import FilterBinaryTypeDict +from foundry.v2.core.models._filter_boolean_type_dict import FilterBooleanTypeDict +from foundry.v2.core.models._filter_date_time_type_dict import FilterDateTimeTypeDict +from foundry.v2.core.models._filter_date_type_dict import FilterDateTypeDict +from foundry.v2.core.models._filter_double_type_dict import FilterDoubleTypeDict +from foundry.v2.core.models._filter_enum_type_dict import FilterEnumTypeDict +from foundry.v2.core.models._filter_float_type_dict import FilterFloatTypeDict +from foundry.v2.core.models._filter_integer_type_dict import FilterIntegerTypeDict +from foundry.v2.core.models._filter_long_type_dict import FilterLongTypeDict +from foundry.v2.core.models._filter_rid_type_dict import FilterRidTypeDict +from foundry.v2.core.models._filter_string_type_dict import FilterStringTypeDict +from foundry.v2.core.models._filter_type_dict import FilterTypeDict +from foundry.v2.core.models._filter_uuid_type_dict import FilterUuidTypeDict from foundry.v2.core.models._float_type import FloatType from foundry.v2.core.models._float_type_dict import FloatTypeDict from foundry.v2.core.models._full_row_change_data_capture_configuration import ( @@ -90,6 +103,7 @@ from foundry.v2.core.models._media_type import MediaType from foundry.v2.core.models._null_type import NullType from foundry.v2.core.models._null_type_dict import NullTypeDict +from foundry.v2.core.models._order_by_direction import OrderByDirection from foundry.v2.core.models._organization_rid import OrganizationRid from foundry.v2.core.models._page_size import PageSize from foundry.v2.core.models._page_token import PageToken @@ -165,6 +179,19 @@ "FieldSchemaDict", "FilePath", "Filename", + "FilterBinaryTypeDict", + "FilterBooleanTypeDict", + "FilterDateTimeTypeDict", + "FilterDateTypeDict", + "FilterDoubleTypeDict", + "FilterEnumTypeDict", + "FilterFloatTypeDict", + "FilterIntegerTypeDict", + "FilterLongTypeDict", + "FilterRidTypeDict", + "FilterStringTypeDict", + "FilterTypeDict", + "FilterUuidTypeDict", "FloatType", "FloatTypeDict", "FullRowChangeDataCaptureConfiguration", @@ -191,6 +218,7 @@ "MediaType", "NullType", "NullTypeDict", + "OrderByDirection", "OrganizationRid", "PageSize", "PageToken", diff --git a/foundry/v2/core/models/_filter_binary_type_dict.py b/foundry/v2/core/models/_filter_binary_type_dict.py new file mode 100644 index 00000000..4812e353 --- /dev/null +++ b/foundry/v2/core/models/_filter_binary_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterBinaryTypeDict(TypedDict): + """FilterBinaryType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["binary"] diff --git a/foundry/v2/core/models/_filter_boolean_type_dict.py b/foundry/v2/core/models/_filter_boolean_type_dict.py new file mode 100644 index 00000000..612eb0cb --- /dev/null +++ b/foundry/v2/core/models/_filter_boolean_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterBooleanTypeDict(TypedDict): + """FilterBooleanType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["boolean"] diff --git a/foundry/v2/core/models/_filter_date_time_type_dict.py b/foundry/v2/core/models/_filter_date_time_type_dict.py new file mode 100644 index 00000000..92edd9c9 --- /dev/null +++ b/foundry/v2/core/models/_filter_date_time_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterDateTimeTypeDict(TypedDict): + """FilterDateTimeType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["dateTime"] diff --git a/foundry/v2/core/models/_filter_date_type_dict.py b/foundry/v2/core/models/_filter_date_type_dict.py new file mode 100644 index 00000000..88d2a068 --- /dev/null +++ b/foundry/v2/core/models/_filter_date_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterDateTypeDict(TypedDict): + """FilterDateType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["date"] diff --git a/foundry/v2/core/models/_filter_double_type_dict.py b/foundry/v2/core/models/_filter_double_type_dict.py new file mode 100644 index 00000000..e008c728 --- /dev/null +++ b/foundry/v2/core/models/_filter_double_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterDoubleTypeDict(TypedDict): + """FilterDoubleType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["double"] diff --git a/foundry/v2/core/models/_filter_enum_type_dict.py b/foundry/v2/core/models/_filter_enum_type_dict.py new file mode 100644 index 00000000..d545a243 --- /dev/null +++ b/foundry/v2/core/models/_filter_enum_type_dict.py @@ -0,0 +1,32 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import List +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterEnumTypeDict(TypedDict): + """FilterEnumType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + values: List[str] + """The values allowed by the enum type.""" + + type: Literal["enum"] diff --git a/foundry/v2/core/models/_filter_float_type_dict.py b/foundry/v2/core/models/_filter_float_type_dict.py new file mode 100644 index 00000000..62752985 --- /dev/null +++ b/foundry/v2/core/models/_filter_float_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterFloatTypeDict(TypedDict): + """FilterFloatType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["float"] diff --git a/foundry/v2/core/models/_filter_integer_type_dict.py b/foundry/v2/core/models/_filter_integer_type_dict.py new file mode 100644 index 00000000..752d48dc --- /dev/null +++ b/foundry/v2/core/models/_filter_integer_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterIntegerTypeDict(TypedDict): + """FilterIntegerType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["integer"] diff --git a/foundry/v2/core/models/_filter_long_type_dict.py b/foundry/v2/core/models/_filter_long_type_dict.py new file mode 100644 index 00000000..15ac26d7 --- /dev/null +++ b/foundry/v2/core/models/_filter_long_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterLongTypeDict(TypedDict): + """FilterLongType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["long"] diff --git a/foundry/v2/core/models/_filter_rid_type_dict.py b/foundry/v2/core/models/_filter_rid_type_dict.py new file mode 100644 index 00000000..eeb32827 --- /dev/null +++ b/foundry/v2/core/models/_filter_rid_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterRidTypeDict(TypedDict): + """FilterRidType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["rid"] diff --git a/foundry/v2/core/models/_filter_string_type_dict.py b/foundry/v2/core/models/_filter_string_type_dict.py new file mode 100644 index 00000000..5123cf8d --- /dev/null +++ b/foundry/v2/core/models/_filter_string_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterStringTypeDict(TypedDict): + """FilterStringType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["string"] diff --git a/foundry/v2/core/models/_filter_type_dict.py b/foundry/v2/core/models/_filter_type_dict.py new file mode 100644 index 00000000..4c5b6c45 --- /dev/null +++ b/foundry/v2/core/models/_filter_type_dict.py @@ -0,0 +1,53 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Union + +import pydantic +from typing_extensions import Annotated + +from foundry.v2.core.models._filter_binary_type_dict import FilterBinaryTypeDict +from foundry.v2.core.models._filter_boolean_type_dict import FilterBooleanTypeDict +from foundry.v2.core.models._filter_date_time_type_dict import FilterDateTimeTypeDict +from foundry.v2.core.models._filter_date_type_dict import FilterDateTypeDict +from foundry.v2.core.models._filter_double_type_dict import FilterDoubleTypeDict +from foundry.v2.core.models._filter_enum_type_dict import FilterEnumTypeDict +from foundry.v2.core.models._filter_float_type_dict import FilterFloatTypeDict +from foundry.v2.core.models._filter_integer_type_dict import FilterIntegerTypeDict +from foundry.v2.core.models._filter_long_type_dict import FilterLongTypeDict +from foundry.v2.core.models._filter_rid_type_dict import FilterRidTypeDict +from foundry.v2.core.models._filter_string_type_dict import FilterStringTypeDict +from foundry.v2.core.models._filter_uuid_type_dict import FilterUuidTypeDict + +FilterTypeDict = Annotated[ + Union[ + FilterDateTimeTypeDict, + FilterDateTypeDict, + FilterBooleanTypeDict, + FilterStringTypeDict, + FilterDoubleTypeDict, + FilterBinaryTypeDict, + FilterIntegerTypeDict, + FilterFloatTypeDict, + FilterRidTypeDict, + FilterUuidTypeDict, + FilterEnumTypeDict, + FilterLongTypeDict, + ], + pydantic.Field(discriminator="type"), +] +"""FilterType""" diff --git a/foundry/v2/core/models/_filter_uuid_type_dict.py b/foundry/v2/core/models/_filter_uuid_type_dict.py new file mode 100644 index 00000000..fac4c6a8 --- /dev/null +++ b/foundry/v2/core/models/_filter_uuid_type_dict.py @@ -0,0 +1,28 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + + +class FilterUuidTypeDict(TypedDict): + """FilterUuidType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + type: Literal["uuid"] diff --git a/foundry/v2/core/models/_order_by_direction.py b/foundry/v2/core/models/_order_by_direction.py new file mode 100644 index 00000000..73f00639 --- /dev/null +++ b/foundry/v2/core/models/_order_by_direction.py @@ -0,0 +1,21 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +OrderByDirection = Literal["ASC", "DESC"] +"""Specifies the ordering direction (can be either `ASC` or `DESC`)""" diff --git a/foundry/v2/orchestration/build.py b/foundry/v2/orchestration/build.py index 896b9860..667ed27c 100644 --- a/foundry/v2/orchestration/build.py +++ b/foundry/v2/orchestration/build.py @@ -17,9 +17,11 @@ from typing import Any from typing import Dict +from typing import List from typing import Optional import pydantic +from annotated_types import Len from typing_extensions import Annotated from typing_extensions import TypedDict @@ -28,6 +30,8 @@ from foundry._core import RequestInfo from foundry._core.utils import maybe_ignore_preview from foundry._errors import handle_unexpected +from foundry.v2.core.models._page_size import PageSize +from foundry.v2.core.models._page_token import PageToken from foundry.v2.core.models._preview_mode import PreviewMode from foundry.v2.datasets.models._branch_name import BranchName from foundry.v2.orchestration.models._abort_on_failure import AbortOnFailure @@ -36,11 +40,24 @@ from foundry.v2.orchestration.models._build_target_dict import BuildTargetDict from foundry.v2.orchestration.models._fallback_branches import FallbackBranches from foundry.v2.orchestration.models._force_build import ForceBuild +from foundry.v2.orchestration.models._get_builds_batch_request_element_dict import ( + GetBuildsBatchRequestElementDict, +) # NOQA +from foundry.v2.orchestration.models._get_builds_batch_response import ( + GetBuildsBatchResponse, +) # NOQA from foundry.v2.orchestration.models._notifications_enabled import NotificationsEnabled from foundry.v2.orchestration.models._retry_backoff_duration_dict import ( RetryBackoffDurationDict, ) # NOQA from foundry.v2.orchestration.models._retry_count import RetryCount +from foundry.v2.orchestration.models._search_builds_filter_dict import ( + SearchBuildsFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_order_by_dict import ( + SearchBuildsOrderByDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_response import SearchBuildsResponse class BuildClient: @@ -212,3 +229,111 @@ def get( request_timeout=request_timeout, ), ) + + @maybe_ignore_preview + @pydantic.validate_call + @handle_unexpected + def get_batch( + self, + body: Annotated[List[GetBuildsBatchRequestElementDict], Len(min_length=1, max_length=100)], + *, + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[pydantic.StrictInt, pydantic.Field(gt=0)]] = None, + ) -> GetBuildsBatchResponse: + """ + Execute multiple get requests on Build. + + The maximum batch size for this endpoint is 100. + :param body: Body of the request + :type body: Annotated[List[GetBuildsBatchRequestElementDict], Len(min_length=1, max_length=100)] + :param preview: preview + :type preview: Optional[PreviewMode] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: GetBuildsBatchResponse + """ + + return self._api_client.call_api( + RequestInfo( + method="POST", + resource_path="/v2/orchestration/builds/getBatch", + query_params={ + "preview": preview, + }, + path_params={}, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body=body, + body_type=Annotated[ + List[GetBuildsBatchRequestElementDict], Len(min_length=1, max_length=100) + ], + response_type=GetBuildsBatchResponse, + request_timeout=request_timeout, + ), + ) + + @maybe_ignore_preview + @pydantic.validate_call + @handle_unexpected + def search( + self, + *, + where: SearchBuildsFilterDict, + order_by: Optional[SearchBuildsOrderByDict] = None, + page_size: Optional[PageSize] = None, + page_token: Optional[PageToken] = None, + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[pydantic.StrictInt, pydantic.Field(gt=0)]] = None, + ) -> SearchBuildsResponse: + """ + Search for Builds. + :param where: + :type where: SearchBuildsFilterDict + :param order_by: + :type order_by: Optional[SearchBuildsOrderByDict] + :param page_size: The page size for the search request. If no value is provided, a default of `100` will be used. + :type page_size: Optional[PageSize] + :param page_token: + :type page_token: Optional[PageToken] + :param preview: preview + :type preview: Optional[PreviewMode] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: SearchBuildsResponse + """ + + return self._api_client.call_api( + RequestInfo( + method="POST", + resource_path="/v2/orchestration/builds/search", + query_params={ + "preview": preview, + }, + path_params={}, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body={ + "where": where, + "orderBy": order_by, + "pageToken": page_token, + "pageSize": page_size, + }, + body_type=TypedDict( + "Body", + { # type: ignore + "where": SearchBuildsFilterDict, + "orderBy": Optional[SearchBuildsOrderByDict], + "pageToken": Optional[PageToken], + "pageSize": Optional[PageSize], + }, + ), + response_type=SearchBuildsResponse, + request_timeout=request_timeout, + ), + ) diff --git a/foundry/v2/orchestration/errors/__init__.py b/foundry/v2/orchestration/errors/__init__.py index 5d8180f9..a233e8c2 100644 --- a/foundry/v2/orchestration/errors/__init__.py +++ b/foundry/v2/orchestration/errors/__init__.py @@ -74,6 +74,9 @@ from foundry.v2.orchestration.errors._schedule_version_not_found import ( ScheduleVersionNotFound, ) # NOQA +from foundry.v2.orchestration.errors._search_builds_permission_denied import ( + SearchBuildsPermissionDenied, +) # NOQA from foundry.v2.orchestration.errors._target_not_supported import TargetNotSupported from foundry.v2.orchestration.errors._unpause_schedule_permission_denied import ( UnpauseSchedulePermissionDenied, @@ -107,6 +110,7 @@ "ScheduleTriggerResourcesNotFound", "ScheduleTriggerResourcesPermissionDenied", "ScheduleVersionNotFound", + "SearchBuildsPermissionDenied", "TargetNotSupported", "UnpauseSchedulePermissionDenied", ] diff --git a/foundry/v2/orchestration/errors/_search_builds_permission_denied.py b/foundry/v2/orchestration/errors/_search_builds_permission_denied.py new file mode 100644 index 00000000..8fbcd005 --- /dev/null +++ b/foundry/v2/orchestration/errors/_search_builds_permission_denied.py @@ -0,0 +1,40 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Literal + +import pydantic +from typing_extensions import TypedDict + +from foundry._errors import PalantirRPCException + + +class SearchBuildsPermissionDeniedParameters(TypedDict): + """Could not search the Build.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + +@dataclass +class SearchBuildsPermissionDenied(PalantirRPCException): + name: Literal["SearchBuildsPermissionDenied"] + parameters: SearchBuildsPermissionDeniedParameters + error_instance_id: str + + +__all__ = ["SearchBuildsPermissionDenied"] diff --git a/foundry/v2/orchestration/models/__init__.py b/foundry/v2/orchestration/models/__init__.py index 715b73f8..491b70c6 100644 --- a/foundry/v2/orchestration/models/__init__.py +++ b/foundry/v2/orchestration/models/__init__.py @@ -58,6 +58,15 @@ ) # NOQA from foundry.v2.orchestration.models._fallback_branches import FallbackBranches from foundry.v2.orchestration.models._force_build import ForceBuild +from foundry.v2.orchestration.models._get_builds_batch_request_element_dict import ( + GetBuildsBatchRequestElementDict, +) # NOQA +from foundry.v2.orchestration.models._get_builds_batch_response import ( + GetBuildsBatchResponse, +) # NOQA +from foundry.v2.orchestration.models._get_builds_batch_response_dict import ( + GetBuildsBatchResponseDict, +) # NOQA from foundry.v2.orchestration.models._job_succeeded_trigger import JobSucceededTrigger from foundry.v2.orchestration.models._job_succeeded_trigger_dict import ( JobSucceededTriggerDict, @@ -143,6 +152,49 @@ from foundry.v2.orchestration.models._schedule_version_rid import ScheduleVersionRid from foundry.v2.orchestration.models._scope_mode import ScopeMode from foundry.v2.orchestration.models._scope_mode_dict import ScopeModeDict +from foundry.v2.orchestration.models._search_builds_and_filter_dict import ( + SearchBuildsAndFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_equals_filter_dict import ( + SearchBuildsEqualsFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_equals_filter_field import ( + SearchBuildsEqualsFilterField, +) # NOQA +from foundry.v2.orchestration.models._search_builds_filter_dict import ( + SearchBuildsFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_gte_filter_dict import ( + SearchBuildsGteFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_gte_filter_field import ( + SearchBuildsGteFilterField, +) # NOQA +from foundry.v2.orchestration.models._search_builds_lt_filter_dict import ( + SearchBuildsLtFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_lt_filter_field import ( + SearchBuildsLtFilterField, +) # NOQA +from foundry.v2.orchestration.models._search_builds_not_filter_dict import ( + SearchBuildsNotFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_or_filter_dict import ( + SearchBuildsOrFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_order_by_dict import ( + SearchBuildsOrderByDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_order_by_field import ( + SearchBuildsOrderByField, +) # NOQA +from foundry.v2.orchestration.models._search_builds_order_by_item_dict import ( + SearchBuildsOrderByItemDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_response import SearchBuildsResponse +from foundry.v2.orchestration.models._search_builds_response_dict import ( + SearchBuildsResponseDict, +) # NOQA from foundry.v2.orchestration.models._time_trigger import TimeTrigger from foundry.v2.orchestration.models._time_trigger_dict import TimeTriggerDict from foundry.v2.orchestration.models._trigger import Trigger @@ -180,6 +232,9 @@ "DatasetUpdatedTriggerDict", "FallbackBranches", "ForceBuild", + "GetBuildsBatchRequestElementDict", + "GetBuildsBatchResponse", + "GetBuildsBatchResponseDict", "JobSucceededTrigger", "JobSucceededTriggerDict", "ListRunsOfScheduleResponse", @@ -229,6 +284,21 @@ "ScheduleVersionRid", "ScopeMode", "ScopeModeDict", + "SearchBuildsAndFilterDict", + "SearchBuildsEqualsFilterDict", + "SearchBuildsEqualsFilterField", + "SearchBuildsFilterDict", + "SearchBuildsGteFilterDict", + "SearchBuildsGteFilterField", + "SearchBuildsLtFilterDict", + "SearchBuildsLtFilterField", + "SearchBuildsNotFilterDict", + "SearchBuildsOrFilterDict", + "SearchBuildsOrderByDict", + "SearchBuildsOrderByField", + "SearchBuildsOrderByItemDict", + "SearchBuildsResponse", + "SearchBuildsResponseDict", "TimeTrigger", "TimeTriggerDict", "Trigger", diff --git a/foundry/v2/orchestration/models/_get_builds_batch_request_element_dict.py b/foundry/v2/orchestration/models/_get_builds_batch_request_element_dict.py new file mode 100644 index 00000000..238b03ef --- /dev/null +++ b/foundry/v2/orchestration/models/_get_builds_batch_request_element_dict.py @@ -0,0 +1,29 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._build_rid import BuildRid + + +class GetBuildsBatchRequestElementDict(TypedDict): + """GetBuildsBatchRequestElement""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + buildRid: BuildRid + """The RID of a build.""" diff --git a/foundry/v2/orchestration/models/_get_builds_batch_response.py b/foundry/v2/orchestration/models/_get_builds_batch_response.py new file mode 100644 index 00000000..dd7ea308 --- /dev/null +++ b/foundry/v2/orchestration/models/_get_builds_batch_response.py @@ -0,0 +1,39 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Dict +from typing import cast + +import pydantic + +from foundry.v2.orchestration.models._build import Build +from foundry.v2.orchestration.models._build_rid import BuildRid +from foundry.v2.orchestration.models._get_builds_batch_response_dict import ( + GetBuildsBatchResponseDict, +) # NOQA + + +class GetBuildsBatchResponse(pydantic.BaseModel): + """GetBuildsBatchResponse""" + + data: Dict[BuildRid, Build] + + model_config = {"extra": "allow"} + + def to_dict(self) -> GetBuildsBatchResponseDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(GetBuildsBatchResponseDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/orchestration/models/_get_builds_batch_response_dict.py b/foundry/v2/orchestration/models/_get_builds_batch_response_dict.py new file mode 100644 index 00000000..3b8b3574 --- /dev/null +++ b/foundry/v2/orchestration/models/_get_builds_batch_response_dict.py @@ -0,0 +1,31 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Dict + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._build_dict import BuildDict +from foundry.v2.orchestration.models._build_rid import BuildRid + + +class GetBuildsBatchResponseDict(TypedDict): + """GetBuildsBatchResponse""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + data: Dict[BuildRid, BuildDict] diff --git a/foundry/v2/orchestration/models/_search_builds_and_filter_dict.py b/foundry/v2/orchestration/models/_search_builds_and_filter_dict.py new file mode 100644 index 00000000..07657f1c --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_and_filter_dict.py @@ -0,0 +1,35 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import List +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_filter_dict import ( + SearchBuildsFilterDict, +) # NOQA + + +class SearchBuildsAndFilterDict(TypedDict): + """Returns the Builds where every filter is satisfied.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + items: List[SearchBuildsFilterDict] + + type: Literal["and"] diff --git a/foundry/v2/orchestration/models/_search_builds_equals_filter_dict.py b/foundry/v2/orchestration/models/_search_builds_equals_filter_dict.py new file mode 100644 index 00000000..37a3daf8 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_equals_filter_dict.py @@ -0,0 +1,37 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Any +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_equals_filter_field import ( + SearchBuildsEqualsFilterField, +) # NOQA + + +class SearchBuildsEqualsFilterDict(TypedDict): + """SearchBuildsEqualsFilter""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + field: SearchBuildsEqualsFilterField + + value: Any + + type: Literal["eq"] diff --git a/foundry/v2/orchestration/models/_search_builds_equals_filter_field.py b/foundry/v2/orchestration/models/_search_builds_equals_filter_field.py new file mode 100644 index 00000000..dd489b06 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_equals_filter_field.py @@ -0,0 +1,21 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +SearchBuildsEqualsFilterField = Literal["CREATED_BY", "BRANCH_NAME", "STATUS", "RID"] +"""SearchBuildsEqualsFilterField""" diff --git a/foundry/v2/orchestration/models/_search_builds_filter_dict.py b/foundry/v2/orchestration/models/_search_builds_filter_dict.py new file mode 100644 index 00000000..d4044d83 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_filter_dict.py @@ -0,0 +1,78 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import List +from typing import Literal +from typing import Union + +import pydantic +from typing_extensions import Annotated +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_equals_filter_dict import ( + SearchBuildsEqualsFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_gte_filter_dict import ( + SearchBuildsGteFilterDict, +) # NOQA +from foundry.v2.orchestration.models._search_builds_lt_filter_dict import ( + SearchBuildsLtFilterDict, +) # NOQA + + +class SearchBuildsNotFilterDict(TypedDict): + """Returns the Builds where the filter is not satisfied.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + value: SearchBuildsFilterDict + + type: Literal["not"] + + +class SearchBuildsOrFilterDict(TypedDict): + """Returns the Builds where at least one filter is satisfied.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + items: List[SearchBuildsFilterDict] + + type: Literal["or"] + + +class SearchBuildsAndFilterDict(TypedDict): + """Returns the Builds where every filter is satisfied.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + items: List[SearchBuildsFilterDict] + + type: Literal["and"] + + +SearchBuildsFilterDict = Annotated[ + Union[ + SearchBuildsNotFilterDict, + SearchBuildsOrFilterDict, + SearchBuildsAndFilterDict, + SearchBuildsLtFilterDict, + SearchBuildsGteFilterDict, + SearchBuildsEqualsFilterDict, + ], + pydantic.Field(discriminator="type"), +] +"""SearchBuildsFilter""" diff --git a/foundry/v2/orchestration/models/_search_builds_gte_filter_dict.py b/foundry/v2/orchestration/models/_search_builds_gte_filter_dict.py new file mode 100644 index 00000000..0f1c0be3 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_gte_filter_dict.py @@ -0,0 +1,37 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Any +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_gte_filter_field import ( + SearchBuildsGteFilterField, +) # NOQA + + +class SearchBuildsGteFilterDict(TypedDict): + """SearchBuildsGteFilter""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + field: SearchBuildsGteFilterField + + value: Any + + type: Literal["gte"] diff --git a/foundry/v2/orchestration/models/_search_builds_gte_filter_field.py b/foundry/v2/orchestration/models/_search_builds_gte_filter_field.py new file mode 100644 index 00000000..8b4a6974 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_gte_filter_field.py @@ -0,0 +1,21 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +SearchBuildsGteFilterField = Literal["STARTED_TIME", "FINISHED_TIME"] +"""SearchBuildsGteFilterField""" diff --git a/foundry/v2/orchestration/models/_search_builds_lt_filter_dict.py b/foundry/v2/orchestration/models/_search_builds_lt_filter_dict.py new file mode 100644 index 00000000..ec588538 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_lt_filter_dict.py @@ -0,0 +1,37 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Any +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_lt_filter_field import ( + SearchBuildsLtFilterField, +) # NOQA + + +class SearchBuildsLtFilterDict(TypedDict): + """SearchBuildsLtFilter""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + field: SearchBuildsLtFilterField + + value: Any + + type: Literal["lt"] diff --git a/foundry/v2/orchestration/models/_search_builds_lt_filter_field.py b/foundry/v2/orchestration/models/_search_builds_lt_filter_field.py new file mode 100644 index 00000000..82614345 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_lt_filter_field.py @@ -0,0 +1,21 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +SearchBuildsLtFilterField = Literal["STARTED_TIME", "FINISHED_TIME"] +"""SearchBuildsLtFilterField""" diff --git a/foundry/v2/orchestration/models/_search_builds_not_filter_dict.py b/foundry/v2/orchestration/models/_search_builds_not_filter_dict.py new file mode 100644 index 00000000..15e85df5 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_not_filter_dict.py @@ -0,0 +1,34 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_filter_dict import ( + SearchBuildsFilterDict, +) # NOQA + + +class SearchBuildsNotFilterDict(TypedDict): + """Returns the Builds where the filter is not satisfied.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + value: SearchBuildsFilterDict + + type: Literal["not"] diff --git a/foundry/v2/orchestration/models/_search_builds_or_filter_dict.py b/foundry/v2/orchestration/models/_search_builds_or_filter_dict.py new file mode 100644 index 00000000..0bed59b9 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_or_filter_dict.py @@ -0,0 +1,35 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import List +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_filter_dict import ( + SearchBuildsFilterDict, +) # NOQA + + +class SearchBuildsOrFilterDict(TypedDict): + """Returns the Builds where at least one filter is satisfied.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + items: List[SearchBuildsFilterDict] + + type: Literal["or"] diff --git a/foundry/v2/orchestration/models/_search_builds_order_by_dict.py b/foundry/v2/orchestration/models/_search_builds_order_by_dict.py new file mode 100644 index 00000000..fd98d4ce --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_order_by_dict.py @@ -0,0 +1,32 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import List + +from typing_extensions import TypedDict + +from foundry.v2.orchestration.models._search_builds_order_by_item_dict import ( + SearchBuildsOrderByItemDict, +) # NOQA + + +class SearchBuildsOrderByDict(TypedDict): + """SearchBuildsOrderBy""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + fields: List[SearchBuildsOrderByItemDict] diff --git a/foundry/v2/orchestration/models/_search_builds_order_by_field.py b/foundry/v2/orchestration/models/_search_builds_order_by_field.py new file mode 100644 index 00000000..687deddb --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_order_by_field.py @@ -0,0 +1,21 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import Literal + +SearchBuildsOrderByField = Literal["STARTED_TIME", "FINISHED_TIME"] +"""SearchBuildsOrderByField""" diff --git a/foundry/v2/orchestration/models/_search_builds_order_by_item_dict.py b/foundry/v2/orchestration/models/_search_builds_order_by_item_dict.py new file mode 100644 index 00000000..698b0eb7 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_order_by_item_dict.py @@ -0,0 +1,33 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing_extensions import TypedDict + +from foundry.v2.core.models._order_by_direction import OrderByDirection +from foundry.v2.orchestration.models._search_builds_order_by_field import ( + SearchBuildsOrderByField, +) # NOQA + + +class SearchBuildsOrderByItemDict(TypedDict): + """SearchBuildsOrderByItem""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + field: SearchBuildsOrderByField + + direction: OrderByDirection diff --git a/foundry/v2/orchestration/models/_search_builds_response.py b/foundry/v2/orchestration/models/_search_builds_response.py new file mode 100644 index 00000000..ecebbe72 --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_response.py @@ -0,0 +1,42 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import List +from typing import Optional +from typing import cast + +import pydantic + +from foundry.v2.core.models._page_token import PageToken +from foundry.v2.orchestration.models._build import Build +from foundry.v2.orchestration.models._search_builds_response_dict import ( + SearchBuildsResponseDict, +) # NOQA + + +class SearchBuildsResponse(pydantic.BaseModel): + """SearchBuildsResponse""" + + data: List[Build] + + next_page_token: Optional[PageToken] = pydantic.Field(alias="nextPageToken", default=None) + + model_config = {"extra": "allow"} + + def to_dict(self) -> SearchBuildsResponseDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(SearchBuildsResponseDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/orchestration/models/_search_builds_response_dict.py b/foundry/v2/orchestration/models/_search_builds_response_dict.py new file mode 100644 index 00000000..1fa8212c --- /dev/null +++ b/foundry/v2/orchestration/models/_search_builds_response_dict.py @@ -0,0 +1,34 @@ +# Copyright 2024 Palantir Technologies, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import annotations + +from typing import List + +from typing_extensions import NotRequired +from typing_extensions import TypedDict + +from foundry.v2.core.models._page_token import PageToken +from foundry.v2.orchestration.models._build_dict import BuildDict + + +class SearchBuildsResponseDict(TypedDict): + """SearchBuildsResponse""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + data: List[BuildDict] + + nextPageToken: NotRequired[PageToken]