Class: DirectusSDK::BookmarksApi

Inherits:
Object
  • Object
show all
Defined in:
lib/directus_sdk/api/bookmarks_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BookmarksApi

Returns a new instance of BookmarksApi.



19
20
21
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_bookmark(opts = {}) ⇒ nil

Create a column in a given table

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :user (String)
    Directus user id

    This assigns the bookmark to a specific user (there's a ticket to allow for "global" bookmarks using NULL) (Only using local connection)

  • :title (String)

    The text to display in the navigation menu

  • :url (String)

    The path to navigate to when clicked, relative to the Directus root

  • :icon_class (String)

    Deprecated

  • :active (String)

    Deprecated

  • :section (String)
    "search" or "other"

    Which nav section to show the link within. User generated bookmarks use "search", while all system links go within "other"

Returns:

  • (nil)


33
34
35
36
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 33

def add_bookmark(opts = {})
  add_bookmark_with_http_info(opts)
  return nil
end

#add_bookmark_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create a column in a given table

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :user (String)
    Directus user id

    This assigns the bookmark to a specific user (there&#39;s a ticket to allow for &quot;global&quot; bookmarks using NULL) (Only using local connection)

  • :title (String)

    The text to display in the navigation menu

  • :url (String)

    The path to navigate to when clicked, relative to the Directus root

  • :icon_class (String)

    Deprecated

  • :active (String)

    Deprecated

  • :section (String)
    &quot;search&quot; or &quot;other&quot;

    Which nav section to show the link within. User generated bookmarks use &quot;search&quot;, while all system links go within &quot;other&quot;

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 48

def add_bookmark_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BookmarksApi.add_bookmark ..."
  end
  # resource path
  local_var_path = "/bookmarks"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}
  form_params["user"] = opts[:'user'] if !opts[:'user'].nil?
  form_params["title"] = opts[:'title'] if !opts[:'title'].nil?
  form_params["url"] = opts[:'url'] if !opts[:'url'].nil?
  form_params["icon_class"] = opts[:'icon_class'] if !opts[:'icon_class'].nil?
  form_params["active"] = opts[:'active'] if !opts[:'active'].nil?
  form_params["section"] = opts[:'section'] if !opts[:'section'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BookmarksApi#add_bookmark\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_bookmark(bookmark_id, opts = {}) ⇒ nil

Deletes specific bookmark

Parameters:

  • bookmark_id

    ID of table to return rows from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


94
95
96
97
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 94

def delete_bookmark(bookmark_id, opts = {})
  delete_bookmark_with_http_info(bookmark_id, opts)
  return nil
end

#delete_bookmark_with_http_info(bookmark_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Deletes specific bookmark

Parameters:

  • bookmark_id

    ID of table to return rows from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 104

def delete_bookmark_with_http_info(bookmark_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BookmarksApi.delete_bookmark ..."
  end
  # verify the required parameter 'bookmark_id' is set
  if @api_client.config.client_side_validation && bookmark_id.nil?
    fail ArgumentError, "Missing the required parameter 'bookmark_id' when calling BookmarksApi.delete_bookmark"
  end
  # resource path
  local_var_path = "/bookmarks/{bookmarkId}".sub('{' + 'bookmarkId' + '}', bookmark_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BookmarksApi#delete_bookmark\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bookmark(bookmark_id, opts = {}) ⇒ GetBookmark

Returns specific bookmark

Parameters:

  • bookmark_id

    ID of table to return rows from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



146
147
148
149
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 146

def get_bookmark(bookmark_id, opts = {})
  data, _status_code, _headers = get_bookmark_with_http_info(bookmark_id, opts)
  return data
end

#get_bookmark_with_http_info(bookmark_id, opts = {}) ⇒ Array<(GetBookmark, Fixnum, Hash)>

Returns specific bookmark

Parameters:

  • bookmark_id

    ID of table to return rows from

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetBookmark, Fixnum, Hash)>)

    GetBookmark data, response status code and response headers



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 156

def get_bookmark_with_http_info(bookmark_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BookmarksApi.get_bookmark ..."
  end
  # verify the required parameter 'bookmark_id' is set
  if @api_client.config.client_side_validation && bookmark_id.nil?
    fail ArgumentError, "Missing the required parameter 'bookmark_id' when calling BookmarksApi.get_bookmark"
  end
  # resource path
  local_var_path = "/bookmarks/{bookmarkId}".sub('{' + 'bookmarkId' + '}', bookmark_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetBookmark')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BookmarksApi#get_bookmark\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bookmarks(opts = {}) ⇒ GetBookmarks

Returns bookmarks

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



198
199
200
201
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 198

def get_bookmarks(opts = {})
  data, _status_code, _headers = get_bookmarks_with_http_info(opts)
  return data
end

#get_bookmarks_self(opts = {}) ⇒ GetBookmarks

Returns bookmarks of current user

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



245
246
247
248
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 245

def get_bookmarks_self(opts = {})
  data, _status_code, _headers = get_bookmarks_self_with_http_info(opts)
  return data
end

#get_bookmarks_self_with_http_info(opts = {}) ⇒ Array<(GetBookmarks, Fixnum, Hash)>

Returns bookmarks of current user

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetBookmarks, Fixnum, Hash)>)

    GetBookmarks data, response status code and response headers



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 254

def get_bookmarks_self_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BookmarksApi.get_bookmarks_self ..."
  end
  # resource path
  local_var_path = "/bookmarks/self"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetBookmarks')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BookmarksApi#get_bookmarks_self\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bookmarks_with_http_info(opts = {}) ⇒ Array<(GetBookmarks, Fixnum, Hash)>

Returns bookmarks

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetBookmarks, Fixnum, Hash)>)

    GetBookmarks data, response status code and response headers



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/directus_sdk/api/bookmarks_api.rb', line 207

def get_bookmarks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: BookmarksApi.get_bookmarks ..."
  end
  # resource path
  local_var_path = "/bookmarks"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetBookmarks')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BookmarksApi#get_bookmarks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end