Class: SmartRecruiters::SubscriptionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_recruiters/api/subscriptions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SubscriptionsApi

Returns a new instance of SubscriptionsApi.



5
6
7
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 5

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



3
4
5
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 3

def api_client
  @api_client
end

Instance Method Details

#subscriptions_activate(id, opts = {}) ⇒ nil

Activate webhook subscription. To ensure that target server is ready to consume notifications, we require you to implement the initial handshake. Having subscription with ‘callbackUrl`: `example.org/hook`, during activation we will make `POST` request with `X-Hook-Secret` header: “` POST example.com/hook X-Hook-Secret: 4jn8fs9011jj8 “` We expect your server to respond within the time of 20 seconds with HTTP `200` response containing `X-Hook-Secret` header with same value. “` Response 200 X-Hook-Secret: 4jn8fs9011jj8 “`

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:

  • (nil)


13
14
15
16
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 13

def subscriptions_activate(id, opts = {})
  subscriptions_activate_with_http_info(id, opts)
  nil
end

#subscriptions_activate_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Activate webhook subscription. To ensure that target server is ready to consume notifications, we require you to implement the initial handshake. Having subscription with &#x60;callbackUrl&#x60;: &#x60;example.org/hook&#x60;, during activation we will make &#x60;POST&#x60; request with &#x60;X-Hook-Secret&#x60; header: &#x60;&#x60;&#x60; POST example.com/hook X-Hook-Secret: 4jn8fs9011jj8 &#x60;&#x60;&#x60; We expect your server to respond within the time of 20 seconds with HTTP &#x60;200&#x60; response containing &#x60;X-Hook-Secret&#x60; header with same value. &#x60;&#x60;&#x60; Response 200 X-Hook-Secret: 4jn8fs9011jj8 &#x60;&#x60;&#x60;

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



23
24
25
26
27
28
29
30
31
32
33
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
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 23

def subscriptions_activate_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_activate ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_activate"
  end
  # resource path
  local_var_path = '/subscriptions/{id}/activation'.sub('{' + 'id' + '}', 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'])

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

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

  return_type = opts[:return_type] 

  auth_names = opts[:auth_names] || ['key', 'oauth']
  data, status_code, headers = @api_client.call_api(:PUT, 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: SubscriptionsApi#subscriptions_activate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#subscriptions_create(body, opts = {}) ⇒ Subscription

Subscribe to a webhook. Please be aware that before any event is delivered each subscription needs to be activated. See [subscription activation](subscriptionsactivate-1). We do limit number of subscriptions each subscriber can register. It means that: * individual user can register up to 20 subscriptions * OAuth application can register up to 20 subscriptions on behalf of a single user Alerting email address and callback authentication properties are optional.

Parameters:

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

    the optional parameters

Returns:



69
70
71
72
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 69

def subscriptions_create(body, opts = {})
  data, _status_code, _headers = subscriptions_create_with_http_info(body, opts)
  data
end

#subscriptions_create_with_http_info(body, opts = {}) ⇒ Array<(Subscription, Integer, Hash)>

Subscribe to a webhook. Please be aware that before any event is delivered each subscription needs to be activated. See [subscription activation](subscriptionsactivate-1). We do limit number of subscriptions each subscriber can register. It means that: * individual user can register up to 20 subscriptions * OAuth application can register up to 20 subscriptions on behalf of a single user Alerting email address and callback authentication properties are optional.

Parameters:

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

    the optional parameters

Returns:

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

    Subscription data, response status code and response headers



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 79

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

  # 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(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

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

  auth_names = opts[:auth_names] || ['key', 'oauth']
  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: SubscriptionsApi#subscriptions_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#subscriptions_delete(id, opts = {}) ⇒ nil

Delete webhook subscription.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:

  • (nil)


126
127
128
129
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 126

def subscriptions_delete(id, opts = {})
  subscriptions_delete_with_http_info(id, opts)
  nil
end

#subscriptions_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete webhook subscription.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
175
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 135

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

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

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

  return_type = opts[:return_type] 

  auth_names = opts[:auth_names] || ['key', 'oauth']
  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: SubscriptionsApi#subscriptions_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#subscriptions_generate_secret_key(id, opts = {}) ⇒ SecretKeyPayload

Generate secret key for a webhook subscription. We allow you to generate a secret key for the subscription. You can use it to verify the author of callback messages. When you have a secret key already defined - a creation of new one will make old one deprecated - it will be still active for 24 hours though. You can have up to 16 non-expired secret keys. A signature will be included in header ‘smartrecruiters-signature` of callback request. Additionally we will send `smartrecruiters-timestamp` header with timestamp (seconds) of request. `smartrecruiters-signature` header value has the following format: “` $SIGNATURE_SCHEMA=$SIGNATURE_1;$SIGNATURE_SCHEMA=$SIGNATURE_2… “` As you may notice there may be multiple signatures included in the header. It can be caused by one or both: * having multiple active keys * smartrecruiters providing multiple signatures per key with different signature schemes. We may use it in the future to deliver new algorithm of signature creation without breaking backward compability. Every segment of header value is delimited by `;` character Currently, we support and sent following signature (`$SIGNATURE_SCHEMA`): #### 1) `v1` Signature calculated using HMAC with SHA256 algorithm. Hash should be calculated from following elements concatenated by the `.` character: * `smartrecruiters-timestamp` header value * request body * `event-id` header value * `event-name` header value * `event-version` header value * `link` header value Order of this elements is important. In absence of header please use an empty string as its value. For example assume we have: * One active secret key: HeBVky2bccvvkcXPimH8c * Callback request: * headers: * content-type: application/json * smartrecruiters-signature: "v1=2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f" * smartrecruiters-timestamp = "1574080897" * event-id = "123" * link = "<smartrecruiters.com/endpoint>; rel=self" * event-name = "application.created" * event-version = "v201910" * body: "cid" hash should be calculated from value: “` 1574080897."job_id":"jid","candidate_id":"cid".123.application.created.v201910.<smartrecruiters.com/endpoint>; rel=self “` and after using HMAC and SHA256 it should give you hash : 2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f, so that `smartrecruiters-signature` header in the callback request will have value: `v1=2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f`

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:



181
182
183
184
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 181

def subscriptions_generate_secret_key(id, opts = {})
  data, _status_code, _headers = subscriptions_generate_secret_key_with_http_info(id, opts)
  data
end

#subscriptions_generate_secret_key_with_http_info(id, opts = {}) ⇒ Array<(SecretKeyPayload, Integer, Hash)>

Generate secret key for a webhook subscription. We allow you to generate a secret key for the subscription. You can use it to verify the author of callback messages. When you have a secret key already defined - a creation of new one will make old one deprecated - it will be still active for 24 hours though. You can have up to 16 non-expired secret keys. A signature will be included in header &#x60;smartrecruiters-signature&#x60; of callback request. Additionally we will send &#x60;smartrecruiters-timestamp&#x60; header with timestamp (seconds) of request. &#x60;smartrecruiters-signature&#x60; header value has the following format: &#x60;&#x60;&#x60; $SIGNATURE_SCHEMA&#x3D;$SIGNATURE_1;$SIGNATURE_SCHEMA&#x3D;$SIGNATURE_2… &#x60;&#x60;&#x60; As you may notice there may be multiple signatures included in the header. It can be caused by one or both: * having multiple active keys * smartrecruiters providing multiple signatures per key with different signature schemes. We may use it in the future to deliver new algorithm of signature creation without breaking backward compability. Every segment of header value is delimited by &#x60;;&#x60; character Currently, we support and sent following signature (&#x60;$SIGNATURE_SCHEMA&#x60;): #### 1) &#x60;v1&#x60; Signature calculated using HMAC with SHA256 algorithm. Hash should be calculated from following elements concatenated by the &#x60;.&#x60; character: * &#x60;smartrecruiters-timestamp&#x60; header value * request body * &#x60;event-id&#x60; header value * &#x60;event-name&#x60; header value * &#x60;event-version&#x60; header value * &#x60;link&#x60; header value Order of this elements is important. In absence of header please use an empty string as its value. For example assume we have: * One active secret key: HeBVky2bccvvkcXPimH8c * Callback request: * headers: * content-type: application/json * smartrecruiters-signature: &quot;v1&#x3D;2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f&quot; * smartrecruiters-timestamp &#x3D; &quot;1574080897&quot; * event-id &#x3D; &quot;123&quot; * link &#x3D; &quot;&lt;smartrecruiters.com/endpoint&gt;; rel&#x3D;self&quot; * event-name &#x3D; &quot;application.created&quot; * event-version &#x3D; &quot;v201910&quot; * body: &quot;cid&quot; hash should be calculated from value: &#x60;&#x60;&#x60; 1574080897.&quot;job_id&quot;:&quot;jid&quot;,&quot;candidate_id&quot;:&quot;cid&quot;.123.application.created.v201910.&lt;smartrecruiters.com/endpoint&gt;; rel&#x3D;self &#x60;&#x60;&#x60; and after using HMAC and SHA256 it should give you hash : 2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f, so that &#x60;smartrecruiters-signature&#x60; header in the callback request will have value: &#x60;v1&#x3D;2e9291f10d44ca10204a4cd81b05d73b6a316b2b605d4e2e0e0b37b40198ce1f&#x60;

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:

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

    SecretKeyPayload data, response status code and response headers



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
226
227
228
229
230
231
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 191

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

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

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

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

  auth_names = opts[:auth_names] || ['key', 'oauth']
  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: SubscriptionsApi#subscriptions_generate_secret_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#subscriptions_get(id, opts = {}) ⇒ Subscription

