directus_sdk 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +185 -0
- data/Rakefile +8 -0
- data/directus_sdk.gemspec +46 -0
- data/docs/ActivityApi.md +59 -0
- data/docs/BookmarksApi.md +290 -0
- data/docs/FilesApi.md +277 -0
- data/docs/GetActivity.md +9 -0
- data/docs/GetActivityData.md +16 -0
- data/docs/GetActivityMeta.md +10 -0
- data/docs/GetBookmark.md +9 -0
- data/docs/GetBookmarks.md +9 -0
- data/docs/GetBookmarksData.md +14 -0
- data/docs/GetBookmarksMeta.md +14 -0
- data/docs/GetFile.md +9 -0
- data/docs/GetFiles.md +9 -0
- data/docs/GetFilesData.md +24 -0
- data/docs/GetGroup.md +9 -0
- data/docs/GetGroups.md +9 -0
- data/docs/GetGroupsData.md +9 -0
- data/docs/GetGroupsDataData.md +16 -0
- data/docs/GetGroupsDataMeta.md +11 -0
- data/docs/GetMessage.md +9 -0
- data/docs/GetMessages.md +9 -0
- data/docs/GetMessagesData.md +18 -0
- data/docs/GetMessagesMeta.md +13 -0
- data/docs/GetMessagesResponses.md +8 -0
- data/docs/GetPreferences.md +9 -0
- data/docs/GetPreferencesData.md +16 -0
- data/docs/GetPrivileges.md +9 -0
- data/docs/GetPrivilegesData.md +19 -0
- data/docs/GetPrivilegesForTable.md +9 -0
- data/docs/GetSettings.md +9 -0
- data/docs/GetSettingsData.md +9 -0
- data/docs/GetSettingsDataFiles.md +13 -0
- data/docs/GetSettingsDataGlobal.md +13 -0
- data/docs/GetSettingsFor.md +9 -0
- data/docs/GetSettingsForMeta.md +10 -0
- data/docs/GetTable.md +9 -0
- data/docs/GetTableColumn.md +9 -0
- data/docs/GetTableColumnData.md +23 -0
- data/docs/GetTableColumns.md +9 -0
- data/docs/GetTableColumnsData.md +27 -0
- data/docs/GetTableData.md +29 -0
- data/docs/GetTableRow.md +9 -0
- data/docs/GetTableRows.md +9 -0
- data/docs/GetTableRowsData.md +9 -0
- data/docs/GetTableRowsMeta.md +14 -0
- data/docs/GetTables.md +9 -0
- data/docs/GetTablesData.md +8 -0
- data/docs/GetTablesMeta.md +9 -0
- data/docs/GroupsApi.md +455 -0
- data/docs/MessagesApi.md +116 -0
- data/docs/PreferencesApi.md +135 -0
- data/docs/SettingsApi.md +175 -0
- data/docs/TablesApi.md +873 -0
- data/docs/UtilsApi.md +126 -0
- data/git_push.sh +55 -0
- data/lib/directus_sdk.rb +92 -0
- data/lib/directus_sdk/api/activity_api.rb +70 -0
- data/lib/directus_sdk/api/bookmarks_api.rb +288 -0
- data/lib/directus_sdk/api/files_api.rb +297 -0
- data/lib/directus_sdk/api/groups_api.rb +469 -0
- data/lib/directus_sdk/api/messages_api.rb +123 -0
- data/lib/directus_sdk/api/preferences_api.rb +151 -0
- data/lib/directus_sdk/api/settings_api.rb +183 -0
- data/lib/directus_sdk/api/tables_api.rb +890 -0
- data/lib/directus_sdk/api/utils_api.rb +134 -0
- data/lib/directus_sdk/api_client.rb +389 -0
- data/lib/directus_sdk/api_error.rb +38 -0
- data/lib/directus_sdk/configuration.rb +209 -0
- data/lib/directus_sdk/models/get_activity.rb +199 -0
- data/lib/directus_sdk/models/get_activity_data.rb +260 -0
- data/lib/directus_sdk/models/get_activity_meta.rb +206 -0
- data/lib/directus_sdk/models/get_bookmark.rb +197 -0
- data/lib/directus_sdk/models/get_bookmarks.rb +199 -0
- data/lib/directus_sdk/models/get_bookmarks_data.rb +242 -0
- data/lib/directus_sdk/models/get_bookmarks_meta.rb +252 -0
- data/lib/directus_sdk/models/get_file.rb +197 -0
- data/lib/directus_sdk/models/get_files.rb +199 -0
- data/lib/directus_sdk/models/get_files_data.rb +332 -0
- data/lib/directus_sdk/models/get_group.rb +197 -0
- data/lib/directus_sdk/models/get_groups.rb +197 -0
- data/lib/directus_sdk/models/get_groups_data.rb +199 -0
- data/lib/directus_sdk/models/get_groups_data_data.rb +260 -0
- data/lib/directus_sdk/models/get_groups_data_meta.rb +215 -0
- data/lib/directus_sdk/models/get_message.rb +197 -0
- data/lib/directus_sdk/models/get_messages.rb +199 -0
- data/lib/directus_sdk/models/get_messages_data.rb +278 -0
- data/lib/directus_sdk/models/get_messages_meta.rb +233 -0
- data/lib/directus_sdk/models/get_messages_responses.rb +190 -0
- data/lib/directus_sdk/models/get_preferences.rb +197 -0
- data/lib/directus_sdk/models/get_preferences_data.rb +260 -0
- data/lib/directus_sdk/models/get_privileges.rb +199 -0
- data/lib/directus_sdk/models/get_privileges_data.rb +287 -0
- data/lib/directus_sdk/models/get_privileges_for_table.rb +197 -0
- data/lib/directus_sdk/models/get_settings.rb +197 -0
- data/lib/directus_sdk/models/get_settings_data.rb +197 -0
- data/lib/directus_sdk/models/get_settings_data_files.rb +233 -0
- data/lib/directus_sdk/models/get_settings_data_global.rb +233 -0
- data/lib/directus_sdk/models/get_settings_for.rb +197 -0
- data/lib/directus_sdk/models/get_settings_for_meta.rb +206 -0
- data/lib/directus_sdk/models/get_table.rb +197 -0
- data/lib/directus_sdk/models/get_table_column.rb +197 -0
- data/lib/directus_sdk/models/get_table_column_data.rb +325 -0
- data/lib/directus_sdk/models/get_table_columns.rb +199 -0
- data/lib/directus_sdk/models/get_table_columns_data.rb +363 -0
- data/lib/directus_sdk/models/get_table_data.rb +379 -0
- data/lib/directus_sdk/models/get_table_row.rb +197 -0
- data/lib/directus_sdk/models/get_table_rows.rb +199 -0
- data/lib/directus_sdk/models/get_table_rows_data.rb +197 -0
- data/lib/directus_sdk/models/get_table_rows_meta.rb +242 -0
- data/lib/directus_sdk/models/get_tables.rb +199 -0
- data/lib/directus_sdk/models/get_tables_data.rb +188 -0
- data/lib/directus_sdk/models/get_tables_meta.rb +197 -0
- data/lib/directus_sdk/version.rb +15 -0
- data/spec/api/activity_api_spec.rb +46 -0
- data/spec/api/bookmarks_api_spec.rb +98 -0
- data/spec/api/files_api_spec.rb +105 -0
- data/spec/api/groups_api_spec.rb +143 -0
- data/spec/api/messages_api_spec.rb +58 -0
- data/spec/api/preferences_api_spec.rb +65 -0
- data/spec/api/settings_api_spec.rb +71 -0
- data/spec/api/tables_api_spec.rb +236 -0
- data/spec/api/utils_api_spec.rb +61 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/get_activity_data_spec.rb +90 -0
- data/spec/models/get_activity_meta_spec.rb +54 -0
- data/spec/models/get_activity_spec.rb +48 -0
- data/spec/models/get_bookmark_spec.rb +48 -0
- data/spec/models/get_bookmarks_data_spec.rb +78 -0
- data/spec/models/get_bookmarks_meta_spec.rb +78 -0
- data/spec/models/get_bookmarks_spec.rb +48 -0
- data/spec/models/get_file_spec.rb +48 -0
- data/spec/models/get_files_data_spec.rb +138 -0
- data/spec/models/get_files_spec.rb +48 -0
- data/spec/models/get_group_spec.rb +48 -0
- data/spec/models/get_groups_data_data_spec.rb +90 -0
- data/spec/models/get_groups_data_meta_spec.rb +60 -0
- data/spec/models/get_groups_data_spec.rb +48 -0
- data/spec/models/get_groups_spec.rb +48 -0
- data/spec/models/get_message_spec.rb +48 -0
- data/spec/models/get_messages_data_spec.rb +102 -0
- data/spec/models/get_messages_meta_spec.rb +72 -0
- data/spec/models/get_messages_responses_spec.rb +42 -0
- data/spec/models/get_messages_spec.rb +48 -0
- data/spec/models/get_preferences_data_spec.rb +90 -0
- data/spec/models/get_preferences_spec.rb +48 -0
- data/spec/models/get_privileges_data_spec.rb +108 -0
- data/spec/models/get_privileges_for_table_spec.rb +48 -0
- data/spec/models/get_privileges_spec.rb +48 -0
- data/spec/models/get_settings_data_files_spec.rb +72 -0
- data/spec/models/get_settings_data_global_spec.rb +72 -0
- data/spec/models/get_settings_data_spec.rb +48 -0
- data/spec/models/get_settings_for_meta_spec.rb +54 -0
- data/spec/models/get_settings_for_spec.rb +48 -0
- data/spec/models/get_settings_spec.rb +48 -0
- data/spec/models/get_table_column_data_spec.rb +132 -0
- data/spec/models/get_table_column_spec.rb +48 -0
- data/spec/models/get_table_columns_data_spec.rb +156 -0
- data/spec/models/get_table_columns_spec.rb +48 -0
- data/spec/models/get_table_data_spec.rb +168 -0
- data/spec/models/get_table_row_spec.rb +48 -0
- data/spec/models/get_table_rows_data_spec.rb +48 -0
- data/spec/models/get_table_rows_meta_spec.rb +78 -0
- data/spec/models/get_table_rows_spec.rb +48 -0
- data/spec/models/get_table_spec.rb +48 -0
- data/spec/models/get_tables_data_spec.rb +42 -0
- data/spec/models/get_tables_meta_spec.rb +48 -0
- data/spec/models/get_tables_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +451 -0
@@ -0,0 +1,123 @@
|
|
1
|
+
=begin
|
2
|
+
#directus.io
|
3
|
+
|
4
|
+
#API for directus.io
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module DirectusSDK
|
16
|
+
class MessagesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns specific message
|
24
|
+
#
|
25
|
+
# @param message_id ID of message to return
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [GetMessage]
|
28
|
+
def get_message(message_id, opts = {})
|
29
|
+
data, _status_code, _headers = get_message_with_http_info(message_id, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns specific message
|
34
|
+
#
|
35
|
+
# @param message_id ID of message to return
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(GetMessage, Fixnum, Hash)>] GetMessage data, response status code and response headers
|
38
|
+
def get_message_with_http_info(message_id, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: MessagesApi.get_message ..."
|
41
|
+
end
|
42
|
+
# verify the required parameter 'message_id' is set
|
43
|
+
if @api_client.config.client_side_validation && message_id.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.get_message"
|
45
|
+
end
|
46
|
+
# resource path
|
47
|
+
local_var_path = "/messages/{messageId}".sub('{' + 'messageId' + '}', message_id.to_s)
|
48
|
+
|
49
|
+
# query parameters
|
50
|
+
query_params = {}
|
51
|
+
|
52
|
+
# header parameters
|
53
|
+
header_params = {}
|
54
|
+
# HTTP header 'Accept' (if needed)
|
55
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
56
|
+
|
57
|
+
# form parameters
|
58
|
+
form_params = {}
|
59
|
+
|
60
|
+
# http body (model)
|
61
|
+
post_body = nil
|
62
|
+
auth_names = ['api_key']
|
63
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
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 => 'GetMessage')
|
70
|
+
if @api_client.config.debugging
|
71
|
+
@api_client.config.logger.debug "API called: MessagesApi#get_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
72
|
+
end
|
73
|
+
return data, status_code, headers
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns messages
|
77
|
+
#
|
78
|
+
# @param [Hash] opts the optional parameters
|
79
|
+
# @return [GetMessages]
|
80
|
+
def get_messages(opts = {})
|
81
|
+
data, _status_code, _headers = get_messages_with_http_info(opts)
|
82
|
+
return data
|
83
|
+
end
|
84
|
+
|
85
|
+
# Returns messages
|
86
|
+
#
|
87
|
+
# @param [Hash] opts the optional parameters
|
88
|
+
# @return [Array<(GetMessages, Fixnum, Hash)>] GetMessages data, response status code and response headers
|
89
|
+
def get_messages_with_http_info(opts = {})
|
90
|
+
if @api_client.config.debugging
|
91
|
+
@api_client.config.logger.debug "Calling API: MessagesApi.get_messages ..."
|
92
|
+
end
|
93
|
+
# resource path
|
94
|
+
local_var_path = "/messages/self"
|
95
|
+
|
96
|
+
# query parameters
|
97
|
+
query_params = {}
|
98
|
+
|
99
|
+
# header parameters
|
100
|
+
header_params = {}
|
101
|
+
# HTTP header 'Accept' (if needed)
|
102
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
103
|
+
|
104
|
+
# form parameters
|
105
|
+
form_params = {}
|
106
|
+
|
107
|
+
# http body (model)
|
108
|
+
post_body = nil
|
109
|
+
auth_names = ['api_key']
|
110
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
111
|
+
:header_params => header_params,
|
112
|
+
:query_params => query_params,
|
113
|
+
:form_params => form_params,
|
114
|
+
:body => post_body,
|
115
|
+
:auth_names => auth_names,
|
116
|
+
:return_type => 'GetMessages')
|
117
|
+
if @api_client.config.debugging
|
118
|
+
@api_client.config.logger.debug "API called: MessagesApi#get_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
119
|
+
end
|
120
|
+
return data, status_code, headers
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,151 @@
|
|
1
|
+
=begin
|
2
|
+
#directus.io
|
3
|
+
|
4
|
+
#API for directus.io
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module DirectusSDK
|
16
|
+
class PreferencesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns table preferences
|
24
|
+
#
|
25
|
+
# @param table_id ID of table to return rows from
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [GetPreferences]
|
28
|
+
def get_preferences(table_id, opts = {})
|
29
|
+
data, _status_code, _headers = get_preferences_with_http_info(table_id, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns table preferences
|
34
|
+
#
|
35
|
+
# @param table_id ID of table to return rows from
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(GetPreferences, Fixnum, Hash)>] GetPreferences data, response status code and response headers
|
38
|
+
def get_preferences_with_http_info(table_id, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: PreferencesApi.get_preferences ..."
|
41
|
+
end
|
42
|
+
# verify the required parameter 'table_id' is set
|
43
|
+
if @api_client.config.client_side_validation && table_id.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter 'table_id' when calling PreferencesApi.get_preferences"
|
45
|
+
end
|
46
|
+
# resource path
|
47
|
+
local_var_path = "/tables/{tableId}/preferences".sub('{' + 'tableId' + '}', table_id.to_s)
|
48
|
+
|
49
|
+
# query parameters
|
50
|
+
query_params = {}
|
51
|
+
|
52
|
+
# header parameters
|
53
|
+
header_params = {}
|
54
|
+
# HTTP header 'Accept' (if needed)
|
55
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
56
|
+
|
57
|
+
# form parameters
|
58
|
+
form_params = {}
|
59
|
+
|
60
|
+
# http body (model)
|
61
|
+
post_body = nil
|
62
|
+
auth_names = ['api_key']
|
63
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
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 => 'GetPreferences')
|
70
|
+
if @api_client.config.debugging
|
71
|
+
@api_client.config.logger.debug "API called: PreferencesApi#get_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
72
|
+
end
|
73
|
+
return data, status_code, headers
|
74
|
+
end
|
75
|
+
|
76
|
+
# Update table preferences
|
77
|
+
#
|
78
|
+
# @param table_id ID of table to return rows from
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @option opts [String] :id Preference's Unique Identification number
|
81
|
+
# @option opts [String] :table_name Name of table to add
|
82
|
+
# @option opts [String] :columns_visible List of visible columns, separated by commas
|
83
|
+
# @option opts [Integer] :sort The sort order of the column used to override the column order in the schema
|
84
|
+
# @option opts [String] :sort_order Sort Order (ASC=Ascending or DESC=Descending)
|
85
|
+
# @option opts [String] :status List of status values. separated by comma
|
86
|
+
# @return [nil]
|
87
|
+
def update_preferences(table_id, opts = {})
|
88
|
+
update_preferences_with_http_info(table_id, opts)
|
89
|
+
return nil
|
90
|
+
end
|
91
|
+
|
92
|
+
# Update table preferences
|
93
|
+
#
|
94
|
+
# @param table_id ID of table to return rows from
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @option opts [String] :id Preference's Unique Identification number
|
97
|
+
# @option opts [String] :table_name Name of table to add
|
98
|
+
# @option opts [String] :columns_visible List of visible columns, separated by commas
|
99
|
+
# @option opts [Integer] :sort The sort order of the column used to override the column order in the schema
|
100
|
+
# @option opts [String] :sort_order Sort Order (ASC=Ascending or DESC=Descending)
|
101
|
+
# @option opts [String] :status List of status values. separated by comma
|
102
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
103
|
+
def update_preferences_with_http_info(table_id, opts = {})
|
104
|
+
if @api_client.config.debugging
|
105
|
+
@api_client.config.logger.debug "Calling API: PreferencesApi.update_preferences ..."
|
106
|
+
end
|
107
|
+
# verify the required parameter 'table_id' is set
|
108
|
+
if @api_client.config.client_side_validation && table_id.nil?
|
109
|
+
fail ArgumentError, "Missing the required parameter 'table_id' when calling PreferencesApi.update_preferences"
|
110
|
+
end
|
111
|
+
if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
|
112
|
+
fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC'
|
113
|
+
end
|
114
|
+
# resource path
|
115
|
+
local_var_path = "/tables/{tableId}/preferences".sub('{' + 'tableId' + '}', table_id.to_s)
|
116
|
+
|
117
|
+
# query parameters
|
118
|
+
query_params = {}
|
119
|
+
|
120
|
+
# header parameters
|
121
|
+
header_params = {}
|
122
|
+
# HTTP header 'Accept' (if needed)
|
123
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
124
|
+
# HTTP header 'Content-Type'
|
125
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
126
|
+
|
127
|
+
# form parameters
|
128
|
+
form_params = {}
|
129
|
+
form_params["id"] = opts[:'id'] if !opts[:'id'].nil?
|
130
|
+
form_params["table_name"] = opts[:'table_name'] if !opts[:'table_name'].nil?
|
131
|
+
form_params["columns_visible"] = opts[:'columns_visible'] if !opts[:'columns_visible'].nil?
|
132
|
+
form_params["sort"] = opts[:'sort'] if !opts[:'sort'].nil?
|
133
|
+
form_params["sort_order"] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
134
|
+
form_params["status"] = opts[:'status'] if !opts[:'status'].nil?
|
135
|
+
|
136
|
+
# http body (model)
|
137
|
+
post_body = nil
|
138
|
+
auth_names = ['api_key']
|
139
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
140
|
+
:header_params => header_params,
|
141
|
+
:query_params => query_params,
|
142
|
+
:form_params => form_params,
|
143
|
+
:body => post_body,
|
144
|
+
:auth_names => auth_names)
|
145
|
+
if @api_client.config.debugging
|
146
|
+
@api_client.config.logger.debug "API called: PreferencesApi#update_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
147
|
+
end
|
148
|
+
return data, status_code, headers
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
@@ -0,0 +1,183 @@
|
|
1
|
+
=begin
|
2
|
+
#directus.io
|
3
|
+
|
4
|
+
#API for directus.io
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module DirectusSDK
|
16
|
+
class SettingsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns settings
|
24
|
+
#
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [GetSettings]
|
27
|
+
def get_settings(opts = {})
|
28
|
+
data, _status_code, _headers = get_settings_with_http_info(opts)
|
29
|
+
return data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns settings
|
33
|
+
#
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @return [Array<(GetSettings, Fixnum, Hash)>] GetSettings data, response status code and response headers
|
36
|
+
def get_settings_with_http_info(opts = {})
|
37
|
+
if @api_client.config.debugging
|
38
|
+
@api_client.config.logger.debug "Calling API: SettingsApi.get_settings ..."
|
39
|
+
end
|
40
|
+
# resource path
|
41
|
+
local_var_path = "/settings"
|
42
|
+
|
43
|
+
# query parameters
|
44
|
+
query_params = {}
|
45
|
+
|
46
|
+
# header parameters
|
47
|
+
header_params = {}
|
48
|
+
# HTTP header 'Accept' (if needed)
|
49
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
50
|
+
|
51
|
+
# form parameters
|
52
|
+
form_params = {}
|
53
|
+
|
54
|
+
# http body (model)
|
55
|
+
post_body = nil
|
56
|
+
auth_names = ['api_key']
|
57
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
58
|
+
:header_params => header_params,
|
59
|
+
:query_params => query_params,
|
60
|
+
:form_params => form_params,
|
61
|
+
:body => post_body,
|
62
|
+
:auth_names => auth_names,
|
63
|
+
:return_type => 'GetSettings')
|
64
|
+
if @api_client.config.debugging
|
65
|
+
@api_client.config.logger.debug "API called: SettingsApi#get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
66
|
+
end
|
67
|
+
return data, status_code, headers
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns settings for collection
|
71
|
+
#
|
72
|
+
# @param collection_name Name of collection to return settings for
|
73
|
+
# @param [Hash] opts the optional parameters
|
74
|
+
# @return [GetSettingsFor]
|
75
|
+
def get_settings_for(collection_name, opts = {})
|
76
|
+
data, _status_code, _headers = get_settings_for_with_http_info(collection_name, opts)
|
77
|
+
return data
|
78
|
+
end
|
79
|
+
|
80
|
+
# Returns settings for collection
|
81
|
+
#
|
82
|
+
# @param collection_name Name of collection to return settings for
|
83
|
+
# @param [Hash] opts the optional parameters
|
84
|
+
# @return [Array<(GetSettingsFor, Fixnum, Hash)>] GetSettingsFor data, response status code and response headers
|
85
|
+
def get_settings_for_with_http_info(collection_name, opts = {})
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "Calling API: SettingsApi.get_settings_for ..."
|
88
|
+
end
|
89
|
+
# verify the required parameter 'collection_name' is set
|
90
|
+
if @api_client.config.client_side_validation && collection_name.nil?
|
91
|
+
fail ArgumentError, "Missing the required parameter 'collection_name' when calling SettingsApi.get_settings_for"
|
92
|
+
end
|
93
|
+
# resource path
|
94
|
+
local_var_path = "/settings/{collectionName}".sub('{' + 'collectionName' + '}', collection_name.to_s)
|
95
|
+
|
96
|
+
# query parameters
|
97
|
+
query_params = {}
|
98
|
+
|
99
|
+
# header parameters
|
100
|
+
header_params = {}
|
101
|
+
# HTTP header 'Accept' (if needed)
|
102
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
103
|
+
|
104
|
+
# form parameters
|
105
|
+
form_params = {}
|
106
|
+
|
107
|
+
# http body (model)
|
108
|
+
post_body = nil
|
109
|
+
auth_names = ['api_key']
|
110
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
111
|
+
:header_params => header_params,
|
112
|
+
:query_params => query_params,
|
113
|
+
:form_params => form_params,
|
114
|
+
:body => post_body,
|
115
|
+
:auth_names => auth_names,
|
116
|
+
:return_type => 'GetSettingsFor')
|
117
|
+
if @api_client.config.debugging
|
118
|
+
@api_client.config.logger.debug "API called: SettingsApi#get_settings_for\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
119
|
+
end
|
120
|
+
return data, status_code, headers
|
121
|
+
end
|
122
|
+
|
123
|
+
# Update settings
|
124
|
+
#
|
125
|
+
# @param collection_name Name of collection to return settings for
|
126
|
+
# @param custom_data Data based on your specific schema eg: active=1&title=LoremIpsum
|
127
|
+
# @param [Hash] opts the optional parameters
|
128
|
+
# @return [nil]
|
129
|
+
def update_settings(collection_name, custom_data, opts = {})
|
130
|
+
update_settings_with_http_info(collection_name, custom_data, opts)
|
131
|
+
return nil
|
132
|
+
end
|
133
|
+
|
134
|
+
# Update settings
|
135
|
+
#
|
136
|
+
# @param collection_name Name of collection to return settings for
|
137
|
+
# @param custom_data Data based on your specific schema eg: active=1&title=LoremIpsum
|
138
|
+
# @param [Hash] opts the optional parameters
|
139
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
140
|
+
def update_settings_with_http_info(collection_name, custom_data, opts = {})
|
141
|
+
if @api_client.config.debugging
|
142
|
+
@api_client.config.logger.debug "Calling API: SettingsApi.update_settings ..."
|
143
|
+
end
|
144
|
+
# verify the required parameter 'collection_name' is set
|
145
|
+
if @api_client.config.client_side_validation && collection_name.nil?
|
146
|
+
fail ArgumentError, "Missing the required parameter 'collection_name' when calling SettingsApi.update_settings"
|
147
|
+
end
|
148
|
+
# verify the required parameter 'custom_data' is set
|
149
|
+
if @api_client.config.client_side_validation && custom_data.nil?
|
150
|
+
fail ArgumentError, "Missing the required parameter 'custom_data' when calling SettingsApi.update_settings"
|
151
|
+
end
|
152
|
+
# resource path
|
153
|
+
local_var_path = "/settings/{collectionName}".sub('{' + 'collectionName' + '}', collection_name.to_s)
|
154
|
+
|
155
|
+
# query parameters
|
156
|
+
query_params = {}
|
157
|
+
|
158
|
+
# header parameters
|
159
|
+
header_params = {}
|
160
|
+
# HTTP header 'Accept' (if needed)
|
161
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
162
|
+
# HTTP header 'Content-Type'
|
163
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
164
|
+
|
165
|
+
# form parameters
|
166
|
+
form_params = {}
|
167
|
+
|
168
|
+
# http body (model)
|
169
|
+
post_body = @api_client.object_to_http_body(custom_data)
|
170
|
+
auth_names = ['api_key']
|
171
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
172
|
+
:header_params => header_params,
|
173
|
+
:query_params => query_params,
|
174
|
+
:form_params => form_params,
|
175
|
+
:body => post_body,
|
176
|
+
:auth_names => auth_names)
|
177
|
+
if @api_client.config.debugging
|
178
|
+
@api_client.config.logger.debug "API called: SettingsApi#update_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
179
|
+
end
|
180
|
+
return data, status_code, headers
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|