Class: Zernio::QueueApi
- Inherits:
-
Object
- Object
- Zernio::QueueApi
- Defined in:
- lib/zernio-sdk/api/queue_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_queue_slot(create_queue_slot_request, opts = {}) ⇒ CreateQueueSlot201Response
Create schedule Create an additional queue for a profile.
-
#create_queue_slot_with_http_info(create_queue_slot_request, opts = {}) ⇒ Array<(CreateQueueSlot201Response, Integer, Hash)>
Create schedule Create an additional queue for a profile.
-
#delete_queue_slot(profile_id, opts = {}) ⇒ QueueDeleteResponse
Delete schedule Delete a queue from a profile.
-
#delete_queue_slot_with_http_info(profile_id, opts = {}) ⇒ Array<(QueueDeleteResponse, Integer, Hash)>
Delete schedule Delete a queue from a profile.
-
#get_next_queue_slot(profile_id, opts = {}) ⇒ QueueNextSlotResponse
Get next available slot Returns the next available queue slot for preview purposes.
-
#get_next_queue_slot_with_http_info(profile_id, opts = {}) ⇒ Array<(QueueNextSlotResponse, Integer, Hash)>
Get next available slot Returns the next available queue slot for preview purposes.
-
#initialize(api_client = ApiClient.default) ⇒ QueueApi
constructor
A new instance of QueueApi.
-
#list_queue_slots(profile_id, opts = {}) ⇒ ListQueueSlots200Response
List schedules Returns queue schedules for a profile.
-
#list_queue_slots_with_http_info(profile_id, opts = {}) ⇒ Array<(ListQueueSlots200Response, Integer, Hash)>
List schedules Returns queue schedules for a profile.
-
#preview_queue(profile_id, opts = {}) ⇒ QueuePreviewResponse
Preview upcoming slots Returns the next N upcoming queue slot times for a profile as ISO datetime strings.
-
#preview_queue_with_http_info(profile_id, opts = {}) ⇒ Array<(QueuePreviewResponse, Integer, Hash)>
Preview upcoming slots Returns the next N upcoming queue slot times for a profile as ISO datetime strings.
-
#update_queue_slot(update_queue_slot_request, opts = {}) ⇒ QueueUpdateResponse
Update schedule Create a new queue or update an existing one.
-
#update_queue_slot_with_http_info(update_queue_slot_request, opts = {}) ⇒ Array<(QueueUpdateResponse, Integer, Hash)>
Update schedule Create a new queue or update an existing one.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_queue_slot(create_queue_slot_request, opts = {}) ⇒ CreateQueueSlot201Response
Create schedule Create an additional queue for a profile. The first queue created becomes the default. Subsequent queues are non-default unless explicitly set.
27 28 29 30 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 27 def create_queue_slot(create_queue_slot_request, opts = {}) data, _status_code, _headers = create_queue_slot_with_http_info(create_queue_slot_request, opts) data end |
#create_queue_slot_with_http_info(create_queue_slot_request, opts = {}) ⇒ Array<(CreateQueueSlot201Response, Integer, Hash)>
Create schedule Create an additional queue for a profile. The first queue created becomes the default. Subsequent queues are non-default unless explicitly set.
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 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 37 def create_queue_slot_with_http_info(create_queue_slot_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QueueApi.create_queue_slot ...' end # verify the required parameter 'create_queue_slot_request' is set if @api_client.config.client_side_validation && create_queue_slot_request.nil? fail ArgumentError, "Missing the required parameter 'create_queue_slot_request' when calling QueueApi.create_queue_slot" end # resource path local_var_path = '/v1/queue/slots' # 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_queue_slot_request) # return_type return_type = opts[:debug_return_type] || 'CreateQueueSlot201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"QueueApi.create_queue_slot", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: QueueApi#create_queue_slot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_queue_slot(profile_id, opts = {}) ⇒ QueueDeleteResponse
Delete schedule Delete a queue from a profile. Pass queueId to delete a specific queue; omit it to delete all queues for the profile. If deleting the default queue, another queue will be promoted to default.
96 97 98 99 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 96 def delete_queue_slot(profile_id, opts = {}) data, _status_code, _headers = delete_queue_slot_with_http_info(profile_id, opts) data end |
#delete_queue_slot_with_http_info(profile_id, opts = {}) ⇒ Array<(QueueDeleteResponse, Integer, Hash)>
Delete schedule Delete a queue from a profile. Pass queueId to delete a specific queue; omit it to delete all queues for the profile. If deleting the default queue, another queue will be promoted to default.
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 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 107 def delete_queue_slot_with_http_info(profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QueueApi.delete_queue_slot ...' end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling QueueApi.delete_queue_slot" end # resource path local_var_path = '/v1/queue/slots' # query parameters query_params = opts[:query_params] || {} query_params[:'profileId'] = profile_id query_params[:'queueId'] = opts[:'queue_id'] if !opts[:'queue_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'QueueDeleteResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"QueueApi.delete_queue_slot", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: QueueApi#delete_queue_slot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_next_queue_slot(profile_id, opts = {}) ⇒ QueueNextSlotResponse
Get next available slot Returns the next available queue slot for preview purposes. To create a queue post, use POST /v1/posts with queuedFromProfile instead of scheduledFor.
163 164 165 166 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 163 def get_next_queue_slot(profile_id, opts = {}) data, _status_code, _headers = get_next_queue_slot_with_http_info(profile_id, opts) data end |
#get_next_queue_slot_with_http_info(profile_id, opts = {}) ⇒ Array<(QueueNextSlotResponse, Integer, Hash)>
Get next available slot Returns the next available queue slot for preview purposes. To create a queue post, use POST /v1/posts with queuedFromProfile instead of scheduledFor.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 174 def get_next_queue_slot_with_http_info(profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QueueApi.get_next_queue_slot ...' end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling QueueApi.get_next_queue_slot" end # resource path local_var_path = '/v1/queue/next-slot' # query parameters query_params = opts[:query_params] || {} query_params[:'profileId'] = profile_id query_params[:'queueId'] = opts[:'queue_id'] if !opts[:'queue_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'QueueNextSlotResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"QueueApi.get_next_queue_slot", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: QueueApi#get_next_queue_slot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_queue_slots(profile_id, opts = {}) ⇒ ListQueueSlots200Response
List schedules Returns queue schedules for a profile. Use all=true for all queues, or queueId for a specific one. Defaults to the default queue.
231 232 233 234 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 231 def list_queue_slots(profile_id, opts = {}) data, _status_code, _headers = list_queue_slots_with_http_info(profile_id, opts) data end |
#list_queue_slots_with_http_info(profile_id, opts = {}) ⇒ Array<(ListQueueSlots200Response, Integer, Hash)>
List schedules Returns queue schedules for a profile. Use all=true for all queues, or queueId for a specific one. Defaults to the default queue.
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 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 243 def list_queue_slots_with_http_info(profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QueueApi.list_queue_slots ...' end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling QueueApi.list_queue_slots" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'all'] && !allowable_values.include?(opts[:'all']) fail ArgumentError, "invalid value for \"all\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/queue/slots' # query parameters query_params = opts[:query_params] || {} query_params[:'profileId'] = profile_id query_params[:'queueId'] = opts[:'queue_id'] if !opts[:'queue_id'].nil? query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListQueueSlots200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"QueueApi.list_queue_slots", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: QueueApi#list_queue_slots\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#preview_queue(profile_id, opts = {}) ⇒ QueuePreviewResponse
Preview upcoming slots Returns the next N upcoming queue slot times for a profile as ISO datetime strings.
305 306 307 308 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 305 def preview_queue(profile_id, opts = {}) data, _status_code, _headers = preview_queue_with_http_info(profile_id, opts) data end |
#preview_queue_with_http_info(profile_id, opts = {}) ⇒ Array<(QueuePreviewResponse, Integer, Hash)>
Preview upcoming slots Returns the next N upcoming queue slot times for a profile as ISO datetime strings.
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 367 368 369 370 371 372 373 374 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 317 def preview_queue_with_http_info(profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QueueApi.preview_queue ...' end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling QueueApi.preview_queue" end if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 100 fail ArgumentError, 'invalid value for "opts[:"count"]" when calling QueueApi.preview_queue, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1 fail ArgumentError, 'invalid value for "opts[:"count"]" when calling QueueApi.preview_queue, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/queue/preview' # query parameters query_params = opts[:query_params] || {} query_params[:'profileId'] = profile_id query_params[:'queueId'] = opts[:'queue_id'] if !opts[:'queue_id'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'QueuePreviewResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"QueueApi.preview_queue", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: QueueApi#preview_queue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_queue_slot(update_queue_slot_request, opts = {}) ⇒ QueueUpdateResponse
Update schedule Create a new queue or update an existing one. Without queueId, creates/updates the default queue. With queueId, updates a specific queue. With setAsDefault=true, makes this queue the default for the profile.
381 382 383 384 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 381 def update_queue_slot(update_queue_slot_request, opts = {}) data, _status_code, _headers = update_queue_slot_with_http_info(update_queue_slot_request, opts) data end |
#update_queue_slot_with_http_info(update_queue_slot_request, opts = {}) ⇒ Array<(QueueUpdateResponse, Integer, Hash)>
Update schedule Create a new queue or update an existing one. Without queueId, creates/updates the default queue. With queueId, updates a specific queue. With setAsDefault=true, makes this queue the default for the profile.
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 430 431 432 433 434 435 436 437 438 439 440 441 442 |
# File 'lib/zernio-sdk/api/queue_api.rb', line 391 def update_queue_slot_with_http_info(update_queue_slot_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QueueApi.update_queue_slot ...' end # verify the required parameter 'update_queue_slot_request' is set if @api_client.config.client_side_validation && update_queue_slot_request.nil? fail ArgumentError, "Missing the required parameter 'update_queue_slot_request' when calling QueueApi.update_queue_slot" end # resource path local_var_path = '/v1/queue/slots' # 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']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_queue_slot_request) # return_type return_type = opts[:debug_return_type] || 'QueueUpdateResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"QueueApi.update_queue_slot", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: QueueApi#update_queue_slot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |