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,445 @@
|
|
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 OrganizationApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# create_organization
|
23
|
+
# create_organization Create a new organization. The auth'ed user who creates the organization will be the default owner of the organization.
|
24
|
+
# @param create_organization_data [CreateOrganizationData] The organization data that you want to create
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [Organization]
|
27
|
+
def create_organization(create_organization_data, opts = {})
|
28
|
+
data, _status_code, _headers = create_organization_with_http_info(create_organization_data, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# create_organization
|
33
|
+
# create_organization Create a new organization. The auth'ed user who creates the organization will be the default owner of the organization.
|
34
|
+
# @param create_organization_data [CreateOrganizationData] The organization data that you want to create
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers
|
37
|
+
def create_organization_with_http_info(create_organization_data, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: OrganizationApi.create_organization ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'create_organization_data' is set
|
42
|
+
if @api_client.config.client_side_validation && create_organization_data.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_organization_data' when calling OrganizationApi.create_organization"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/api/organization'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
+
if !content_type.nil?
|
58
|
+
header_params['Content-Type'] = content_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_organization_data)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'Organization'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"OrganizationApi.create_organization",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: OrganizationApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# delete_organization
|
91
|
+
# delete_organization Delete an organization by its id. The auth'ed user must be an owner of the organization to delete it.
|
92
|
+
# @param tr_organization [String] The organization id to use for the request
|
93
|
+
# @param organization_id [String] The id of the organization you want to fetch.
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [Organization]
|
96
|
+
def delete_organization_by_id(tr_organization, organization_id, opts = {})
|
97
|
+
data, _status_code, _headers = delete_organization_by_id_with_http_info(tr_organization, organization_id, opts)
|
98
|
+
data
|
99
|
+
end
|
100
|
+
|
101
|
+
# delete_organization
|
102
|
+
# delete_organization Delete an organization by its id. The auth'ed user must be an owner of the organization to delete it.
|
103
|
+
# @param tr_organization [String] The organization id to use for the request
|
104
|
+
# @param organization_id [String] The id of the organization you want to fetch.
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers
|
107
|
+
def delete_organization_by_id_with_http_info(tr_organization, organization_id, opts = {})
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug 'Calling API: OrganizationApi.delete_organization_by_id ...'
|
110
|
+
end
|
111
|
+
# verify the required parameter 'tr_organization' is set
|
112
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
113
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling OrganizationApi.delete_organization_by_id"
|
114
|
+
end
|
115
|
+
# verify the required parameter 'organization_id' is set
|
116
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationApi.delete_organization_by_id"
|
118
|
+
end
|
119
|
+
# resource path
|
120
|
+
local_var_path = '/api/organization/{organization_id}'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))
|
121
|
+
|
122
|
+
# query parameters
|
123
|
+
query_params = opts[:query_params] || {}
|
124
|
+
|
125
|
+
# header parameters
|
126
|
+
header_params = opts[:header_params] || {}
|
127
|
+
# HTTP header 'Accept' (if needed)
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
129
|
+
header_params[:'TR-Organization'] = tr_organization
|
130
|
+
|
131
|
+
# form parameters
|
132
|
+
form_params = opts[:form_params] || {}
|
133
|
+
|
134
|
+
# http body (model)
|
135
|
+
post_body = opts[:debug_body]
|
136
|
+
|
137
|
+
# return_type
|
138
|
+
return_type = opts[:debug_return_type] || 'Organization'
|
139
|
+
|
140
|
+
# auth_names
|
141
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
142
|
+
|
143
|
+
new_options = opts.merge(
|
144
|
+
:operation => :"OrganizationApi.delete_organization_by_id",
|
145
|
+
:header_params => header_params,
|
146
|
+
:query_params => query_params,
|
147
|
+
:form_params => form_params,
|
148
|
+
:body => post_body,
|
149
|
+
:auth_names => auth_names,
|
150
|
+
:return_type => return_type
|
151
|
+
)
|
152
|
+
|
153
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
154
|
+
if @api_client.config.debugging
|
155
|
+
@api_client.config.logger.debug "API called: OrganizationApi#delete_organization_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
156
|
+
end
|
157
|
+
return data, status_code, headers
|
158
|
+
end
|
159
|
+
|
160
|
+
# get_organization
|
161
|
+
# get_organization Fetch the details of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.
|
162
|
+
# @param tr_organization [String] The organization id to use for the request
|
163
|
+
# @param organization_id [String] The id of the organization you want to fetch.
|
164
|
+
# @param [Hash] opts the optional parameters
|
165
|
+
# @return [Organization]
|
166
|
+
def get_organization_by_id(tr_organization, organization_id, opts = {})
|
167
|
+
data, _status_code, _headers = get_organization_by_id_with_http_info(tr_organization, organization_id, opts)
|
168
|
+
data
|
169
|
+
end
|
170
|
+
|
171
|
+
# get_organization
|
172
|
+
# get_organization Fetch the details of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.
|
173
|
+
# @param tr_organization [String] The organization id to use for the request
|
174
|
+
# @param organization_id [String] The id of the organization you want to fetch.
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers
|
177
|
+
def get_organization_by_id_with_http_info(tr_organization, organization_id, opts = {})
|
178
|
+
if @api_client.config.debugging
|
179
|
+
@api_client.config.logger.debug 'Calling API: OrganizationApi.get_organization_by_id ...'
|
180
|
+
end
|
181
|
+
# verify the required parameter 'tr_organization' is set
|
182
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
183
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling OrganizationApi.get_organization_by_id"
|
184
|
+
end
|
185
|
+
# verify the required parameter 'organization_id' is set
|
186
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
187
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationApi.get_organization_by_id"
|
188
|
+
end
|
189
|
+
# resource path
|
190
|
+
local_var_path = '/api/organization/{organization_id}'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))
|
191
|
+
|
192
|
+
# query parameters
|
193
|
+
query_params = opts[:query_params] || {}
|
194
|
+
|
195
|
+
# header parameters
|
196
|
+
header_params = opts[:header_params] || {}
|
197
|
+
# HTTP header 'Accept' (if needed)
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
199
|
+
header_params[:'TR-Organization'] = tr_organization
|
200
|
+
|
201
|
+
# form parameters
|
202
|
+
form_params = opts[:form_params] || {}
|
203
|
+
|
204
|
+
# http body (model)
|
205
|
+
post_body = opts[:debug_body]
|
206
|
+
|
207
|
+
# return_type
|
208
|
+
return_type = opts[:debug_return_type] || 'Organization'
|
209
|
+
|
210
|
+
# auth_names
|
211
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
212
|
+
|
213
|
+
new_options = opts.merge(
|
214
|
+
:operation => :"OrganizationApi.get_organization_by_id",
|
215
|
+
:header_params => header_params,
|
216
|
+
:query_params => query_params,
|
217
|
+
:form_params => form_params,
|
218
|
+
:body => post_body,
|
219
|
+
:auth_names => auth_names,
|
220
|
+
:return_type => return_type
|
221
|
+
)
|
222
|
+
|
223
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
224
|
+
if @api_client.config.debugging
|
225
|
+
@api_client.config.logger.debug "API called: OrganizationApi#get_organization_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
226
|
+
end
|
227
|
+
return data, status_code, headers
|
228
|
+
end
|
229
|
+
|
230
|
+
# get_organization_usage
|
231
|
+
# get_organization_usage Fetch the current usage specification of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.
|
232
|
+
# @param tr_organization [String] The organization id to use for the request
|
233
|
+
# @param organization_id [String] The id of the organization you want to fetch the usage of.
|
234
|
+
# @param [Hash] opts the optional parameters
|
235
|
+
# @return [OrganizationUsageCount]
|
236
|
+
def get_organization_usage(tr_organization, organization_id, opts = {})
|
237
|
+
data, _status_code, _headers = get_organization_usage_with_http_info(tr_organization, organization_id, opts)
|
238
|
+
data
|
239
|
+
end
|
240
|
+
|
241
|
+
# get_organization_usage
|
242
|
+
# get_organization_usage Fetch the current usage specification of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.
|
243
|
+
# @param tr_organization [String] The organization id to use for the request
|
244
|
+
# @param organization_id [String] The id of the organization you want to fetch the usage of.
|
245
|
+
# @param [Hash] opts the optional parameters
|
246
|
+
# @return [Array<(OrganizationUsageCount, Integer, Hash)>] OrganizationUsageCount data, response status code and response headers
|
247
|
+
def get_organization_usage_with_http_info(tr_organization, organization_id, opts = {})
|
248
|
+
if @api_client.config.debugging
|
249
|
+
@api_client.config.logger.debug 'Calling API: OrganizationApi.get_organization_usage ...'
|
250
|
+
end
|
251
|
+
# verify the required parameter 'tr_organization' is set
|
252
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
253
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling OrganizationApi.get_organization_usage"
|
254
|
+
end
|
255
|
+
# verify the required parameter 'organization_id' is set
|
256
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
257
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationApi.get_organization_usage"
|
258
|
+
end
|
259
|
+
# resource path
|
260
|
+
local_var_path = '/api/organization/usage/{organization_id}'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))
|
261
|
+
|
262
|
+
# query parameters
|
263
|
+
query_params = opts[:query_params] || {}
|
264
|
+
|
265
|
+
# header parameters
|
266
|
+
header_params = opts[:header_params] || {}
|
267
|
+
# HTTP header 'Accept' (if needed)
|
268
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
269
|
+
header_params[:'TR-Organization'] = tr_organization
|
270
|
+
|
271
|
+
# form parameters
|
272
|
+
form_params = opts[:form_params] || {}
|
273
|
+
|
274
|
+
# http body (model)
|
275
|
+
post_body = opts[:debug_body]
|
276
|
+
|
277
|
+
# return_type
|
278
|
+
return_type = opts[:debug_return_type] || 'OrganizationUsageCount'
|
279
|
+
|
280
|
+
# auth_names
|
281
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
282
|
+
|
283
|
+
new_options = opts.merge(
|
284
|
+
:operation => :"OrganizationApi.get_organization_usage",
|
285
|
+
:header_params => header_params,
|
286
|
+
:query_params => query_params,
|
287
|
+
:form_params => form_params,
|
288
|
+
:body => post_body,
|
289
|
+
:auth_names => auth_names,
|
290
|
+
:return_type => return_type
|
291
|
+
)
|
292
|
+
|
293
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
294
|
+
if @api_client.config.debugging
|
295
|
+
@api_client.config.logger.debug "API called: OrganizationApi#get_organization_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
296
|
+
end
|
297
|
+
return data, status_code, headers
|
298
|
+
end
|
299
|
+
|
300
|
+
# get_organization_users
|
301
|
+
# get_organization_users Fetch the users of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.
|
302
|
+
# @param tr_organization [String] The organization id to use for the request
|
303
|
+
# @param organization_id [String] The id of the organization you want to fetch the users of.
|
304
|
+
# @param [Hash] opts the optional parameters
|
305
|
+
# @return [Array<SlimUser>]
|
306
|
+
def get_organization_users(tr_organization, organization_id, opts = {})
|
307
|
+
data, _status_code, _headers = get_organization_users_with_http_info(tr_organization, organization_id, opts)
|
308
|
+
data
|
309
|
+
end
|
310
|
+
|
311
|
+
# get_organization_users
|
312
|
+
# get_organization_users Fetch the users of an organization by its id. The auth'ed user must be an admin or owner of the organization to fetch it.
|
313
|
+
# @param tr_organization [String] The organization id to use for the request
|
314
|
+
# @param organization_id [String] The id of the organization you want to fetch the users of.
|
315
|
+
# @param [Hash] opts the optional parameters
|
316
|
+
# @return [Array<(Array<SlimUser>, Integer, Hash)>] Array<SlimUser> data, response status code and response headers
|
317
|
+
def get_organization_users_with_http_info(tr_organization, organization_id, opts = {})
|
318
|
+
if @api_client.config.debugging
|
319
|
+
@api_client.config.logger.debug 'Calling API: OrganizationApi.get_organization_users ...'
|
320
|
+
end
|
321
|
+
# verify the required parameter 'tr_organization' is set
|
322
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
323
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling OrganizationApi.get_organization_users"
|
324
|
+
end
|
325
|
+
# verify the required parameter 'organization_id' is set
|
326
|
+
if @api_client.config.client_side_validation && organization_id.nil?
|
327
|
+
fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationApi.get_organization_users"
|
328
|
+
end
|
329
|
+
# resource path
|
330
|
+
local_var_path = '/api/organization/users/{organization_id}'.sub('{' + 'organization_id' + '}', CGI.escape(organization_id.to_s))
|
331
|
+
|
332
|
+
# query parameters
|
333
|
+
query_params = opts[:query_params] || {}
|
334
|
+
|
335
|
+
# header parameters
|
336
|
+
header_params = opts[:header_params] || {}
|
337
|
+
# HTTP header 'Accept' (if needed)
|
338
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
339
|
+
header_params[:'TR-Organization'] = tr_organization
|
340
|
+
|
341
|
+
# form parameters
|
342
|
+
form_params = opts[:form_params] || {}
|
343
|
+
|
344
|
+
# http body (model)
|
345
|
+
post_body = opts[:debug_body]
|
346
|
+
|
347
|
+
# return_type
|
348
|
+
return_type = opts[:debug_return_type] || 'Array<SlimUser>'
|
349
|
+
|
350
|
+
# auth_names
|
351
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
352
|
+
|
353
|
+
new_options = opts.merge(
|
354
|
+
:operation => :"OrganizationApi.get_organization_users",
|
355
|
+
:header_params => header_params,
|
356
|
+
:query_params => query_params,
|
357
|
+
:form_params => form_params,
|
358
|
+
:body => post_body,
|
359
|
+
:auth_names => auth_names,
|
360
|
+
:return_type => return_type
|
361
|
+
)
|
362
|
+
|
363
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
364
|
+
if @api_client.config.debugging
|
365
|
+
@api_client.config.logger.debug "API called: OrganizationApi#get_organization_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
366
|
+
end
|
367
|
+
return data, status_code, headers
|
368
|
+
end
|
369
|
+
|
370
|
+
# update_organization
|
371
|
+
# update_organization Update an organization. Only the owner of the organization can update it.
|
372
|
+
# @param tr_organization [String] The organization id to use for the request
|
373
|
+
# @param update_organization_data [UpdateOrganizationData] The organization data that you want to update
|
374
|
+
# @param [Hash] opts the optional parameters
|
375
|
+
# @return [Organization]
|
376
|
+
def update_organization(tr_organization, update_organization_data, opts = {})
|
377
|
+
data, _status_code, _headers = update_organization_with_http_info(tr_organization, update_organization_data, opts)
|
378
|
+
data
|
379
|
+
end
|
380
|
+
|
381
|
+
# update_organization
|
382
|
+
# update_organization Update an organization. Only the owner of the organization can update it.
|
383
|
+
# @param tr_organization [String] The organization id to use for the request
|
384
|
+
# @param update_organization_data [UpdateOrganizationData] The organization data that you want to update
|
385
|
+
# @param [Hash] opts the optional parameters
|
386
|
+
# @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers
|
387
|
+
def update_organization_with_http_info(tr_organization, update_organization_data, opts = {})
|
388
|
+
if @api_client.config.debugging
|
389
|
+
@api_client.config.logger.debug 'Calling API: OrganizationApi.update_organization ...'
|
390
|
+
end
|
391
|
+
# verify the required parameter 'tr_organization' is set
|
392
|
+
if @api_client.config.client_side_validation && tr_organization.nil?
|
393
|
+
fail ArgumentError, "Missing the required parameter 'tr_organization' when calling OrganizationApi.update_organization"
|
394
|
+
end
|
395
|
+
# verify the required parameter 'update_organization_data' is set
|
396
|
+
if @api_client.config.client_side_validation && update_organization_data.nil?
|
397
|
+
fail ArgumentError, "Missing the required parameter 'update_organization_data' when calling OrganizationApi.update_organization"
|
398
|
+
end
|
399
|
+
# resource path
|
400
|
+
local_var_path = '/api/organization'
|
401
|
+
|
402
|
+
# query parameters
|
403
|
+
query_params = opts[:query_params] || {}
|
404
|
+
|
405
|
+
# header parameters
|
406
|
+
header_params = opts[:header_params] || {}
|
407
|
+
# HTTP header 'Accept' (if needed)
|
408
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
409
|
+
# HTTP header 'Content-Type'
|
410
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
411
|
+
if !content_type.nil?
|
412
|
+
header_params['Content-Type'] = content_type
|
413
|
+
end
|
414
|
+
header_params[:'TR-Organization'] = tr_organization
|
415
|
+
|
416
|
+
# form parameters
|
417
|
+
form_params = opts[:form_params] || {}
|
418
|
+
|
419
|
+
# http body (model)
|
420
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_organization_data)
|
421
|
+
|
422
|
+
# return_type
|
423
|
+
return_type = opts[:debug_return_type] || 'Organization'
|
424
|
+
|
425
|
+
# auth_names
|
426
|
+
auth_names = opts[:debug_auth_names] || ['Cookie', 'ApiKey']
|
427
|
+
|
428
|
+
new_options = opts.merge(
|
429
|
+
:operation => :"OrganizationApi.update_organization",
|
430
|
+
:header_params => header_params,
|
431
|
+
:query_params => query_params,
|
432
|
+
:form_params => form_params,
|
433
|
+
:body => post_body,
|
434
|
+
:auth_names => auth_names,
|
435
|
+
:return_type => return_type
|
436
|
+
)
|
437
|
+
|
438
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
439
|
+
if @api_client.config.debugging
|
440
|
+
@api_client.config.logger.debug "API called: OrganizationApi#update_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
441
|
+
end
|
442
|
+
return data, status_code, headers
|
443
|
+
end
|
444
|
+
end
|
445
|
+
end
|