Class: Notifo::MediaApi
- Inherits:
-
Object
- Object
- Notifo::MediaApi
- Defined in:
- lib/notifo/api/media_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ MediaApi
constructor
A new instance of MediaApi.
-
#media_delete(app_id, file_name, opts = {}) ⇒ nil
Delete a media.
-
#media_delete_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a media.
-
#media_download(app_id, file_name, opts = {}) ⇒ String
Download a media object.
-
#media_download2(app_id, file_name, opts = {}) ⇒ String
Download a media object.
-
#media_download2_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(String, Integer, Hash)>
Download a media object.
-
#media_download_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(String, Integer, Hash)>
Download a media object.
-
#media_get_medias(app_id, opts = {}) ⇒ ListResponseDtoOfMediaDto
Query media items.
-
#media_get_medias_with_http_info(app_id, opts = {}) ⇒ Array<(ListResponseDtoOfMediaDto, Integer, Hash)>
Query media items.
-
#media_upload(app_id, opts = {}) ⇒ nil
Upload a media object.
-
#media_upload_with_http_info(app_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Upload a media object.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
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.
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.
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.
94 95 96 97 |
# File 'lib/notifo/api/media_api.rb', line 94 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.
184 185 186 187 |
# File 'lib/notifo/api/media_api.rb', line 184 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.
204 205 206 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 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/notifo/api/media_api.rb', line 204 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/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[:'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? # 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_download_with_http_info(app_id, file_name, opts = {}) ⇒ Array<(String, Integer, Hash)>
Download a media object.
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 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 |
# File 'lib/notifo/api/media_api.rb', line 114 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[:'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? # 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.
266 267 268 269 |
# File 'lib/notifo/api/media_api.rb', line 266 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.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/notifo/api/media_api.rb', line 278 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_upload(app_id, opts = {}) ⇒ nil
Upload a media object.
327 328 329 330 |
# File 'lib/notifo/api/media_api.rb', line 327 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.
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 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/notifo/api/media_api.rb', line 337 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 |