Retrieve single webhook subscription.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:



236
237
238
239
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 236

def subscriptions_get(id, opts = {})
  data, _status_code, _headers = subscriptions_get_with_http_info(id, opts)
  data
end

#subscriptions_get_all(opts = {}) ⇒ Subscriptions

Retrieve webhook subscriptions.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_id (String)

    identifier of the next page of subscriptions

  • :limit (Integer)

    number of elements to return (default to 10)

Returns:



291
292
293
294
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 291

def subscriptions_get_all(opts = {})
  data, _status_code, _headers = subscriptions_get_all_with_http_info(opts)
  data
end

#subscriptions_get_all_with_http_info(opts = {}) ⇒ Array<(Subscriptions, Integer, Hash)>

Retrieve webhook subscriptions.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_id (String)

    identifier of the next page of subscriptions

  • :limit (Integer)

    number of elements to return

Returns:

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

    Subscriptions data, response status code and response headers



301
302
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
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 301

def subscriptions_get_all_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_get_all ...'
  end
  # resource path
  local_var_path = '/subscriptions'

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

  auth_names = opts[:auth_names] || ['key', 'oauth']
  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: SubscriptionsApi#subscriptions_get_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#subscriptions_get_secret_key(id, opts = {}) ⇒ SecretKeyPayload

Retrieve subscription secret key Retrieves the last secret key for webhook subscription.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:



345
346
347
348
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 345

def subscriptions_get_secret_key(id, opts = {})
  data, _status_code, _headers = subscriptions_get_secret_key_with_http_info(id, opts)
  data
end

#subscriptions_get_secret_key_with_http_info(id, opts = {}) ⇒ Array<(SecretKeyPayload, Integer, Hash)>

Retrieve subscription secret key Retrieves the last secret key for webhook subscription.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:

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

    SecretKeyPayload data, response status code and response headers



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
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 355

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

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

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

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

  auth_names = opts[:auth_names] || ['key', 'oauth']
  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: SubscriptionsApi#subscriptions_get_secret_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#subscriptions_get_with_http_info(id, opts = {}) ⇒ Array<(Subscription, Integer, Hash)>

Retrieve single webhook subscription.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Returns:

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

    Subscription data, response status code and response headers



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
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 245

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

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

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

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

  auth_names = opts[:auth_names] || ['key', 'oauth']
  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: SubscriptionsApi#subscriptions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#subscriptions_search_callback_log(id, opts = {}) ⇒ CallbackRequests

Retrieve callback request details starting from newest.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Options Hash (opts):

  • :page_id (String)

    identifier of the next page of subscriptions

  • :limit (Integer)

    number of elements to return (default to 10)

  • :callback_status (String)

    status of callback, whan absent all statuses will be returned

  • :after (DateTime)

    Requests sent after timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ

  • :before (DateTime)

    Requests sent before timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ

Returns:



405
406
407
408
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 405

def subscriptions_search_callback_log(id, opts = {})
  data, _status_code, _headers = subscriptions_search_callback_log_with_http_info(id, opts)
  data
end

#subscriptions_search_callback_log_with_http_info(id, opts = {}) ⇒ Array<(CallbackRequests, Integer, Hash)>

Retrieve callback request details starting from newest.

Parameters:

  • id

    subscription identifier

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

    the optional parameters

Options Hash (opts):

  • :page_id (String)

    identifier of the next page of subscriptions

  • :limit (Integer)

    number of elements to return

  • :callback_status (String)

    status of callback, whan absent all statuses will be returned

  • :after (DateTime)

    Requests sent after timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ

  • :before (DateTime)

    Requests sent before timestamp. Min value is 30 days ago. Format ISO8601: yyyy-MM-ddTHH:mm:ss.SSSZZ

Returns:

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

    CallbackRequests data, response status code and response headers



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
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
# File 'lib/smart_recruiters/api/subscriptions_api.rb', line 419

def subscriptions_search_callback_log_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscriptions_search_callback_log ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SubscriptionsApi.subscriptions_search_callback_log"
  end
  if @api_client.config.client_side_validation && opts[:'callback_status'] && !['successful', 'failed'].include?(opts[:'callback_status'])
    fail ArgumentError, 'invalid value for "callback_status", must be one of successful, failed'
  end
  # resource path
  local_var_path = '/subscriptions/{id}/callbacks-log'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_id'] = opts[:'page_id'] if !opts[:'page_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'callbackStatus'] = opts[:'callback_status'] if !opts[:'callback_status'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].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] || 'CallbackRequests' 

  auth_names = opts[:auth_names] || ['key', 'oauth']
  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: SubscriptionsApi#subscriptions_search_callback_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end