Class: Notifo::MediaApi

Inherits:
Object
  • Object
show all
Defined in:
lib/notifo/api/media_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MediaApi

Returns a new instance of MediaApi.



16
17
18
# File 'lib/notifo/api/media_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/notifo/api/media_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#media_delete(app_id, file_name, opts = {}) ⇒ nil

Delete a media.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The file name of the media.

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

    the optional parameters

Returns:

  • (nil)


24
25
26
27
# File 'lib/notifo/api/media_api.rb', line 24

def media_delete(app_id, file_name, opts = {})
  media_delete_with_http_info(app_id, file_name, opts)
  nil
end

#media_delete_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a media.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The file name of the media.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/notifo/api/media_api.rb', line 34

def media_delete_with_http_info(app_id, file_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MediaApi.media_delete ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling MediaApi.media_delete"
  end
  # verify the required parameter 'file_name' is set
  if @api_client.config.client_side_validation && file_name.nil?
    fail ArgumentError, "Missing the required parameter 'file_name' when calling MediaApi.media_delete"
  end
  # resource path
  local_var_path = '/api/apps/{appId}/media/{fileName}'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'fileName' + '}', file_name.to_s)

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] 

  auth_names = opts[:auth_names] || []
  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,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MediaApi#media_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#media_download(app_id, file_name, opts = {}) ⇒ String

Download a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The name of the media to download.

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

    the optional parameters

Options Hash (opts):

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (String)


96
97
98
99
# File 'lib/notifo/api/media_api.rb', line 96

def media_download(app_id, file_name, opts = {})
  data, _status_code, _headers = media_download_with_http_info(app_id, file_name, opts)
  data
end

#media_download2(app_id, file_name, opts = {}) ⇒ String

Download a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The name of the media to download.

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

    the optional parameters

Options Hash (opts):

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (String)


192
193
194
195
# File 'lib/notifo/api/media_api.rb', line 192

def media_download2(app_id, file_name, opts = {})
  data, _status_code, _headers = media_download2_with_http_info(app_id, file_name, opts)
  data
end

#media_download2_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(String, Integer, Hash)>

Download a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The name of the media to download.

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

    the optional parameters

Options Hash (opts):

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/notifo/api/media_api.rb', line 214

