From 6e62137e5e88e1a7a682d6ac68e84774ea31e4ca Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Tue, 24 Sep 2024 07:05:05 -0700 Subject: [PATCH] Excavator: Upgrade API Version (#30) --- README.md | 55 +++++ docs/v2/Admin/Marking.md | 56 +++++ docs/v2/Filesystem/Resource.md | 59 +++++ docs/v2/Functions/Query.md | 176 ++++++++++++++ docs/v2/Streams/Dataset.md | 82 +++++++ docs/v2/Streams/Stream.md | 65 +++++ .../GetMarkingsBatchRequestElementDict.md | 11 + .../admin/models/GetMarkingsBatchResponse.md | 11 + .../models/GetMarkingsBatchResponseDict.md | 11 + docs/v2/core/models/ResourceType.md | 58 +++++ docs/v2/filesystem/models/Resource.md | 24 ++ docs/v2/filesystem/models/ResourceDict.md | 24 ++ .../filesystem/models/ResourceDisplayName.md | 11 + docs/v2/filesystem/models/ResourcePath.md | 11 + docs/v2/filesystem/models/ResourceRid.md | 11 + docs/v2/filesystem/models/SpaceRid.md | 11 + docs/v2/filesystem/models/TrashedStatus.md | 12 + docs/v2/functions/models/DataValue.md | 33 +++ .../functions/models/ExecuteQueryResponse.md | 11 + .../models/ExecuteQueryResponseDict.md | 11 + docs/v2/functions/models/FunctionRid.md | 12 + docs/v2/functions/models/FunctionVersion.md | 13 + docs/v2/functions/models/Parameter.md | 12 + docs/v2/functions/models/ParameterDict.md | 12 + docs/v2/functions/models/ParameterId.md | 13 + docs/v2/functions/models/Query.md | 17 ++ .../models/QueryAggregationKeyType.md | 22 ++ .../models/QueryAggregationKeyTypeDict.md | 22 ++ .../models/QueryAggregationRangeSubType.md | 19 ++ .../QueryAggregationRangeSubTypeDict.md | 19 ++ .../models/QueryAggregationRangeType.md | 12 + .../models/QueryAggregationRangeTypeDict.md | 12 + .../models/QueryAggregationValueType.md | 18 ++ .../models/QueryAggregationValueTypeDict.md | 18 ++ docs/v2/functions/models/QueryApiName.md | 11 + docs/v2/functions/models/QueryArrayType.md | 12 + .../v2/functions/models/QueryArrayTypeDict.md | 12 + docs/v2/functions/models/QueryDataType.md | 32 +++ docs/v2/functions/models/QueryDataTypeDict.md | 32 +++ docs/v2/functions/models/QueryDict.md | 17 ++ docs/v2/functions/models/QuerySetType.md | 12 + docs/v2/functions/models/QuerySetTypeDict.md | 12 + docs/v2/functions/models/QueryStructField.md | 12 + .../functions/models/QueryStructFieldDict.md | 12 + docs/v2/functions/models/QueryStructType.md | 12 + .../functions/models/QueryStructTypeDict.md | 12 + docs/v2/functions/models/QueryUnionType.md | 12 + .../v2/functions/models/QueryUnionTypeDict.md | 12 + docs/v2/functions/models/StructFieldName.md | 12 + .../models/ThreeDimensionalAggregation.md | 13 + .../models/ThreeDimensionalAggregationDict.md | 13 + .../models/TwoDimensionalAggregation.md | 13 + .../models/TwoDimensionalAggregationDict.md | 13 + docs/v2/streams/models/Compressed.md | 15 ++ docs/v2/streams/models/Dataset.md | 13 + docs/v2/streams/models/DatasetDict.md | 13 + docs/v2/streams/models/PartitionsCount.md | 12 + docs/v2/streams/models/Stream.md | 15 ++ docs/v2/streams/models/StreamDict.md | 15 ++ docs/v2/streams/models/StreamType.md | 22 ++ docs/v2/streams/models/ViewRid.md | 12 + foundry/_versions.py | 2 +- foundry/v2/admin/marking.py | 52 ++++ foundry/v2/admin/models/__init__.py | 10 + ...get_markings_batch_request_element_dict.py | 28 +++ .../models/_get_markings_batch_response.py | 41 ++++ .../_get_markings_batch_response_dict.py | 31 +++ foundry/v2/cli.py | 229 ++++++++++++++++++ foundry/v2/client.py | 6 + foundry/v2/core/models/__init__.py | 2 + foundry/v2/core/models/_resource_type.py | 71 ++++++ foundry/v2/filesystem/client.py | 24 ++ foundry/v2/filesystem/models/__init__.py | 14 ++ foundry/v2/filesystem/models/_resource.py | 97 ++++++++ .../v2/filesystem/models/_resource_dict.py | 89 +++++++ .../models/_resource_display_name.py | 21 ++ .../v2/filesystem/models/_resource_path.py | 21 ++ foundry/v2/filesystem/models/_resource_rid.py | 21 ++ foundry/v2/filesystem/models/_space_rid.py | 21 ++ .../v2/filesystem/models/_trashed_status.py | 21 ++ foundry/v2/filesystem/resource.py | 79 ++++++ foundry/v2/functions/client.py | 24 ++ foundry/v2/functions/models/__init__.py | 114 +++++++++ foundry/v2/functions/models/_data_value.py | 44 ++++ .../models/_execute_query_response.py | 37 +++ .../models/_execute_query_response_dict.py | 28 +++ foundry/v2/functions/models/_function_rid.py | 21 ++ .../v2/functions/models/_function_version.py | 24 ++ foundry/v2/functions/models/_parameter.py | 40 +++ .../v2/functions/models/_parameter_dict.py | 32 +++ foundry/v2/functions/models/_parameter_id.py | 24 ++ foundry/v2/functions/models/_query.py | 57 +++++ .../models/_query_aggregation_key_type.py | 45 ++++ .../_query_aggregation_key_type_dict.py | 45 ++++ .../_query_aggregation_range_sub_type.py | 31 +++ .../_query_aggregation_range_sub_type_dict.py | 32 +++ .../models/_query_aggregation_range_type.py | 45 ++++ .../_query_aggregation_range_type_dict.py | 34 +++ .../models/_query_aggregation_value_type.py | 30 +++ .../_query_aggregation_value_type_dict.py | 30 +++ .../v2/functions/models/_query_api_name.py | 21 ++ .../v2/functions/models/_query_array_type.py | 39 +++ .../models/_query_array_type_dict.py | 32 +++ .../v2/functions/models/_query_data_type.py | 144 +++++++++++ .../functions/models/_query_data_type_dict.py | 118 +++++++++ foundry/v2/functions/models/_query_dict.py | 50 ++++ .../v2/functions/models/_query_set_type.py | 39 +++ .../functions/models/_query_set_type_dict.py | 32 +++ .../functions/models/_query_struct_field.py | 39 +++ .../models/_query_struct_field_dict.py | 31 +++ .../v2/functions/models/_query_struct_type.py | 39 +++ .../models/_query_struct_type_dict.py | 33 +++ .../v2/functions/models/_query_union_type.py | 40 +++ .../models/_query_union_type_dict.py | 33 +++ .../v2/functions/models/_struct_field_name.py | 21 ++ .../models/_three_dimensional_aggregation.py | 48 ++++ .../_three_dimensional_aggregation_dict.py | 39 +++ .../models/_two_dimensional_aggregation.py | 48 ++++ .../_two_dimensional_aggregation_dict.py | 39 +++ foundry/v2/functions/query.py | 188 ++++++++++++++ foundry/v2/streams/client.py | 24 ++ foundry/v2/streams/dataset.py | 122 ++++++++++ foundry/v2/streams/models/__init__.py | 34 +++ foundry/v2/streams/models/_compressed.py | 26 ++ foundry/v2/streams/models/_dataset.py | 42 ++++ foundry/v2/streams/models/_dataset_dict.py | 34 +++ .../v2/streams/models/_partitions_count.py | 21 ++ foundry/v2/streams/models/_stream.py | 60 +++++ foundry/v2/streams/models/_stream_dict.py | 52 ++++ foundry/v2/streams/models/_stream_type.py | 33 +++ foundry/v2/streams/models/_view_rid.py | 21 ++ foundry/v2/streams/stream.py | 86 +++++++ tests/test_discriminators.py | 4 + 133 files changed, 4605 insertions(+), 1 deletion(-) create mode 100644 docs/v2/Filesystem/Resource.md create mode 100644 docs/v2/Functions/Query.md create mode 100644 docs/v2/Streams/Dataset.md create mode 100644 docs/v2/Streams/Stream.md create mode 100644 docs/v2/admin/models/GetMarkingsBatchRequestElementDict.md create mode 100644 docs/v2/admin/models/GetMarkingsBatchResponse.md create mode 100644 docs/v2/admin/models/GetMarkingsBatchResponseDict.md create mode 100644 docs/v2/core/models/ResourceType.md create mode 100644 docs/v2/filesystem/models/Resource.md create mode 100644 docs/v2/filesystem/models/ResourceDict.md create mode 100644 docs/v2/filesystem/models/ResourceDisplayName.md create mode 100644 docs/v2/filesystem/models/ResourcePath.md create mode 100644 docs/v2/filesystem/models/ResourceRid.md create mode 100644 docs/v2/filesystem/models/SpaceRid.md create mode 100644 docs/v2/filesystem/models/TrashedStatus.md create mode 100644 docs/v2/functions/models/DataValue.md create mode 100644 docs/v2/functions/models/ExecuteQueryResponse.md create mode 100644 docs/v2/functions/models/ExecuteQueryResponseDict.md create mode 100644 docs/v2/functions/models/FunctionRid.md create mode 100644 docs/v2/functions/models/FunctionVersion.md create mode 100644 docs/v2/functions/models/Parameter.md create mode 100644 docs/v2/functions/models/ParameterDict.md create mode 100644 docs/v2/functions/models/ParameterId.md create mode 100644 docs/v2/functions/models/Query.md create mode 100644 docs/v2/functions/models/QueryAggregationKeyType.md create mode 100644 docs/v2/functions/models/QueryAggregationKeyTypeDict.md create mode 100644 docs/v2/functions/models/QueryAggregationRangeSubType.md create mode 100644 docs/v2/functions/models/QueryAggregationRangeSubTypeDict.md create mode 100644 docs/v2/functions/models/QueryAggregationRangeType.md create mode 100644 docs/v2/functions/models/QueryAggregationRangeTypeDict.md create mode 100644 docs/v2/functions/models/QueryAggregationValueType.md create mode 100644 docs/v2/functions/models/QueryAggregationValueTypeDict.md create mode 100644 docs/v2/functions/models/QueryApiName.md create mode 100644 docs/v2/functions/models/QueryArrayType.md create mode 100644 docs/v2/functions/models/QueryArrayTypeDict.md create mode 100644 docs/v2/functions/models/QueryDataType.md create mode 100644 docs/v2/functions/models/QueryDataTypeDict.md create mode 100644 docs/v2/functions/models/QueryDict.md create mode 100644 docs/v2/functions/models/QuerySetType.md create mode 100644 docs/v2/functions/models/QuerySetTypeDict.md create mode 100644 docs/v2/functions/models/QueryStructField.md create mode 100644 docs/v2/functions/models/QueryStructFieldDict.md create mode 100644 docs/v2/functions/models/QueryStructType.md create mode 100644 docs/v2/functions/models/QueryStructTypeDict.md create mode 100644 docs/v2/functions/models/QueryUnionType.md create mode 100644 docs/v2/functions/models/QueryUnionTypeDict.md create mode 100644 docs/v2/functions/models/StructFieldName.md create mode 100644 docs/v2/functions/models/ThreeDimensionalAggregation.md create mode 100644 docs/v2/functions/models/ThreeDimensionalAggregationDict.md create mode 100644 docs/v2/functions/models/TwoDimensionalAggregation.md create mode 100644 docs/v2/functions/models/TwoDimensionalAggregationDict.md create mode 100644 docs/v2/streams/models/Compressed.md create mode 100644 docs/v2/streams/models/Dataset.md create mode 100644 docs/v2/streams/models/DatasetDict.md create mode 100644 docs/v2/streams/models/PartitionsCount.md create mode 100644 docs/v2/streams/models/Stream.md create mode 100644 docs/v2/streams/models/StreamDict.md create mode 100644 docs/v2/streams/models/StreamType.md create mode 100644 docs/v2/streams/models/ViewRid.md create mode 100644 foundry/v2/admin/models/_get_markings_batch_request_element_dict.py create mode 100644 foundry/v2/admin/models/_get_markings_batch_response.py create mode 100644 foundry/v2/admin/models/_get_markings_batch_response_dict.py create mode 100644 foundry/v2/core/models/_resource_type.py create mode 100644 foundry/v2/filesystem/client.py create mode 100644 foundry/v2/filesystem/models/_resource.py create mode 100644 foundry/v2/filesystem/models/_resource_dict.py create mode 100644 foundry/v2/filesystem/models/_resource_display_name.py create mode 100644 foundry/v2/filesystem/models/_resource_path.py create mode 100644 foundry/v2/filesystem/models/_resource_rid.py create mode 100644 foundry/v2/filesystem/models/_space_rid.py create mode 100644 foundry/v2/filesystem/models/_trashed_status.py create mode 100644 foundry/v2/filesystem/resource.py create mode 100644 foundry/v2/functions/client.py create mode 100644 foundry/v2/functions/models/__init__.py create mode 100644 foundry/v2/functions/models/_data_value.py create mode 100644 foundry/v2/functions/models/_execute_query_response.py create mode 100644 foundry/v2/functions/models/_execute_query_response_dict.py create mode 100644 foundry/v2/functions/models/_function_rid.py create mode 100644 foundry/v2/functions/models/_function_version.py create mode 100644 foundry/v2/functions/models/_parameter.py create mode 100644 foundry/v2/functions/models/_parameter_dict.py create mode 100644 foundry/v2/functions/models/_parameter_id.py create mode 100644 foundry/v2/functions/models/_query.py create mode 100644 foundry/v2/functions/models/_query_aggregation_key_type.py create mode 100644 foundry/v2/functions/models/_query_aggregation_key_type_dict.py create mode 100644 foundry/v2/functions/models/_query_aggregation_range_sub_type.py create mode 100644 foundry/v2/functions/models/_query_aggregation_range_sub_type_dict.py create mode 100644 foundry/v2/functions/models/_query_aggregation_range_type.py create mode 100644 foundry/v2/functions/models/_query_aggregation_range_type_dict.py create mode 100644 foundry/v2/functions/models/_query_aggregation_value_type.py create mode 100644 foundry/v2/functions/models/_query_aggregation_value_type_dict.py create mode 100644 foundry/v2/functions/models/_query_api_name.py create mode 100644 foundry/v2/functions/models/_query_array_type.py create mode 100644 foundry/v2/functions/models/_query_array_type_dict.py create mode 100644 foundry/v2/functions/models/_query_data_type.py create mode 100644 foundry/v2/functions/models/_query_data_type_dict.py create mode 100644 foundry/v2/functions/models/_query_dict.py create mode 100644 foundry/v2/functions/models/_query_set_type.py create mode 100644 foundry/v2/functions/models/_query_set_type_dict.py create mode 100644 foundry/v2/functions/models/_query_struct_field.py create mode 100644 foundry/v2/functions/models/_query_struct_field_dict.py create mode 100644 foundry/v2/functions/models/_query_struct_type.py create mode 100644 foundry/v2/functions/models/_query_struct_type_dict.py create mode 100644 foundry/v2/functions/models/_query_union_type.py create mode 100644 foundry/v2/functions/models/_query_union_type_dict.py create mode 100644 foundry/v2/functions/models/_struct_field_name.py create mode 100644 foundry/v2/functions/models/_three_dimensional_aggregation.py create mode 100644 foundry/v2/functions/models/_three_dimensional_aggregation_dict.py create mode 100644 foundry/v2/functions/models/_two_dimensional_aggregation.py create mode 100644 foundry/v2/functions/models/_two_dimensional_aggregation_dict.py create mode 100644 foundry/v2/functions/query.py create mode 100644 foundry/v2/streams/client.py create mode 100644 foundry/v2/streams/dataset.py create mode 100644 foundry/v2/streams/models/__init__.py create mode 100644 foundry/v2/streams/models/_compressed.py create mode 100644 foundry/v2/streams/models/_dataset.py create mode 100644 foundry/v2/streams/models/_dataset_dict.py create mode 100644 foundry/v2/streams/models/_partitions_count.py create mode 100644 foundry/v2/streams/models/_stream.py create mode 100644 foundry/v2/streams/models/_stream_dict.py create mode 100644 foundry/v2/streams/models/_stream_type.py create mode 100644 foundry/v2/streams/models/_view_rid.py create mode 100644 foundry/v2/streams/stream.py diff --git a/README.md b/README.md index 17e612eb..d3ad876a 100644 --- a/README.md +++ b/README.md @@ -459,6 +459,9 @@ Namespace | Resource | Operation | HTTP request | - [GetGroupsBatchRequestElementDict](docs/v2/models/GetGroupsBatchRequestElementDict.md) - [GetGroupsBatchResponse](docs/v2/models/GetGroupsBatchResponse.md) - [GetGroupsBatchResponseDict](docs/v2/models/GetGroupsBatchResponseDict.md) +- [GetMarkingsBatchRequestElementDict](docs/v2/models/GetMarkingsBatchRequestElementDict.md) +- [GetMarkingsBatchResponse](docs/v2/models/GetMarkingsBatchResponse.md) +- [GetMarkingsBatchResponseDict](docs/v2/models/GetMarkingsBatchResponseDict.md) - [GetUserMarkingsResponse](docs/v2/models/GetUserMarkingsResponse.md) - [GetUserMarkingsResponseDict](docs/v2/models/GetUserMarkingsResponseDict.md) - [GetUsersBatchRequestElementDict](docs/v2/models/GetUsersBatchRequestElementDict.md) @@ -552,6 +555,7 @@ Namespace | Resource | Operation | HTTP request | - [PrincipalType](docs/v2/models/PrincipalType.md) - [Realm](docs/v2/models/Realm.md) - [ReleaseStatus](docs/v2/models/ReleaseStatus.md) +- [ResourceType](docs/v2/models/ResourceType.md) - [ShortType](docs/v2/models/ShortType.md) - [ShortTypeDict](docs/v2/models/ShortTypeDict.md) - [SizeBytes](docs/v2/models/SizeBytes.md) @@ -594,6 +598,49 @@ Namespace | Resource | Operation | HTTP request | - [TransactionType](docs/v2/models/TransactionType.md) - [FolderRid](docs/v2/models/FolderRid.md) - [ProjectRid](docs/v2/models/ProjectRid.md) +- [Resource](docs/v2/models/Resource.md) +- [ResourceDict](docs/v2/models/ResourceDict.md) +- [ResourceDisplayName](docs/v2/models/ResourceDisplayName.md) +- [ResourcePath](docs/v2/models/ResourcePath.md) +- [ResourceRid](docs/v2/models/ResourceRid.md) +- [SpaceRid](docs/v2/models/SpaceRid.md) +- [TrashedStatus](docs/v2/models/TrashedStatus.md) +- [DataValue](docs/v2/models/DataValue.md) +- [ExecuteQueryResponse](docs/v2/models/ExecuteQueryResponse.md) +- [ExecuteQueryResponseDict](docs/v2/models/ExecuteQueryResponseDict.md) +- [FunctionRid](docs/v2/models/FunctionRid.md) +- [FunctionVersion](docs/v2/models/FunctionVersion.md) +- [Parameter](docs/v2/models/Parameter.md) +- [ParameterDict](docs/v2/models/ParameterDict.md) +- [ParameterId](docs/v2/models/ParameterId.md) +- [Query](docs/v2/models/Query.md) +- [QueryAggregationKeyType](docs/v2/models/QueryAggregationKeyType.md) +- [QueryAggregationKeyTypeDict](docs/v2/models/QueryAggregationKeyTypeDict.md) +- [QueryAggregationRangeSubType](docs/v2/models/QueryAggregationRangeSubType.md) +- [QueryAggregationRangeSubTypeDict](docs/v2/models/QueryAggregationRangeSubTypeDict.md) +- [QueryAggregationRangeType](docs/v2/models/QueryAggregationRangeType.md) +- [QueryAggregationRangeTypeDict](docs/v2/models/QueryAggregationRangeTypeDict.md) +- [QueryAggregationValueType](docs/v2/models/QueryAggregationValueType.md) +- [QueryAggregationValueTypeDict](docs/v2/models/QueryAggregationValueTypeDict.md) +- [QueryApiName](docs/v2/models/QueryApiName.md) +- [QueryArrayType](docs/v2/models/QueryArrayType.md) +- [QueryArrayTypeDict](docs/v2/models/QueryArrayTypeDict.md) +- [QueryDataType](docs/v2/models/QueryDataType.md) +- [QueryDataTypeDict](docs/v2/models/QueryDataTypeDict.md) +- [QueryDict](docs/v2/models/QueryDict.md) +- [QuerySetType](docs/v2/models/QuerySetType.md) +- [QuerySetTypeDict](docs/v2/models/QuerySetTypeDict.md) +- [QueryStructField](docs/v2/models/QueryStructField.md) +- [QueryStructFieldDict](docs/v2/models/QueryStructFieldDict.md) +- [QueryStructType](docs/v2/models/QueryStructType.md) +- [QueryStructTypeDict](docs/v2/models/QueryStructTypeDict.md) +- [QueryUnionType](docs/v2/models/QueryUnionType.md) +- [QueryUnionTypeDict](docs/v2/models/QueryUnionTypeDict.md) +- [StructFieldName](docs/v2/models/StructFieldName.md) +- [ThreeDimensionalAggregation](docs/v2/models/ThreeDimensionalAggregation.md) +- [ThreeDimensionalAggregationDict](docs/v2/models/ThreeDimensionalAggregationDict.md) +- [TwoDimensionalAggregation](docs/v2/models/TwoDimensionalAggregation.md) +- [TwoDimensionalAggregationDict](docs/v2/models/TwoDimensionalAggregationDict.md) - [BBox](docs/v2/models/BBox.md) - [Coordinate](docs/v2/models/Coordinate.md) - [GeoPoint](docs/v2/models/GeoPoint.md) @@ -988,6 +1035,14 @@ Namespace | Resource | Operation | HTTP request | - [UserScope](docs/v2/models/UserScope.md) - [UserScopeDict](docs/v2/models/UserScopeDict.md) - [ZoneId](docs/v2/models/ZoneId.md) +- [Compressed](docs/v2/models/Compressed.md) +- [Dataset](docs/v2/models/Dataset.md) +- [DatasetDict](docs/v2/models/DatasetDict.md) +- [PartitionsCount](docs/v2/models/PartitionsCount.md) +- [Stream](docs/v2/models/Stream.md) +- [StreamDict](docs/v2/models/StreamDict.md) +- [StreamType](docs/v2/models/StreamType.md) +- [ViewRid](docs/v2/models/ViewRid.md) - [ListVersionsResponse](docs/v2/models/ListVersionsResponse.md) - [ListVersionsResponseDict](docs/v2/models/ListVersionsResponseDict.md) - [Subdomain](docs/v2/models/Subdomain.md) diff --git a/docs/v2/Admin/Marking.md b/docs/v2/Admin/Marking.md index 16f4b803..5092be88 100644 --- a/docs/v2/Admin/Marking.md +++ b/docs/v2/Admin/Marking.md @@ -57,6 +57,62 @@ 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) +Execute multiple get requests on Marking. + +The maximum batch size for this endpoint is 500. + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**body** | Annotated[List[GetMarkingsBatchRequestElementDict], Len(min_length=1, max_length=500)] | Body of the request | | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**GetMarkingsBatchResponse** + +### 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[GetMarkingsBatchRequestElementDict], Len(min_length=1, max_length=500)] | Body of the request +body = {"markingId": "18212f9a-0e63-4b79-96a0-aae04df23336"} +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.admin.Marking.get_batch( + body, + preview=preview, + ) + print("The get_batch response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Marking.get_batch: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | GetMarkingsBatchResponse | | 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) + Maximum page size 100. ### Parameters diff --git a/docs/v2/Filesystem/Resource.md b/docs/v2/Filesystem/Resource.md new file mode 100644 index 00000000..8c701adc --- /dev/null +++ b/docs/v2/Filesystem/Resource.md @@ -0,0 +1,59 @@ +# Resource + +Method | HTTP request | +------------- | ------------- | + +Get the Resource with the specified rid. + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**resource_rid** | ResourceRid | resourceRid | | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**Resource** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# ResourceRid | resourceRid +resource_rid = "ri.foundry.main.dataset.c26f11c8-cdb3-4f44-9f5d-9816ea1c82da" +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.filesystem.Resource.get( + resource_rid, + preview=preview, + ) + print("The get response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Resource.get: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | Resource | | 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/Functions/Query.md b/docs/v2/Functions/Query.md new file mode 100644 index 00000000..90738e5e --- /dev/null +++ b/docs/v2/Functions/Query.md @@ -0,0 +1,176 @@ +# Query + +Method | HTTP request | +------------- | ------------- | + +Executes a Query using the given parameters. + +Optional parameters do not need to be supplied. + + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**query_api_name** | QueryApiName | queryApiName | | +**parameters** | Dict[ParameterId, Optional[DataValue]] | | | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**ExecuteQueryResponse** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# QueryApiName | queryApiName +query_api_name = None +# Dict[ParameterId, Optional[DataValue]] | +parameters = None +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.functions.Query.execute( + query_api_name, + parameters=parameters, + preview=preview, + ) + print("The execute response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Query.execute: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | ExecuteQueryResponse | | 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) + +Gets a specific query type with the given API name. + + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**query_api_name** | QueryApiName | queryApiName | | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**Query** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# QueryApiName | queryApiName +query_api_name = None +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.functions.Query.get( + query_api_name, + preview=preview, + ) + print("The get response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Query.get: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | Query | | 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) + +Gets a specific query type with the given RID. + + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**rid** | FunctionRid | | | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**Query** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# FunctionRid | +rid = None +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.functions.Query.get_by_rid( + rid=rid, + preview=preview, + ) + print("The get_by_rid response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Query.get_by_rid: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | Query | | 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/Streams/Dataset.md b/docs/v2/Streams/Dataset.md new file mode 100644 index 00000000..b5e550fb --- /dev/null +++ b/docs/v2/Streams/Dataset.md @@ -0,0 +1,82 @@ +# Dataset + +Method | HTTP request | +------------- | ------------- | + +Creates a streaming dataset with a stream on the specified branch, or if no branch is specified, on the +default branch ('master' for most enrollments). For more information on streaming datasets, refer to the +[streams](/docs/foundry/data-integration/streams/) user documentation. + + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**name** | DatasetName | | | +**parent_folder_rid** | FolderRid | | | +**branch_name** | Optional[BranchName] | The branch to create the initial stream on. If not specified, the default branch will be used ('master' for most enrollments). | [optional] | +**compressed** | Optional[Compressed] | Whether or not compression is enabled for the stream. Defaults to false. | [optional] | +**partitions_count** | Optional[PartitionsCount] | The number of partitions for the Foundry stream. Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions are recommended. If not specified, 1 partition is used. This value cannot be changed later. | [optional] | +**preview** | Optional[PreviewMode] | preview | [optional] | +**stream_type** | Optional[StreamType] | A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. | [optional] | + +### Return type +**Dataset** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# DatasetName | +name = None +# FolderRid | +parent_folder_rid = None +# Optional[BranchName] | The branch to create the initial stream on. If not specified, the default branch will be used ('master' for most enrollments). +branch_name = "master" +# Optional[Compressed] | Whether or not compression is enabled for the stream. Defaults to false. +compressed = None +# Optional[PartitionsCount] | The number of partitions for the Foundry stream. Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions are recommended. If not specified, 1 partition is used. This value cannot be changed later. +partitions_count = None +# Optional[PreviewMode] | preview +preview = None +# Optional[StreamType] | A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. +stream_type = "LOW_LATENCY" + + +try: + api_response = foundry_client.streams.Dataset.create( + name=name, + parent_folder_rid=parent_folder_rid, + branch_name=branch_name, + compressed=compressed, + partitions_count=partitions_count, + preview=preview, + stream_type=stream_type, + ) + print("The create response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Dataset.create: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | Dataset | | 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/Streams/Stream.md b/docs/v2/Streams/Stream.md new file mode 100644 index 00000000..9d2768a1 --- /dev/null +++ b/docs/v2/Streams/Stream.md @@ -0,0 +1,65 @@ +# Stream + +Method | HTTP request | +------------- | ------------- | + +Get a stream by its branch name. If the branch does not exist, there is no stream on that branch, or the +user does not have permission to access the stream, a 404 error will be returned. + + +### Parameters + +Name | Type | Description | Notes | +------------- | ------------- | ------------- | ------------- | +**dataset_rid** | DatasetRid | datasetRid | | +**stream_branch_name** | BranchName | streamBranchName | | +**preview** | Optional[PreviewMode] | preview | [optional] | + +### Return type +**Stream** + +### Example + +```python +from foundry.v2 import FoundryClient +import foundry +from pprint import pprint + +foundry_client = FoundryClient( + auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com" +) + +# DatasetRid | datasetRid +dataset_rid = None +# BranchName | streamBranchName +stream_branch_name = None +# Optional[PreviewMode] | preview +preview = None + + +try: + api_response = foundry_client.streams.Dataset.Stream.get( + dataset_rid, + stream_branch_name, + preview=preview, + ) + print("The get response:\n") + pprint(api_response) +except foundry.PalantirRPCException as e: + print("HTTP error when calling Stream.get: %s\n" % e) + +``` + + + +### Authorization + +See [README](../../../README.md#authorization) + +### HTTP response details +| Status Code | Type | Description | Content Type | +|-------------|-------------|-------------|------------------| +**200** | Stream | | 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/admin/models/GetMarkingsBatchRequestElementDict.md b/docs/v2/admin/models/GetMarkingsBatchRequestElementDict.md new file mode 100644 index 00000000..3591d462 --- /dev/null +++ b/docs/v2/admin/models/GetMarkingsBatchRequestElementDict.md @@ -0,0 +1,11 @@ +# GetMarkingsBatchRequestElementDict + +GetMarkingsBatchRequestElement + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**markingId** | MarkingId | 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/admin/models/GetMarkingsBatchResponse.md b/docs/v2/admin/models/GetMarkingsBatchResponse.md new file mode 100644 index 00000000..57b2724f --- /dev/null +++ b/docs/v2/admin/models/GetMarkingsBatchResponse.md @@ -0,0 +1,11 @@ +# GetMarkingsBatchResponse + +GetMarkingsBatchResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**data** | Dict[MarkingId, Marking] | 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/admin/models/GetMarkingsBatchResponseDict.md b/docs/v2/admin/models/GetMarkingsBatchResponseDict.md new file mode 100644 index 00000000..92bb8b7a --- /dev/null +++ b/docs/v2/admin/models/GetMarkingsBatchResponseDict.md @@ -0,0 +1,11 @@ +# GetMarkingsBatchResponseDict + +GetMarkingsBatchResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**data** | Dict[MarkingId, MarkingDict] | 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/core/models/ResourceType.md b/docs/v2/core/models/ResourceType.md new file mode 100644 index 00000000..92ac32fb --- /dev/null +++ b/docs/v2/core/models/ResourceType.md @@ -0,0 +1,58 @@ +# ResourceType + +The type of a resource. + +| **Value** | +| --------- | +| `"Academy_Tutorial"` | +| `"Artifacts_Repository"` | +| `"Automate_Automation"` | +| `"Builder_Pipeline"` | +| `"Carbon_Workspace"` | +| `"Cipher_Channel"` | +| `"Code_Repository"` | +| `"Code_Workbook"` | +| `"Code_Workspace"` | +| `"Connectivity_Agent"` | +| `"Connectivity_Source"` | +| `"Connectivity_VirtualTable"` | +| `"Contour_Analysis"` | +| `"Data_Lineage_Graph"` | +| `"Datasets_Dataset"` | +| `"Filesystem_Document"` | +| `"Filesystem_Folder"` | +| `"Filesystem_Image"` | +| `"Filesystem_Project"` | +| `"Filesystem_Space"` | +| `"Filesystem_WebLink"` | +| `"Foundry_Form"` | +| `"Foundry_Report"` | +| `"Foundry_Template"` | +| `"FoundryRules_Workflow"` | +| `"Fusion_Document"` | +| `"Logic_Function"` | +| `"Machinery_ProcessGraph"` | +| `"Maps_Layer"` | +| `"Maps_Map"` | +| `"Marketplace_Installation"` | +| `"Marketplace_LocalStore"` | +| `"Marketplace_RemoteStore"` | +| `"Media_Set"` | +| `"Modeling_Model"` | +| `"Modeling_ModelVersion"` | +| `"Modeling_Objective"` | +| `"Monitoring_MonitoringView"` | +| `"Notepad_Document"` | +| `"Notepad_Template"` | +| `"ObjectExploration_Exploration"` | +| `"ObjectExploration_Layout"` | +| `"Quiver_Analysis"` | +| `"Slate_Application"` | +| `"SolutionDesigner_Diagram"` | +| `"ThirdPartyApplication_ThirdPartyApplication"` | +| `"Unknown"` | +| `"Vertex_Graph"` | +| `"Workshop_Module"` | + + +[[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/filesystem/models/Resource.md b/docs/v2/filesystem/models/Resource.md new file mode 100644 index 00000000..1b5f9e87 --- /dev/null +++ b/docs/v2/filesystem/models/Resource.md @@ -0,0 +1,24 @@ +# Resource + +Resource + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**rid** | ResourceRid | Yes | | +**display_name** | ResourceDisplayName | Yes | The display name of the Resource | +**description** | Optional[StrictStr] | No | The description of the Resource | +**documentation** | Optional[StrictStr] | No | The documentation associated with the Resource | +**path** | ResourcePath | Yes | The full path to the resource, including the resource name itself | +**type** | ResourceType | Yes | The type of the Resource derived from the Resource Identifier (RID). | +**created_by** | CreatedBy | Yes | The user that created the Resource. | +**updated_by** | UpdatedBy | Yes | The user that last updated the Resource. | +**created_time** | CreatedTime | Yes | The timestamp that the Resource was last created. | +**updated_time** | UpdatedTime | Yes | The timestamp that the Resource was last modified. For folders, this includes any of its descendants. For top level folders (spaces and projects), this is not updated by child updates for performance reasons. | +**trashed** | TrashedStatus | Yes | The trash status of the resource. If trashed, a resource can either be directly trashed or one of its ancestors can be trashed. | +**parent_folder_rid** | FolderRid | Yes | The parent folder Resource Identifier (RID). For projects, this will be the Space RID. | +**project_rid** | ProjectRid | Yes | The Project Resource Identifier (RID) that the Resource lives in. If the Resource itself is a Project, this value will still be populated with the Project RID. | +**space_rid** | SpaceRid | Yes | The Space Resource Identifier (RID) that the Resource lives in. | + + +[[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/filesystem/models/ResourceDict.md b/docs/v2/filesystem/models/ResourceDict.md new file mode 100644 index 00000000..40fd8cde --- /dev/null +++ b/docs/v2/filesystem/models/ResourceDict.md @@ -0,0 +1,24 @@ +# ResourceDict + +Resource + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**rid** | ResourceRid | Yes | | +**displayName** | ResourceDisplayName | Yes | The display name of the Resource | +**description** | NotRequired[StrictStr] | No | The description of the Resource | +**documentation** | NotRequired[StrictStr] | No | The documentation associated with the Resource | +**path** | ResourcePath | Yes | The full path to the resource, including the resource name itself | +**type** | ResourceType | Yes | The type of the Resource derived from the Resource Identifier (RID). | +**createdBy** | CreatedBy | Yes | The user that created the Resource. | +**updatedBy** | UpdatedBy | Yes | The user that last updated the Resource. | +**createdTime** | CreatedTime | Yes | The timestamp that the Resource was last created. | +**updatedTime** | UpdatedTime | Yes | The timestamp that the Resource was last modified. For folders, this includes any of its descendants. For top level folders (spaces and projects), this is not updated by child updates for performance reasons. | +**trashed** | TrashedStatus | Yes | The trash status of the resource. If trashed, a resource can either be directly trashed or one of its ancestors can be trashed. | +**parentFolderRid** | FolderRid | Yes | The parent folder Resource Identifier (RID). For projects, this will be the Space RID. | +**projectRid** | ProjectRid | Yes | The Project Resource Identifier (RID) that the Resource lives in. If the Resource itself is a Project, this value will still be populated with the Project RID. | +**spaceRid** | SpaceRid | Yes | The Space Resource Identifier (RID) that the Resource lives in. | + + +[[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/filesystem/models/ResourceDisplayName.md b/docs/v2/filesystem/models/ResourceDisplayName.md new file mode 100644 index 00000000..d0b078a4 --- /dev/null +++ b/docs/v2/filesystem/models/ResourceDisplayName.md @@ -0,0 +1,11 @@ +# ResourceDisplayName + +The display name of the Resource + +## Type +```python +StrictStr +``` + + +[[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/filesystem/models/ResourcePath.md b/docs/v2/filesystem/models/ResourcePath.md new file mode 100644 index 00000000..8a53c42d --- /dev/null +++ b/docs/v2/filesystem/models/ResourcePath.md @@ -0,0 +1,11 @@ +# ResourcePath + +The full path to the resource, including the resource name itself + +## Type +```python +StrictStr +``` + + +[[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/filesystem/models/ResourceRid.md b/docs/v2/filesystem/models/ResourceRid.md new file mode 100644 index 00000000..747b707f --- /dev/null +++ b/docs/v2/filesystem/models/ResourceRid.md @@ -0,0 +1,11 @@ +# ResourceRid + +The unique resource identifier (RID) of a Resource. + +## Type +```python +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/filesystem/models/SpaceRid.md b/docs/v2/filesystem/models/SpaceRid.md new file mode 100644 index 00000000..ab1669a5 --- /dev/null +++ b/docs/v2/filesystem/models/SpaceRid.md @@ -0,0 +1,11 @@ +# SpaceRid + +The unique resource identifier (RID) of a Space. + +## Type +```python +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/filesystem/models/TrashedStatus.md b/docs/v2/filesystem/models/TrashedStatus.md new file mode 100644 index 00000000..ce865066 --- /dev/null +++ b/docs/v2/filesystem/models/TrashedStatus.md @@ -0,0 +1,12 @@ +# TrashedStatus + +TrashedStatus + +| **Value** | +| --------- | +| `"DIRECTLY_TRASHED"` | +| `"ANCESTOR_TRASHED"` | +| `"NOT_TRASHED"` | + + +[[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/functions/models/DataValue.md b/docs/v2/functions/models/DataValue.md new file mode 100644 index 00000000..090ea1b5 --- /dev/null +++ b/docs/v2/functions/models/DataValue.md @@ -0,0 +1,33 @@ +# DataValue + +Represents the value of data in the following format. Note that these values can be nested, for example an array of structs. +| Type | JSON encoding | Example | +|-----------------------------|-------------------------------------------------------|-------------------------------------------------------------------------------| +| Array | array | `["alpha", "bravo", "charlie"]` | +| Attachment | string | `"ri.attachments.main.attachment.2f944bae-5851-4204-8615-920c969a9f2e"` | +| Boolean | boolean | `true` | +| Byte | number | `31` | +| Date | ISO 8601 extended local date string | `"2021-05-01"` | +| Decimal | string | `"2.718281828"` | +| Float | number | `3.14159265` | +| Double | number | `3.14159265` | +| Integer | number | `238940` | +| Long | string | `"58319870951433"` | +| Marking | string | `"MU"` | +| Null | null | `null` | +| Set | array | `["alpha", "bravo", "charlie"]` | +| Short | number | `8739` | +| String | string | `"Call me Ishmael"` | +| Struct | JSON object | `{"name": "John Doe", "age": 42}` | +| TwoDimensionalAggregation | JSON object | `{"groups": [{"key": "alpha", "value": 100}, {"key": "beta", "value": 101}]}` | +| ThreeDimensionalAggregation | JSON object | `{"groups": [{"key": "NYC", "groups": [{"key": "Engineer", "value" : 100}]}]}`| +| Timestamp | ISO 8601 extended offset date-time string in UTC zone | `"2021-01-04T05:00:00Z"` | + + +## Type +```python +Any +``` + + +[[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/functions/models/ExecuteQueryResponse.md b/docs/v2/functions/models/ExecuteQueryResponse.md new file mode 100644 index 00000000..7fb62023 --- /dev/null +++ b/docs/v2/functions/models/ExecuteQueryResponse.md @@ -0,0 +1,11 @@ +# ExecuteQueryResponse + +ExecuteQueryResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**value** | DataValue | 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/functions/models/ExecuteQueryResponseDict.md b/docs/v2/functions/models/ExecuteQueryResponseDict.md new file mode 100644 index 00000000..15bb6b00 --- /dev/null +++ b/docs/v2/functions/models/ExecuteQueryResponseDict.md @@ -0,0 +1,11 @@ +# ExecuteQueryResponseDict + +ExecuteQueryResponse + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**value** | DataValue | 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/functions/models/FunctionRid.md b/docs/v2/functions/models/FunctionRid.md new file mode 100644 index 00000000..2ea83761 --- /dev/null +++ b/docs/v2/functions/models/FunctionRid.md @@ -0,0 +1,12 @@ +# FunctionRid + +The unique resource identifier of a Function, useful for interacting with other Foundry APIs. + + +## Type +```python +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/functions/models/FunctionVersion.md b/docs/v2/functions/models/FunctionVersion.md new file mode 100644 index 00000000..f8c88d6b --- /dev/null +++ b/docs/v2/functions/models/FunctionVersion.md @@ -0,0 +1,13 @@ +# FunctionVersion + +The version of the given Function, written `..-`, where `-` is optional. +Examples: `1.2.3`, `1.2.3-rc1`. + + +## Type +```python +StrictStr +``` + + +[[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/functions/models/Parameter.md b/docs/v2/functions/models/Parameter.md new file mode 100644 index 00000000..30cdc416 --- /dev/null +++ b/docs/v2/functions/models/Parameter.md @@ -0,0 +1,12 @@ +# Parameter + +Details about a parameter of a query. + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**description** | Optional[StrictStr] | No | | +**data_type** | QueryDataType | 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/functions/models/ParameterDict.md b/docs/v2/functions/models/ParameterDict.md new file mode 100644 index 00000000..5304f9f7 --- /dev/null +++ b/docs/v2/functions/models/ParameterDict.md @@ -0,0 +1,12 @@ +# ParameterDict + +Details about a parameter of a query. + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**description** | NotRequired[StrictStr] | No | | +**dataType** | QueryDataTypeDict | 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/functions/models/ParameterId.md b/docs/v2/functions/models/ParameterId.md new file mode 100644 index 00000000..c6446719 --- /dev/null +++ b/docs/v2/functions/models/ParameterId.md @@ -0,0 +1,13 @@ +# ParameterId + +The unique identifier of the parameter. Parameters are used as inputs when an action or query is applied. +Parameters can be viewed and managed in the **Ontology Manager**. + + +## Type +```python +StrictStr +``` + + +[[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/functions/models/Query.md b/docs/v2/functions/models/Query.md new file mode 100644 index 00000000..3c0d746e --- /dev/null +++ b/docs/v2/functions/models/Query.md @@ -0,0 +1,17 @@ +# Query + +Query + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**api_name** | QueryApiName | Yes | | +**description** | Optional[StrictStr] | No | | +**display_name** | Optional[DisplayName] | No | | +**parameters** | Dict[ParameterId, Parameter] | Yes | | +**output** | QueryDataType | Yes | | +**rid** | FunctionRid | Yes | | +**version** | FunctionVersion | 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/functions/models/QueryAggregationKeyType.md b/docs/v2/functions/models/QueryAggregationKeyType.md new file mode 100644 index 00000000..af8af64a --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationKeyType.md @@ -0,0 +1,22 @@ +# QueryAggregationKeyType + +A union of all the types supported by query aggregation keys. + + +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 +| ------------ | ------------- +DateType | date +BooleanType | boolean +StringType | string +DoubleType | double +QueryAggregationRangeType | range +IntegerType | integer +TimestampType | timestamp + + +[[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/functions/models/QueryAggregationKeyTypeDict.md b/docs/v2/functions/models/QueryAggregationKeyTypeDict.md new file mode 100644 index 00000000..c8def0b1 --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationKeyTypeDict.md @@ -0,0 +1,22 @@ +# QueryAggregationKeyTypeDict + +A union of all the types supported by query aggregation keys. + + +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 +| ------------ | ------------- +DateTypeDict | date +BooleanTypeDict | boolean +StringTypeDict | string +DoubleTypeDict | double +QueryAggregationRangeTypeDict | range +IntegerTypeDict | integer +TimestampTypeDict | timestamp + + +[[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/functions/models/QueryAggregationRangeSubType.md b/docs/v2/functions/models/QueryAggregationRangeSubType.md new file mode 100644 index 00000000..b2b00734 --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationRangeSubType.md @@ -0,0 +1,19 @@ +# QueryAggregationRangeSubType + +A union of all the types supported by query aggregation ranges. + + +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 +| ------------ | ------------- +DateType | date +DoubleType | double +IntegerType | integer +TimestampType | timestamp + + +[[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/functions/models/QueryAggregationRangeSubTypeDict.md b/docs/v2/functions/models/QueryAggregationRangeSubTypeDict.md new file mode 100644 index 00000000..6ccfc055 --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationRangeSubTypeDict.md @@ -0,0 +1,19 @@ +# QueryAggregationRangeSubTypeDict + +A union of all the types supported by query aggregation ranges. + + +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 +| ------------ | ------------- +DateTypeDict | date +DoubleTypeDict | double +IntegerTypeDict | integer +TimestampTypeDict | timestamp + + +[[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/functions/models/QueryAggregationRangeType.md b/docs/v2/functions/models/QueryAggregationRangeType.md new file mode 100644 index 00000000..8f7de155 --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationRangeType.md @@ -0,0 +1,12 @@ +# QueryAggregationRangeType + +QueryAggregationRangeType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**sub_type** | QueryAggregationRangeSubType | Yes | | +**type** | Literal["range"] | 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/functions/models/QueryAggregationRangeTypeDict.md b/docs/v2/functions/models/QueryAggregationRangeTypeDict.md new file mode 100644 index 00000000..3d15c61b --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationRangeTypeDict.md @@ -0,0 +1,12 @@ +# QueryAggregationRangeTypeDict + +QueryAggregationRangeType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**subType** | QueryAggregationRangeSubTypeDict | Yes | | +**type** | Literal["range"] | 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/functions/models/QueryAggregationValueType.md b/docs/v2/functions/models/QueryAggregationValueType.md new file mode 100644 index 00000000..7802d4da --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationValueType.md @@ -0,0 +1,18 @@ +# QueryAggregationValueType + +A union of all the types supported by query aggregation keys. + + +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 +| ------------ | ------------- +DateType | date +DoubleType | double +TimestampType | timestamp + + +[[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/functions/models/QueryAggregationValueTypeDict.md b/docs/v2/functions/models/QueryAggregationValueTypeDict.md new file mode 100644 index 00000000..bbd2be4b --- /dev/null +++ b/docs/v2/functions/models/QueryAggregationValueTypeDict.md @@ -0,0 +1,18 @@ +# QueryAggregationValueTypeDict + +A union of all the types supported by query aggregation keys. + + +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 +| ------------ | ------------- +DateTypeDict | date +DoubleTypeDict | double +TimestampTypeDict | timestamp + + +[[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/functions/models/QueryApiName.md b/docs/v2/functions/models/QueryApiName.md new file mode 100644 index 00000000..61ead319 --- /dev/null +++ b/docs/v2/functions/models/QueryApiName.md @@ -0,0 +1,11 @@ +# QueryApiName + +The name of the Query in the API. + +## Type +```python +StrictStr +``` + + +[[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/functions/models/QueryArrayType.md b/docs/v2/functions/models/QueryArrayType.md new file mode 100644 index 00000000..ef02cc33 --- /dev/null +++ b/docs/v2/functions/models/QueryArrayType.md @@ -0,0 +1,12 @@ +# QueryArrayType + +QueryArrayType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**sub_type** | QueryDataType | Yes | | +**type** | Literal["array"] | 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/functions/models/QueryArrayTypeDict.md b/docs/v2/functions/models/QueryArrayTypeDict.md new file mode 100644 index 00000000..d1b016f8 --- /dev/null +++ b/docs/v2/functions/models/QueryArrayTypeDict.md @@ -0,0 +1,12 @@ +# QueryArrayTypeDict + +QueryArrayType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**subType** | QueryDataTypeDict | Yes | | +**type** | Literal["array"] | 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/functions/models/QueryDataType.md b/docs/v2/functions/models/QueryDataType.md new file mode 100644 index 00000000..21694ce6 --- /dev/null +++ b/docs/v2/functions/models/QueryDataType.md @@ -0,0 +1,32 @@ +# QueryDataType + +A union of all the types supported by Query parameters or outputs. + + +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 +| ------------ | ------------- +DateType | date +QueryStructType | struct +QuerySetType | set +StringType | string +DoubleType | double +IntegerType | integer +ThreeDimensionalAggregation | threeDimensionalAggregation +QueryUnionType | union +FloatType | float +LongType | long +BooleanType | boolean +UnsupportedType | unsupported +AttachmentType | attachment +NullType | null +QueryArrayType | array +TwoDimensionalAggregation | twoDimensionalAggregation +TimestampType | timestamp + + +[[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/functions/models/QueryDataTypeDict.md b/docs/v2/functions/models/QueryDataTypeDict.md new file mode 100644 index 00000000..f763479a --- /dev/null +++ b/docs/v2/functions/models/QueryDataTypeDict.md @@ -0,0 +1,32 @@ +# QueryDataTypeDict + +A union of all the types supported by Query parameters or outputs. + + +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 +| ------------ | ------------- +DateTypeDict | date +QueryStructTypeDict | struct +QuerySetTypeDict | set +StringTypeDict | string +DoubleTypeDict | double +IntegerTypeDict | integer +ThreeDimensionalAggregationDict | threeDimensionalAggregation +QueryUnionTypeDict | union +FloatTypeDict | float +LongTypeDict | long +BooleanTypeDict | boolean +UnsupportedTypeDict | unsupported +AttachmentTypeDict | attachment +NullTypeDict | null +QueryArrayTypeDict | array +TwoDimensionalAggregationDict | twoDimensionalAggregation +TimestampTypeDict | timestamp + + +[[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/functions/models/QueryDict.md b/docs/v2/functions/models/QueryDict.md new file mode 100644 index 00000000..b45e42f4 --- /dev/null +++ b/docs/v2/functions/models/QueryDict.md @@ -0,0 +1,17 @@ +# QueryDict + +Query + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**apiName** | QueryApiName | Yes | | +**description** | NotRequired[StrictStr] | No | | +**displayName** | NotRequired[DisplayName] | No | | +**parameters** | Dict[ParameterId, ParameterDict] | Yes | | +**output** | QueryDataTypeDict | Yes | | +**rid** | FunctionRid | Yes | | +**version** | FunctionVersion | 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/functions/models/QuerySetType.md b/docs/v2/functions/models/QuerySetType.md new file mode 100644 index 00000000..786ad834 --- /dev/null +++ b/docs/v2/functions/models/QuerySetType.md @@ -0,0 +1,12 @@ +# QuerySetType + +QuerySetType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**sub_type** | QueryDataType | Yes | | +**type** | Literal["set"] | 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/functions/models/QuerySetTypeDict.md b/docs/v2/functions/models/QuerySetTypeDict.md new file mode 100644 index 00000000..7ee4cc50 --- /dev/null +++ b/docs/v2/functions/models/QuerySetTypeDict.md @@ -0,0 +1,12 @@ +# QuerySetTypeDict + +QuerySetType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**subType** | QueryDataTypeDict | Yes | | +**type** | Literal["set"] | 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/functions/models/QueryStructField.md b/docs/v2/functions/models/QueryStructField.md new file mode 100644 index 00000000..0e7bc858 --- /dev/null +++ b/docs/v2/functions/models/QueryStructField.md @@ -0,0 +1,12 @@ +# QueryStructField + +QueryStructField + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**name** | StructFieldName | Yes | | +**field_type** | QueryDataType | 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/functions/models/QueryStructFieldDict.md b/docs/v2/functions/models/QueryStructFieldDict.md new file mode 100644 index 00000000..fa34f068 --- /dev/null +++ b/docs/v2/functions/models/QueryStructFieldDict.md @@ -0,0 +1,12 @@ +# QueryStructFieldDict + +QueryStructField + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**name** | StructFieldName | Yes | | +**fieldType** | QueryDataTypeDict | 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/functions/models/QueryStructType.md b/docs/v2/functions/models/QueryStructType.md new file mode 100644 index 00000000..9ccbb086 --- /dev/null +++ b/docs/v2/functions/models/QueryStructType.md @@ -0,0 +1,12 @@ +# QueryStructType + +QueryStructType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**fields** | List[QueryStructField] | Yes | | +**type** | Literal["struct"] | 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/functions/models/QueryStructTypeDict.md b/docs/v2/functions/models/QueryStructTypeDict.md new file mode 100644 index 00000000..eadd8ce1 --- /dev/null +++ b/docs/v2/functions/models/QueryStructTypeDict.md @@ -0,0 +1,12 @@ +# QueryStructTypeDict + +QueryStructType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**fields** | List[QueryStructFieldDict] | Yes | | +**type** | Literal["struct"] | 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/functions/models/QueryUnionType.md b/docs/v2/functions/models/QueryUnionType.md new file mode 100644 index 00000000..a1b15ebb --- /dev/null +++ b/docs/v2/functions/models/QueryUnionType.md @@ -0,0 +1,12 @@ +# QueryUnionType + +QueryUnionType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**union_types** | List[QueryDataType] | Yes | | +**type** | Literal["union"] | 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/functions/models/QueryUnionTypeDict.md b/docs/v2/functions/models/QueryUnionTypeDict.md new file mode 100644 index 00000000..200ebb65 --- /dev/null +++ b/docs/v2/functions/models/QueryUnionTypeDict.md @@ -0,0 +1,12 @@ +# QueryUnionTypeDict + +QueryUnionType + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**unionTypes** | List[QueryDataTypeDict] | Yes | | +**type** | Literal["union"] | 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/functions/models/StructFieldName.md b/docs/v2/functions/models/StructFieldName.md new file mode 100644 index 00000000..ad143bfd --- /dev/null +++ b/docs/v2/functions/models/StructFieldName.md @@ -0,0 +1,12 @@ +# StructFieldName + +The name of a field in a `Struct`. + + +## Type +```python +StrictStr +``` + + +[[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/functions/models/ThreeDimensionalAggregation.md b/docs/v2/functions/models/ThreeDimensionalAggregation.md new file mode 100644 index 00000000..9fb4c0c8 --- /dev/null +++ b/docs/v2/functions/models/ThreeDimensionalAggregation.md @@ -0,0 +1,13 @@ +# ThreeDimensionalAggregation + +ThreeDimensionalAggregation + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**key_type** | QueryAggregationKeyType | Yes | | +**value_type** | TwoDimensionalAggregation | Yes | | +**type** | Literal["threeDimensionalAggregation"] | 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/functions/models/ThreeDimensionalAggregationDict.md b/docs/v2/functions/models/ThreeDimensionalAggregationDict.md new file mode 100644 index 00000000..bd9eab2b --- /dev/null +++ b/docs/v2/functions/models/ThreeDimensionalAggregationDict.md @@ -0,0 +1,13 @@ +# ThreeDimensionalAggregationDict + +ThreeDimensionalAggregation + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**keyType** | QueryAggregationKeyTypeDict | Yes | | +**valueType** | TwoDimensionalAggregationDict | Yes | | +**type** | Literal["threeDimensionalAggregation"] | 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/functions/models/TwoDimensionalAggregation.md b/docs/v2/functions/models/TwoDimensionalAggregation.md new file mode 100644 index 00000000..b6f42990 --- /dev/null +++ b/docs/v2/functions/models/TwoDimensionalAggregation.md @@ -0,0 +1,13 @@ +# TwoDimensionalAggregation + +TwoDimensionalAggregation + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**key_type** | QueryAggregationKeyType | Yes | | +**value_type** | QueryAggregationValueType | Yes | | +**type** | Literal["twoDimensionalAggregation"] | 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/functions/models/TwoDimensionalAggregationDict.md b/docs/v2/functions/models/TwoDimensionalAggregationDict.md new file mode 100644 index 00000000..0bf09bf9 --- /dev/null +++ b/docs/v2/functions/models/TwoDimensionalAggregationDict.md @@ -0,0 +1,13 @@ +# TwoDimensionalAggregationDict + +TwoDimensionalAggregation + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**keyType** | QueryAggregationKeyTypeDict | Yes | | +**valueType** | QueryAggregationValueTypeDict | Yes | | +**type** | Literal["twoDimensionalAggregation"] | 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/streams/models/Compressed.md b/docs/v2/streams/models/Compressed.md new file mode 100644 index 00000000..8d5762ba --- /dev/null +++ b/docs/v2/streams/models/Compressed.md @@ -0,0 +1,15 @@ +# Compressed + +Compression helps reduce the size of the data being sent, resulting in lower network usage and +storage, at the cost of some additional CPU usage for compression and decompression. This stream type +is only recommended if your stream contains a high volume of repetitive strings and is experiencing poor +network bandwidth symptoms like non-zero lag, lower than expected throughput, or dropped records. + + +## Type +```python +StrictBool +``` + + +[[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/streams/models/Dataset.md b/docs/v2/streams/models/Dataset.md new file mode 100644 index 00000000..ab30e61e --- /dev/null +++ b/docs/v2/streams/models/Dataset.md @@ -0,0 +1,13 @@ +# Dataset + +Dataset + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**rid** | DatasetRid | Yes | | +**name** | DatasetName | Yes | | +**parent_folder_rid** | FolderRid | 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/streams/models/DatasetDict.md b/docs/v2/streams/models/DatasetDict.md new file mode 100644 index 00000000..b82426df --- /dev/null +++ b/docs/v2/streams/models/DatasetDict.md @@ -0,0 +1,13 @@ +# DatasetDict + +Dataset + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**rid** | DatasetRid | Yes | | +**name** | DatasetName | Yes | | +**parentFolderRid** | FolderRid | 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/streams/models/PartitionsCount.md b/docs/v2/streams/models/PartitionsCount.md new file mode 100644 index 00000000..04b67344 --- /dev/null +++ b/docs/v2/streams/models/PartitionsCount.md @@ -0,0 +1,12 @@ +# PartitionsCount + +The number of partitions for a Foundry stream. + + +## Type +```python +StrictInt +``` + + +[[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/streams/models/Stream.md b/docs/v2/streams/models/Stream.md new file mode 100644 index 00000000..41d9d65d --- /dev/null +++ b/docs/v2/streams/models/Stream.md @@ -0,0 +1,15 @@ +# Stream + +Stream + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**branch_name** | BranchName | Yes | | +**view_rid** | ViewRid | Yes | The view that this stream corresponds to. | +**partitions_count** | PartitionsCount | Yes | The number of partitions for the Foundry stream. Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions are recommended. | +**stream_type** | StreamType | Yes | A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. | +**compressed** | Compressed | Yes | Whether or not compression is enabled for the stream. Defaults to false. | + + +[[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/streams/models/StreamDict.md b/docs/v2/streams/models/StreamDict.md new file mode 100644 index 00000000..2db401a3 --- /dev/null +++ b/docs/v2/streams/models/StreamDict.md @@ -0,0 +1,15 @@ +# StreamDict + +Stream + +## Properties +| Name | Type | Required | Description | +| ------------ | ------------- | ------------- | ------------- | +**branchName** | BranchName | Yes | | +**viewRid** | ViewRid | Yes | The view that this stream corresponds to. | +**partitionsCount** | PartitionsCount | Yes | The number of partitions for the Foundry stream. Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions are recommended. | +**streamType** | StreamType | Yes | A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. | +**compressed** | Compressed | Yes | Whether or not compression is enabled for the stream. Defaults to false. | + + +[[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/streams/models/StreamType.md b/docs/v2/streams/models/StreamType.md new file mode 100644 index 00000000..59ff32e6 --- /dev/null +++ b/docs/v2/streams/models/StreamType.md @@ -0,0 +1,22 @@ +# StreamType + +LOW_LATENCY: The default stream type. Recommended for most use cases. + +HIGH_THROUGHPUT: Best for streams that send large amounts of data every second. Using this stream type might +introduce some non-zero latency at the expense of a higher throughput. This stream type is only +recommended if you inspect your stream metrics in-platform and observe that the average batch size is equal +to the max match size, or if jobs using the stream are failing due to Kafka producer batches expiring. For +additional information on inspecting stream metrics, refer to the +(stream monitoring)[/docs/foundry/data-integration/stream-monitoring/#viewing-metrics] documentation. + +For more information, refer to the [stream types](/docs/foundry/data-integration/streams/#stream-types) +documentation. + + +| **Value** | +| --------- | +| `"LOW_LATENCY"` | +| `"HIGH_THROUGHPUT"` | + + +[[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/streams/models/ViewRid.md b/docs/v2/streams/models/ViewRid.md new file mode 100644 index 00000000..ada8e0b8 --- /dev/null +++ b/docs/v2/streams/models/ViewRid.md @@ -0,0 +1,12 @@ +# ViewRid + +The resource identifier (RID) of the view that represents a stream. + + +## Type +```python +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/foundry/_versions.py b/foundry/_versions.py index e80f7a17..f70a680b 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.928.0" +__openapi_document_version__ = "1.932.0" diff --git a/foundry/v2/admin/marking.py b/foundry/v2/admin/marking.py index dcde83c3..89e593f6 100644 --- a/foundry/v2/admin/marking.py +++ b/foundry/v2/admin/marking.py @@ -17,8 +17,10 @@ from typing import Any from typing import Dict +from typing import List from typing import Optional +from annotated_types import Len from pydantic import Field from pydantic import StrictInt from pydantic import validate_call @@ -29,6 +31,10 @@ from foundry._core import RequestInfo from foundry._core import ResourceIterator from foundry._errors import handle_unexpected +from foundry.v2.admin.models._get_markings_batch_request_element_dict import ( + GetMarkingsBatchRequestElementDict, +) # NOQA +from foundry.v2.admin.models._get_markings_batch_response import GetMarkingsBatchResponse # NOQA from foundry.v2.admin.models._list_markings_response import ListMarkingsResponse from foundry.v2.admin.models._marking import Marking from foundry.v2.core.models._marking_id import MarkingId @@ -82,6 +88,52 @@ def get( ), ) + @validate_call + @handle_unexpected + def get_batch( + self, + body: Annotated[ + List[GetMarkingsBatchRequestElementDict], Len(min_length=1, max_length=500) + ], + *, + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[StrictInt, Field(gt=0)]] = None, + ) -> GetMarkingsBatchResponse: + """ + Execute multiple get requests on Marking. + + The maximum batch size for this endpoint is 500. + :param body: Body of the request + :type body: Annotated[List[GetMarkingsBatchRequestElementDict], Len(min_length=1, max_length=500)] + :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: GetMarkingsBatchResponse + """ + + return self._api_client.call_api( + RequestInfo( + method="POST", + resource_path="/v2/admin/markings/getBatch", + query_params={ + "preview": preview, + }, + path_params={}, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body=body, + body_type=Annotated[ + List[GetMarkingsBatchRequestElementDict], Len(min_length=1, max_length=500) + ], + response_type=GetMarkingsBatchResponse, + request_timeout=request_timeout, + ), + ) + @validate_call @handle_unexpected def list( diff --git a/foundry/v2/admin/models/__init__.py b/foundry/v2/admin/models/__init__.py index d6c623e2..a8f509c6 100644 --- a/foundry/v2/admin/models/__init__.py +++ b/foundry/v2/admin/models/__init__.py @@ -23,6 +23,13 @@ from foundry.v2.admin.models._get_groups_batch_response_dict import ( GetGroupsBatchResponseDict, ) # NOQA +from foundry.v2.admin.models._get_markings_batch_request_element_dict import ( + GetMarkingsBatchRequestElementDict, +) # NOQA +from foundry.v2.admin.models._get_markings_batch_response import GetMarkingsBatchResponse # NOQA +from foundry.v2.admin.models._get_markings_batch_response_dict import ( + GetMarkingsBatchResponseDict, +) # NOQA from foundry.v2.admin.models._get_user_markings_response import GetUserMarkingsResponse from foundry.v2.admin.models._get_user_markings_response_dict import ( GetUserMarkingsResponseDict, @@ -91,6 +98,9 @@ "GetGroupsBatchRequestElementDict", "GetGroupsBatchResponse", "GetGroupsBatchResponseDict", + "GetMarkingsBatchRequestElementDict", + "GetMarkingsBatchResponse", + "GetMarkingsBatchResponseDict", "GetUserMarkingsResponse", "GetUserMarkingsResponseDict", "GetUsersBatchRequestElementDict", diff --git a/foundry/v2/admin/models/_get_markings_batch_request_element_dict.py b/foundry/v2/admin/models/_get_markings_batch_request_element_dict.py new file mode 100644 index 00000000..2a0a4e8d --- /dev/null +++ b/foundry/v2/admin/models/_get_markings_batch_request_element_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_extensions import TypedDict + +from foundry.v2.core.models._marking_id import MarkingId + + +class GetMarkingsBatchRequestElementDict(TypedDict): + """GetMarkingsBatchRequestElement""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + markingId: MarkingId diff --git a/foundry/v2/admin/models/_get_markings_batch_response.py b/foundry/v2/admin/models/_get_markings_batch_response.py new file mode 100644 index 00000000..6f8ee2fb --- /dev/null +++ b/foundry/v2/admin/models/_get_markings_batch_response.py @@ -0,0 +1,41 @@ +# 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 + +from pydantic import BaseModel + +from foundry.v2.admin.models._get_markings_batch_response_dict import ( + GetMarkingsBatchResponseDict, +) # NOQA +from foundry.v2.admin.models._marking import Marking +from foundry.v2.core.models._marking_id import MarkingId + + +class GetMarkingsBatchResponse(BaseModel): + """GetMarkingsBatchResponse""" + + data: Dict[MarkingId, Marking] + + model_config = {"extra": "allow"} + + def to_dict(self) -> GetMarkingsBatchResponseDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast( + GetMarkingsBatchResponseDict, self.model_dump(by_alias=True, exclude_unset=True) + ) diff --git a/foundry/v2/admin/models/_get_markings_batch_response_dict.py b/foundry/v2/admin/models/_get_markings_batch_response_dict.py new file mode 100644 index 00000000..49360165 --- /dev/null +++ b/foundry/v2/admin/models/_get_markings_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.admin.models._marking_dict import MarkingDict +from foundry.v2.core.models._marking_id import MarkingId + + +class GetMarkingsBatchResponseDict(TypedDict): + """GetMarkingsBatchResponse""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + data: Dict[MarkingId, MarkingDict] diff --git a/foundry/v2/cli.py b/foundry/v2/cli.py index b003385e..3117d751 100644 --- a/foundry/v2/cli.py +++ b/foundry/v2/cli.py @@ -392,6 +392,27 @@ def admin_marking_get( click.echo(repr(result)) +@admin_marking.command("get_batch") +@click.argument("body", type=str, required=True) +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def admin_marking_get_batch( + client: foundry.v2.FoundryClient, + body: str, + preview: Optional[bool], +): + """ + Execute multiple get requests on Marking. + + The maximum batch size for this endpoint is 500. + """ + result = client.admin.Marking.get_batch( + body=json.loads(body), + preview=preview, + ) + click.echo(repr(result)) + + @admin_marking.command("list") @click.option("--page_size", type=int, required=False, help="""pageSize""") @click.option("--preview", type=bool, required=False, help="""preview""") @@ -1335,6 +1356,105 @@ def filesystem(): pass +@filesystem.group("resource") +def filesystem_resource(): + pass + + +@filesystem_resource.command("get") +@click.argument("resource_rid", type=str, required=True) +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def filesystem_resource_get( + client: foundry.v2.FoundryClient, + resource_rid: str, + preview: Optional[bool], +): + """ + Get the Resource with the specified rid. + """ + result = client.filesystem.Resource.get( + resource_rid=resource_rid, + preview=preview, + ) + click.echo(repr(result)) + + +@cli.group("functions") +def functions(): + pass + + +@functions.group("query") +def functions_query(): + pass + + +@functions_query.command("execute") +@click.argument("query_api_name", type=str, required=True) +@click.option("--parameters", type=str, required=True, help="""""") +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def functions_query_execute( + client: foundry.v2.FoundryClient, + query_api_name: str, + parameters: str, + preview: Optional[bool], +): + """ + Executes a Query using the given parameters. + + Optional parameters do not need to be supplied. + + """ + result = client.functions.Query.execute( + query_api_name=query_api_name, + parameters=json.loads(parameters), + preview=preview, + ) + click.echo(repr(result)) + + +@functions_query.command("get") +@click.argument("query_api_name", type=str, required=True) +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def functions_query_get( + client: foundry.v2.FoundryClient, + query_api_name: str, + preview: Optional[bool], +): + """ + Gets a specific query type with the given API name. + + """ + result = client.functions.Query.get( + query_api_name=query_api_name, + preview=preview, + ) + click.echo(repr(result)) + + +@functions_query.command("get_by_rid") +@click.option("--rid", type=str, required=True, help="""""") +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def functions_query_get_by_rid( + client: foundry.v2.FoundryClient, + rid: str, + preview: Optional[bool], +): + """ + Gets a specific query type with the given RID. + + """ + result = client.functions.Query.get_by_rid( + rid=rid, + preview=preview, + ) + click.echo(repr(result)) + + @cli.group("geo") def geo(): pass @@ -3082,6 +3202,115 @@ def orchestration_build_get( click.echo(repr(result)) +@cli.group("streams") +def streams(): + pass + + +@streams.group("dataset") +def streams_dataset(): + pass + + +@streams_dataset.command("create") +@click.option("--name", type=str, required=True, help="""""") +@click.option("--parent_folder_rid", type=str, required=True, help="""""") +@click.option( + "--branch_name", + type=str, + required=False, + help="""The branch to create the initial stream on. If not specified, the default branch will be used +('master' for most enrollments). +""", +) +@click.option( + "--compressed", + type=bool, + required=False, + help="""Whether or not compression is enabled for the stream. Defaults to false. +""", +) +@click.option( + "--partitions_count", + type=int, + required=False, + help="""The number of partitions for the Foundry stream. + +Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions +are recommended. + +If not specified, 1 partition is used. + +This value cannot be changed later. +""", +) +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.option( + "--stream_type", + type=click.Choice(["LOW_LATENCY", "HIGH_THROUGHPUT"]), + required=False, + help="""A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and +LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. +""", +) +@click.pass_obj +def streams_dataset_create( + client: foundry.v2.FoundryClient, + name: str, + parent_folder_rid: str, + branch_name: Optional[str], + compressed: Optional[bool], + partitions_count: Optional[int], + preview: Optional[bool], + stream_type: Optional[Literal["LOW_LATENCY", "HIGH_THROUGHPUT"]], +): + """ + Creates a streaming dataset with a stream on the specified branch, or if no branch is specified, on the + default branch ('master' for most enrollments). For more information on streaming datasets, refer to the + [streams](/docs/foundry/data-integration/streams/) user documentation. + + """ + result = client.streams.Dataset.create( + name=name, + parent_folder_rid=parent_folder_rid, + branch_name=branch_name, + compressed=compressed, + partitions_count=partitions_count, + preview=preview, + stream_type=stream_type, + ) + click.echo(repr(result)) + + +@streams_dataset.group("stream") +def streams_dataset_stream(): + pass + + +@streams_dataset_stream.command("get") +@click.argument("dataset_rid", type=str, required=True) +@click.argument("stream_branch_name", type=str, required=True) +@click.option("--preview", type=bool, required=False, help="""preview""") +@click.pass_obj +def streams_dataset_stream_get( + client: foundry.v2.FoundryClient, + dataset_rid: str, + stream_branch_name: str, + preview: Optional[bool], +): + """ + Get a stream by its branch name. If the branch does not exist, there is no stream on that branch, or the + user does not have permission to access the stream, a 404 error will be returned. + + """ + result = client.streams.Dataset.Stream.get( + dataset_rid=dataset_rid, + stream_branch_name=stream_branch_name, + preview=preview, + ) + click.echo(repr(result)) + + @cli.group("third_party_applications") def third_party_applications(): pass diff --git a/foundry/v2/client.py b/foundry/v2/client.py index 18249123..13a17500 100644 --- a/foundry/v2/client.py +++ b/foundry/v2/client.py @@ -27,12 +27,18 @@ class FoundryClient: def __init__(self, auth: Auth, hostname: str): from foundry.v2.admin.client import AdminClient from foundry.v2.datasets.client import DatasetsClient + from foundry.v2.filesystem.client import FilesystemClient + from foundry.v2.functions.client import FunctionsClient from foundry.v2.ontologies.client import OntologiesClient from foundry.v2.orchestration.client import OrchestrationClient + from foundry.v2.streams.client import StreamsClient from foundry.v2.third_party_applications.client import ThirdPartyApplicationsClient # NOQA self.admin = AdminClient(auth=auth, hostname=hostname) self.datasets = DatasetsClient(auth=auth, hostname=hostname) + self.filesystem = FilesystemClient(auth=auth, hostname=hostname) + self.functions = FunctionsClient(auth=auth, hostname=hostname) self.ontologies = OntologiesClient(auth=auth, hostname=hostname) self.orchestration = OrchestrationClient(auth=auth, hostname=hostname) + self.streams = StreamsClient(auth=auth, hostname=hostname) self.third_party_applications = ThirdPartyApplicationsClient(auth=auth, hostname=hostname) diff --git a/foundry/v2/core/models/__init__.py b/foundry/v2/core/models/__init__.py index 31bd43b7..71846b41 100644 --- a/foundry/v2/core/models/__init__.py +++ b/foundry/v2/core/models/__init__.py @@ -62,6 +62,7 @@ from foundry.v2.core.models._principal_type import PrincipalType from foundry.v2.core.models._realm import Realm from foundry.v2.core.models._release_status import ReleaseStatus +from foundry.v2.core.models._resource_type import ResourceType from foundry.v2.core.models._short_type import ShortType from foundry.v2.core.models._short_type_dict import ShortTypeDict from foundry.v2.core.models._size_bytes import SizeBytes @@ -132,6 +133,7 @@ "PrincipalType", "Realm", "ReleaseStatus", + "ResourceType", "ShortType", "ShortTypeDict", "SizeBytes", diff --git a/foundry/v2/core/models/_resource_type.py b/foundry/v2/core/models/_resource_type.py new file mode 100644 index 00000000..62ae4866 --- /dev/null +++ b/foundry/v2/core/models/_resource_type.py @@ -0,0 +1,71 @@ +# 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 + +ResourceType = Literal[ + "Academy_Tutorial", + "Artifacts_Repository", + "Automate_Automation", + "Builder_Pipeline", + "Carbon_Workspace", + "Cipher_Channel", + "Code_Repository", + "Code_Workbook", + "Code_Workspace", + "Connectivity_Agent", + "Connectivity_Source", + "Connectivity_VirtualTable", + "Contour_Analysis", + "Data_Lineage_Graph", + "Datasets_Dataset", + "Filesystem_Document", + "Filesystem_Folder", + "Filesystem_Image", + "Filesystem_Project", + "Filesystem_Space", + "Filesystem_WebLink", + "Foundry_Form", + "Foundry_Report", + "Foundry_Template", + "FoundryRules_Workflow", + "Fusion_Document", + "Logic_Function", + "Machinery_ProcessGraph", + "Maps_Layer", + "Maps_Map", + "Marketplace_Installation", + "Marketplace_LocalStore", + "Marketplace_RemoteStore", + "Media_Set", + "Modeling_Model", + "Modeling_ModelVersion", + "Modeling_Objective", + "Monitoring_MonitoringView", + "Notepad_Document", + "Notepad_Template", + "ObjectExploration_Exploration", + "ObjectExploration_Layout", + "Quiver_Analysis", + "Slate_Application", + "SolutionDesigner_Diagram", + "ThirdPartyApplication_ThirdPartyApplication", + "Unknown", + "Vertex_Graph", + "Workshop_Module", +] +"""The type of a resource.""" diff --git a/foundry/v2/filesystem/client.py b/foundry/v2/filesystem/client.py new file mode 100644 index 00000000..9a3c9aa5 --- /dev/null +++ b/foundry/v2/filesystem/client.py @@ -0,0 +1,24 @@ +# 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 foundry._core import Auth +from foundry.v2.filesystem.resource import ResourceClient + + +class FilesystemClient: + def __init__(self, auth: Auth, hostname: str): + self.Resource = ResourceClient(auth=auth, hostname=hostname) diff --git a/foundry/v2/filesystem/models/__init__.py b/foundry/v2/filesystem/models/__init__.py index 77c7df49..1d4e6006 100644 --- a/foundry/v2/filesystem/models/__init__.py +++ b/foundry/v2/filesystem/models/__init__.py @@ -15,8 +15,22 @@ from foundry.v2.filesystem.models._folder_rid import FolderRid from foundry.v2.filesystem.models._project_rid import ProjectRid +from foundry.v2.filesystem.models._resource import Resource +from foundry.v2.filesystem.models._resource_dict import ResourceDict +from foundry.v2.filesystem.models._resource_display_name import ResourceDisplayName +from foundry.v2.filesystem.models._resource_path import ResourcePath +from foundry.v2.filesystem.models._resource_rid import ResourceRid +from foundry.v2.filesystem.models._space_rid import SpaceRid +from foundry.v2.filesystem.models._trashed_status import TrashedStatus __all__ = [ "FolderRid", "ProjectRid", + "Resource", + "ResourceDict", + "ResourceDisplayName", + "ResourcePath", + "ResourceRid", + "SpaceRid", + "TrashedStatus", ] diff --git a/foundry/v2/filesystem/models/_resource.py b/foundry/v2/filesystem/models/_resource.py new file mode 100644 index 00000000..9496503a --- /dev/null +++ b/foundry/v2/filesystem/models/_resource.py @@ -0,0 +1,97 @@ +# 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 Optional +from typing import cast + +from pydantic import BaseModel +from pydantic import Field +from pydantic import StrictStr + +from foundry.v2.core.models._created_by import CreatedBy +from foundry.v2.core.models._created_time import CreatedTime +from foundry.v2.core.models._resource_type import ResourceType +from foundry.v2.core.models._updated_by import UpdatedBy +from foundry.v2.core.models._updated_time import UpdatedTime +from foundry.v2.filesystem.models._folder_rid import FolderRid +from foundry.v2.filesystem.models._project_rid import ProjectRid +from foundry.v2.filesystem.models._resource_dict import ResourceDict +from foundry.v2.filesystem.models._resource_display_name import ResourceDisplayName +from foundry.v2.filesystem.models._resource_path import ResourcePath +from foundry.v2.filesystem.models._resource_rid import ResourceRid +from foundry.v2.filesystem.models._space_rid import SpaceRid +from foundry.v2.filesystem.models._trashed_status import TrashedStatus + + +class Resource(BaseModel): + """Resource""" + + rid: ResourceRid + + display_name: ResourceDisplayName = Field(alias="displayName") + """The display name of the Resource""" + + description: Optional[StrictStr] = None + """The description of the Resource""" + + documentation: Optional[StrictStr] = None + """The documentation associated with the Resource""" + + path: ResourcePath + """The full path to the resource, including the resource name itself""" + + type: ResourceType + """The type of the Resource derived from the Resource Identifier (RID).""" + + created_by: CreatedBy = Field(alias="createdBy") + """The user that created the Resource.""" + + updated_by: UpdatedBy = Field(alias="updatedBy") + """The user that last updated the Resource.""" + + created_time: CreatedTime = Field(alias="createdTime") + """The timestamp that the Resource was last created.""" + + updated_time: UpdatedTime = Field(alias="updatedTime") + """ + The timestamp that the Resource was last modified. For folders, this includes any of its descendants. For + top level folders (spaces and projects), this is not updated by child updates for performance reasons. + """ + + trashed: TrashedStatus + """ + The trash status of the resource. If trashed, a resource can either be directly trashed or one + of its ancestors can be trashed. + """ + + parent_folder_rid: FolderRid = Field(alias="parentFolderRid") + """The parent folder Resource Identifier (RID). For projects, this will be the Space RID.""" + + project_rid: ProjectRid = Field(alias="projectRid") + """ + The Project Resource Identifier (RID) that the Resource lives in. If the Resource itself is a + Project, this value will still be populated with the Project RID. + """ + + space_rid: SpaceRid = Field(alias="spaceRid") + """The Space Resource Identifier (RID) that the Resource lives in.""" + + model_config = {"extra": "allow"} + + def to_dict(self) -> ResourceDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(ResourceDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/filesystem/models/_resource_dict.py b/foundry/v2/filesystem/models/_resource_dict.py new file mode 100644 index 00000000..aad0a788 --- /dev/null +++ b/foundry/v2/filesystem/models/_resource_dict.py @@ -0,0 +1,89 @@ +# 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 pydantic import StrictStr +from typing_extensions import NotRequired +from typing_extensions import TypedDict + +from foundry.v2.core.models._created_by import CreatedBy +from foundry.v2.core.models._created_time import CreatedTime +from foundry.v2.core.models._resource_type import ResourceType +from foundry.v2.core.models._updated_by import UpdatedBy +from foundry.v2.core.models._updated_time import UpdatedTime +from foundry.v2.filesystem.models._folder_rid import FolderRid +from foundry.v2.filesystem.models._project_rid import ProjectRid +from foundry.v2.filesystem.models._resource_display_name import ResourceDisplayName +from foundry.v2.filesystem.models._resource_path import ResourcePath +from foundry.v2.filesystem.models._resource_rid import ResourceRid +from foundry.v2.filesystem.models._space_rid import SpaceRid +from foundry.v2.filesystem.models._trashed_status import TrashedStatus + + +class ResourceDict(TypedDict): + """Resource""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + rid: ResourceRid + + displayName: ResourceDisplayName + """The display name of the Resource""" + + description: NotRequired[StrictStr] + """The description of the Resource""" + + documentation: NotRequired[StrictStr] + """The documentation associated with the Resource""" + + path: ResourcePath + """The full path to the resource, including the resource name itself""" + + type: ResourceType + """The type of the Resource derived from the Resource Identifier (RID).""" + + createdBy: CreatedBy + """The user that created the Resource.""" + + updatedBy: UpdatedBy + """The user that last updated the Resource.""" + + createdTime: CreatedTime + """The timestamp that the Resource was last created.""" + + updatedTime: UpdatedTime + """ + The timestamp that the Resource was last modified. For folders, this includes any of its descendants. For + top level folders (spaces and projects), this is not updated by child updates for performance reasons. + """ + + trashed: TrashedStatus + """ + The trash status of the resource. If trashed, a resource can either be directly trashed or one + of its ancestors can be trashed. + """ + + parentFolderRid: FolderRid + """The parent folder Resource Identifier (RID). For projects, this will be the Space RID.""" + + projectRid: ProjectRid + """ + The Project Resource Identifier (RID) that the Resource lives in. If the Resource itself is a + Project, this value will still be populated with the Project RID. + """ + + spaceRid: SpaceRid + """The Space Resource Identifier (RID) that the Resource lives in.""" diff --git a/foundry/v2/filesystem/models/_resource_display_name.py b/foundry/v2/filesystem/models/_resource_display_name.py new file mode 100644 index 00000000..fedc985c --- /dev/null +++ b/foundry/v2/filesystem/models/_resource_display_name.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 pydantic import StrictStr + +ResourceDisplayName = StrictStr +"""The display name of the Resource""" diff --git a/foundry/v2/filesystem/models/_resource_path.py b/foundry/v2/filesystem/models/_resource_path.py new file mode 100644 index 00000000..092b5757 --- /dev/null +++ b/foundry/v2/filesystem/models/_resource_path.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 pydantic import StrictStr + +ResourcePath = StrictStr +"""The full path to the resource, including the resource name itself""" diff --git a/foundry/v2/filesystem/models/_resource_rid.py b/foundry/v2/filesystem/models/_resource_rid.py new file mode 100644 index 00000000..75bb9352 --- /dev/null +++ b/foundry/v2/filesystem/models/_resource_rid.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 foundry._core.utils import RID + +ResourceRid = RID +"""The unique resource identifier (RID) of a Resource.""" diff --git a/foundry/v2/filesystem/models/_space_rid.py b/foundry/v2/filesystem/models/_space_rid.py new file mode 100644 index 00000000..02e7601c --- /dev/null +++ b/foundry/v2/filesystem/models/_space_rid.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 foundry._core.utils import RID + +SpaceRid = RID +"""The unique resource identifier (RID) of a Space.""" diff --git a/foundry/v2/filesystem/models/_trashed_status.py b/foundry/v2/filesystem/models/_trashed_status.py new file mode 100644 index 00000000..59a7001a --- /dev/null +++ b/foundry/v2/filesystem/models/_trashed_status.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 + +TrashedStatus = Literal["DIRECTLY_TRASHED", "ANCESTOR_TRASHED", "NOT_TRASHED"] +"""TrashedStatus""" diff --git a/foundry/v2/filesystem/resource.py b/foundry/v2/filesystem/resource.py new file mode 100644 index 00000000..c04d0907 --- /dev/null +++ b/foundry/v2/filesystem/resource.py @@ -0,0 +1,79 @@ +# 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 Dict +from typing import Optional + +from pydantic import Field +from pydantic import StrictInt +from pydantic import validate_call +from typing_extensions import Annotated + +from foundry._core import ApiClient +from foundry._core import Auth +from foundry._core import RequestInfo +from foundry._errors import handle_unexpected +from foundry.v2.core.models._preview_mode import PreviewMode +from foundry.v2.filesystem.models._resource import Resource +from foundry.v2.filesystem.models._resource_rid import ResourceRid + + +class ResourceClient: + def __init__(self, auth: Auth, hostname: str) -> None: + self._api_client = ApiClient(auth=auth, hostname=hostname) + + @validate_call + @handle_unexpected + def get( + self, + resource_rid: ResourceRid, + *, + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[StrictInt, Field(gt=0)]] = None, + ) -> Resource: + """ + Get the Resource with the specified rid. + :param resource_rid: resourceRid + :type resource_rid: ResourceRid + :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: Resource + """ + + return self._api_client.call_api( + RequestInfo( + method="GET", + resource_path="/v2/filesystem/resources/{resourceRid}", + query_params={ + "preview": preview, + }, + path_params={ + "resourceRid": resource_rid, + }, + header_params={ + "Accept": "application/json", + }, + body=None, + body_type=None, + response_type=Resource, + request_timeout=request_timeout, + ), + ) diff --git a/foundry/v2/functions/client.py b/foundry/v2/functions/client.py new file mode 100644 index 00000000..c972c132 --- /dev/null +++ b/foundry/v2/functions/client.py @@ -0,0 +1,24 @@ +# 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 foundry._core import Auth +from foundry.v2.functions.query import QueryClient + + +class FunctionsClient: + def __init__(self, auth: Auth, hostname: str): + self.Query = QueryClient(auth=auth, hostname=hostname) diff --git a/foundry/v2/functions/models/__init__.py b/foundry/v2/functions/models/__init__.py new file mode 100644 index 00000000..97162f2d --- /dev/null +++ b/foundry/v2/functions/models/__init__.py @@ -0,0 +1,114 @@ +# 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 foundry.v2.functions.models._data_value import DataValue +from foundry.v2.functions.models._execute_query_response import ExecuteQueryResponse +from foundry.v2.functions.models._execute_query_response_dict import ( + ExecuteQueryResponseDict, +) # NOQA +from foundry.v2.functions.models._function_rid import FunctionRid +from foundry.v2.functions.models._function_version import FunctionVersion +from foundry.v2.functions.models._parameter import Parameter +from foundry.v2.functions.models._parameter_dict import ParameterDict +from foundry.v2.functions.models._parameter_id import ParameterId +from foundry.v2.functions.models._query import Query +from foundry.v2.functions.models._query_aggregation_key_type import QueryAggregationKeyType # NOQA +from foundry.v2.functions.models._query_aggregation_key_type_dict import ( + QueryAggregationKeyTypeDict, +) # NOQA +from foundry.v2.functions.models._query_aggregation_range_sub_type import ( + QueryAggregationRangeSubType, +) # NOQA +from foundry.v2.functions.models._query_aggregation_range_sub_type_dict import ( + QueryAggregationRangeSubTypeDict, +) # NOQA +from foundry.v2.functions.models._query_aggregation_range_type import ( + QueryAggregationRangeType, +) # NOQA +from foundry.v2.functions.models._query_aggregation_range_type_dict import ( + QueryAggregationRangeTypeDict, +) # NOQA +from foundry.v2.functions.models._query_aggregation_value_type import ( + QueryAggregationValueType, +) # NOQA +from foundry.v2.functions.models._query_aggregation_value_type_dict import ( + QueryAggregationValueTypeDict, +) # NOQA +from foundry.v2.functions.models._query_api_name import QueryApiName +from foundry.v2.functions.models._query_array_type import QueryArrayType +from foundry.v2.functions.models._query_array_type_dict import QueryArrayTypeDict +from foundry.v2.functions.models._query_data_type import QueryDataType +from foundry.v2.functions.models._query_data_type_dict import QueryDataTypeDict +from foundry.v2.functions.models._query_dict import QueryDict +from foundry.v2.functions.models._query_set_type import QuerySetType +from foundry.v2.functions.models._query_set_type_dict import QuerySetTypeDict +from foundry.v2.functions.models._query_struct_field import QueryStructField +from foundry.v2.functions.models._query_struct_field_dict import QueryStructFieldDict +from foundry.v2.functions.models._query_struct_type import QueryStructType +from foundry.v2.functions.models._query_struct_type_dict import QueryStructTypeDict +from foundry.v2.functions.models._query_union_type import QueryUnionType +from foundry.v2.functions.models._query_union_type_dict import QueryUnionTypeDict +from foundry.v2.functions.models._struct_field_name import StructFieldName +from foundry.v2.functions.models._three_dimensional_aggregation import ( + ThreeDimensionalAggregation, +) # NOQA +from foundry.v2.functions.models._three_dimensional_aggregation_dict import ( + ThreeDimensionalAggregationDict, +) # NOQA +from foundry.v2.functions.models._two_dimensional_aggregation import ( + TwoDimensionalAggregation, +) # NOQA +from foundry.v2.functions.models._two_dimensional_aggregation_dict import ( + TwoDimensionalAggregationDict, +) # NOQA + +__all__ = [ + "DataValue", + "ExecuteQueryResponse", + "ExecuteQueryResponseDict", + "FunctionRid", + "FunctionVersion", + "Parameter", + "ParameterDict", + "ParameterId", + "Query", + "QueryAggregationKeyType", + "QueryAggregationKeyTypeDict", + "QueryAggregationRangeSubType", + "QueryAggregationRangeSubTypeDict", + "QueryAggregationRangeType", + "QueryAggregationRangeTypeDict", + "QueryAggregationValueType", + "QueryAggregationValueTypeDict", + "QueryApiName", + "QueryArrayType", + "QueryArrayTypeDict", + "QueryDataType", + "QueryDataTypeDict", + "QueryDict", + "QuerySetType", + "QuerySetTypeDict", + "QueryStructField", + "QueryStructFieldDict", + "QueryStructType", + "QueryStructTypeDict", + "QueryUnionType", + "QueryUnionTypeDict", + "StructFieldName", + "ThreeDimensionalAggregation", + "ThreeDimensionalAggregationDict", + "TwoDimensionalAggregation", + "TwoDimensionalAggregationDict", +] diff --git a/foundry/v2/functions/models/_data_value.py b/foundry/v2/functions/models/_data_value.py new file mode 100644 index 00000000..08da6bfc --- /dev/null +++ b/foundry/v2/functions/models/_data_value.py @@ -0,0 +1,44 @@ +# 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 + +DataValue = Any +""" +Represents the value of data in the following format. Note that these values can be nested, for example an array of structs. +| Type | JSON encoding | Example | +|-----------------------------|-------------------------------------------------------|-------------------------------------------------------------------------------| +| Array | array | `["alpha", "bravo", "charlie"]` | +| Attachment | string | `"ri.attachments.main.attachment.2f944bae-5851-4204-8615-920c969a9f2e"` | +| Boolean | boolean | `true` | +| Byte | number | `31` | +| Date | ISO 8601 extended local date string | `"2021-05-01"` | +| Decimal | string | `"2.718281828"` | +| Float | number | `3.14159265` | +| Double | number | `3.14159265` | +| Integer | number | `238940` | +| Long | string | `"58319870951433"` | +| Marking | string | `"MU"` | +| Null | null | `null` | +| Set | array | `["alpha", "bravo", "charlie"]` | +| Short | number | `8739` | +| String | string | `"Call me Ishmael"` | +| Struct | JSON object | `{"name": "John Doe", "age": 42}` | +| TwoDimensionalAggregation | JSON object | `{"groups": [{"key": "alpha", "value": 100}, {"key": "beta", "value": 101}]}` | +| ThreeDimensionalAggregation | JSON object | `{"groups": [{"key": "NYC", "groups": [{"key": "Engineer", "value" : 100}]}]}`| +| Timestamp | ISO 8601 extended offset date-time string in UTC zone | `"2021-01-04T05:00:00Z"` | +""" diff --git a/foundry/v2/functions/models/_execute_query_response.py b/foundry/v2/functions/models/_execute_query_response.py new file mode 100644 index 00000000..f9ebe85d --- /dev/null +++ b/foundry/v2/functions/models/_execute_query_response.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 cast + +from pydantic import BaseModel + +from foundry.v2.functions.models._data_value import DataValue +from foundry.v2.functions.models._execute_query_response_dict import ( + ExecuteQueryResponseDict, +) # NOQA + + +class ExecuteQueryResponse(BaseModel): + """ExecuteQueryResponse""" + + value: DataValue + + model_config = {"extra": "allow"} + + def to_dict(self) -> ExecuteQueryResponseDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(ExecuteQueryResponseDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_execute_query_response_dict.py b/foundry/v2/functions/models/_execute_query_response_dict.py new file mode 100644 index 00000000..03ad44a8 --- /dev/null +++ b/foundry/v2/functions/models/_execute_query_response_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_extensions import TypedDict + +from foundry.v2.functions.models._data_value import DataValue + + +class ExecuteQueryResponseDict(TypedDict): + """ExecuteQueryResponse""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + value: DataValue diff --git a/foundry/v2/functions/models/_function_rid.py b/foundry/v2/functions/models/_function_rid.py new file mode 100644 index 00000000..c6c31d2c --- /dev/null +++ b/foundry/v2/functions/models/_function_rid.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 foundry._core.utils import RID + +FunctionRid = RID +"""The unique resource identifier of a Function, useful for interacting with other Foundry APIs.""" diff --git a/foundry/v2/functions/models/_function_version.py b/foundry/v2/functions/models/_function_version.py new file mode 100644 index 00000000..9232ac09 --- /dev/null +++ b/foundry/v2/functions/models/_function_version.py @@ -0,0 +1,24 @@ +# 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 pydantic import StrictStr + +FunctionVersion = StrictStr +""" +The version of the given Function, written `..-`, where `-` is optional. +Examples: `1.2.3`, `1.2.3-rc1`. +""" diff --git a/foundry/v2/functions/models/_parameter.py b/foundry/v2/functions/models/_parameter.py new file mode 100644 index 00000000..1035b17d --- /dev/null +++ b/foundry/v2/functions/models/_parameter.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 typing import Optional +from typing import cast + +from pydantic import BaseModel +from pydantic import Field +from pydantic import StrictStr + +from foundry.v2.functions.models._parameter_dict import ParameterDict +from foundry.v2.functions.models._query_data_type import QueryDataType + + +class Parameter(BaseModel): + """Details about a parameter of a query.""" + + description: Optional[StrictStr] = None + + data_type: QueryDataType = Field(alias="dataType") + + model_config = {"extra": "allow"} + + def to_dict(self) -> ParameterDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(ParameterDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_parameter_dict.py b/foundry/v2/functions/models/_parameter_dict.py new file mode 100644 index 00000000..c104a5cb --- /dev/null +++ b/foundry/v2/functions/models/_parameter_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 pydantic import StrictStr +from typing_extensions import NotRequired +from typing_extensions import TypedDict + +from foundry.v2.functions.models._query_data_type_dict import QueryDataTypeDict + + +class ParameterDict(TypedDict): + """Details about a parameter of a query.""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + description: NotRequired[StrictStr] + + dataType: QueryDataTypeDict diff --git a/foundry/v2/functions/models/_parameter_id.py b/foundry/v2/functions/models/_parameter_id.py new file mode 100644 index 00000000..f19a988e --- /dev/null +++ b/foundry/v2/functions/models/_parameter_id.py @@ -0,0 +1,24 @@ +# 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 pydantic import StrictStr + +ParameterId = StrictStr +""" +The unique identifier of the parameter. Parameters are used as inputs when an action or query is applied. +Parameters can be viewed and managed in the **Ontology Manager**. +""" diff --git a/foundry/v2/functions/models/_query.py b/foundry/v2/functions/models/_query.py new file mode 100644 index 00000000..f9fd2015 --- /dev/null +++ b/foundry/v2/functions/models/_query.py @@ -0,0 +1,57 @@ +# 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 Optional +from typing import cast + +from pydantic import BaseModel +from pydantic import Field +from pydantic import StrictStr + +from foundry.v2.core.models._display_name import DisplayName +from foundry.v2.functions.models._function_rid import FunctionRid +from foundry.v2.functions.models._function_version import FunctionVersion +from foundry.v2.functions.models._parameter import Parameter +from foundry.v2.functions.models._parameter_id import ParameterId +from foundry.v2.functions.models._query_api_name import QueryApiName +from foundry.v2.functions.models._query_data_type import QueryDataType +from foundry.v2.functions.models._query_dict import QueryDict + + +class Query(BaseModel): + """Query""" + + api_name: QueryApiName = Field(alias="apiName") + + description: Optional[StrictStr] = None + + display_name: Optional[DisplayName] = Field(alias="displayName", default=None) + + parameters: Dict[ParameterId, Parameter] + + output: QueryDataType + + rid: FunctionRid + + version: FunctionVersion + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_query_aggregation_key_type.py b/foundry/v2/functions/models/_query_aggregation_key_type.py new file mode 100644 index 00000000..b0dcac5c --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_key_type.py @@ -0,0 +1,45 @@ +# 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 + +from pydantic import Field +from typing_extensions import Annotated + +from foundry.v2.core.models._boolean_type import BooleanType +from foundry.v2.core.models._date_type import DateType +from foundry.v2.core.models._double_type import DoubleType +from foundry.v2.core.models._integer_type import IntegerType +from foundry.v2.core.models._string_type import StringType +from foundry.v2.core.models._timestamp_type import TimestampType +from foundry.v2.functions.models._query_aggregation_range_type import ( + QueryAggregationRangeType, +) # NOQA + +QueryAggregationKeyType = Annotated[ + Union[ + DateType, + BooleanType, + StringType, + DoubleType, + QueryAggregationRangeType, + IntegerType, + TimestampType, + ], + Field(discriminator="type"), +] +"""A union of all the types supported by query aggregation keys.""" diff --git a/foundry/v2/functions/models/_query_aggregation_key_type_dict.py b/foundry/v2/functions/models/_query_aggregation_key_type_dict.py new file mode 100644 index 00000000..25dd1536 --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_key_type_dict.py @@ -0,0 +1,45 @@ +# 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 + +from pydantic import Field +from typing_extensions import Annotated + +from foundry.v2.core.models._boolean_type_dict import BooleanTypeDict +from foundry.v2.core.models._date_type_dict import DateTypeDict +from foundry.v2.core.models._double_type_dict import DoubleTypeDict +from foundry.v2.core.models._integer_type_dict import IntegerTypeDict +from foundry.v2.core.models._string_type_dict import StringTypeDict +from foundry.v2.core.models._timestamp_type_dict import TimestampTypeDict +from foundry.v2.functions.models._query_aggregation_range_type_dict import ( + QueryAggregationRangeTypeDict, +) # NOQA + +QueryAggregationKeyTypeDict = Annotated[ + Union[ + DateTypeDict, + BooleanTypeDict, + StringTypeDict, + DoubleTypeDict, + QueryAggregationRangeTypeDict, + IntegerTypeDict, + TimestampTypeDict, + ], + Field(discriminator="type"), +] +"""A union of all the types supported by query aggregation keys.""" diff --git a/foundry/v2/functions/models/_query_aggregation_range_sub_type.py b/foundry/v2/functions/models/_query_aggregation_range_sub_type.py new file mode 100644 index 00000000..4a4f1f5a --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_range_sub_type.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 Union + +from pydantic import Field +from typing_extensions import Annotated + +from foundry.v2.core.models._date_type import DateType +from foundry.v2.core.models._double_type import DoubleType +from foundry.v2.core.models._integer_type import IntegerType +from foundry.v2.core.models._timestamp_type import TimestampType + +QueryAggregationRangeSubType = Annotated[ + Union[DateType, DoubleType, IntegerType, TimestampType], Field(discriminator="type") +] +"""A union of all the types supported by query aggregation ranges.""" diff --git a/foundry/v2/functions/models/_query_aggregation_range_sub_type_dict.py b/foundry/v2/functions/models/_query_aggregation_range_sub_type_dict.py new file mode 100644 index 00000000..fa1a8d99 --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_range_sub_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 Union + +from pydantic import Field +from typing_extensions import Annotated + +from foundry.v2.core.models._date_type_dict import DateTypeDict +from foundry.v2.core.models._double_type_dict import DoubleTypeDict +from foundry.v2.core.models._integer_type_dict import IntegerTypeDict +from foundry.v2.core.models._timestamp_type_dict import TimestampTypeDict + +QueryAggregationRangeSubTypeDict = Annotated[ + Union[DateTypeDict, DoubleTypeDict, IntegerTypeDict, TimestampTypeDict], + Field(discriminator="type"), +] +"""A union of all the types supported by query aggregation ranges.""" diff --git a/foundry/v2/functions/models/_query_aggregation_range_type.py b/foundry/v2/functions/models/_query_aggregation_range_type.py new file mode 100644 index 00000000..c379b870 --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_range_type.py @@ -0,0 +1,45 @@ +# 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 import cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.functions.models._query_aggregation_range_sub_type import ( + QueryAggregationRangeSubType, +) # NOQA +from foundry.v2.functions.models._query_aggregation_range_type_dict import ( + QueryAggregationRangeTypeDict, +) # NOQA + + +class QueryAggregationRangeType(BaseModel): + """QueryAggregationRangeType""" + + sub_type: QueryAggregationRangeSubType = Field(alias="subType") + + type: Literal["range"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryAggregationRangeTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast( + QueryAggregationRangeTypeDict, self.model_dump(by_alias=True, exclude_unset=True) + ) diff --git a/foundry/v2/functions/models/_query_aggregation_range_type_dict.py b/foundry/v2/functions/models/_query_aggregation_range_type_dict.py new file mode 100644 index 00000000..666a17b9 --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_range_type_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.functions.models._query_aggregation_range_sub_type_dict import ( + QueryAggregationRangeSubTypeDict, +) # NOQA + + +class QueryAggregationRangeTypeDict(TypedDict): + """QueryAggregationRangeType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + subType: QueryAggregationRangeSubTypeDict + + type: Literal["range"] diff --git a/foundry/v2/functions/models/_query_aggregation_value_type.py b/foundry/v2/functions/models/_query_aggregation_value_type.py new file mode 100644 index 00000000..61592d35 --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_value_type.py @@ -0,0 +1,30 @@ +# 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 + +from pydantic import Field +from typing_extensions import Annotated + +from foundry.v2.core.models._date_type import DateType +from foundry.v2.core.models._double_type import DoubleType +from foundry.v2.core.models._timestamp_type import TimestampType + +QueryAggregationValueType = Annotated[ + Union[DateType, DoubleType, TimestampType], Field(discriminator="type") +] +"""A union of all the types supported by query aggregation keys.""" diff --git a/foundry/v2/functions/models/_query_aggregation_value_type_dict.py b/foundry/v2/functions/models/_query_aggregation_value_type_dict.py new file mode 100644 index 00000000..30517d25 --- /dev/null +++ b/foundry/v2/functions/models/_query_aggregation_value_type_dict.py @@ -0,0 +1,30 @@ +# 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 + +from pydantic import Field +from typing_extensions import Annotated + +from foundry.v2.core.models._date_type_dict import DateTypeDict +from foundry.v2.core.models._double_type_dict import DoubleTypeDict +from foundry.v2.core.models._timestamp_type_dict import TimestampTypeDict + +QueryAggregationValueTypeDict = Annotated[ + Union[DateTypeDict, DoubleTypeDict, TimestampTypeDict], Field(discriminator="type") +] +"""A union of all the types supported by query aggregation keys.""" diff --git a/foundry/v2/functions/models/_query_api_name.py b/foundry/v2/functions/models/_query_api_name.py new file mode 100644 index 00000000..db3c38fe --- /dev/null +++ b/foundry/v2/functions/models/_query_api_name.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 pydantic import StrictStr + +QueryApiName = StrictStr +"""The name of the Query in the API.""" diff --git a/foundry/v2/functions/models/_query_array_type.py b/foundry/v2/functions/models/_query_array_type.py new file mode 100644 index 00000000..f717bb99 --- /dev/null +++ b/foundry/v2/functions/models/_query_array_type.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 Literal +from typing import cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.functions.models._query_array_type_dict import QueryArrayTypeDict +from foundry.v2.functions.models._query_data_type import QueryDataType + + +class QueryArrayType(BaseModel): + """QueryArrayType""" + + sub_type: QueryDataType = Field(alias="subType") + + type: Literal["array"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryArrayTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryArrayTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_query_array_type_dict.py b/foundry/v2/functions/models/_query_array_type_dict.py new file mode 100644 index 00000000..bcfffc08 --- /dev/null +++ b/foundry/v2/functions/models/_query_array_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 Literal + +from typing_extensions import TypedDict + +from foundry.v2.functions.models._query_data_type_dict import QueryDataTypeDict + + +class QueryArrayTypeDict(TypedDict): + """QueryArrayType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + subType: QueryDataTypeDict + + type: Literal["array"] diff --git a/foundry/v2/functions/models/_query_data_type.py b/foundry/v2/functions/models/_query_data_type.py new file mode 100644 index 00000000..2b1b33b6 --- /dev/null +++ b/foundry/v2/functions/models/_query_data_type.py @@ -0,0 +1,144 @@ +# 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 +from typing import cast + +from pydantic import BaseModel +from pydantic import Field +from typing_extensions import Annotated + +from foundry.v2.core.models._attachment_type import AttachmentType +from foundry.v2.core.models._boolean_type import BooleanType +from foundry.v2.core.models._date_type import DateType +from foundry.v2.core.models._double_type import DoubleType +from foundry.v2.core.models._float_type import FloatType +from foundry.v2.core.models._integer_type import IntegerType +from foundry.v2.core.models._long_type import LongType +from foundry.v2.core.models._null_type import NullType +from foundry.v2.core.models._string_type import StringType +from foundry.v2.core.models._timestamp_type import TimestampType +from foundry.v2.core.models._unsupported_type import UnsupportedType +from foundry.v2.functions.models._query_array_type_dict import QueryArrayTypeDict +from foundry.v2.functions.models._query_set_type_dict import QuerySetTypeDict +from foundry.v2.functions.models._query_struct_field_dict import QueryStructFieldDict +from foundry.v2.functions.models._query_struct_type_dict import QueryStructTypeDict +from foundry.v2.functions.models._query_union_type_dict import QueryUnionTypeDict +from foundry.v2.functions.models._struct_field_name import StructFieldName +from foundry.v2.functions.models._three_dimensional_aggregation import ( + ThreeDimensionalAggregation, +) # NOQA +from foundry.v2.functions.models._two_dimensional_aggregation import ( + TwoDimensionalAggregation, +) # NOQA + + +class QueryStructField(BaseModel): + """QueryStructField""" + + name: StructFieldName + + field_type: QueryDataType = Field(alias="fieldType") + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryStructFieldDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryStructFieldDict, self.model_dump(by_alias=True, exclude_unset=True)) + + +class QueryStructType(BaseModel): + """QueryStructType""" + + fields: List[QueryStructField] + + type: Literal["struct"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryStructTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryStructTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) + + +class QuerySetType(BaseModel): + """QuerySetType""" + + sub_type: QueryDataType = Field(alias="subType") + + type: Literal["set"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QuerySetTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QuerySetTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) + + +class QueryUnionType(BaseModel): + """QueryUnionType""" + + union_types: List[QueryDataType] = Field(alias="unionTypes") + + type: Literal["union"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryUnionTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryUnionTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) + + +class QueryArrayType(BaseModel): + """QueryArrayType""" + + sub_type: QueryDataType = Field(alias="subType") + + type: Literal["array"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryArrayTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryArrayTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) + + +QueryDataType = Annotated[ + Union[ + DateType, + QueryStructType, + QuerySetType, + StringType, + DoubleType, + IntegerType, + ThreeDimensionalAggregation, + QueryUnionType, + FloatType, + LongType, + BooleanType, + UnsupportedType, + AttachmentType, + NullType, + QueryArrayType, + TwoDimensionalAggregation, + TimestampType, + ], + Field(discriminator="type"), +] +"""A union of all the types supported by Query parameters or outputs.""" diff --git a/foundry/v2/functions/models/_query_data_type_dict.py b/foundry/v2/functions/models/_query_data_type_dict.py new file mode 100644 index 00000000..116af6a3 --- /dev/null +++ b/foundry/v2/functions/models/_query_data_type_dict.py @@ -0,0 +1,118 @@ +# 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 + +from pydantic import Field +from typing_extensions import Annotated +from typing_extensions import TypedDict + +from foundry.v2.core.models._attachment_type_dict import AttachmentTypeDict +from foundry.v2.core.models._boolean_type_dict import BooleanTypeDict +from foundry.v2.core.models._date_type_dict import DateTypeDict +from foundry.v2.core.models._double_type_dict import DoubleTypeDict +from foundry.v2.core.models._float_type_dict import FloatTypeDict +from foundry.v2.core.models._integer_type_dict import IntegerTypeDict +from foundry.v2.core.models._long_type_dict import LongTypeDict +from foundry.v2.core.models._null_type_dict import NullTypeDict +from foundry.v2.core.models._string_type_dict import StringTypeDict +from foundry.v2.core.models._timestamp_type_dict import TimestampTypeDict +from foundry.v2.core.models._unsupported_type_dict import UnsupportedTypeDict +from foundry.v2.functions.models._struct_field_name import StructFieldName +from foundry.v2.functions.models._three_dimensional_aggregation_dict import ( + ThreeDimensionalAggregationDict, +) # NOQA +from foundry.v2.functions.models._two_dimensional_aggregation_dict import ( + TwoDimensionalAggregationDict, +) # NOQA + + +class QueryStructFieldDict(TypedDict): + """QueryStructField""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + name: StructFieldName + + fieldType: QueryDataTypeDict + + +class QueryStructTypeDict(TypedDict): + """QueryStructType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + fields: List[QueryStructFieldDict] + + type: Literal["struct"] + + +class QuerySetTypeDict(TypedDict): + """QuerySetType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + subType: QueryDataTypeDict + + type: Literal["set"] + + +class QueryUnionTypeDict(TypedDict): + """QueryUnionType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + unionTypes: List[QueryDataTypeDict] + + type: Literal["union"] + + +class QueryArrayTypeDict(TypedDict): + """QueryArrayType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + subType: QueryDataTypeDict + + type: Literal["array"] + + +QueryDataTypeDict = Annotated[ + Union[ + DateTypeDict, + QueryStructTypeDict, + QuerySetTypeDict, + StringTypeDict, + DoubleTypeDict, + IntegerTypeDict, + ThreeDimensionalAggregationDict, + QueryUnionTypeDict, + FloatTypeDict, + LongTypeDict, + BooleanTypeDict, + UnsupportedTypeDict, + AttachmentTypeDict, + NullTypeDict, + QueryArrayTypeDict, + TwoDimensionalAggregationDict, + TimestampTypeDict, + ], + Field(discriminator="type"), +] +"""A union of all the types supported by Query parameters or outputs.""" diff --git a/foundry/v2/functions/models/_query_dict.py b/foundry/v2/functions/models/_query_dict.py new file mode 100644 index 00000000..68755f83 --- /dev/null +++ b/foundry/v2/functions/models/_query_dict.py @@ -0,0 +1,50 @@ +# 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 pydantic import StrictStr +from typing_extensions import NotRequired +from typing_extensions import TypedDict + +from foundry.v2.core.models._display_name import DisplayName +from foundry.v2.functions.models._function_rid import FunctionRid +from foundry.v2.functions.models._function_version import FunctionVersion +from foundry.v2.functions.models._parameter_dict import ParameterDict +from foundry.v2.functions.models._parameter_id import ParameterId +from foundry.v2.functions.models._query_api_name import QueryApiName +from foundry.v2.functions.models._query_data_type_dict import QueryDataTypeDict + + +class QueryDict(TypedDict): + """Query""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + apiName: QueryApiName + + description: NotRequired[StrictStr] + + displayName: NotRequired[DisplayName] + + parameters: Dict[ParameterId, ParameterDict] + + output: QueryDataTypeDict + + rid: FunctionRid + + version: FunctionVersion diff --git a/foundry/v2/functions/models/_query_set_type.py b/foundry/v2/functions/models/_query_set_type.py new file mode 100644 index 00000000..a77f3029 --- /dev/null +++ b/foundry/v2/functions/models/_query_set_type.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 Literal +from typing import cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.functions.models._query_data_type import QueryDataType +from foundry.v2.functions.models._query_set_type_dict import QuerySetTypeDict + + +class QuerySetType(BaseModel): + """QuerySetType""" + + sub_type: QueryDataType = Field(alias="subType") + + type: Literal["set"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QuerySetTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QuerySetTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_query_set_type_dict.py b/foundry/v2/functions/models/_query_set_type_dict.py new file mode 100644 index 00000000..0ee8c9d8 --- /dev/null +++ b/foundry/v2/functions/models/_query_set_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 Literal + +from typing_extensions import TypedDict + +from foundry.v2.functions.models._query_data_type_dict import QueryDataTypeDict + + +class QuerySetTypeDict(TypedDict): + """QuerySetType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + subType: QueryDataTypeDict + + type: Literal["set"] diff --git a/foundry/v2/functions/models/_query_struct_field.py b/foundry/v2/functions/models/_query_struct_field.py new file mode 100644 index 00000000..5efe3156 --- /dev/null +++ b/foundry/v2/functions/models/_query_struct_field.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 cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.functions.models._query_data_type import QueryDataType +from foundry.v2.functions.models._query_struct_field_dict import QueryStructFieldDict +from foundry.v2.functions.models._struct_field_name import StructFieldName + + +class QueryStructField(BaseModel): + """QueryStructField""" + + name: StructFieldName + + field_type: QueryDataType = Field(alias="fieldType") + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryStructFieldDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryStructFieldDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_query_struct_field_dict.py b/foundry/v2/functions/models/_query_struct_field_dict.py new file mode 100644 index 00000000..8651838d --- /dev/null +++ b/foundry/v2/functions/models/_query_struct_field_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_extensions import TypedDict + +from foundry.v2.functions.models._query_data_type_dict import QueryDataTypeDict +from foundry.v2.functions.models._struct_field_name import StructFieldName + + +class QueryStructFieldDict(TypedDict): + """QueryStructField""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + name: StructFieldName + + fieldType: QueryDataTypeDict diff --git a/foundry/v2/functions/models/_query_struct_type.py b/foundry/v2/functions/models/_query_struct_type.py new file mode 100644 index 00000000..76450df1 --- /dev/null +++ b/foundry/v2/functions/models/_query_struct_type.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 List +from typing import Literal +from typing import cast + +from pydantic import BaseModel + +from foundry.v2.functions.models._query_struct_field import QueryStructField +from foundry.v2.functions.models._query_struct_type_dict import QueryStructTypeDict + + +class QueryStructType(BaseModel): + """QueryStructType""" + + fields: List[QueryStructField] + + type: Literal["struct"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryStructTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryStructTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_query_struct_type_dict.py b/foundry/v2/functions/models/_query_struct_type_dict.py new file mode 100644 index 00000000..da7fd046 --- /dev/null +++ b/foundry/v2/functions/models/_query_struct_type_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 import List +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.functions.models._query_struct_field_dict import QueryStructFieldDict + + +class QueryStructTypeDict(TypedDict): + """QueryStructType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + fields: List[QueryStructFieldDict] + + type: Literal["struct"] diff --git a/foundry/v2/functions/models/_query_union_type.py b/foundry/v2/functions/models/_query_union_type.py new file mode 100644 index 00000000..fbeef28f --- /dev/null +++ b/foundry/v2/functions/models/_query_union_type.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 typing import List +from typing import Literal +from typing import cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.functions.models._query_data_type import QueryDataType +from foundry.v2.functions.models._query_union_type_dict import QueryUnionTypeDict + + +class QueryUnionType(BaseModel): + """QueryUnionType""" + + union_types: List[QueryDataType] = Field(alias="unionTypes") + + type: Literal["union"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> QueryUnionTypeDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(QueryUnionTypeDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/functions/models/_query_union_type_dict.py b/foundry/v2/functions/models/_query_union_type_dict.py new file mode 100644 index 00000000..260d33b2 --- /dev/null +++ b/foundry/v2/functions/models/_query_union_type_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 import List +from typing import Literal + +from typing_extensions import TypedDict + +from foundry.v2.functions.models._query_data_type_dict import QueryDataTypeDict + + +class QueryUnionTypeDict(TypedDict): + """QueryUnionType""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + unionTypes: List[QueryDataTypeDict] + + type: Literal["union"] diff --git a/foundry/v2/functions/models/_struct_field_name.py b/foundry/v2/functions/models/_struct_field_name.py new file mode 100644 index 00000000..57dd00b8 --- /dev/null +++ b/foundry/v2/functions/models/_struct_field_name.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 pydantic import StrictStr + +StructFieldName = StrictStr +"""The name of a field in a `Struct`.""" diff --git a/foundry/v2/functions/models/_three_dimensional_aggregation.py b/foundry/v2/functions/models/_three_dimensional_aggregation.py new file mode 100644 index 00000000..60bc09ef --- /dev/null +++ b/foundry/v2/functions/models/_three_dimensional_aggregation.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 typing import Literal +from typing import cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.functions.models._query_aggregation_key_type import QueryAggregationKeyType # NOQA +from foundry.v2.functions.models._three_dimensional_aggregation_dict import ( + ThreeDimensionalAggregationDict, +) # NOQA +from foundry.v2.functions.models._two_dimensional_aggregation import ( + TwoDimensionalAggregation, +) # NOQA + + +class ThreeDimensionalAggregation(BaseModel): + """ThreeDimensionalAggregation""" + + key_type: QueryAggregationKeyType = Field(alias="keyType") + + value_type: TwoDimensionalAggregation = Field(alias="valueType") + + type: Literal["threeDimensionalAggregation"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> ThreeDimensionalAggregationDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast( + ThreeDimensionalAggregationDict, self.model_dump(by_alias=True, exclude_unset=True) + ) diff --git a/foundry/v2/functions/models/_three_dimensional_aggregation_dict.py b/foundry/v2/functions/models/_three_dimensional_aggregation_dict.py new file mode 100644 index 00000000..f4ee19c1 --- /dev/null +++ b/foundry/v2/functions/models/_three_dimensional_aggregation_dict.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 Literal + +from typing_extensions import TypedDict + +from foundry.v2.functions.models._query_aggregation_key_type_dict import ( + QueryAggregationKeyTypeDict, +) # NOQA +from foundry.v2.functions.models._two_dimensional_aggregation_dict import ( + TwoDimensionalAggregationDict, +) # NOQA + + +class ThreeDimensionalAggregationDict(TypedDict): + """ThreeDimensionalAggregation""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + keyType: QueryAggregationKeyTypeDict + + valueType: TwoDimensionalAggregationDict + + type: Literal["threeDimensionalAggregation"] diff --git a/foundry/v2/functions/models/_two_dimensional_aggregation.py b/foundry/v2/functions/models/_two_dimensional_aggregation.py new file mode 100644 index 00000000..fa7b5f75 --- /dev/null +++ b/foundry/v2/functions/models/_two_dimensional_aggregation.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 typing import Literal +from typing import cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.functions.models._query_aggregation_key_type import QueryAggregationKeyType # NOQA +from foundry.v2.functions.models._query_aggregation_value_type import ( + QueryAggregationValueType, +) # NOQA +from foundry.v2.functions.models._two_dimensional_aggregation_dict import ( + TwoDimensionalAggregationDict, +) # NOQA + + +class TwoDimensionalAggregation(BaseModel): + """TwoDimensionalAggregation""" + + key_type: QueryAggregationKeyType = Field(alias="keyType") + + value_type: QueryAggregationValueType = Field(alias="valueType") + + type: Literal["twoDimensionalAggregation"] + + model_config = {"extra": "allow"} + + def to_dict(self) -> TwoDimensionalAggregationDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast( + TwoDimensionalAggregationDict, self.model_dump(by_alias=True, exclude_unset=True) + ) diff --git a/foundry/v2/functions/models/_two_dimensional_aggregation_dict.py b/foundry/v2/functions/models/_two_dimensional_aggregation_dict.py new file mode 100644 index 00000000..cc070fbe --- /dev/null +++ b/foundry/v2/functions/models/_two_dimensional_aggregation_dict.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 Literal + +from typing_extensions import TypedDict + +from foundry.v2.functions.models._query_aggregation_key_type_dict import ( + QueryAggregationKeyTypeDict, +) # NOQA +from foundry.v2.functions.models._query_aggregation_value_type_dict import ( + QueryAggregationValueTypeDict, +) # NOQA + + +class TwoDimensionalAggregationDict(TypedDict): + """TwoDimensionalAggregation""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + keyType: QueryAggregationKeyTypeDict + + valueType: QueryAggregationValueTypeDict + + type: Literal["twoDimensionalAggregation"] diff --git a/foundry/v2/functions/query.py b/foundry/v2/functions/query.py new file mode 100644 index 00000000..92b9e3e5 --- /dev/null +++ b/foundry/v2/functions/query.py @@ -0,0 +1,188 @@ +# 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 Dict +from typing import Optional + +from pydantic import Field +from pydantic import StrictInt +from pydantic import validate_call +from typing_extensions import Annotated +from typing_extensions import TypedDict + +from foundry._core import ApiClient +from foundry._core import Auth +from foundry._core import RequestInfo +from foundry._errors import handle_unexpected +from foundry.v2.core.models._preview_mode import PreviewMode +from foundry.v2.functions.models._data_value import DataValue +from foundry.v2.functions.models._execute_query_response import ExecuteQueryResponse +from foundry.v2.functions.models._function_rid import FunctionRid +from foundry.v2.functions.models._parameter_id import ParameterId +from foundry.v2.functions.models._query import Query +from foundry.v2.functions.models._query_api_name import QueryApiName + + +class QueryClient: + def __init__(self, auth: Auth, hostname: str) -> None: + self._api_client = ApiClient(auth=auth, hostname=hostname) + + @validate_call + @handle_unexpected + def execute( + self, + query_api_name: QueryApiName, + *, + parameters: Dict[ParameterId, Optional[DataValue]], + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[StrictInt, Field(gt=0)]] = None, + ) -> ExecuteQueryResponse: + """ + Executes a Query using the given parameters. + + Optional parameters do not need to be supplied. + + :param query_api_name: queryApiName + :type query_api_name: QueryApiName + :param parameters: + :type parameters: Dict[ParameterId, Optional[DataValue]] + :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: ExecuteQueryResponse + """ + + return self._api_client.call_api( + RequestInfo( + method="POST", + resource_path="/v2/functions/queries/{queryApiName}/execute", + query_params={ + "preview": preview, + }, + path_params={ + "queryApiName": query_api_name, + }, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body={ + "parameters": parameters, + }, + body_type=TypedDict( + "Body", + { # type: ignore + "parameters": Dict[ParameterId, Optional[DataValue]], + }, + ), + response_type=ExecuteQueryResponse, + request_timeout=request_timeout, + ), + ) + + @validate_call + @handle_unexpected + def get( + self, + query_api_name: QueryApiName, + *, + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[StrictInt, Field(gt=0)]] = None, + ) -> Query: + """ + Gets a specific query type with the given API name. + + :param query_api_name: queryApiName + :type query_api_name: QueryApiName + :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: Query + """ + + return self._api_client.call_api( + RequestInfo( + method="GET", + resource_path="/v2/functions/queries/{queryApiName}", + query_params={ + "preview": preview, + }, + path_params={ + "queryApiName": query_api_name, + }, + header_params={ + "Accept": "application/json", + }, + body=None, + body_type=None, + response_type=Query, + request_timeout=request_timeout, + ), + ) + + @validate_call + @handle_unexpected + def get_by_rid( + self, + *, + rid: FunctionRid, + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[StrictInt, Field(gt=0)]] = None, + ) -> Query: + """ + Gets a specific query type with the given RID. + + :param rid: + :type rid: FunctionRid + :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: Query + """ + + return self._api_client.call_api( + RequestInfo( + method="POST", + resource_path="/v2/functions/queries/getByRid", + query_params={ + "preview": preview, + }, + path_params={}, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body={ + "rid": rid, + }, + body_type=TypedDict( + "Body", + { # type: ignore + "rid": FunctionRid, + }, + ), + response_type=Query, + request_timeout=request_timeout, + ), + ) diff --git a/foundry/v2/streams/client.py b/foundry/v2/streams/client.py new file mode 100644 index 00000000..cecd5bd1 --- /dev/null +++ b/foundry/v2/streams/client.py @@ -0,0 +1,24 @@ +# 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 foundry._core import Auth +from foundry.v2.streams.dataset import DatasetClient + + +class StreamsClient: + def __init__(self, auth: Auth, hostname: str): + self.Dataset = DatasetClient(auth=auth, hostname=hostname) diff --git a/foundry/v2/streams/dataset.py b/foundry/v2/streams/dataset.py new file mode 100644 index 00000000..1204efc6 --- /dev/null +++ b/foundry/v2/streams/dataset.py @@ -0,0 +1,122 @@ +# 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 Dict +from typing import Optional + +from pydantic import Field +from pydantic import StrictInt +from pydantic import validate_call +from typing_extensions import Annotated +from typing_extensions import TypedDict + +from foundry._core import ApiClient +from foundry._core import Auth +from foundry._core import RequestInfo +from foundry._errors import handle_unexpected +from foundry.v2.core.models._preview_mode import PreviewMode +from foundry.v2.datasets.models._branch_name import BranchName +from foundry.v2.datasets.models._dataset_name import DatasetName +from foundry.v2.filesystem.models._folder_rid import FolderRid +from foundry.v2.streams.models._compressed import Compressed +from foundry.v2.streams.models._dataset import Dataset +from foundry.v2.streams.models._partitions_count import PartitionsCount +from foundry.v2.streams.models._stream_type import StreamType +from foundry.v2.streams.stream import StreamClient + + +class DatasetClient: + def __init__(self, auth: Auth, hostname: str) -> None: + self._api_client = ApiClient(auth=auth, hostname=hostname) + + self.Stream = StreamClient(auth=auth, hostname=hostname) + + @validate_call + @handle_unexpected + def create( + self, + *, + name: DatasetName, + parent_folder_rid: FolderRid, + branch_name: Optional[BranchName] = None, + compressed: Optional[Compressed] = None, + partitions_count: Optional[PartitionsCount] = None, + preview: Optional[PreviewMode] = None, + stream_type: Optional[StreamType] = None, + request_timeout: Optional[Annotated[StrictInt, Field(gt=0)]] = None, + ) -> Dataset: + """ + Creates a streaming dataset with a stream on the specified branch, or if no branch is specified, on the + default branch ('master' for most enrollments). For more information on streaming datasets, refer to the + [streams](/docs/foundry/data-integration/streams/) user documentation. + + :param name: + :type name: DatasetName + :param parent_folder_rid: + :type parent_folder_rid: FolderRid + :param branch_name: The branch to create the initial stream on. If not specified, the default branch will be used ('master' for most enrollments). + :type branch_name: Optional[BranchName] + :param compressed: Whether or not compression is enabled for the stream. Defaults to false. + :type compressed: Optional[Compressed] + :param partitions_count: The number of partitions for the Foundry stream. Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions are recommended. If not specified, 1 partition is used. This value cannot be changed later. + :type partitions_count: Optional[PartitionsCount] + :param preview: preview + :type preview: Optional[PreviewMode] + :param stream_type: A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. + :type stream_type: Optional[StreamType] + :param request_timeout: timeout setting for this request in seconds. + :type request_timeout: Optional[int] + :return: Returns the result object. + :rtype: Dataset + """ + + return self._api_client.call_api( + RequestInfo( + method="POST", + resource_path="/v2/streams/datasets/create", + query_params={ + "preview": preview, + }, + path_params={}, + header_params={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + body={ + "name": name, + "parentFolderRid": parent_folder_rid, + "branchName": branch_name, + "partitionsCount": partitions_count, + "streamType": stream_type, + "compressed": compressed, + }, + body_type=TypedDict( + "Body", + { # type: ignore + "name": DatasetName, + "parentFolderRid": FolderRid, + "branchName": Optional[BranchName], + "partitionsCount": Optional[PartitionsCount], + "streamType": Optional[StreamType], + "compressed": Optional[Compressed], + }, + ), + response_type=Dataset, + request_timeout=request_timeout, + ), + ) diff --git a/foundry/v2/streams/models/__init__.py b/foundry/v2/streams/models/__init__.py new file mode 100644 index 00000000..0131abe2 --- /dev/null +++ b/foundry/v2/streams/models/__init__.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 foundry.v2.streams.models._compressed import Compressed +from foundry.v2.streams.models._dataset import Dataset +from foundry.v2.streams.models._dataset_dict import DatasetDict +from foundry.v2.streams.models._partitions_count import PartitionsCount +from foundry.v2.streams.models._stream import Stream +from foundry.v2.streams.models._stream_dict import StreamDict +from foundry.v2.streams.models._stream_type import StreamType +from foundry.v2.streams.models._view_rid import ViewRid + +__all__ = [ + "Compressed", + "Dataset", + "DatasetDict", + "PartitionsCount", + "Stream", + "StreamDict", + "StreamType", + "ViewRid", +] diff --git a/foundry/v2/streams/models/_compressed.py b/foundry/v2/streams/models/_compressed.py new file mode 100644 index 00000000..c3ffca87 --- /dev/null +++ b/foundry/v2/streams/models/_compressed.py @@ -0,0 +1,26 @@ +# 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 pydantic import StrictBool + +Compressed = StrictBool +""" +Compression helps reduce the size of the data being sent, resulting in lower network usage and +storage, at the cost of some additional CPU usage for compression and decompression. This stream type +is only recommended if your stream contains a high volume of repetitive strings and is experiencing poor +network bandwidth symptoms like non-zero lag, lower than expected throughput, or dropped records. +""" diff --git a/foundry/v2/streams/models/_dataset.py b/foundry/v2/streams/models/_dataset.py new file mode 100644 index 00000000..5bc7bbf7 --- /dev/null +++ b/foundry/v2/streams/models/_dataset.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 cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.datasets.models._dataset_name import DatasetName +from foundry.v2.datasets.models._dataset_rid import DatasetRid +from foundry.v2.filesystem.models._folder_rid import FolderRid +from foundry.v2.streams.models._dataset_dict import DatasetDict + + +class Dataset(BaseModel): + """Dataset""" + + rid: DatasetRid + + name: DatasetName + + parent_folder_rid: FolderRid = Field(alias="parentFolderRid") + + model_config = {"extra": "allow"} + + def to_dict(self) -> DatasetDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(DatasetDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/streams/models/_dataset_dict.py b/foundry/v2/streams/models/_dataset_dict.py new file mode 100644 index 00000000..952d5c96 --- /dev/null +++ b/foundry/v2/streams/models/_dataset_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_extensions import TypedDict + +from foundry.v2.datasets.models._dataset_name import DatasetName +from foundry.v2.datasets.models._dataset_rid import DatasetRid +from foundry.v2.filesystem.models._folder_rid import FolderRid + + +class DatasetDict(TypedDict): + """Dataset""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + rid: DatasetRid + + name: DatasetName + + parentFolderRid: FolderRid diff --git a/foundry/v2/streams/models/_partitions_count.py b/foundry/v2/streams/models/_partitions_count.py new file mode 100644 index 00000000..670ed34c --- /dev/null +++ b/foundry/v2/streams/models/_partitions_count.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 pydantic import StrictInt + +PartitionsCount = StrictInt +"""The number of partitions for a Foundry stream.""" diff --git a/foundry/v2/streams/models/_stream.py b/foundry/v2/streams/models/_stream.py new file mode 100644 index 00000000..dd7e3344 --- /dev/null +++ b/foundry/v2/streams/models/_stream.py @@ -0,0 +1,60 @@ +# 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 cast + +from pydantic import BaseModel +from pydantic import Field + +from foundry.v2.datasets.models._branch_name import BranchName +from foundry.v2.streams.models._compressed import Compressed +from foundry.v2.streams.models._partitions_count import PartitionsCount +from foundry.v2.streams.models._stream_dict import StreamDict +from foundry.v2.streams.models._stream_type import StreamType +from foundry.v2.streams.models._view_rid import ViewRid + + +class Stream(BaseModel): + """Stream""" + + branch_name: BranchName = Field(alias="branchName") + + view_rid: ViewRid = Field(alias="viewRid") + """The view that this stream corresponds to.""" + + partitions_count: PartitionsCount = Field(alias="partitionsCount") + """ + The number of partitions for the Foundry stream. + + Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions + are recommended. + """ + + stream_type: StreamType = Field(alias="streamType") + """ + A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and + LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. + """ + + compressed: Compressed + """Whether or not compression is enabled for the stream. Defaults to false.""" + + model_config = {"extra": "allow"} + + def to_dict(self) -> StreamDict: + """Return the dictionary representation of the model using the field aliases.""" + return cast(StreamDict, self.model_dump(by_alias=True, exclude_unset=True)) diff --git a/foundry/v2/streams/models/_stream_dict.py b/foundry/v2/streams/models/_stream_dict.py new file mode 100644 index 00000000..c9748576 --- /dev/null +++ b/foundry/v2/streams/models/_stream_dict.py @@ -0,0 +1,52 @@ +# 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.datasets.models._branch_name import BranchName +from foundry.v2.streams.models._compressed import Compressed +from foundry.v2.streams.models._partitions_count import PartitionsCount +from foundry.v2.streams.models._stream_type import StreamType +from foundry.v2.streams.models._view_rid import ViewRid + + +class StreamDict(TypedDict): + """Stream""" + + __pydantic_config__ = {"extra": "allow"} # type: ignore + + branchName: BranchName + + viewRid: ViewRid + """The view that this stream corresponds to.""" + + partitionsCount: PartitionsCount + """ + The number of partitions for the Foundry stream. + + Generally, each partition can handle about 5 mb/s of data, so for higher volume streams, more partitions + are recommended. + """ + + streamType: StreamType + """ + A conceptual representation of the expected shape of the data for a stream. HIGH_THROUGHPUT and + LOW_LATENCY are not compatible with each other. Defaults to LOW_LATENCY. + """ + + compressed: Compressed + """Whether or not compression is enabled for the stream. Defaults to false.""" diff --git a/foundry/v2/streams/models/_stream_type.py b/foundry/v2/streams/models/_stream_type.py new file mode 100644 index 00000000..4791ef28 --- /dev/null +++ b/foundry/v2/streams/models/_stream_type.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 import Literal + +StreamType = Literal["LOW_LATENCY", "HIGH_THROUGHPUT"] +""" +LOW_LATENCY: The default stream type. Recommended for most use cases. + +HIGH_THROUGHPUT: Best for streams that send large amounts of data every second. Using this stream type might +introduce some non-zero latency at the expense of a higher throughput. This stream type is only +recommended if you inspect your stream metrics in-platform and observe that the average batch size is equal +to the max match size, or if jobs using the stream are failing due to Kafka producer batches expiring. For +additional information on inspecting stream metrics, refer to the +(stream monitoring)[/docs/foundry/data-integration/stream-monitoring/#viewing-metrics] documentation. + +For more information, refer to the [stream types](/docs/foundry/data-integration/streams/#stream-types) +documentation. +""" diff --git a/foundry/v2/streams/models/_view_rid.py b/foundry/v2/streams/models/_view_rid.py new file mode 100644 index 00000000..528479d4 --- /dev/null +++ b/foundry/v2/streams/models/_view_rid.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 foundry._core.utils import RID + +ViewRid = RID +"""The resource identifier (RID) of the view that represents a stream.""" diff --git a/foundry/v2/streams/stream.py b/foundry/v2/streams/stream.py new file mode 100644 index 00000000..7f9756e8 --- /dev/null +++ b/foundry/v2/streams/stream.py @@ -0,0 +1,86 @@ +# 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 Dict +from typing import Optional + +from pydantic import Field +from pydantic import StrictInt +from pydantic import validate_call +from typing_extensions import Annotated + +from foundry._core import ApiClient +from foundry._core import Auth +from foundry._core import RequestInfo +from foundry._errors import handle_unexpected +from foundry.v2.core.models._preview_mode import PreviewMode +from foundry.v2.datasets.models._branch_name import BranchName +from foundry.v2.datasets.models._dataset_rid import DatasetRid +from foundry.v2.streams.models._stream import Stream + + +class StreamClient: + def __init__(self, auth: Auth, hostname: str) -> None: + self._api_client = ApiClient(auth=auth, hostname=hostname) + + @validate_call + @handle_unexpected + def get( + self, + dataset_rid: DatasetRid, + stream_branch_name: BranchName, + *, + preview: Optional[PreviewMode] = None, + request_timeout: Optional[Annotated[StrictInt, Field(gt=0)]] = None, + ) -> Stream: + """ + Get a stream by its branch name. If the branch does not exist, there is no stream on that branch, or the + user does not have permission to access the stream, a 404 error will be returned. + + :param dataset_rid: datasetRid + :type dataset_rid: DatasetRid + :param stream_branch_name: streamBranchName + :type stream_branch_name: BranchName + :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: Stream + """ + + return self._api_client.call_api( + RequestInfo( + method="GET", + resource_path="/v2/streams/datasets/{datasetRid}/streams/{streamBranchName}", + query_params={ + "preview": preview, + }, + path_params={ + "datasetRid": dataset_rid, + "streamBranchName": stream_branch_name, + }, + header_params={ + "Accept": "application/json", + }, + body=None, + body_type=None, + response_type=Stream, + request_timeout=request_timeout, + ), + ) diff --git a/tests/test_discriminators.py b/tests/test_discriminators.py index 6aafe064..5488f8e8 100644 --- a/tests/test_discriminators.py +++ b/tests/test_discriminators.py @@ -26,9 +26,11 @@ from foundry.v2.core import models as models_core_v2 from foundry.v2.datasets import models as models_datasets_v2 from foundry.v2.filesystem import models as models_filesystem_v2 +from foundry.v2.functions import models as models_functions_v2 from foundry.v2.geo import models as models_geo_v2 from foundry.v2.ontologies import models as models_ontologies_v2 from foundry.v2.orchestration import models as models_orchestration_v2 +from foundry.v2.streams import models as models_streams_v2 from foundry.v2.third_party_applications import models as models_third_party_applications_v2 # NOQA @@ -47,10 +49,12 @@ def test_can_validate_types(): *[(models_core_v2, model_name) for model_name in dir(models_core_v2)], *[(models_datasets_v2, model_name) for model_name in dir(models_datasets_v2)], *[(models_filesystem_v2, model_name) for model_name in dir(models_filesystem_v2)], + *[(models_functions_v2, model_name) for model_name in dir(models_functions_v2)], *[(models_geo_v2, model_name) for model_name in dir(models_geo_v2)], *[(models_ontologies_v2, model_name) for model_name in dir(models_ontologies_v2)], *[(models_ontologies_v2, model_name) for model_name in dir(models_ontologies_v2)], *[(models_orchestration_v2, model_name) for model_name in dir(models_orchestration_v2)], + *[(models_streams_v2, model_name) for model_name in dir(models_streams_v2)], *[ (models_third_party_applications_v2, model_name) for model_name in dir(models_third_party_applications_v2)