trieve_ruby_client 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +240 -0
- data/Rakefile +10 -0
- data/docs/AddChunkToGroupData.md +18 -0
- data/docs/ApiKeyDTO.md +28 -0
- data/docs/AuthApi.md +274 -0
- data/docs/BookmarkData.md +22 -0
- data/docs/BookmarkGroupResult.md +20 -0
- data/docs/ChatMessageProxy.md +20 -0
- data/docs/ChunkApi.md +955 -0
- data/docs/ChunkFilter.md +22 -0
- data/docs/ChunkGroup.md +30 -0
- data/docs/ChunkGroupAndFile.md +32 -0
- data/docs/ChunkGroupApi.md +1262 -0
- data/docs/ChunkMetadata.md +42 -0
- data/docs/ChunkMetadataWithFileData.md +44 -0
- data/docs/ClientDatasetConfiguration.md +38 -0
- data/docs/CreateChunkData.md +42 -0
- data/docs/CreateChunkGroupData.md +22 -0
- data/docs/CreateDatasetRequest.md +24 -0
- data/docs/CreateMessageData.md +28 -0
- data/docs/CreateOrganizationData.md +18 -0
- data/docs/CreateTopicData.md +22 -0
- data/docs/Dataset.md +30 -0
- data/docs/DatasetAndUsage.md +20 -0
- data/docs/DatasetApi.md +480 -0
- data/docs/DatasetDTO.md +28 -0
- data/docs/DatasetUsageCount.md +22 -0
- data/docs/DeleteDatasetRequest.md +18 -0
- data/docs/DeleteTopicData.md +18 -0
- data/docs/DeleteUserApiKeyRequest.md +18 -0
- data/docs/EditMessageData.md +30 -0
- data/docs/ErrorResponseBody.md +18 -0
- data/docs/Event.md +28 -0
- data/docs/EventReturn.md +20 -0
- data/docs/EventsApi.md +86 -0
- data/docs/FieldCondition.md +22 -0
- data/docs/File.md +36 -0
- data/docs/FileApi.md +326 -0
- data/docs/FileDTO.md +32 -0
- data/docs/GenerateChunksRequest.md +26 -0
- data/docs/GetGroupsForChunksData.md +18 -0
- data/docs/GroupData.md +20 -0
- data/docs/GroupScoreChunkDTO.md +20 -0
- data/docs/HealthApi.md +66 -0
- data/docs/InvitationApi.md +85 -0
- data/docs/InvitationData.md +26 -0
- data/docs/MatchCondition.md +49 -0
- data/docs/Message.md +38 -0
- data/docs/MessageApi.md +322 -0
- data/docs/Organization.md +26 -0
- data/docs/OrganizationApi.md +479 -0
- data/docs/OrganizationUsageCount.md +28 -0
- data/docs/Range.md +24 -0
- data/docs/ReccomendGroupChunksRequest.md +30 -0
- data/docs/RecommendChunksRequest.md +28 -0
- data/docs/RegenerateMessageData.md +26 -0
- data/docs/ReturnQueuedChunk.md +20 -0
- data/docs/ScoreChunkDTO.md +20 -0
- data/docs/SearchChunkData.md +38 -0
- data/docs/SearchChunkQueryResponseBody.md +20 -0
- data/docs/SearchGroupsResult.md +22 -0
- data/docs/SearchOverGroupsData.md +36 -0
- data/docs/SearchOverGroupsResponseBody.md +20 -0
- data/docs/SearchWithinGroupData.md +40 -0
- data/docs/SetUserApiKeyRequest.md +20 -0
- data/docs/SetUserApiKeyResponse.md +18 -0
- data/docs/SlimGroup.md +24 -0
- data/docs/SlimUser.md +32 -0
- data/docs/StripeApi.md +285 -0
- data/docs/StripePlan.md +38 -0
- data/docs/StripeSubscription.md +30 -0
- data/docs/SuggestedQueriesRequest.md +18 -0
- data/docs/SuggestedQueriesResponse.md +18 -0
- data/docs/Topic.md +30 -0
- data/docs/TopicApi.md +321 -0
- data/docs/UpdateChunkByTrackingIdData.md +32 -0
- data/docs/UpdateChunkData.md +34 -0
- data/docs/UpdateChunkGroupData.md +24 -0
- data/docs/UpdateDatasetRequest.md +24 -0
- data/docs/UpdateGroupByTrackingIDData.md +22 -0
- data/docs/UpdateOrganizationData.md +20 -0
- data/docs/UpdateTopicData.md +20 -0
- data/docs/UpdateUserData.md +30 -0
- data/docs/UploadFileData.md +34 -0
- data/docs/UploadFileResult.md +18 -0
- data/docs/UserApi.md +238 -0
- data/docs/UserOrganization.md +28 -0
- data/git_push.sh +57 -0
- data/lib/trieve_ruby_client/api/auth_api.rb +262 -0
- data/lib/trieve_ruby_client/api/chunk_api.rb +906 -0
- data/lib/trieve_ruby_client/api/chunk_group_api.rb +1230 -0
- data/lib/trieve_ruby_client/api/dataset_api.rb +458 -0
- data/lib/trieve_ruby_client/api/events_api.rb +92 -0
- data/lib/trieve_ruby_client/api/file_api.rb +324 -0
- data/lib/trieve_ruby_client/api/health_api.rb +75 -0
- data/lib/trieve_ruby_client/api/invitation_api.rb +97 -0
- data/lib/trieve_ruby_client/api/message_api.rb +317 -0
- data/lib/trieve_ruby_client/api/organization_api.rb +445 -0
- data/lib/trieve_ruby_client/api/stripe_api.rb +278 -0
- data/lib/trieve_ruby_client/api/topic_api.rb +317 -0
- data/lib/trieve_ruby_client/api/user_api.rb +226 -0
- data/lib/trieve_ruby_client/api_client.rb +394 -0
- data/lib/trieve_ruby_client/api_error.rb +58 -0
- data/lib/trieve_ruby_client/configuration.rb +305 -0
- data/lib/trieve_ruby_client/models/add_chunk_to_group_data.rb +222 -0
- data/lib/trieve_ruby_client/models/api_key_dto.rb +301 -0
- data/lib/trieve_ruby_client/models/bookmark_data.rb +255 -0
- data/lib/trieve_ruby_client/models/bookmark_group_result.rb +239 -0
- data/lib/trieve_ruby_client/models/chat_message_proxy.rb +237 -0
- data/lib/trieve_ruby_client/models/chunk_filter.rb +244 -0
- data/lib/trieve_ruby_client/models/chunk_group.rb +311 -0
- data/lib/trieve_ruby_client/models/chunk_group_and_file.rb +321 -0
- data/lib/trieve_ruby_client/models/chunk_metadata.rb +371 -0
- data/lib/trieve_ruby_client/models/chunk_metadata_with_file_data.rb +381 -0
- data/lib/trieve_ruby_client/models/client_dataset_configuration.rb +336 -0
- data/lib/trieve_ruby_client/models/create_chunk_data.rb +356 -0
- data/lib/trieve_ruby_client/models/create_chunk_group_data.rb +250 -0
- data/lib/trieve_ruby_client/models/create_dataset_request.rb +265 -0
- data/lib/trieve_ruby_client/models/create_message_data.rb +285 -0
- data/lib/trieve_ruby_client/models/create_organization_data.rb +222 -0
- data/lib/trieve_ruby_client/models/create_topic_data.rb +238 -0
- data/lib/trieve_ruby_client/models/dataset.rb +309 -0
- data/lib/trieve_ruby_client/models/dataset_and_usage.rb +237 -0
- data/lib/trieve_ruby_client/models/dataset_dto.rb +297 -0
- data/lib/trieve_ruby_client/models/dataset_usage_count.rb +253 -0
- data/lib/trieve_ruby_client/models/delete_dataset_request.rb +222 -0
- data/lib/trieve_ruby_client/models/delete_topic_data.rb +222 -0
- data/lib/trieve_ruby_client/models/delete_user_api_key_request.rb +222 -0
- data/lib/trieve_ruby_client/models/edit_message_data.rb +302 -0
- data/lib/trieve_ruby_client/models/error_response_body.rb +221 -0
- data/lib/trieve_ruby_client/models/event.rb +297 -0
- data/lib/trieve_ruby_client/models/event_return.rb +239 -0
- data/lib/trieve_ruby_client/models/field_condition.rb +245 -0
- data/lib/trieve_ruby_client/models/file.rb +341 -0
- data/lib/trieve_ruby_client/models/file_dto.rb +321 -0
- data/lib/trieve_ruby_client/models/generate_chunks_request.rb +276 -0
- data/lib/trieve_ruby_client/models/get_groups_for_chunks_data.rb +223 -0
- data/lib/trieve_ruby_client/models/group_data.rb +239 -0
- data/lib/trieve_ruby_client/models/group_score_chunk_dto.rb +239 -0
- data/lib/trieve_ruby_client/models/invitation_data.rb +290 -0
- data/lib/trieve_ruby_client/models/match_condition.rb +105 -0
- data/lib/trieve_ruby_client/models/message.rb +369 -0
- data/lib/trieve_ruby_client/models/organization.rb +279 -0
- data/lib/trieve_ruby_client/models/organization_usage_count.rb +301 -0
- data/lib/trieve_ruby_client/models/range.rb +245 -0
- data/lib/trieve_ruby_client/models/reccomend_group_chunks_request.rb +319 -0
- data/lib/trieve_ruby_client/models/recommend_chunks_request.rb +293 -0
- data/lib/trieve_ruby_client/models/regenerate_message_data.rb +268 -0
- data/lib/trieve_ruby_client/models/return_queued_chunk.rb +237 -0
- data/lib/trieve_ruby_client/models/score_chunk_dto.rb +239 -0
- data/lib/trieve_ruby_client/models/search_chunk_data.rb +369 -0
- data/lib/trieve_ruby_client/models/search_chunk_query_response_body.rb +239 -0
- data/lib/trieve_ruby_client/models/search_groups_result.rb +255 -0
- data/lib/trieve_ruby_client/models/search_over_groups_data.rb +372 -0
- data/lib/trieve_ruby_client/models/search_over_groups_response_body.rb +239 -0
- data/lib/trieve_ruby_client/models/search_within_group_data.rb +380 -0
- data/lib/trieve_ruby_client/models/set_user_api_key_request.rb +239 -0
- data/lib/trieve_ruby_client/models/set_user_api_key_response.rb +222 -0
- data/lib/trieve_ruby_client/models/slim_group.rb +269 -0
- data/lib/trieve_ruby_client/models/slim_user.rb +319 -0
- data/lib/trieve_ruby_client/models/stripe_plan.rb +381 -0
- data/lib/trieve_ruby_client/models/stripe_subscription.rb +311 -0
- data/lib/trieve_ruby_client/models/suggested_queries_request.rb +222 -0
- data/lib/trieve_ruby_client/models/suggested_queries_response.rb +223 -0
- data/lib/trieve_ruby_client/models/topic.rb +317 -0
- data/lib/trieve_ruby_client/models/update_chunk_by_tracking_id_data.rb +303 -0
- data/lib/trieve_ruby_client/models/update_chunk_data.rb +308 -0
- data/lib/trieve_ruby_client/models/update_chunk_group_data.rb +249 -0
- data/lib/trieve_ruby_client/models/update_dataset_request.rb +255 -0
- data/lib/trieve_ruby_client/models/update_group_by_tracking_id_data.rb +244 -0
- data/lib/trieve_ruby_client/models/update_organization_data.rb +233 -0
- data/lib/trieve_ruby_client/models/update_topic_data.rb +239 -0
- data/lib/trieve_ruby_client/models/update_user_data.rb +288 -0
- data/lib/trieve_ruby_client/models/upload_file_data.rb +324 -0
- data/lib/trieve_ruby_client/models/upload_file_result.rb +221 -0
- data/lib/trieve_ruby_client/models/user_organization.rb +301 -0
- data/lib/trieve_ruby_client/version.rb +15 -0
- data/lib/trieve_ruby_client.rb +124 -0
- data/openapi-generator.yaml +9 -0
- data/openapi.json +6530 -0
- data/openapitools.json +7 -0
- data/spec/api/auth_api_spec.rb +82 -0
- data/spec/api/chunk_api_spec.rb +191 -0
- data/spec/api/chunk_group_api_spec.rb +242 -0
- data/spec/api/dataset_api_spec.rb +113 -0
- data/spec/api/events_api_spec.rb +48 -0
- data/spec/api/file_api_spec.rb +89 -0
- data/spec/api/health_api_spec.rb +44 -0
- data/spec/api/invitation_api_spec.rb +48 -0
- data/spec/api/message_api_spec.rb +87 -0
- data/spec/api/organization_api_spec.rb +112 -0
- data/spec/api/stripe_api_spec.rb +78 -0
- data/spec/api/topic_api_spec.rb +87 -0
- data/spec/api/user_api_spec.rb +71 -0
- data/spec/models/add_chunk_to_group_data_spec.rb +36 -0
- data/spec/models/api_key_dto_spec.rb +66 -0
- data/spec/models/bookmark_data_spec.rb +48 -0
- data/spec/models/bookmark_group_result_spec.rb +42 -0
- data/spec/models/chat_message_proxy_spec.rb +42 -0
- data/spec/models/chunk_filter_spec.rb +48 -0
- data/spec/models/chunk_group_and_file_spec.rb +78 -0
- data/spec/models/chunk_group_spec.rb +72 -0
- data/spec/models/chunk_metadata_spec.rb +108 -0
- data/spec/models/chunk_metadata_with_file_data_spec.rb +114 -0
- data/spec/models/client_dataset_configuration_spec.rb +96 -0
- data/spec/models/create_chunk_data_spec.rb +108 -0
- data/spec/models/create_chunk_group_data_spec.rb +48 -0
- data/spec/models/create_dataset_request_spec.rb +54 -0
- data/spec/models/create_message_data_spec.rb +66 -0
- data/spec/models/create_organization_data_spec.rb +36 -0
- data/spec/models/create_topic_data_spec.rb +48 -0
- data/spec/models/dataset_and_usage_spec.rb +42 -0
- data/spec/models/dataset_dto_spec.rb +66 -0
- data/spec/models/dataset_spec.rb +72 -0
- data/spec/models/dataset_usage_count_spec.rb +48 -0
- data/spec/models/delete_dataset_request_spec.rb +36 -0
- data/spec/models/delete_topic_data_spec.rb +36 -0
- data/spec/models/delete_user_api_key_request_spec.rb +36 -0
- data/spec/models/edit_message_data_spec.rb +72 -0
- data/spec/models/error_response_body_spec.rb +36 -0
- data/spec/models/event_return_spec.rb +42 -0
- data/spec/models/event_spec.rb +66 -0
- data/spec/models/field_condition_spec.rb +48 -0
- data/spec/models/file_dto_spec.rb +78 -0
- data/spec/models/file_spec.rb +90 -0
- data/spec/models/generate_chunks_request_spec.rb +60 -0
- data/spec/models/get_groups_for_chunks_data_spec.rb +36 -0
- data/spec/models/group_data_spec.rb +42 -0
- data/spec/models/group_score_chunk_dto_spec.rb +42 -0
- data/spec/models/invitation_data_spec.rb +60 -0
- data/spec/models/match_condition_spec.rb +32 -0
- data/spec/models/message_spec.rb +96 -0
- data/spec/models/organization_spec.rb +60 -0
- data/spec/models/organization_usage_count_spec.rb +66 -0
- data/spec/models/range_spec.rb +54 -0
- data/spec/models/reccomend_group_chunks_request_spec.rb +72 -0
- data/spec/models/recommend_chunks_request_spec.rb +66 -0
- data/spec/models/regenerate_message_data_spec.rb +60 -0
- data/spec/models/return_queued_chunk_spec.rb +42 -0
- data/spec/models/score_chunk_dto_spec.rb +42 -0
- data/spec/models/search_chunk_data_spec.rb +96 -0
- data/spec/models/search_chunk_query_response_body_spec.rb +42 -0
- data/spec/models/search_groups_result_spec.rb +48 -0
- data/spec/models/search_over_groups_data_spec.rb +90 -0
- data/spec/models/search_over_groups_response_body_spec.rb +42 -0
- data/spec/models/search_within_group_data_spec.rb +102 -0
- data/spec/models/set_user_api_key_request_spec.rb +42 -0
- data/spec/models/set_user_api_key_response_spec.rb +36 -0
- data/spec/models/slim_group_spec.rb +54 -0
- data/spec/models/slim_user_spec.rb +78 -0
- data/spec/models/stripe_plan_spec.rb +96 -0
- data/spec/models/stripe_subscription_spec.rb +72 -0
- data/spec/models/suggested_queries_request_spec.rb +36 -0
- data/spec/models/suggested_queries_response_spec.rb +36 -0
- data/spec/models/topic_spec.rb +72 -0
- data/spec/models/update_chunk_by_tracking_id_data_spec.rb +66 -0
- data/spec/models/update_chunk_data_spec.rb +72 -0
- data/spec/models/update_chunk_group_data_spec.rb +48 -0
- data/spec/models/update_dataset_request_spec.rb +54 -0
- data/spec/models/update_group_by_tracking_id_data_spec.rb +48 -0
- data/spec/models/update_organization_data_spec.rb +42 -0
- data/spec/models/update_topic_data_spec.rb +42 -0
- data/spec/models/update_user_data_spec.rb +72 -0
- data/spec/models/upload_file_data_spec.rb +84 -0
- data/spec/models/upload_file_result_spec.rb +36 -0
- data/spec/models/user_organization_spec.rb +66 -0
- data/spec/spec_helper.rb +111 -0
- data/trieve_ruby_client.gemspec +39 -0
- metadata +439 -0
@@ -0,0 +1,458 @@
|
|
1
|
+
=begin
|
2
|
+
#Trieve API
|
3
|
+
|
4
|
+
#Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.3.4
|
7
|
+
Contact: developers@trieve.ai
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module TrieveRubyClient
|
16
|
+
class DatasetApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# create_dataset
|
23
|
+
# create_dataset Create a new dataset. The auth'ed user must be an owner of the organization to create a dataset.
|
24
|
+
# @param tr_organization [String] The organization id to use for the request
|
25
|
+
# @param create_dataset_request [CreateDatasetRequest] JSON request payload to create a new dataset
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [Dataset]
|
28
|
+
def create_dataset(tr_organization, create_dataset_request, opts = {})
|
29
|
+
data, _status_code, _headers = create_dataset_with_http_info(tr_organization, create_dataset_request, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# create_dataset
|
34
|
+
# create_dataset Create a new dataset. The auth'ed user must be an owner of the organization to create a dataset.
|
35
|
+
# @param tr_organization [String] The organization id to use for the request
|
36
|
+
# @param create_dataset_request [CreateDatasetRequest] JSON request payload to create a new dataset
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(Dataset, Integer, Hash)>] Dataset data, response status code and response headers
|
39
|
+
def create_dataset_with_http_info(tr_organization, create_dataset_request, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: DatasetApi.create_dataset ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'tr_organization' is set
|
44
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling DatasetApi.create_dataset"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'create_dataset_request' is set
|
48
|
+
if @api_client.config.client_side_validation && create_dataset_request.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'create_dataset_request' when calling DatasetApi.create_dataset"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/api/dataset'
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
63
|
+
if !content_type.nil?
|
64
|
+
header_params['Content-Type'] = content_type
|
65
|
+
end
|
66
|
+
header_params[:'TR-Organization'] = tr_organization
|
67
|
+
|
68
|
+
# form parameters
|
69
|
+
form_params = opts[:form_params] || {}
|
70
|
+
|
71
|
+
# http body (model)
|
72
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_dataset_request)
|
73
|
+
|
74
|
+
# return_type
|
75
|
+
return_type = opts[:debug_return_type] || 'Dataset'
|
76
|
+
|
77
|
+
# auth_names
|
78
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
79
|
+
|
80
|
+
new_options = opts.merge(
|
81
|
+
:operation => :"DatasetApi.create_dataset",
|
82
|
+
:header_params => header_params,
|
83
|
+
:query_params => query_params,
|
84
|
+
:form_params => form_params,
|
85
|
+
:body => post_body,
|
86
|
+
:auth_names => auth_names,
|
87
|
+
:return_type => return_type
|
88
|
+
)
|
89
|
+
|
90
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
91
|
+
if @api_client.config.debugging
|
92
|
+
@api_client.config.logger.debug "API called: DatasetApi#create_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
+
end
|
94
|
+
return data, status_code, headers
|
95
|
+
end
|
96
|
+
|
97
|
+
# delete_dataset
|
98
|
+
# delete_dataset Delete a dataset. The auth'ed user must be an owner of the organization to delete a dataset.
|
99
|
+
# @param tr_organization [String] The organization id to use for the request
|
100
|
+
# @param delete_dataset_request [DeleteDatasetRequest] JSON request payload to delete a dataset
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @return [nil]
|
103
|
+
def delete_dataset(tr_organization, delete_dataset_request, opts = {})
|
104
|
+
delete_dataset_with_http_info(tr_organization, delete_dataset_request, opts)
|
105
|
+
nil
|
106
|
+
end
|
107
|
+
|
108
|
+
# delete_dataset
|
109
|
+
# delete_dataset Delete a dataset. The auth'ed user must be an owner of the organization to delete a dataset.
|
110
|
+
# @param tr_organization [String] The organization id to use for the request
|
111
|
+
# @param delete_dataset_request [DeleteDatasetRequest] JSON request payload to delete a dataset
|
112
|
+
# @param [Hash] opts the optional parameters
|
113
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
114
|
+
def delete_dataset_with_http_info(tr_organization, delete_dataset_request, opts = {})
|
115
|
+
if @api_client.config.debugging
|
116
|
+
@api_client.config.logger.debug 'Calling API: DatasetApi.delete_dataset ...'
|
117
|
+
end
|
118
|
+
# verify the required parameter 'tr_organization' is set
|
119
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
120
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling DatasetApi.delete_dataset"
|
121
|
+
end
|
122
|
+
# verify the required parameter 'delete_dataset_request' is set
|
123
|
+
if @api_client.config.client_side_validation && delete_dataset_request.nil?
|
124
|
+
fail ArgumentError, "Missing the required parameter 'delete_dataset_request' when calling DatasetApi.delete_dataset"
|
125
|
+
end
|
126
|
+
# resource path
|
127
|
+
local_var_path = '/api/dataset'
|
128
|
+
|
129
|
+
# query parameters
|
130
|
+
query_params = opts[:query_params] || {}
|
131
|
+
|
132
|
+
# header parameters
|
133
|
+
header_params = opts[:header_params] || {}
|
134
|
+
# HTTP header 'Accept' (if needed)
|
135
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
136
|
+
# HTTP header 'Content-Type'
|
137
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
138
|
+
if !content_type.nil?
|
139
|
+
header_params['Content-Type'] = content_type
|
140
|
+
end
|
141
|
+
header_params[:'TR-Organization'] = tr_organization
|
142
|
+
|
143
|
+
# form parameters
|
144
|
+
form_params = opts[:form_params] || {}
|
145
|
+
|
146
|
+
# http body (model)
|
147
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(delete_dataset_request)
|
148
|
+
|
149
|
+
# return_type
|
150
|
+
return_type = opts[:debug_return_type]
|
151
|
+
|
152
|
+
# auth_names
|
153
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
154
|
+
|
155
|
+
new_options = opts.merge(
|
156
|
+
:operation => :"DatasetApi.delete_dataset",
|
157
|
+
:header_params => header_params,
|
158
|
+
:query_params => query_params,
|
159
|
+
:form_params => form_params,
|
160
|
+
:body => post_body,
|
161
|
+
:auth_names => auth_names,
|
162
|
+
:return_type => return_type
|
163
|
+
)
|
164
|
+
|
165
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug "API called: DatasetApi#delete_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
168
|
+
end
|
169
|
+
return data, status_code, headers
|
170
|
+
end
|
171
|
+
|
172
|
+
# get_client_dataset_config
|
173
|
+
# get_client_dataset_config Get the client configuration for a dataset. Will use the TR-D
|
174
|
+
# @param tr_dataset [String] The dataset id to use for the request
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @return [ClientDatasetConfiguration]
|
177
|
+
def get_client_dataset_config(tr_dataset, opts = {})
|
178
|
+
data, _status_code, _headers = get_client_dataset_config_with_http_info(tr_dataset, opts)
|
179
|
+
data
|
180
|
+
end
|
181
|
+
|
182
|
+
# get_client_dataset_config
|
183
|
+
# get_client_dataset_config Get the client configuration for a dataset. Will use the TR-D
|
184
|
+
# @param tr_dataset [String] The dataset id to use for the request
|
185
|
+
# @param [Hash] opts the optional parameters
|
186
|
+
# @return [Array<(ClientDatasetConfiguration, Integer, Hash)>] ClientDatasetConfiguration data, response status code and response headers
|
187
|
+
def get_client_dataset_config_with_http_info(tr_dataset, opts = {})
|
188
|
+
if @api_client.config.debugging
|
189
|
+
@api_client.config.logger.debug 'Calling API: DatasetApi.get_client_dataset_config ...'
|
190
|
+
end
|
191
|
+
# verify the required parameter 'tr_dataset' is set
|
192
|
+
if @api_client.config.client_side_validation && tr_dataset.nil?
|
193
|
+
fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling DatasetApi.get_client_dataset_config"
|
194
|
+
end
|
195
|
+
# resource path
|
196
|
+
local_var_path = '/api/dataset/envs'
|
197
|
+
|
198
|
+
# query parameters
|
199
|
+
query_params = opts[:query_params] || {}
|
200
|
+
|
201
|
+
# header parameters
|
202
|
+
header_params = opts[:header_params] || {}
|
203
|
+
# HTTP header 'Accept' (if needed)
|
204
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
205
|
+
header_params[:'TR-Dataset'] = tr_dataset
|
206
|
+
|
207
|
+
# form parameters
|
208
|
+
form_params = opts[:form_params] || {}
|
209
|
+
|
210
|
+
# http body (model)
|
211
|
+
post_body = opts[:debug_body]
|
212
|
+
|
213
|
+
# return_type
|
214
|
+
return_type = opts[:debug_return_type] || 'ClientDatasetConfiguration'
|
215
|
+
|
216
|
+
# auth_names
|
217
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
218
|
+
|
219
|
+
new_options = opts.merge(
|
220
|
+
:operation => :"DatasetApi.get_client_dataset_config",
|
221
|
+
:header_params => header_params,
|
222
|
+
:query_params => query_params,
|
223
|
+
:form_params => form_params,
|
224
|
+
:body => post_body,
|
225
|
+
:auth_names => auth_names,
|
226
|
+
:return_type => return_type
|
227
|
+
)
|
228
|
+
|
229
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
230
|
+
if @api_client.config.debugging
|
231
|
+
@api_client.config.logger.debug "API called: DatasetApi#get_client_dataset_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
232
|
+
end
|
233
|
+
return data, status_code, headers
|
234
|
+
end
|
235
|
+
|
236
|
+
# get_dataset
|
237
|
+
# get_dataset Get a dataset by id. The auth'ed user must be an admin or owner of the organization to get a dataset.
|
238
|
+
# @param tr_organization [String] The organization id to use for the request
|
239
|
+
# @param tr_dataset [String] The dataset id to use for the request
|
240
|
+
# @param dataset_id [String] The id of the dataset you want to retrieve.
|
241
|
+
# @param [Hash] opts the optional parameters
|
242
|
+
# @return [Dataset]
|
243
|
+
def get_dataset(tr_organization, tr_dataset, dataset_id, opts = {})
|
244
|
+
data, _status_code, _headers = get_dataset_with_http_info(tr_organization, tr_dataset, dataset_id, opts)
|
245
|
+
data
|
246
|
+
end
|
247
|
+
|
248
|
+
# get_dataset
|
249
|
+
# get_dataset Get a dataset by id. The auth'ed user must be an admin or owner of the organization to get a dataset.
|
250
|
+
# @param tr_organization [String] The organization id to use for the request
|
251
|
+
# @param tr_dataset [String] The dataset id to use for the request
|
252
|
+
# @param dataset_id [String] The id of the dataset you want to retrieve.
|
253
|
+
# @param [Hash] opts the optional parameters
|
254
|
+
# @return [Array<(Dataset, Integer, Hash)>] Dataset data, response status code and response headers
|
255
|
+
def get_dataset_with_http_info(tr_organization, tr_dataset, dataset_id, opts = {})
|
256
|
+
if @api_client.config.debugging
|
257
|
+
@api_client.config.logger.debug 'Calling API: DatasetApi.get_dataset ...'
|
258
|
+
end
|
259
|
+
# verify the required parameter 'tr_organization' is set
|
260
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
261
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling DatasetApi.get_dataset"
|
262
|
+
end
|
263
|
+
# verify the required parameter 'tr_dataset' is set
|
264
|
+
if @api_client.config.client_side_validation && tr_dataset.nil?
|
265
|
+
fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling DatasetApi.get_dataset"
|
266
|
+
end
|
267
|
+
# verify the required parameter 'dataset_id' is set
|
268
|
+
if @api_client.config.client_side_validation && dataset_id.nil?
|
269
|
+
fail ArgumentError, "Missing the required parameter 'dataset_id' when calling DatasetApi.get_dataset"
|
270
|
+
end
|
271
|
+
# resource path
|
272
|
+
local_var_path = '/api/dataset/{dataset_id}'.sub('{' + 'dataset_id' + '}', CGI.escape(dataset_id.to_s))
|
273
|
+
|
274
|
+
# query parameters
|
275
|
+
query_params = opts[:query_params] || {}
|
276
|
+
|
277
|
+
# header parameters
|
278
|
+
header_params = opts[:header_params] || {}
|
279
|
+
# HTTP header 'Accept' (if needed)
|
280
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
281
|
+
header_params[:'TR-Organization'] = tr_organization
|
282
|
+
header_params[:'TR-Dataset'] = tr_dataset
|
283
|
+
|
284
|
+
# form parameters
|
285
|
+
form_params = opts[:form_params] || {}
|
286
|
+
|
287
|
+
# http body (model)
|
288
|
+
post_body = opts[:debug_body]
|
289
|
+
|
290
|
+
# return_type
|
291
|
+
return_type = opts[:debug_return_type] || 'Dataset'
|
292
|
+
|
293
|
+
# auth_names
|
294
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
295
|
+
|
296
|
+
new_options = opts.merge(
|
297
|
+
:operation => :"DatasetApi.get_dataset",
|
298
|
+
:header_params => header_params,
|
299
|
+
:query_params => query_params,
|
300
|
+
:form_params => form_params,
|
301
|
+
:body => post_body,
|
302
|
+
:auth_names => auth_names,
|
303
|
+
:return_type => return_type
|
304
|
+
)
|
305
|
+
|
306
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
307
|
+
if @api_client.config.debugging
|
308
|
+
@api_client.config.logger.debug "API called: DatasetApi#get_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
309
|
+
end
|
310
|
+
return data, status_code, headers
|
311
|
+
end
|
312
|
+
|
313
|
+
# get_organization_datasets
|
314
|
+
# get_organization_datasets Get all datasets for an organization. The auth'ed user must be an admin or owner of the organization to get its datasets.
|
315
|
+
# @param tr_organization [String] The organization id to use for the request
|
316
|
+
# @param organization_id [String] id of the organization you want to retrieve datasets for
|
317
|
+
# @param [Hash] opts the optional parameters
|
318
|
+
# @return [Array<DatasetAndUsage>]
|
319
|
+
def get_datasets_from_organization(tr_organization, organization_id, opts = {})
|
320
|
+
data, _status_code, _headers = get_datasets_from_organization_with_http_info(tr_organization, organization_id, opts)
|
321
|
+
data
|
322
|
+
end
|
323
|
+
|
324
|
+
# get_organization_datasets
|
325
|
+
# get_organization_datasets Get all datasets for an organization. The auth'ed user must be an admin or owner of the organization to get its datasets.
|
326
|
+
# @param tr_organization [String] The organization id to use for the request
|
327
|
+
# @param organization_id [String] id of the organization you want to retrieve datasets for
|
328
|
+
# @param [Hash] opts the optional parameters
|
329
|
+
# @return [Array<(Array<DatasetAndUsage>, Integer, Hash)>] Array<DatasetAndUsage> data, response status code and response headers
|
330
|
+
def get_datasets_from_organization_with_http_info(tr_organization, organization_id, opts = {})
|
331
|
+
if @api_client.config.debugging
|
332
|
+
@api_client.config.logger.debug 'Calling API: DatasetApi.get_datasets_from_organization ...'
|
333
|
+
end
|
334
|
+
# verify the required parameter 'tr_organization' is set
|
335
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
336
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling DatasetApi.get_datasets_from_organization"
|
337
|
+
end
|
338
|
+
# verify the required parameter 'organization_id' is set
|
339
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
340
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling DatasetApi.get_datasets_from_organization"
|
341
|
+
end
|
342
|
+
# resource path
|
343
|
+
local_var_path = '/api/dataset/organization/{organization_id}'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))
|
344
|
+
|
345
|
+
# query parameters
|
346
|
+
query_params = opts[:query_params] || {}
|
347
|
+
|
348
|
+
# header parameters
|
349
|
+
header_params = opts[:header_params] || {}
|
350
|
+
# HTTP header 'Accept' (if needed)
|
351
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
352
|
+
header_params[:'TR-Organization'] = tr_organization
|
353
|
+
|
354
|
+
# form parameters
|
355
|
+
form_params = opts[:form_params] || {}
|
356
|
+
|
357
|
+
# http body (model)
|
358
|
+
post_body = opts[:debug_body]
|
359
|
+
|
360
|
+
# return_type
|
361
|
+
return_type = opts[:debug_return_type] || 'Array<DatasetAndUsage>'
|
362
|
+
|
363
|
+
# auth_names
|
364
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
365
|
+
|
366
|
+
new_options = opts.merge(
|
367
|
+
:operation => :"DatasetApi.get_datasets_from_organization",
|
368
|
+
:header_params => header_params,
|
369
|
+
:query_params => query_params,
|
370
|
+
:form_params => form_params,
|
371
|
+
:body => post_body,
|
372
|
+
:auth_names => auth_names,
|
373
|
+
:return_type => return_type
|
374
|
+
)
|
375
|
+
|
376
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
377
|
+
if @api_client.config.debugging
|
378
|
+
@api_client.config.logger.debug "API called: DatasetApi#get_datasets_from_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
379
|
+
end
|
380
|
+
return data, status_code, headers
|
381
|
+
end
|
382
|
+
|
383
|
+
# update_dataset
|
384
|
+
# update_dataset Update a dataset. The auth'ed user must be an owner of the organization to update a dataset.
|
385
|
+
# @param tr_organization [String] The organization id to use for the request
|
386
|
+
# @param update_dataset_request [UpdateDatasetRequest] JSON request payload to update a dataset
|
387
|
+
# @param [Hash] opts the optional parameters
|
388
|
+
# @return [Dataset]
|
389
|
+
def update_dataset(tr_organization, update_dataset_request, opts = {})
|
390
|
+
data, _status_code, _headers = update_dataset_with_http_info(tr_organization, update_dataset_request, opts)
|
391
|
+
data
|
392
|
+
end
|
393
|
+
|
394
|
+
# update_dataset
|
395
|
+
# update_dataset Update a dataset. The auth'ed user must be an owner of the organization to update a dataset.
|
396
|
+
# @param tr_organization [String] The organization id to use for the request
|
397
|
+
# @param update_dataset_request [UpdateDatasetRequest] JSON request payload to update a dataset
|
398
|
+
# @param [Hash] opts the optional parameters
|
399
|
+
# @return [Array<(Dataset, Integer, Hash)>] Dataset data, response status code and response headers
|
400
|
+
def update_dataset_with_http_info(tr_organization, update_dataset_request, opts = {})
|
401
|
+
if @api_client.config.debugging
|
402
|
+
@api_client.config.logger.debug 'Calling API: DatasetApi.update_dataset ...'
|
403
|
+
end
|
404
|
+
# verify the required parameter 'tr_organization' is set
|
405
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
406
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling DatasetApi.update_dataset"
|
407
|
+
end
|
408
|
+
# verify the required parameter 'update_dataset_request' is set
|
409
|
+
if @api_client.config.client_side_validation && update_dataset_request.nil?
|
410
|
+
fail ArgumentError, "Missing the required parameter 'update_dataset_request' when calling DatasetApi.update_dataset"
|
411
|
+
end
|
412
|
+
# resource path
|
413
|
+
local_var_path = '/api/dataset'
|
414
|
+
|
415
|
+
# query parameters
|
416
|
+
query_params = opts[:query_params] || {}
|
417
|
+
|
418
|
+
# header parameters
|
419
|
+
header_params = opts[:header_params] || {}
|
420
|
+
# HTTP header 'Accept' (if needed)
|
421
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
422
|
+
# HTTP header 'Content-Type'
|
423
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
424
|
+
if !content_type.nil?
|
425
|
+
header_params['Content-Type'] = content_type
|
426
|
+
end
|
427
|
+
header_params[:'TR-Organization'] = tr_organization
|
428
|
+
|
429
|
+
# form parameters
|
430
|
+
form_params = opts[:form_params] || {}
|
431
|
+
|
432
|
+
# http body (model)
|
433
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_dataset_request)
|
434
|
+
|
435
|
+
# return_type
|
436
|
+
return_type = opts[:debug_return_type] || 'Dataset'
|
437
|
+
|
438
|
+
# auth_names
|
439
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
440
|
+
|
441
|
+
new_options = opts.merge(
|
442
|
+
:operation => :"DatasetApi.update_dataset",
|
443
|
+
:header_params => header_params,
|
444
|
+
:query_params => query_params,
|
445
|
+
:form_params => form_params,
|
446
|
+
:body => post_body,
|
447
|
+
:auth_names => auth_names,
|
448
|
+
:return_type => return_type
|
449
|
+
)
|
450
|
+
|
451
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
452
|
+
if @api_client.config.debugging
|
453
|
+
@api_client.config.logger.debug "API called: DatasetApi#update_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
454
|
+
end
|
455
|
+
return data, status_code, headers
|
456
|
+
end
|
457
|
+
end
|
458
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
=begin
|
2
|
+
#Trieve API
|
3
|
+
|
4
|
+
#Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.3.4
|
7
|
+
Contact: developers@trieve.ai
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module TrieveRubyClient
|
16
|
+
class EventsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# get_events
|
23
|
+
# get_events Get events for the auth'ed user. Currently, this is only for events belonging to the auth'ed user. Soon, we plan to associate events to datasets instead of users. Each page contains 10 events.
|
24
|
+
# @param tr_dataset [String] The dataset id to use for the request
|
25
|
+
# @param page [Integer] Page number of events to get
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [EventReturn]
|
28
|
+
def get_events(tr_dataset, page, opts = {})
|
29
|
+
data, _status_code, _headers = get_events_with_http_info(tr_dataset, page, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# get_events
|
34
|
+
# get_events Get events for the auth'ed user. Currently, this is only for events belonging to the auth'ed user. Soon, we plan to associate events to datasets instead of users. Each page contains 10 events.
|
35
|
+
# @param tr_dataset [String] The dataset id to use for the request
|
36
|
+
# @param page [Integer] Page number of events to get
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(EventReturn, Integer, Hash)>] EventReturn data, response status code and response headers
|
39
|
+
def get_events_with_http_info(tr_dataset, page, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_events ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'tr_dataset' is set
|
44
|
+
if @api_client.config.client_side_validation && tr_dataset.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'tr_dataset' when calling EventsApi.get_events"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'page' is set
|
48
|
+
if @api_client.config.client_side_validation && page.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'page' when calling EventsApi.get_events"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/api/events/{page}'.sub('{' + 'page' + '}', CGI.escape(page.to_s))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
header_params[:'TR-Dataset'] = tr_dataset
|
62
|
+
|
63
|
+
# form parameters
|
64
|
+
form_params = opts[:form_params] || {}
|
65
|
+
|
66
|
+
# http body (model)
|
67
|
+
post_body = opts[:debug_body]
|
68
|
+
|
69
|
+
# return_type
|
70
|
+
return_type = opts[:debug_return_type] || 'EventReturn'
|
71
|
+
|
72
|
+
# auth_names
|
73
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
74
|
+
|
75
|
+
new_options = opts.merge(
|
76
|
+
:operation => :"EventsApi.get_events",
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: EventsApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|