def media_download2_with_http_info(app_id, file_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MediaApi.media_download2 ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling MediaApi.media_download2"
  end
  # verify the required parameter 'file_name' is set
  if @api_client.config.client_side_validation && file_name.nil?
    fail ArgumentError, "Missing the required parameter 'file_name' when calling MediaApi.media_download2"
  end
  # resource path
  local_var_path = '/api/asset/{appId}/{fileName}'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'fileName' + '}', file_name.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cache'] = opts[:'cache'] if !opts[:'cache'].nil?
  query_params[:'download'] = opts[:'download'] if !opts[:'download'].nil?
  query_params[:'bg'] = opts[:'bg'] if !opts[:'bg'].nil?
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  query_params[:'preset'] = opts[:'preset'] if !opts[:'preset'].nil?
  query_params[:'mode'] = opts[:'mode'] if !opts[:'mode'].nil?
  query_params[:'focusX'] = opts[:'focus_x'] if !opts[:'focus_x'].nil?
  query_params[:'focusY'] = opts[:'focus_y'] if !opts[:'focus_y'].nil?
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
  query_params[:'emptyOnFailure'] = opts[:'empty_on_failure'] if !opts[:'empty_on_failure'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'String' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MediaApi#media_download2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#media_download3(app_id, file_name, opts = {}) ⇒ String

Download a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The name of the media to download.

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

    the optional parameters

Options Hash (opts):

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (String)


288
289
290
291
# File 'lib/notifo/api/media_api.rb', line 288

def media_download3(app_id, file_name, opts = {})
  data, _status_code, _headers = media_download3_with_http_info(app_id, file_name, opts)
  data
end

#media_download3_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(String, Integer, Hash)>

Download a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The name of the media to download.

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

    the optional parameters

Options Hash (opts):

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/notifo/api/media_api.rb', line 310

def media_download3_with_http_info(app_id, file_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MediaApi.media_download3 ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling MediaApi.media_download3"
  end
  # verify the required parameter 'file_name' is set
  if @api_client.config.client_side_validation && file_name.nil?
    fail ArgumentError, "Missing the required parameter 'file_name' when calling MediaApi.media_download3"
  end
  # resource path
  local_var_path = '/api/assets/{appId}/{fileName}'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'fileName' + '}', file_name.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cache'] = opts[:'cache'] if !opts[:'cache'].nil?
  query_params[:'download'] = opts[:'download'] if !opts[:'download'].nil?
  query_params[:'bg'] = opts[:'bg'] if !opts[:'bg'].nil?
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  query_params[:'preset'] = opts[:'preset'] if !opts[:'preset'].nil?
  query_params[:'mode'] = opts[:'mode'] if !opts[:'mode'].nil?
  query_params[:'focusX'] = opts[:'focus_x'] if !opts[:'focus_x'].nil?
  query_params[:'focusY'] = opts[:'focus_y'] if !opts[:'focus_y'].nil?
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
  query_params[:'emptyOnFailure'] = opts[:'empty_on_failure'] if !opts[:'empty_on_failure'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'String' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MediaApi#media_download3\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#media_download_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(String, Integer, Hash)>

Download a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

  • file_name

    The name of the media to download.

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

    the optional parameters

Options Hash (opts):

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/notifo/api/media_api.rb', line 118

def media_download_with_http_info(app_id, file_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MediaApi.media_download ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling MediaApi.media_download"
  end
  # verify the required parameter 'file_name' is set
  if @api_client.config.client_side_validation && file_name.nil?
    fail ArgumentError, "Missing the required parameter 'file_name' when calling MediaApi.media_download"
  end
  # resource path
  local_var_path = '/api/apps/{appId}/media/{fileName}'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'fileName' + '}', file_name.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cache'] = opts[:'cache'] if !opts[:'cache'].nil?
  query_params[:'download'] = opts[:'download'] if !opts[:'download'].nil?
  query_params[:'bg'] = opts[:'bg'] if !opts[:'bg'].nil?
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  query_params[:'preset'] = opts[:'preset'] if !opts[:'preset'].nil?
  query_params[:'mode'] = opts[:'mode'] if !opts[:'mode'].nil?
  query_params[:'focusX'] = opts[:'focus_x'] if !opts[:'focus_x'].nil?
  query_params[:'focusY'] = opts[:'focus_y'] if !opts[:'focus_y'].nil?
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
  query_params[:'emptyOnFailure'] = opts[:'empty_on_failure'] if !opts[:'empty_on_failure'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'String' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MediaApi#media_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#media_get_medias(app_id, opts = {}) ⇒ ListResponseDtoOfMediaDto

Query media items.

Parameters:

  • app_id

    The app where the media belongs to.

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

    the optional parameters

Options Hash (opts):

  • :query (String)

    The optional query to search for items.

  • :take (Integer)

    The number of items to return.

  • :skip (Integer)

    The number of items to skip.

Returns:



374
375
376
377
# File 'lib/notifo/api/media_api.rb', line 374

def media_get_medias(app_id, opts = {})
  data, _status_code, _headers = media_get_medias_with_http_info(app_id, opts)
  data
end

#media_get_medias_with_http_info(app_id, opts = {}) ⇒ Array<(ListResponseDtoOfMediaDto, Integer, Hash)>

Query media items.

Parameters:

  • app_id

    The app where the media belongs to.

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

    the optional parameters

Options Hash (opts):

  • :query (String)

    The optional query to search for items.

  • :take (Integer)

    The number of items to return.

  • :skip (Integer)

    The number of items to skip.

Returns:

  • (Array<(ListResponseDtoOfMediaDto, Integer, Hash)>)

    ListResponseDtoOfMediaDto data, response status code and response headers



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/notifo/api/media_api.rb', line 386

def media_get_medias_with_http_info(app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MediaApi.media_get_medias ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling MediaApi.media_get_medias"
  end
  # resource path
  local_var_path = '/api/apps/{appId}/media'.sub('{' + 'appId' + '}', app_id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'take'] = opts[:'take'] if !opts[:'take'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'ListResponseDtoOfMediaDto' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MediaApi#media_get_medias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#media_proxy_proxy_image(opts = {}) ⇒ String

Download a media object.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :url (String)

    The app id where the media belongs to.

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (String)


446
447
448
449
# File 'lib/notifo/api/media_api.rb', line 446

def media_proxy_proxy_image(opts = {})
  data, _status_code, _headers = media_proxy_proxy_image_with_http_info(opts)
  data
end

#media_proxy_proxy_image_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>

Download a media object.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :url (String)

    The app id where the media belongs to.

  • :cache (Integer)

    The cache duration.

  • :download (Integer)

    Set it to 1 to create a download response.

  • :bg (String)

    Optional background color.

  • :width (Integer)

    The target width when an image.

  • :height (Integer)

    The target height when an image.

  • :quality (Integer)

    The target quality when an image.

  • :preset (String)

    A preset dimension.

  • :mode (ResizeMode)

    The resize mode.

  • :focus_x (Float)

    The x position of the focues point.

  • :focus_y (Float)

    The y position of the focues point.

  • :force (BOOLEAN)

    True to resize it and clear the cache.

  • :empty_on_failure (BOOLEAN)

    True, to return an empty image on failure.

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/notifo/api/media_api.rb', line 467

def media_proxy_proxy_image_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MediaApi.media_proxy_proxy_image ...'
  end
  # resource path
  local_var_path = '/api/assets/proxy'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'url'] = opts[:'url'] if !opts[:'url'].nil?
  query_params[:'cache'] = opts[:'cache'] if !opts[:'cache'].nil?
  query_params[:'download'] = opts[:'download'] if !opts[:'download'].nil?
  query_params[:'bg'] = opts[:'bg'] if !opts[:'bg'].nil?
  query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
  query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
  query_params[:'quality'] = opts[:'quality'] if !opts[:'quality'].nil?
  query_params[:'preset'] = opts[:'preset'] if !opts[:'preset'].nil?
  query_params[:'mode'] = opts[:'mode'] if !opts[:'mode'].nil?
  query_params[:'focusX'] = opts[:'focus_x'] if !opts[:'focus_x'].nil?
  query_params[:'focusY'] = opts[:'focus_y'] if !opts[:'focus_y'].nil?
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
  query_params[:'emptyOnFailure'] = opts[:'empty_on_failure'] if !opts[:'empty_on_failure'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'String' 

  auth_names = opts[:auth_names] || []
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MediaApi#media_proxy_proxy_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#media_upload(app_id, opts = {}) ⇒ nil

Upload a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

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

    the optional parameters

Options Hash (opts):

  • :file (String)

Returns:

  • (nil)


522
523
524
525
# File 'lib/notifo/api/media_api.rb', line 522

def media_upload(app_id, opts = {})
  media_upload_with_http_info(app_id, opts)
  nil
end

#media_upload_with_http_info(app_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Upload a media object.

Parameters:

  • app_id

    The app id where the media belongs to.

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

    the optional parameters

Options Hash (opts):

  • :file (String)

Returns:

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

    nil, response status code and response headers



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
# File 'lib/notifo/api/media_api.rb', line 532

def media_upload_with_http_info(app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MediaApi.media_upload ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling MediaApi.media_upload"
  end
  # resource path
  local_var_path = '/api/apps/{appId}/media'.sub('{' + 'appId' + '}', app_id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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(['multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] 

  auth_names = opts[:auth_names] || []
  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,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MediaApi#media_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end