Class: OryKratosClient::IdentityApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ory-kratos-client/api/identity_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ IdentityApi

Returns a new instance of IdentityApi.



19
20
21
# File 'lib/ory-kratos-client/api/identity_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/ory-kratos-client/api/identity_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#batch_patch_identities(opts = {}) ⇒ BatchPatchIdentitiesResponse

Create multiple identities Creates multiple [identities](www.ory.sh/docs/kratos/concepts/identity-user-model). This endpoint can also be used to [import credentials](www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities) for instance passwords, social sign in configurations or multifactor methods.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



27
28
29
30
# File 'lib/ory-kratos-client/api/identity_api.rb', line 27

def batch_patch_identities(opts = {})
  data, _status_code, _headers = batch_patch_identities_with_http_info(opts)
  data
end

#batch_patch_identities_with_http_info(opts = {}) ⇒ Array<(BatchPatchIdentitiesResponse, Integer, Hash)>

Create multiple identities Creates multiple [identities](www.ory.sh/docs/kratos/concepts/identity-user-model). This endpoint can also be used to [import credentials](www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities) for instance passwords, social sign in configurations or multifactor methods.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



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
# File 'lib/ory-kratos-client/api/identity_api.rb', line 37

def batch_patch_identities_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.batch_patch_identities ...'
  end
  # resource path
  local_var_path = '/admin/identities'

  # 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'
  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(opts[:'patch_identities_body'])

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.batch_patch_identities",
    :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: IdentityApi#batch_patch_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_identity(opts = {}) ⇒ Identity

Create an Identity Create an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model). This endpoint can also be used to [import credentials](www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities) for instance passwords, social sign in configurations or multifactor methods.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



91
92
93
94
# File 'lib/ory-kratos-client/api/identity_api.rb', line 91

def create_identity(opts = {})
  data, _status_code, _headers = create_identity_with_http_info(opts)
  data
end

#create_identity_with_http_info(opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Create an Identity Create an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model). This endpoint can also be used to [import credentials](www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities) for instance passwords, social sign in configurations or multifactor methods.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Identity data, response status code and response headers



101
102
103
104
105
106
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
# File 'lib/ory-kratos-client/api/identity_api.rb', line 101

def create_identity_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.create_identity ...'
  end
  # resource path
  local_var_path = '/admin/identities'

  # 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'
  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(opts[:'create_identity_body'])

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.create_identity",
    :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: IdentityApi#create_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_recovery_code_for_identity(opts = {}) ⇒ RecoveryCodeForIdentity

Create a Recovery Code This endpoint creates a recovery code which should be given to the user in order for them to recover (or activate) their account.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



155
156
157
158
# File 'lib/ory-kratos-client/api/identity_api.rb', line 155

def create_recovery_code_for_identity(opts = {})
  data, _status_code, _headers = create_recovery_code_for_identity_with_http_info(opts)
  data
end

#create_recovery_code_for_identity_with_http_info(opts = {}) ⇒ Array<(RecoveryCodeForIdentity, Integer, Hash)>

Create a Recovery Code This endpoint creates a recovery code which should be given to the user in order for them to recover (or activate) their account.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    RecoveryCodeForIdentity data, response status code and response headers



165
166
167
168
169
170
171
172
173
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
# File 'lib/ory-kratos-client/api/identity_api.rb', line 165

def create_recovery_code_for_identity_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.create_recovery_code_for_identity ...'
  end
  # resource path
  local_var_path = '/admin/recovery/code'

  # 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'
  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(opts[:'create_recovery_code_for_identity_body'])

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.create_recovery_code_for_identity",
    :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: IdentityApi#create_recovery_code_for_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a Recovery Link This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



220
221
222
223
# File 'lib/ory-kratos-client/api/identity_api.rb', line 220

def create_recovery_link_for_identity(opts = {})
  data, _status_code, _headers = create_recovery_link_for_identity_with_http_info(opts)
  data
end

Create a Recovery Link This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    RecoveryLinkForIdentity data, response status code and response headers



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
271
272
273
274
275
276
277
278
279
# File 'lib/ory-kratos-client/api/identity_api.rb', line 231

