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
data/docs/UserApi.md
ADDED
@@ -0,0 +1,238 @@
|
|
1
|
+
# TrieveRubyClient::UserApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**delete_user_api_key**](UserApi.md#delete_user_api_key) | **DELETE** /api/user/delete_api_key | delete_user_api_key |
|
8
|
+
| [**set_user_api_key**](UserApi.md#set_user_api_key) | **POST** /api/user/set_api_key | set_user_api_key |
|
9
|
+
| [**update_user**](UserApi.md#update_user) | **PUT** /api/user | update_user |
|
10
|
+
|
11
|
+
|
12
|
+
## delete_user_api_key
|
13
|
+
|
14
|
+
> <Array<ApiKeyDTO>> delete_user_api_key(delete_user_api_key_request)
|
15
|
+
|
16
|
+
delete_user_api_key
|
17
|
+
|
18
|
+
delete_user_api_key Delete an api key for the auth'ed user.
|
19
|
+
|
20
|
+
### Examples
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'time'
|
24
|
+
require 'trieve_ruby_client'
|
25
|
+
# setup authorization
|
26
|
+
TrieveRubyClient.configure do |config|
|
27
|
+
# Configure API key authorization: Cookie
|
28
|
+
config.api_key['Cookie'] = 'YOUR API KEY'
|
29
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
30
|
+
# config.api_key_prefix['Cookie'] = 'Bearer'
|
31
|
+
|
32
|
+
# Configure API key authorization: ApiKey
|
33
|
+
config.api_key['ApiKey'] = 'YOUR API KEY'
|
34
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
35
|
+
# config.api_key_prefix['ApiKey'] = 'Bearer'
|
36
|
+
end
|
37
|
+
|
38
|
+
api_instance = TrieveRubyClient::UserApi.new
|
39
|
+
delete_user_api_key_request = TrieveRubyClient::DeleteUserApiKeyRequest.new({api_key_id: 'api_key_id_example'}) # DeleteUserApiKeyRequest | JSON request payload to delete a user api key
|
40
|
+
|
41
|
+
begin
|
42
|
+
# delete_user_api_key
|
43
|
+
result = api_instance.delete_user_api_key(delete_user_api_key_request)
|
44
|
+
p result
|
45
|
+
rescue TrieveRubyClient::ApiError => e
|
46
|
+
puts "Error when calling UserApi->delete_user_api_key: #{e}"
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
#### Using the delete_user_api_key_with_http_info variant
|
51
|
+
|
52
|
+
This returns an Array which contains the response data, status code and headers.
|
53
|
+
|
54
|
+
> <Array(<Array<ApiKeyDTO>>, Integer, Hash)> delete_user_api_key_with_http_info(delete_user_api_key_request)
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
begin
|
58
|
+
# delete_user_api_key
|
59
|
+
data, status_code, headers = api_instance.delete_user_api_key_with_http_info(delete_user_api_key_request)
|
60
|
+
p status_code # => 2xx
|
61
|
+
p headers # => { ... }
|
62
|
+
p data # => <Array<ApiKeyDTO>>
|
63
|
+
rescue TrieveRubyClient::ApiError => e
|
64
|
+
puts "Error when calling UserApi->delete_user_api_key_with_http_info: #{e}"
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
### Parameters
|
69
|
+
|
70
|
+
| Name | Type | Description | Notes |
|
71
|
+
| ---- | ---- | ----------- | ----- |
|
72
|
+
| **delete_user_api_key_request** | [**DeleteUserApiKeyRequest**](DeleteUserApiKeyRequest.md) | JSON request payload to delete a user api key | |
|
73
|
+
|
74
|
+
### Return type
|
75
|
+
|
76
|
+
[**Array<ApiKeyDTO>**](ApiKeyDTO.md)
|
77
|
+
|
78
|
+
### Authorization
|
79
|
+
|
80
|
+
[Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
|
81
|
+
|
82
|
+
### HTTP request headers
|
83
|
+
|
84
|
+
- **Content-Type**: application/json
|
85
|
+
- **Accept**: application/json
|
86
|
+
|
87
|
+
|
88
|
+
## set_user_api_key
|
89
|
+
|
90
|
+
> <SetUserApiKeyResponse> set_user_api_key(set_user_api_key_request)
|
91
|
+
|
92
|
+
set_user_api_key
|
93
|
+
|
94
|
+
set_user_api_key Create a new api key for the auth'ed user. Successful response will contain the newly created api key. If a write role is assigned the api key will have permission level of the auth'ed user who calls this endpoint.
|
95
|
+
|
96
|
+
### Examples
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
require 'time'
|
100
|
+
require 'trieve_ruby_client'
|
101
|
+
# setup authorization
|
102
|
+
TrieveRubyClient.configure do |config|
|
103
|
+
# Configure API key authorization: Cookie
|
104
|
+
config.api_key['Cookie'] = 'YOUR API KEY'
|
105
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
106
|
+
# config.api_key_prefix['Cookie'] = 'Bearer'
|
107
|
+
|
108
|
+
# Configure API key authorization: ApiKey
|
109
|
+
config.api_key['ApiKey'] = 'YOUR API KEY'
|
110
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
111
|
+
# config.api_key_prefix['ApiKey'] = 'Bearer'
|
112
|
+
end
|
113
|
+
|
114
|
+
api_instance = TrieveRubyClient::UserApi.new
|
115
|
+
set_user_api_key_request = TrieveRubyClient::SetUserApiKeyRequest.new({name: 'name_example', role: 37}) # SetUserApiKeyRequest | JSON request payload to create a new user api key
|
116
|
+
|
117
|
+
begin
|
118
|
+
# set_user_api_key
|
119
|
+
result = api_instance.set_user_api_key(set_user_api_key_request)
|
120
|
+
p result
|
121
|
+
rescue TrieveRubyClient::ApiError => e
|
122
|
+
puts "Error when calling UserApi->set_user_api_key: #{e}"
|
123
|
+
end
|
124
|
+
```
|
125
|
+
|
126
|
+
#### Using the set_user_api_key_with_http_info variant
|
127
|
+
|
128
|
+
This returns an Array which contains the response data, status code and headers.
|
129
|
+
|
130
|
+
> <Array(<SetUserApiKeyResponse>, Integer, Hash)> set_user_api_key_with_http_info(set_user_api_key_request)
|
131
|
+
|
132
|
+
```ruby
|
133
|
+
begin
|
134
|
+
# set_user_api_key
|
135
|
+
data, status_code, headers = api_instance.set_user_api_key_with_http_info(set_user_api_key_request)
|
136
|
+
p status_code # => 2xx
|
137
|
+
p headers # => { ... }
|
138
|
+
p data # => <SetUserApiKeyResponse>
|
139
|
+
rescue TrieveRubyClient::ApiError => e
|
140
|
+
puts "Error when calling UserApi->set_user_api_key_with_http_info: #{e}"
|
141
|
+
end
|
142
|
+
```
|
143
|
+
|
144
|
+
### Parameters
|
145
|
+
|
146
|
+
| Name | Type | Description | Notes |
|
147
|
+
| ---- | ---- | ----------- | ----- |
|
148
|
+
| **set_user_api_key_request** | [**SetUserApiKeyRequest**](SetUserApiKeyRequest.md) | JSON request payload to create a new user api key | |
|
149
|
+
|
150
|
+
### Return type
|
151
|
+
|
152
|
+
[**SetUserApiKeyResponse**](SetUserApiKeyResponse.md)
|
153
|
+
|
154
|
+
### Authorization
|
155
|
+
|
156
|
+
[Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
|
157
|
+
|
158
|
+
### HTTP request headers
|
159
|
+
|
160
|
+
- **Content-Type**: application/json
|
161
|
+
- **Accept**: application/json
|
162
|
+
|
163
|
+
|
164
|
+
## update_user
|
165
|
+
|
166
|
+
> <SlimUser> update_user(update_user_data)
|
167
|
+
|
168
|
+
update_user
|
169
|
+
|
170
|
+
update_user Update a user's information. If the user_id is not provided, the auth'ed user will be updated. If the user_id is provided, the auth'ed user must be an admin (1) or owner (2) of the organization.
|
171
|
+
|
172
|
+
### Examples
|
173
|
+
|
174
|
+
```ruby
|
175
|
+
require 'time'
|
176
|
+
require 'trieve_ruby_client'
|
177
|
+
# setup authorization
|
178
|
+
TrieveRubyClient.configure do |config|
|
179
|
+
# Configure API key authorization: Cookie
|
180
|
+
config.api_key['Cookie'] = 'YOUR API KEY'
|
181
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
182
|
+
# config.api_key_prefix['Cookie'] = 'Bearer'
|
183
|
+
|
184
|
+
# Configure API key authorization: ApiKey
|
185
|
+
config.api_key['ApiKey'] = 'YOUR API KEY'
|
186
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
187
|
+
# config.api_key_prefix['ApiKey'] = 'Bearer'
|
188
|
+
end
|
189
|
+
|
190
|
+
api_instance = TrieveRubyClient::UserApi.new
|
191
|
+
update_user_data = TrieveRubyClient::UpdateUserData.new({organization_id: 'organization_id_example'}) # UpdateUserData | JSON request payload to update user information for the auth'ed user
|
192
|
+
|
193
|
+
begin
|
194
|
+
# update_user
|
195
|
+
result = api_instance.update_user(update_user_data)
|
196
|
+
p result
|
197
|
+
rescue TrieveRubyClient::ApiError => e
|
198
|
+
puts "Error when calling UserApi->update_user: #{e}"
|
199
|
+
end
|
200
|
+
```
|
201
|
+
|
202
|
+
#### Using the update_user_with_http_info variant
|
203
|
+
|
204
|
+
This returns an Array which contains the response data, status code and headers.
|
205
|
+
|
206
|
+
> <Array(<SlimUser>, Integer, Hash)> update_user_with_http_info(update_user_data)
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
begin
|
210
|
+
# update_user
|
211
|
+
data, status_code, headers = api_instance.update_user_with_http_info(update_user_data)
|
212
|
+
p status_code # => 2xx
|
213
|
+
p headers # => { ... }
|
214
|
+
p data # => <SlimUser>
|
215
|
+
rescue TrieveRubyClient::ApiError => e
|
216
|
+
puts "Error when calling UserApi->update_user_with_http_info: #{e}"
|
217
|
+
end
|
218
|
+
```
|
219
|
+
|
220
|
+
### Parameters
|
221
|
+
|
222
|
+
| Name | Type | Description | Notes |
|
223
|
+
| ---- | ---- | ----------- | ----- |
|
224
|
+
| **update_user_data** | [**UpdateUserData**](UpdateUserData.md) | JSON request payload to update user information for the auth'ed user | |
|
225
|
+
|
226
|
+
### Return type
|
227
|
+
|
228
|
+
[**SlimUser**](SlimUser.md)
|
229
|
+
|
230
|
+
### Authorization
|
231
|
+
|
232
|
+
[Cookie](../README.md#Cookie), [ApiKey](../README.md#ApiKey)
|
233
|
+
|
234
|
+
### HTTP request headers
|
235
|
+
|
236
|
+
- **Content-Type**: application/json
|
237
|
+
- **Accept**: application/json
|
238
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# TrieveRubyClient::UserOrganization
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **created_at** | **Time** | | |
|
8
|
+
| **id** | **String** | | |
|
9
|
+
| **organization_id** | **String** | | |
|
10
|
+
| **role** | **Integer** | | |
|
11
|
+
| **updated_at** | **Time** | | |
|
12
|
+
| **user_id** | **String** | | |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'trieve_ruby_client'
|
18
|
+
|
19
|
+
instance = TrieveRubyClient::UserOrganization.new(
|
20
|
+
created_at: null,
|
21
|
+
id: null,
|
22
|
+
organization_id: null,
|
23
|
+
role: null,
|
24
|
+
updated_at: null,
|
25
|
+
user_id: null
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
@@ -0,0 +1,262 @@
|
|
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 AuthApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# openid_callback
|
23
|
+
# openid_callback This is the callback route for the OAuth provider, it should not be called directly. Redirects to browser with set-cookie header.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [SlimUser]
|
26
|
+
def callback(opts = {})
|
27
|
+
data, _status_code, _headers = callback_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# openid_callback
|
32
|
+
# openid_callback This is the callback route for the OAuth provider, it should not be called directly. Redirects to browser with set-cookie header.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(SlimUser, Integer, Hash)>] SlimUser data, response status code and response headers
|
35
|
+
def callback_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.callback ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/api/auth/callback'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = opts[:form_params] || {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = opts[:debug_body]
|
55
|
+
|
56
|
+
# return_type
|
57
|
+
return_type = opts[:debug_return_type] || 'SlimUser'
|
58
|
+
|
59
|
+
# auth_names
|
60
|
+
auth_names = opts[:debug_auth_names] || []
|
61
|
+
|
62
|
+
new_options = opts.merge(
|
63
|
+
:operation => :"AuthApi.callback",
|
64
|
+
:header_params => header_params,
|
65
|
+
:query_params => query_params,
|
66
|
+
:form_params => form_params,
|
67
|
+
:body => post_body,
|
68
|
+
:auth_names => auth_names,
|
69
|
+
:return_type => return_type
|
70
|
+
)
|
71
|
+
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: AuthApi#callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
return data, status_code, headers
|
77
|
+
end
|
78
|
+
|
79
|
+
# get_me
|
80
|
+
# get_me Get the user corresponding to your current auth credentials.
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [SlimUser]
|
83
|
+
def get_me(opts = {})
|
84
|
+
data, _status_code, _headers = get_me_with_http_info(opts)
|
85
|
+
data
|
86
|
+
end
|
87
|
+
|
88
|
+
# get_me
|
89
|
+
# get_me Get the user corresponding to your current auth credentials.
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @return [Array<(SlimUser, Integer, Hash)>] SlimUser data, response status code and response headers
|
92
|
+
def get_me_with_http_info(opts = {})
|
93
|
+
if @api_client.config.debugging
|
94
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.get_me ...'
|
95
|
+
end
|
96
|
+
# resource path
|
97
|
+
local_var_path = '/api/auth/me'
|
98
|
+
|
99
|
+
# query parameters
|
100
|
+
query_params = opts[:query_params] || {}
|
101
|
+
|
102
|
+
# header parameters
|
103
|
+
header_params = opts[:header_params] || {}
|
104
|
+
# HTTP header 'Accept' (if needed)
|
105
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
106
|
+
|
107
|
+
# form parameters
|
108
|
+
form_params = opts[:form_params] || {}
|
109
|
+
|
110
|
+
# http body (model)
|
111
|
+
post_body = opts[:debug_body]
|
112
|
+
|
113
|
+
# return_type
|
114
|
+
return_type = opts[:debug_return_type] || 'SlimUser'
|
115
|
+
|
116
|
+
# auth_names
|
117
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
118
|
+
|
119
|
+
new_options = opts.merge(
|
120
|
+
:operation => :"AuthApi.get_me",
|
121
|
+
:header_params => header_params,
|
122
|
+
:query_params => query_params,
|
123
|
+
:form_params => form_params,
|
124
|
+
:body => post_body,
|
125
|
+
:auth_names => auth_names,
|
126
|
+
:return_type => return_type
|
127
|
+
)
|
128
|
+
|
129
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
130
|
+
if @api_client.config.debugging
|
131
|
+
@api_client.config.logger.debug "API called: AuthApi#get_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
|
+
end
|
133
|
+
return data, status_code, headers
|
134
|
+
end
|
135
|
+
|
136
|
+
# login
|
137
|
+
# login This will redirect you to the OAuth provider for authentication with email/pass, SSO, Google, Github, etc.
|
138
|
+
# @param [Hash] opts the optional parameters
|
139
|
+
# @option opts [String] :inv_code Code sent via email as a result of successful call to send_invitation
|
140
|
+
# @option opts [String] :organization_id ID of organization to authenticate into
|
141
|
+
# @option opts [String] :redirect_uri URL to redirect to after successful login
|
142
|
+
# @return [nil]
|
143
|
+
def login(opts = {})
|
144
|
+
login_with_http_info(opts)
|
145
|
+
nil
|
146
|
+
end
|
147
|
+
|
148
|
+
# login
|
149
|
+
# login This will redirect you to the OAuth provider for authentication with email/pass, SSO, Google, Github, etc.
|
150
|
+
# @param [Hash] opts the optional parameters
|
151
|
+
# @option opts [String] :inv_code Code sent via email as a result of successful call to send_invitation
|
152
|
+
# @option opts [String] :organization_id ID of organization to authenticate into
|
153
|
+
# @option opts [String] :redirect_uri URL to redirect to after successful login
|
154
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
155
|
+
def login_with_http_info(opts = {})
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.login ...'
|
158
|
+
end
|
159
|
+
# resource path
|
160
|
+
local_var_path = '/api/auth'
|
161
|
+
|
162
|
+
# query parameters
|
163
|
+
query_params = opts[:query_params] || {}
|
164
|
+
|
165
|
+
# header parameters
|
166
|
+
header_params = opts[:header_params] || {}
|
167
|
+
# HTTP header 'Accept' (if needed)
|
168
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
169
|
+
# HTTP header 'Content-Type'
|
170
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
171
|
+
if !content_type.nil?
|
172
|
+
header_params['Content-Type'] = content_type
|
173
|
+
end
|
174
|
+
|
175
|
+
# form parameters
|
176
|
+
form_params = opts[:form_params] || {}
|
177
|
+
form_params['inv_code'] = opts[:'inv_code'] if !opts[:'inv_code'].nil?
|
178
|
+
form_params['organization_id'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?
|
179
|
+
form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
|
180
|
+
|
181
|
+
# http body (model)
|
182
|
+
post_body = opts[:debug_body]
|
183
|
+
|
184
|
+
# return_type
|
185
|
+
return_type = opts[:debug_return_type]
|
186
|
+
|
187
|
+
# auth_names
|
188
|
+
auth_names = opts[:debug_auth_names] || []
|
189
|
+
|
190
|
+
new_options = opts.merge(
|
191
|
+
:operation => :"AuthApi.login",
|
192
|
+
:header_params => header_params,
|
193
|
+
:query_params => query_params,
|
194
|
+
:form_params => form_params,
|
195
|
+
:body => post_body,
|
196
|
+
:auth_names => auth_names,
|
197
|
+
:return_type => return_type
|
198
|
+
)
|
199
|
+
|
200
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
201
|
+
if @api_client.config.debugging
|
202
|
+
@api_client.config.logger.debug "API called: AuthApi#login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
203
|
+
end
|
204
|
+
return data, status_code, headers
|
205
|
+
end
|
206
|
+
|
207
|
+
# logout
|
208
|
+
# logout Invalidate your current auth credential stored typically stored in a cookie. This does not invalidate your API key.
|
209
|
+
# @param [Hash] opts the optional parameters
|
210
|
+
# @return [nil]
|
211
|
+
def logout(opts = {})
|
212
|
+
logout_with_http_info(opts)
|
213
|
+
nil
|
214
|
+
end
|
215
|
+
|
216
|
+
# logout
|
217
|
+
# logout Invalidate your current auth credential stored typically stored in a cookie. This does not invalidate your API key.
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
220
|
+
def logout_with_http_info(opts = {})
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.logout ...'
|
223
|
+
end
|
224
|
+
# resource path
|
225
|
+
local_var_path = '/api/auth'
|
226
|
+
|
227
|
+
# query parameters
|
228
|
+
query_params = opts[:query_params] || {}
|
229
|
+
|
230
|
+
# header parameters
|
231
|
+
header_params = opts[:header_params] || {}
|
232
|
+
|
233
|
+
# form parameters
|
234
|
+
form_params = opts[:form_params] || {}
|
235
|
+
|
236
|
+
# http body (model)
|
237
|
+
post_body = opts[:debug_body]
|
238
|
+
|
239
|
+
# return_type
|
240
|
+
return_type = opts[:debug_return_type]
|
241
|
+
|
242
|
+
# auth_names
|
243
|
+
auth_names = opts[:debug_auth_names] || []
|
244
|
+
|
245
|
+
new_options = opts.merge(
|
246
|
+
:operation => :"AuthApi.logout",
|
247
|
+
:header_params => header_params,
|
248
|
+
:query_params => query_params,
|
249
|
+
:form_params => form_params,
|
250
|
+
:body => post_body,
|
251
|
+
:auth_names => auth_names,
|
252
|
+
:return_type => return_type
|
253
|
+
)
|
254
|
+
|
255
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
256
|
+
if @api_client.config.debugging
|
257
|
+
@api_client.config.logger.debug "API called: AuthApi#logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
258
|
+
end
|
259
|
+
return data, status_code, headers
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|