Class: Zyphr::TopicsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zyphr/api/topics_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TopicsApi

Returns a new instance of TopicsApi.



19
20
21
# File 'lib/zyphr/api/topics_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/zyphr/api/topics_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_topic_subscribers(key, add_topic_subscribers_request, opts = {}) ⇒ TopicSubscribersAddResponse

Add subscribers to a topic Add one or more subscribers to a topic. Maximum 1000 subscriber IDs per request.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/zyphr/api/topics_api.rb', line 28

def add_topic_subscribers(key, add_topic_subscribers_request, opts = {})
  data, _status_code, _headers = add_topic_subscribers_with_http_info(key, add_topic_subscribers_request, opts)
  data
end

#add_topic_subscribers_with_http_info(key, add_topic_subscribers_request, opts = {}) ⇒ Array<(TopicSubscribersAddResponse, Integer, Hash)>

Add subscribers to a topic Add one or more subscribers to a topic. Maximum 1000 subscriber IDs per request.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:

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

    TopicSubscribersAddResponse data, response status code and response headers



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
89
90
91
92
93
94
# File 'lib/zyphr/api/topics_api.rb', line 39

def add_topic_subscribers_with_http_info(key, add_topic_subscribers_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.add_topic_subscribers ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling TopicsApi.add_topic_subscribers"
  end
  # verify the required parameter 'add_topic_subscribers_request' is set
  if @api_client.config.client_side_validation && add_topic_subscribers_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_topic_subscribers_request' when calling TopicsApi.add_topic_subscribers"
  end
  # resource path
  local_var_path = '/topics/{key}/subscribers'.sub('{' + 'key' + '}', CGI.escape(key.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']) 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(add_topic_subscribers_request)

  # return_type
  return_type = opts[:debug_return_type] || 'TopicSubscribersAddResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.add_topic_subscribers",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#add_topic_subscribers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_topic(create_topic_request, opts = {}) ⇒ TopicResponse

Create a new topic Create a new notification topic for broadcasting to groups of subscribers.

Parameters:

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

    the optional parameters

Returns:



101
102
103
104
# File 'lib/zyphr/api/topics_api.rb', line 101

def create_topic(create_topic_request, opts = {})
  data, _status_code, _headers = create_topic_with_http_info(create_topic_request, opts)
  data
end

#create_topic_with_http_info(create_topic_request, opts = {}) ⇒ Array<(TopicResponse, Integer, Hash)>

Create a new topic Create a new notification topic for broadcasting to groups of subscribers.

Parameters:

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

    the optional parameters

Returns:

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

    TopicResponse data, response status code and response headers



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
156
157
158
159
160
161
162
# File 'lib/zyphr/api/topics_api.rb', line 111

def create_topic_with_http_info(create_topic_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.create_topic ...'
  end
  # verify the required parameter 'create_topic_request' is set
  if @api_client.config.client_side_validation && create_topic_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_topic_request' when calling TopicsApi.create_topic"
  end
  # resource path
  local_var_path = '/topics'

  # 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_topic_request)

  # return_type
  return_type = opts[:debug_return_type] || 'TopicResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.create_topic",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#create_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_topic(key, opts = {}) ⇒ TopicDeleteResponse

Delete a topic Delete a topic by its unique key. This cascades to all subscriptions.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:



169
170
171
172
# File 'lib/zyphr/api/topics_api.rb', line 169

def delete_topic(key, opts = {})
  data, _status_code, _headers = delete_topic_with_http_info(key, opts)
  data
end

#delete_topic_with_http_info(key, opts = {}) ⇒ Array<(TopicDeleteResponse, Integer, Hash)>

Delete a topic Delete a topic by its unique key. This cascades to all subscriptions.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:

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

    TopicDeleteResponse data, response status code and response headers



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
223
224
225
# File 'lib/zyphr/api/topics_api.rb', line 179

def delete_topic_with_http_info(key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.delete_topic ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling TopicsApi.delete_topic"
  end
  # resource path
  local_var_path = '/topics/{key}'.sub('{' + 'key' + '}', CGI.escape(key.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']) 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] || 'TopicDeleteResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.delete_topic",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#delete_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_topic(key, opts = {}) ⇒ TopicResponse

Get a topic Retrieve a specific topic by its unique key.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:



232
233
234
235
# File 'lib/zyphr/api/topics_api.rb', line 232

def get_topic(key, opts = {})
  data, _status_code, _headers = get_topic_with_http_info(key, opts)
  data
end

#get_topic_stats(opts = {}) ⇒ TopicStatsResponse

Get topic statistics Get aggregate statistics for all topics in the account.

Parameters:

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

    the optional parameters

Returns:



294
295
296
297
# File 'lib/zyphr/api/topics_api.rb', line 294

def get_topic_stats(opts = {})
  data, _status_code, _headers = get_topic_stats_with_http_info(opts)
  data
end

#get_topic_stats_with_http_info(opts = {}) ⇒ Array<(TopicStatsResponse, Integer, Hash)>

Get topic statistics Get aggregate statistics for all topics in the account.

Parameters:

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

    the optional parameters

Returns:

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

    TopicStatsResponse data, response status code and response headers



303
304
305
306
307
308
309
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
# File 'lib/zyphr/api/topics_api.rb', line 303

def get_topic_stats_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.get_topic_stats ...'
  end
  # resource path
  local_var_path = '/topics/stats'

  # 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']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'TopicStatsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.get_topic_stats",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#get_topic_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_topic_with_http_info(key, opts = {}) ⇒ Array<(TopicResponse, Integer, Hash)>

Get a topic Retrieve a specific topic by its unique key.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:

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

    TopicResponse data, response status code and response headers



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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/zyphr/api/topics_api.rb', line 242

def get_topic_with_http_info(key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.get_topic ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling TopicsApi.get_topic"
  end
  # resource path
  local_var_path = '/topics/{key}'.sub('{' + 'key' + '}', CGI.escape(key.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']) 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] || 'TopicResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.get_topic",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#get_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_topic_subscribers(key, opts = {}) ⇒ TopicSubscriberListResponse

List topic subscribers List all subscribers for a specific topic with pagination.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (default to 1)

  • :per_page (Integer)

    Items per page (max 1000) (default to 100)

Returns:



354
355
356
357
# File 'lib/zyphr/api/topics_api.rb', line 354

def list_topic_subscribers(key, opts = {})
  data, _status_code, _headers = list_topic_subscribers_with_http_info(key, opts)
  data
end

#list_topic_subscribers_with_http_info(key, opts = {}) ⇒ Array<(TopicSubscriberListResponse, Integer, Hash)>

List topic subscribers List all subscribers for a specific topic with pagination.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (default to 1)

  • :per_page (Integer)

    Items per page (max 1000) (default to 100)

Returns:

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

    TopicSubscriberListResponse data, response status code and response headers



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
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
# File 'lib/zyphr/api/topics_api.rb', line 366

def list_topic_subscribers_with_http_info(key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.list_topic_subscribers ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling TopicsApi.list_topic_subscribers"
  end
  # resource path
  local_var_path = '/topics/{key}/subscribers'.sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].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] || 'TopicSubscriberListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.list_topic_subscribers",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#list_topic_subscribers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_topics(opts = {}) ⇒ TopicListResponse

List topics List all topics for the account with pagination and optional search.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (default to 1)

  • :per_page (Integer)

    Items per page (max 100) (default to 25)

  • :search (String)

    Search topics by name or key

Returns:



423
424
425
426
# File 'lib/zyphr/api/topics_api.rb', line 423

def list_topics(opts = {})
  data, _status_code, _headers = list_topics_with_http_info(opts)
  data
end

#list_topics_with_http_info(opts = {}) ⇒ Array<(TopicListResponse, Integer, Hash)>

List topics List all topics for the account with pagination and optional search.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (default to 1)

  • :per_page (Integer)

    Items per page (max 100) (default to 25)

  • :search (String)

    Search topics by name or key

Returns:

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

    TopicListResponse data, response status code and response headers



435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/zyphr/api/topics_api.rb', line 435

def list_topics_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.list_topics ...'
  end
  # resource path
  local_var_path = '/topics'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].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] || 'TopicListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.list_topics",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#list_topics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_topic_subscribers(key, remove_topic_subscribers_request, opts = {}) ⇒ TopicSubscribersRemoveResponse

Remove subscribers from a topic Remove one or more subscribers from a topic. Maximum 1000 subscriber IDs per request.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:



488
489
490
491
# File 'lib/zyphr/api/topics_api.rb', line 488

def remove_topic_subscribers(key, remove_topic_subscribers_request, opts = {})
  data, _status_code, _headers = remove_topic_subscribers_with_http_info(key, remove_topic_subscribers_request, opts)
  data
end

#remove_topic_subscribers_with_http_info(key, remove_topic_subscribers_request, opts = {}) ⇒ Array<(TopicSubscribersRemoveResponse, Integer, Hash)>

Remove subscribers from a topic Remove one or more subscribers from a topic. Maximum 1000 subscriber IDs per request.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/zyphr/api/topics_api.rb', line 499

def remove_topic_subscribers_with_http_info(key, remove_topic_subscribers_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.remove_topic_subscribers ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling TopicsApi.remove_topic_subscribers"
  end
  # verify the required parameter 'remove_topic_subscribers_request' is set
  if @api_client.config.client_side_validation && remove_topic_subscribers_request.nil?
    fail ArgumentError, "Missing the required parameter 'remove_topic_subscribers_request' when calling TopicsApi.remove_topic_subscribers"
  end
  # resource path
  local_var_path = '/topics/{key}/subscribers'.sub('{' + 'key' + '}', CGI.escape(key.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']) 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(remove_topic_subscribers_request)

  # return_type
  return_type = opts[:debug_return_type] || 'TopicSubscribersRemoveResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.remove_topic_subscribers",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#remove_topic_subscribers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_topic(key, update_topic_request, opts = {}) ⇒ TopicResponse

Update a topic Update a topic’s name or description by its unique key.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:



562
563
564
565
# File 'lib/zyphr/api/topics_api.rb', line 562

def update_topic(key, update_topic_request, opts = {})
  data, _status_code, _headers = update_topic_with_http_info(key, update_topic_request, opts)
  data
end

#update_topic_with_http_info(key, update_topic_request, opts = {}) ⇒ Array<(TopicResponse, Integer, Hash)>

Update a topic Update a topic&#39;s name or description by its unique key.

Parameters:

  • key (String)

    The unique topic key

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

    the optional parameters

Returns:

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

    TopicResponse data, response status code and response headers



573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/zyphr/api/topics_api.rb', line 573

def update_topic_with_http_info(key, update_topic_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TopicsApi.update_topic ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling TopicsApi.update_topic"
  end
  # verify the required parameter 'update_topic_request' is set
  if @api_client.config.client_side_validation && update_topic_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_topic_request' when calling TopicsApi.update_topic"
  end
  # resource path
  local_var_path = '/topics/{key}'.sub('{' + 'key' + '}', CGI.escape(key.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']) 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_topic_request)

  # return_type
  return_type = opts[:debug_return_type] || 'TopicResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"TopicsApi.update_topic",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TopicsApi#update_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end