def create_recovery_link_for_identity_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.create_recovery_link_for_identity ...'
  end
  # resource path
  local_var_path = '/admin/recovery/link'

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

  # 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'
  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(opts[:'create_recovery_link_for_identity_body'])

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.create_recovery_link_for_identity",
    :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: IdentityApi#create_recovery_link_for_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete an Identity Calling this endpoint irrecoverably and permanently deletes the [identity](www.ory.sh/docs/kratos/concepts/identity-user-model) given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

  • (nil)


286
287
288
289
# File 'lib/ory-kratos-client/api/identity_api.rb', line 286

def delete_identity(id, opts = {})
  delete_identity_with_http_info(id, opts)
  nil
end

#delete_identity_credentials(id, type, opts = {}) ⇒ nil

Delete a credential for a specific identity Delete an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model) credential by its type You can only delete second factor (aal2) credentials.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

  • type (String)

    Type is the type of credentials to be deleted. password CredentialsTypePassword oidc CredentialsTypeOIDC totp CredentialsTypeTOTP lookup_secret CredentialsTypeLookup webauthn CredentialsTypeWebAuthn code CredentialsTypeCodeAuth passkey CredentialsTypePasskey profile CredentialsTypeProfile link_recovery CredentialsTypeRecoveryLink CredentialsTypeRecoveryLink is a special credential type linked to the link strategy (recovery flow). It is not used within the credentials object itself. code_recovery CredentialsTypeRecoveryCode

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

    the optional parameters

Returns:

  • (nil)


350
351
352
353
# File 'lib/ory-kratos-client/api/identity_api.rb', line 350

def delete_identity_credentials(id, type, opts = {})
  delete_identity_credentials_with_http_info(id, type, opts)
  nil
end

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

Delete a credential for a specific identity Delete an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model) credential by its type You can only delete second factor (aal2) credentials.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

  • type (String)

    Type is the type of credentials to be deleted. password CredentialsTypePassword oidc CredentialsTypeOIDC totp CredentialsTypeTOTP lookup_secret CredentialsTypeLookup webauthn CredentialsTypeWebAuthn code CredentialsTypeCodeAuth passkey CredentialsTypePasskey profile CredentialsTypeProfile link_recovery CredentialsTypeRecoveryLink CredentialsTypeRecoveryLink is a special credential type linked to the link strategy (recovery flow). It is not used within the credentials object itself. code_recovery CredentialsTypeRecoveryCode

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/ory-kratos-client/api/identity_api.rb', line 361

def delete_identity_credentials_with_http_info(id, type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.delete_identity_credentials ...'
  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 IdentityApi.delete_identity_credentials"
  end
  # verify the required parameter 'type' is set
  if @api_client.config.client_side_validation && type.nil?
    fail ArgumentError, "Missing the required parameter 'type' when calling IdentityApi.delete_identity_credentials"
  end
  # verify enum value
  allowable_values = ["password", "oidc", "totp", "lookup_secret", "webauthn", "code", "passkey", "profile", "link_recovery", "code_recovery"]
  if @api_client.config.client_side_validation && !allowable_values.include?(type)
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/admin/identities/{id}/credentials/{type}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'type' + '}', CGI.escape(type.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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"IdentityApi.delete_identity_credentials",
    :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: IdentityApi#delete_identity_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete & Invalidate an Identity’s Sessions Calling this endpoint irrecoverably and permanently deletes and invalidates all sessions that belong to the given Identity.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

  • (nil)


423
424
425
426
# File 'lib/ory-kratos-client/api/identity_api.rb', line 423

def delete_identity_sessions(id, opts = {})
  delete_identity_sessions_with_http_info(id, opts)
  nil
end

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

Delete &amp; Invalidate an Identity&#39;s Sessions Calling this endpoint irrecoverably and permanently deletes and invalidates all sessions that belong to the given Identity.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/ory-kratos-client/api/identity_api.rb', line 433

def delete_identity_sessions_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.delete_identity_sessions ...'
  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 IdentityApi.delete_identity_sessions"
  end
  # resource path
  local_var_path = '/admin/identities/{id}/sessions'.sub('{' + 'id' + '}', CGI.escape(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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"IdentityApi.delete_identity_sessions",
    :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: IdentityApi#delete_identity_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete an Identity Calling this endpoint irrecoverably and permanently deletes the [identity](www.ory.sh/docs/kratos/concepts/identity-user-model) given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/ory-kratos-client/api/identity_api.rb', line 296

def delete_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.delete_identity ...'
  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 IdentityApi.delete_identity"
  end
  # resource path
  local_var_path = '/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"IdentityApi.delete_identity",
    :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: IdentityApi#delete_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Deactivate a Session Calling this endpoint deactivates the specified session. Session data is not deleted.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:

  • (nil)


486
487
488
489
# File 'lib/ory-kratos-client/api/identity_api.rb', line 486

def disable_session(id, opts = {})
  disable_session_with_http_info(id, opts)
  nil
end

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

Deactivate a Session Calling this endpoint deactivates the specified session. Session data is not deleted.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



496
497
498
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
# File 'lib/ory-kratos-client/api/identity_api.rb', line 496

def disable_session_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.disable_session ...'
  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 IdentityApi.disable_session"
  end
  # resource path
  local_var_path = '/admin/sessions/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"IdentityApi.disable_session",
    :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: IdentityApi#disable_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#extend_session(id, opts = {}) ⇒ Session

Extend a Session Calling this endpoint extends the given session ID. If ‘session.earliest_possible_extend` is set it will only extend the session after the specified time has passed. Retrieve the session ID from the `/sessions/whoami` endpoint / `toSession` SDK method.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:



549
550
551
552
# File 'lib/ory-kratos-client/api/identity_api.rb', line 549

def extend_session(id, opts = {})
  data, _status_code, _headers = extend_session_with_http_info(id, opts)
  data
end

#extend_session_with_http_info(id, opts = {}) ⇒ Array<(Session, Integer, Hash)>

Extend a Session Calling this endpoint extends the given session ID. If &#x60;session.earliest_possible_extend&#x60; is set it will only extend the session after the specified time has passed. Retrieve the session ID from the &#x60;/sessions/whoami&#x60; endpoint / &#x60;toSession&#x60; SDK method.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Returns:

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

    Session data, response status code and response headers



559
560
561
562
563
564
565
566
567
568
569
570
571
572
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
# File 'lib/ory-kratos-client/api/identity_api.rb', line 559

def extend_session_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.extend_session ...'
  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 IdentityApi.extend_session"
  end
  # resource path
  local_var_path = '/admin/sessions/{id}/extend'.sub('{' + 'id' + '}', CGI.escape(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[:debug_body]

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.extend_session",
    :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: IdentityApi#extend_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_identity(id, opts = {}) ⇒ Identity

Get an Identity Return an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model) by its ID. You can optionally include credentials (e.g. social sign in connections) in the response by using the ‘include_credential` query parameter.

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to get

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

    the optional parameters

Options Hash (opts):

  • :include_credential (Array<String>)

    Include Credentials in Response Include any credential, for example &#x60;password&#x60; or &#x60;oidc&#x60;, in the response. When set to &#x60;oidc&#x60;, This will return the initial OAuth 2.0 Access Token, OAuth 2.0 Refresh Token and the OpenID Connect ID Token if available.

Returns:



613
614
615
616
# File 'lib/ory-kratos-client/api/identity_api.rb', line 613

def get_identity(id, opts = {})
  data, _status_code, _headers = get_identity_with_http_info(id, opts)
  data
end

#get_identity_schema(id, opts = {}) ⇒ Object

Get Identity JSON Schema Return a specific identity schema.

Parameters:

  • id (String)

    ID must be set to the ID of schema you want to get

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

    the optional parameters

Returns:

  • (Object)


682
683
684
685
# File 'lib/ory-kratos-client/api/identity_api.rb', line 682

def get_identity_schema(id, opts = {})
  data, _status_code, _headers = get_identity_schema_with_http_info(id, opts)
  data
end

#get_identity_schema_with_http_info(id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Identity JSON Schema Return a specific identity schema.

Parameters:

  • id (String)

    ID must be set to the ID of schema you want to get

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
# File 'lib/ory-kratos-client/api/identity_api.rb', line 692

def get_identity_schema_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.get_identity_schema ...'
  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 IdentityApi.get_identity_schema"
  end
  # resource path
  local_var_path = '/schemas/{id}'.sub('{' + 'id' + '}', CGI.escape(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[:debug_body]

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.get_identity_schema",
    :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: IdentityApi#get_identity_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_identity_with_http_info(id, opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Get an Identity Return an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model) by its ID. You can optionally include credentials (e.g. social sign in connections) in the response by using the &#x60;include_credential&#x60; query parameter.

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to get

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

    the optional parameters

Options Hash (opts):

  • :include_credential (Array<String>)

    Include Credentials in Response Include any credential, for example &#x60;password&#x60; or &#x60;oidc&#x60;, in the response. When set to &#x60;oidc&#x60;, This will return the initial OAuth 2.0 Access Token, OAuth 2.0 Refresh Token and the OpenID Connect ID Token if available.

Returns:

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

    Identity data, response status code and response headers



624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/ory-kratos-client/api/identity_api.rb', line 624

def get_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.get_identity ...'
  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 IdentityApi.get_identity"
  end
  allowable_values = ["password", "oidc", "totp", "lookup_secret", "webauthn", "code", "passkey", "profile", "link_recovery", "code_recovery"]
  if @api_client.config.client_side_validation && opts[:'include_credential'] && !opts[:'include_credential'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"include_credential\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_credential'] = @api_client.build_collection_param(opts[:'include_credential'], :multi) if !opts[:'include_credential'].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[:debug_body]

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.get_identity",
    :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: IdentityApi#get_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_session(id, opts = {}) ⇒ Session

Get Session This endpoint is useful for: Getting a session object with all specified expandables that exist in an administrative context.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

    ExpandOptions is a query parameter encoded list of all properties that must be expanded in the Session. Example - ?expand&#x3D;Identity&amp;expand&#x3D;Devices If no value is provided, the expandable properties are skipped.

Returns:



746
747
748
749
# File 'lib/ory-kratos-client/api/identity_api.rb', line 746

def get_session(id, opts = {})
  data, _status_code, _headers = get_session_with_http_info(id, opts)
  data
end

#get_session_with_http_info(id, opts = {}) ⇒ Array<(Session, Integer, Hash)>

Get Session This endpoint is useful for: Getting a session object with all specified expandables that exist in an administrative context.

Parameters:

  • id (String)

    ID is the session&#39;s ID.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

    ExpandOptions is a query parameter encoded list of all properties that must be expanded in the Session. Example - ?expand&#x3D;Identity&amp;expand&#x3D;Devices If no value is provided, the expandable properties are skipped.

Returns:

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

    Session data, response status code and response headers



757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
# File 'lib/ory-kratos-client/api/identity_api.rb', line 757

def get_session_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.get_session ...'
  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 IdentityApi.get_session"
  end
  allowable_values = ["identity", "devices"]
  if @api_client.config.client_side_validation && opts[:'expand'] && !opts[:'expand'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"expand\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/admin/sessions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].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[:debug_body]

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.get_session",
    :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: IdentityApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_identities(opts = {}) ⇒ Array<Identity>

List Identities Lists all [identities](www.ory.sh/docs/kratos/concepts/identity-user-model) in the system.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Deprecated Items per Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This is the number of items per page. (default to 250)

  • :page (Integer)

    Deprecated Pagination Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the &#x60;Link&#x60; header.

  • :page_size (Integer)

    Page Size This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to ‘1’)

  • :consistency (String)

    Read Consistency Level (preview) The read consistency level determines the consistency guarantee for reads: strong (slow): The read is guaranteed to return the most recent data committed at the start of the read. eventual (very fast): The result will return data that is about 4.8 seconds old. The default consistency guarantee can be changed in the Ory Network Console or using the Ory CLI with &#x60;ory patch project –replace &#39;/previews/default_read_consistency_level&#x3D;&quot;strong&quot;&#39;&#x60;. Setting the default consistency level to &#x60;eventual&#x60; may cause regressions in the future as we add consistency controls to more APIs. Currently, the following APIs will be affected by this setting: &#x60;GET /admin/identities&#x60; This feature is in preview and only available in Ory Network. ConsistencyLevelUnset ConsistencyLevelUnset is the unset / default consistency level. strong ConsistencyLevelStrong ConsistencyLevelStrong is the strong consistency level. eventual ConsistencyLevelEventual ConsistencyLevelEventual is the eventual consistency level using follower read timestamps.

  • :ids (Array<String>)

    List of ids used to filter identities. If this list is empty, then no filter will be applied.

  • :credentials_identifier (String)

    CredentialsIdentifier is the identifier (username, email) of the credentials to look up using exact match. Only one of CredentialsIdentifier and CredentialsIdentifierSimilar can be used.

  • :preview_credentials_identifier_similar (String)

    This is an EXPERIMENTAL parameter that WILL CHANGE. Do NOT rely on consistent, deterministic behavior. THIS PARAMETER WILL BE REMOVED IN AN UPCOMING RELEASE WITHOUT ANY MIGRATION PATH. CredentialsIdentifierSimilar is the (partial) identifier (username, email) of the credentials to look up using similarity search. Only one of CredentialsIdentifier and CredentialsIdentifierSimilar can be used.

  • :include_credential (Array<String>)

    Include Credentials in Response Include any credential, for example &#x60;password&#x60; or &#x60;oidc&#x60;, in the response. When set to &#x60;oidc&#x60;, This will return the initial OAuth 2.0 Access Token, OAuth 2.0 Refresh Token and the OpenID Connect ID Token if available.

Returns:



823
824
825
826
# File 'lib/ory-kratos-client/api/identity_api.rb', line 823

def list_identities(opts = {})
  data, _status_code, _headers = list_identities_with_http_info(opts)
  data
end

#list_identities_with_http_info(opts = {}) ⇒ Array<(Array<Identity>, Integer, Hash)>

List Identities Lists all [identities](www.ory.sh/docs/kratos/concepts/identity-user-model) in the system.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Deprecated Items per Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This is the number of items per page. (default to 250)

  • :page (Integer)

    Deprecated Pagination Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the &#x60;Link&#x60; header.

  • :page_size (Integer)

    Page Size This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to ‘1’)

  • :consistency (String)

    Read Consistency Level (preview) The read consistency level determines the consistency guarantee for reads: strong (slow): The read is guaranteed to return the most recent data committed at the start of the read. eventual (very fast): The result will return data that is about 4.8 seconds old. The default consistency guarantee can be changed in the Ory Network Console or using the Ory CLI with &#x60;ory patch project –replace &#39;/previews/default_read_consistency_level&#x3D;&quot;strong&quot;&#39;&#x60;. Setting the default consistency level to &#x60;eventual&#x60; may cause regressions in the future as we add consistency controls to more APIs. Currently, the following APIs will be affected by this setting: &#x60;GET /admin/identities&#x60; This feature is in preview and only available in Ory Network. ConsistencyLevelUnset ConsistencyLevelUnset is the unset / default consistency level. strong ConsistencyLevelStrong ConsistencyLevelStrong is the strong consistency level. eventual ConsistencyLevelEventual ConsistencyLevelEventual is the eventual consistency level using follower read timestamps.

  • :ids (Array<String>)

    List of ids used to filter identities. If this list is empty, then no filter will be applied.

  • :credentials_identifier (String)

    CredentialsIdentifier is the identifier (username, email) of the credentials to look up using exact match. Only one of CredentialsIdentifier and CredentialsIdentifierSimilar can be used.

  • :preview_credentials_identifier_similar (String)

    This is an EXPERIMENTAL parameter that WILL CHANGE. Do NOT rely on consistent, deterministic behavior. THIS PARAMETER WILL BE REMOVED IN AN UPCOMING RELEASE WITHOUT ANY MIGRATION PATH. CredentialsIdentifierSimilar is the (partial) identifier (username, email) of the credentials to look up using similarity search. Only one of CredentialsIdentifier and CredentialsIdentifierSimilar can be used.

  • :include_credential (Array<String>)

    Include Credentials in Response Include any credential, for example &#x60;password&#x60; or &#x60;oidc&#x60;, in the response. When set to &#x60;oidc&#x60;, This will return the initial OAuth 2.0 Access Token, OAuth 2.0 Refresh Token and the OpenID Connect ID Token if available.

Returns:

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

    Array<Identity> data, response status code and response headers



841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
# File 'lib/ory-kratos-client/api/identity_api.rb', line 841

def list_identities_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.list_identities ...'
  end
  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityApi.list_identities, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityApi.list_identities, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_identities, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_identities, must be greater than or equal to 1.'
  end

  allowable_values = ["", "strong", "eventual"]
  if @api_client.config.client_side_validation && opts[:'consistency'] && !allowable_values.include?(opts[:'consistency'])
    fail ArgumentError, "invalid value for \"consistency\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/admin/identities'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'consistency'] = opts[:'consistency'] if !opts[:'consistency'].nil?
  query_params[:'ids'] = @api_client.build_collection_param(opts[:'ids'], :multi) if !opts[:'ids'].nil?
  query_params[:'credentials_identifier'] = opts[:'credentials_identifier'] if !opts[:'credentials_identifier'].nil?
  query_params[:'preview_credentials_identifier_similar'] = opts[:'preview_credentials_identifier_similar'] if !opts[:'preview_credentials_identifier_similar'].nil?
  query_params[:'include_credential'] = @api_client.build_collection_param(opts[:'include_credential'], :multi) if !opts[:'include_credential'].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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Identity>'

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

  new_options = opts.merge(
    :operation => :"IdentityApi.list_identities",
    :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: IdentityApi#list_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_identity_schemas(opts = {}) ⇒ Array<IdentitySchemaContainer>

Get all Identity Schemas Returns a list of all identity schemas currently in use.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Deprecated Items per Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This is the number of items per page. (default to 250)

  • :page (Integer)

    Deprecated Pagination Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the &#x60;Link&#x60; header.

  • :page_size (Integer)

    Page Size This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to ‘1’)

Returns:



922
923
924
925
# File 'lib/ory-kratos-client/api/identity_api.rb', line 922

def list_identity_schemas(opts = {})
  data, _status_code, _headers = list_identity_schemas_with_http_info(opts)
  data
end

#list_identity_schemas_with_http_info(opts = {}) ⇒ Array<(Array<IdentitySchemaContainer>, Integer, Hash)>

Get all Identity Schemas Returns a list of all identity schemas currently in use.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Deprecated Items per Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This is the number of items per page. (default to 250)

  • :page (Integer)

    Deprecated Pagination Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the &#x60;Link&#x60; header.

  • :page_size (Integer)

    Page Size This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to ‘1’)

Returns:

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

    Array<IdentitySchemaContainer> data, response status code and response headers



935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
# File 'lib/ory-kratos-client/api/identity_api.rb', line 935

def list_identity_schemas_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.list_identity_schemas ...'
  end
  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityApi.list_identity_schemas, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityApi.list_identity_schemas, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_identity_schemas, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_identity_schemas, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/schemas'

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

  # return_type
  return_type = opts[:debug_return_type] || 'Array<IdentitySchemaContainer>'

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

  new_options = opts.merge(
    :operation => :"IdentityApi.list_identity_schemas",
    :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: IdentityApi#list_identity_schemas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_identity_sessions(id, opts = {}) ⇒ Array<Session>

List an Identity’s Sessions This endpoint returns all sessions that belong to the given Identity.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Deprecated Items per Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This is the number of items per page. (default to 250)

  • :page (Integer)

    Deprecated Pagination Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the &#x60;Link&#x60; header.

  • :page_size (Integer)

    Page Size This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to ‘1’)

  • :active (Boolean)

    Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned.

Returns:



1009
1010
1011
1012
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1009

def list_identity_sessions(id, opts = {})
  data, _status_code, _headers = list_identity_sessions_with_http_info(id, opts)
  data
end

#list_identity_sessions_with_http_info(id, opts = {}) ⇒ Array<(Array<Session>, Integer, Hash)>

List an Identity&#39;s Sessions This endpoint returns all sessions that belong to the given Identity.

Parameters:

  • id (String)

    ID is the identity&#39;s ID.

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

    the optional parameters

Options Hash (opts):

  • :per_page (Integer)

    Deprecated Items per Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This is the number of items per page. (default to 250)

  • :page (Integer)

    Deprecated Pagination Page DEPRECATED: Please use &#x60;page_token&#x60; instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the &#x60;Link&#x60; header.

  • :page_size (Integer)

    Page Size This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to ‘1’)

  • :active (Boolean)

    Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned.

Returns:

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

    Array<Session> data, response status code and response headers



1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1024

def list_identity_sessions_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.list_identity_sessions ...'
  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 IdentityApi.list_identity_sessions"
  end
  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityApi.list_identity_sessions, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityApi.list_identity_sessions, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_identity_sessions, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_identity_sessions, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/admin/identities/{id}/sessions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Session>'

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

  new_options = opts.merge(
    :operation => :"IdentityApi.list_identity_sessions",
    :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: IdentityApi#list_identity_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_sessions(opts = {}) ⇒ Array<Session>

List All Sessions Listing all sessions that exist.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination).

  • :active (Boolean)

    Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned.

  • :expand (Array<String>)

    ExpandOptions is a query parameter encoded list of all properties that must be expanded in the Session. If no value is provided, the expandable properties are skipped.

Returns:



1101
1102
1103
1104
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1101

def list_sessions(opts = {})
  data, _status_code, _headers = list_sessions_with_http_info(opts)
  data
end

#list_sessions_with_http_info(opts = {}) ⇒ Array<(Array<Session>, Integer, Hash)>

List All Sessions Listing all sessions that exist.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination). (default to 250)

  • :page_token (String)

    Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](www.ory.sh/docs/ecosystem/api-design#pagination).

  • :active (Boolean)

    Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned.

  • :expand (Array<String>)

    ExpandOptions is a query parameter encoded list of all properties that must be expanded in the Session. If no value is provided, the expandable properties are skipped.

Returns:

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

    Array<Session> data, response status code and response headers



1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1114

def list_sessions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.list_sessions ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_sessions, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IdentityApi.list_sessions, must be greater than or equal to 1.'
  end

  allowable_values = ["identity", "devices"]
  if @api_client.config.client_side_validation && opts[:'expand'] && !opts[:'expand'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"expand\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/admin/sessions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'active'] = opts[:'active'] if !opts[:'active'].nil?
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Session>'

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

  new_options = opts.merge(
    :operation => :"IdentityApi.list_sessions",
    :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: IdentityApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_identity(id, opts = {}) ⇒ Identity

Patch an Identity Partially updates an [identity’s](www.ory.sh/docs/kratos/concepts/identity-user-model) field using [JSON Patch](jsonpatch.com/). The fields ‘id`, `stateChangedAt` and `credentials` can not be updated using this method.

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:



1180
1181
1182
1183
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1180

def patch_identity(id, opts = {})
  data, _status_code, _headers = patch_identity_with_http_info(id, opts)
  data
end

#patch_identity_with_http_info(id, opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Patch an Identity Partially updates an [identity&#39;s](www.ory.sh/docs/kratos/concepts/identity-user-model) field using [JSON Patch](jsonpatch.com/). The fields &#x60;id&#x60;, &#x60;stateChangedAt&#x60; and &#x60;credentials&#x60; can not be updated using this method.

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Identity data, response status code and response headers



1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1191

def patch_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.patch_identity ...'
  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 IdentityApi.patch_identity"
  end
  # resource path
  local_var_path = '/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(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'
  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(opts[:'json_patch'])

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

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

  new_options = opts.merge(
    :operation => :"IdentityApi.patch_identity",
    :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: IdentityApi#patch_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_identity(id, opts = {}) ⇒ Identity

Update an Identity This endpoint updates an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model). The full identity payload (except credentials) is expected. It is possible to update the identity’s credentials as well.

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:



1250
1251
1252
1253
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1250

def update_identity(id, opts = {})
  data, _status_code, _headers = update_identity_with_http_info(id, opts)
  data
end

#update_identity_with_http_info(id, opts = {}) ⇒ Array<(Identity, Integer, Hash)>

Update an Identity This endpoint updates an [identity](www.ory.sh/docs/kratos/concepts/identity-user-model). The full identity payload (except credentials) is expected. It is possible to update the identity&#39;s credentials as well.

Parameters:

  • id (String)

    ID must be set to the ID of identity you want to update

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Identity data, response status code and response headers



1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
# File 'lib/ory-kratos-client/api/identity_api.rb', line 1261

def update_identity_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityApi.update_identity ...'
  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 IdentityApi.update_identity"
  end
  # resource path
  local_var_path = '/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(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'
  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(opts[:'update_identity_body'])

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

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

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