Class: Plaid::WatchlistScreeningEntity::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/plaid/watchlist_screening_entity/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ void

Parameters:



9
10
11
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 9

def initialize(client:)
  @client = client
end

Instance Method Details

#create(request_options: {}, **params) ⇒ Plaid::Types::WatchlistScreeningEntityCreateResponse

Create a new entity watchlist screening to check your customer against watchlists defined in the associated entity watchlist program. If your associated program has ongoing screening enabled, this is the profile information that will be used to monitor your customer over time.

Examples:

client.watchlist_screening_entity.create(search_terms: {
  entity_watchlist_program_id: "entprg_2eRPsDnL66rZ7H",
  legal_name: "Al-Qaida"
})

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



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
64
65
66
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 32

def create(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  request = Plaid::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "watchlist_screening/entity/create",
    body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityCreateRequest.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Plaid::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    begin
      (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityCreateResponse.load(response.body))
    rescue ::JSON::ParserError
      raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
    end
  else
    error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
    error_types = {
      400 => Plaid::Types::PlaidError,
      401 => Plaid::Types::PlaidError,
      429 => Plaid::Types::PlaidError,
      500 => Plaid::Types::PlaidError,
      (400..499) => Plaid::Types::PlaidError,
      (500..599) => Plaid::Types::PlaidError
    }
    error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
    raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
  end
end

#create_review(request_options: {}, **params) ⇒ Plaid::Types::WatchlistScreeningEntityReviewCreateResponse

Create a review for an entity watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid.

Examples:

client.watchlist_screening_entity.create_review(
  confirmed_hits: ["enthit_52xR9LKo77r1Np"],
  dismissed_hits: ["enthit_52xR9LKo77r1Np"],
  entity_watchlist_screening_id: "entscr_52xR9LKo77r1Np"
)

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 448

def create_review(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  request = Plaid::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "watchlist_screening/entity/review/create",
    body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityReviewCreateRequest.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Plaid::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    begin
      (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityReviewCreateResponse.load(response.body))
    rescue ::JSON::ParserError
      raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
    end
  else
    error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
    error_types = {
      400 => Plaid::Types::PlaidError,
      401 => Plaid::Types::PlaidError,
      429 => Plaid::Types::PlaidError,
      500 => Plaid::Types::PlaidError,
      (400..499) => Plaid::Types::PlaidError,
      (500..599) => Plaid::Types::PlaidError
    }
    error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
    raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
  end
end

#get(request_options: {}, **params) ⇒ Plaid::Types::WatchlistScreeningEntityGetResponse

Retrieve an entity watchlist screening.

Examples:

client.watchlist_screening_entity.get(entity_watchlist_screening_id: "entscr_52xR9LKo77r1Np")

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



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
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 82

def get(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  request = Plaid::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "watchlist_screening/entity/get",
    body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityGetRequest.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Plaid::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    begin
      (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityGetResponse.load(response.body))
    rescue ::JSON::ParserError
      raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
    end
  else
    error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
    error_types = {
      400 => Plaid::Types::PlaidError,
      401 => Plaid::Types::PlaidError,
      429 => Plaid::Types::PlaidError,
      500 => Plaid::Types::PlaidError,
      (400..499) => Plaid::Types::PlaidError,
      (500..599) => Plaid::Types::PlaidError
    }
    error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
    raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
  end
end

#get_program(request_options: {}, **params) ⇒ Plaid::Types::WatchlistScreeningEntityProgramGetResponse

Get an entity watchlist screening program

Examples:

client.watchlist_screening_entity.get_program(entity_watchlist_program_id: "entprg_2eRPsDnL66rZ7H")

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 328

def get_program(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  request = Plaid::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "watchlist_screening/entity/program/get",
    body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityProgramGetRequest.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Plaid::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    begin
      (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityProgramGetResponse.load(response.body))
    rescue ::JSON::ParserError
      raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
    end
  else
    error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
    error_types = {
      400 => Plaid::Types::PlaidError,
      401 => Plaid::Types::PlaidError,
      429 => Plaid::Types::PlaidError,
      500 => Plaid::Types::PlaidError,
      (400..499) => Plaid::Types::PlaidError,
      (500..599) => Plaid::Types::PlaidError
    }
    error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
    raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
  end
end

#list(request_options: {}, **params) ⇒ Plaid::Internal::CursorItemIterator

List all entity screenings.

Returns a Plaid::Internal::CursorItemIterator that yields each Plaid::Types::EntityWatchlistScreening in the entity_watchlist_screenings field of every page, requesting pages as they are needed. Call pages on it to get each page as a Plaid::Types::WatchlistScreeningEntityListResponse, including its other fields.

No request is sent by this call. The first page is requested when you start iterating (or call load_first_page), so an API error is raised by the loop (or by load_first_page), not by this call.

Examples:

client.watchlist_screening_entity.list(entity_watchlist_program_id: "entprg_2eRPsDnL66rZ7H")

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 270

def list(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  Plaid::Internal::CursorItemIterator.new(
    cursor_field: :next_cursor,
    item_field: :entity_watchlist_screenings,
    initial_cursor: params[:cursor]
  ) do |next_cursor|
    params[:cursor] = next_cursor
    request = Plaid::Internal::JSON::Request.new(
      base_url: request_options[:base_url],
      method: "POST",
      path: "watchlist_screening/entity/list",
      body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityListRequest.new(params).to_h,
      request_options: request_options
    )
    begin
      response = @client.send(request)
    rescue Net::HTTPRequestTimeout
      raise Plaid::Errors::TimeoutError
    end
    code = response.code.to_i
    if code.between?(200, 299)
      begin
        parsed_response = (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityListResponse.load(response.body))
      rescue ::JSON::ParserError
        raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
      end
      [parsed_response, response]
    else
      error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
      error_types = {
        400 => Plaid::Types::PlaidError,
        401 => Plaid::Types::PlaidError,
        429 => Plaid::Types::PlaidError,
        500 => Plaid::Types::PlaidError,
        (400..499) => Plaid::Types::PlaidError,
        (500..599) => Plaid::Types::PlaidError
      }
      error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
      raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
    end
  end
end

#list_history(request_options: {}, **params) ⇒ Plaid::Internal::CursorItemIterator

List all changes to the entity watchlist screening in reverse-chronological order. If the watchlist screening has not been edited, no history will be returned.

Returns a Plaid::Internal::CursorItemIterator that yields each Plaid::Types::EntityWatchlistScreening in the entity_watchlist_screenings field of every page, requesting pages as they are needed. Call pages on it to get each page as a Plaid::Types::WatchlistScreeningEntityHistoryListResponse, including its other fields.

No request is sent by this call. The first page is requested when you start iterating (or call load_first_page), so an API error is raised by the loop (or by load_first_page), not by this call.

Examples:

client.watchlist_screening_entity.list_history(entity_watchlist_screening_id: "entscr_52xR9LKo77r1Np")

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



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
176
177
178
179
180
181
182
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 140

def list_history(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  Plaid::Internal::CursorItemIterator.new(
    cursor_field: :next_cursor,
    item_field: :entity_watchlist_screenings,
    initial_cursor: params[:cursor]
  ) do |next_cursor|
    params[:cursor] = next_cursor
    request = Plaid::Internal::JSON::Request.new(
      base_url: request_options[:base_url],
      method: "POST",
      path: "watchlist_screening/entity/history/list",
      body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityHistoryListRequest.new(params).to_h,
      request_options: request_options
    )
    begin
      response = @client.send(request)
    rescue Net::HTTPRequestTimeout
      raise Plaid::Errors::TimeoutError
    end
    code = response.code.to_i
    if code.between?(200, 299)
      begin
        parsed_response = (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityHistoryListResponse.load(response.body))
      rescue ::JSON::ParserError
        raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
      end
      [parsed_response, response]
    else
      error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
      error_types = {
        400 => Plaid::Types::PlaidError,
        401 => Plaid::Types::PlaidError,
        429 => Plaid::Types::PlaidError,
        500 => Plaid::Types::PlaidError,
        (400..499) => Plaid::Types::PlaidError,
        (500..599) => Plaid::Types::PlaidError
      }
      error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
      raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
    end
  end
end

#list_hits(request_options: {}, **params) ⇒ Plaid::Internal::CursorItemIterator

List all hits for the entity watchlist screening.

Returns a Plaid::Internal::CursorItemIterator that yields each Plaid::Types::EntityWatchlistScreeningHit in the entity_watchlist_screening_hits field of every page, requesting pages as they are needed. Call pages on it to get each page as a Plaid::Types::WatchlistScreeningEntityHitListResponse, including its other fields.

No request is sent by this call. The first page is requested when you start iterating (or call load_first_page), so an API error is raised by the loop (or by load_first_page), not by this call.

Examples:

client.watchlist_screening_entity.list_hits(entity_watchlist_screening_id: "entscr_52xR9LKo77r1Np")

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 205

def list_hits(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  Plaid::Internal::CursorItemIterator.new(
    cursor_field: :next_cursor,
    item_field: :entity_watchlist_screening_hits,
    initial_cursor: params[:cursor]
  ) do |next_cursor|
    params[:cursor] = next_cursor
    request = Plaid::Internal::JSON::Request.new(
      base_url: request_options[:base_url],
      method: "POST",
      path: "watchlist_screening/entity/hit/list",
      body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityHitListRequest.new(params).to_h,
      request_options: request_options
    )
    begin
      response = @client.send(request)
    rescue Net::HTTPRequestTimeout
      raise Plaid::Errors::TimeoutError
    end
    code = response.code.to_i
    if code.between?(200, 299)
      begin
        parsed_response = (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityHitListResponse.load(response.body))
      rescue ::JSON::ParserError
        raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
      end
      [parsed_response, response]
    else
      error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
      error_types = {
        400 => Plaid::Types::PlaidError,
        401 => Plaid::Types::PlaidError,
        429 => Plaid::Types::PlaidError,
        500 => Plaid::Types::PlaidError,
        (400..499) => Plaid::Types::PlaidError,
        (500..599) => Plaid::Types::PlaidError
      }
      error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
      raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
    end
  end
end

#list_programs(request_options: {}, **params) ⇒ Plaid::Internal::CursorItemIterator

List all entity watchlist screening programs

Returns a Plaid::Internal::CursorItemIterator that yields each Plaid::Types::EntityWatchlistProgram in the entity_watchlist_programs field of every page, requesting pages as they are needed. Call pages on it to get each page as a Plaid::Types::WatchlistScreeningEntityProgramListResponse, including its other fields.

No request is sent by this call. The first page is requested when you start iterating (or call load_first_page), so an API error is raised by the loop (or by load_first_page), not by this call.

Examples:

client.watchlist_screening_entity.list_programs

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



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
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 385

def list_programs(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  Plaid::Internal::CursorItemIterator.new(
    cursor_field: :next_cursor,
    item_field: :entity_watchlist_programs,
    initial_cursor: params[:cursor]
  ) do |next_cursor|
    params[:cursor] = next_cursor
    request = Plaid::Internal::JSON::Request.new(
      base_url: request_options[:base_url],
      method: "POST",
      path: "watchlist_screening/entity/program/list",
      body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityProgramListRequest.new(params).to_h,
      request_options: request_options
    )
    begin
      response = @client.send(request)
    rescue Net::HTTPRequestTimeout
      raise Plaid::Errors::TimeoutError
    end
    code = response.code.to_i
    if code.between?(200, 299)
      begin
        parsed_response = (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityProgramListResponse.load(response.body))
      rescue ::JSON::ParserError
        raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
      end
      [parsed_response, response]
    else
      error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
      error_types = {
        400 => Plaid::Types::PlaidError,
        401 => Plaid::Types::PlaidError,
        429 => Plaid::Types::PlaidError,
        500 => Plaid::Types::PlaidError,
        (400..499) => Plaid::Types::PlaidError,
        (500..599) => Plaid::Types::PlaidError
      }
      error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
      raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
    end
  end
end

#list_reviews(request_options: {}, **params) ⇒ Plaid::Internal::CursorItemIterator

List all reviews for a particular entity watchlist screening. Reviews are compliance reports created by users in your organization regarding the relevance of potential hits found by Plaid.

Returns a Plaid::Internal::CursorItemIterator that yields each Plaid::Types::EntityWatchlistScreeningReview in the entity_watchlist_screening_reviews field of every page, requesting pages as they are needed. Call pages on it to get each page as a Plaid::Types::WatchlistScreeningEntityReviewListResponse, including its other fields.

No request is sent by this call. The first page is requested when you start iterating (or call load_first_page), so an API error is raised by the loop (or by load_first_page), not by this call.

Examples:

client.watchlist_screening_entity.list_reviews(entity_watchlist_screening_id: "entscr_52xR9LKo77r1Np")

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 507

def list_reviews(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  Plaid::Internal::CursorItemIterator.new(
    cursor_field: :next_cursor,
    item_field: :entity_watchlist_screening_reviews,
    initial_cursor: params[:cursor]
  ) do |next_cursor|
    params[:cursor] = next_cursor
    request = Plaid::Internal::JSON::Request.new(
      base_url: request_options[:base_url],
      method: "POST",
      path: "watchlist_screening/entity/review/list",
      body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityReviewListRequest.new(params).to_h,
      request_options: request_options
    )
    begin
      response = @client.send(request)
    rescue Net::HTTPRequestTimeout
      raise Plaid::Errors::TimeoutError
    end
    code = response.code.to_i
    if code.between?(200, 299)
      begin
        parsed_response = (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityReviewListResponse.load(response.body))
      rescue ::JSON::ParserError
        raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
      end
      [parsed_response, response]
    else
      error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
      error_types = {
        400 => Plaid::Types::PlaidError,
        401 => Plaid::Types::PlaidError,
        429 => Plaid::Types::PlaidError,
        500 => Plaid::Types::PlaidError,
        (400..499) => Plaid::Types::PlaidError,
        (500..599) => Plaid::Types::PlaidError
      }
      error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
      raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
    end
  end
end

#update(request_options: {}, **params) ⇒ Plaid::Types::WatchlistScreeningEntityUpdateResponse

Update an entity watchlist screening.

Examples:

client.watchlist_screening_entity.update(entity_watchlist_screening_id: "entscr_52xR9LKo77r1Np")

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



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
# File 'lib/plaid/watchlist_screening_entity/client.rb', line 565

def update(request_options: {}, **params)
  params = Plaid::Internal::Types::Utils.normalize_keys(params)
  request = Plaid::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "POST",
    path: "watchlist_screening/entity/update",
    body: Plaid::WatchlistScreeningEntity::Types::WatchlistScreeningEntityUpdateRequest.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Plaid::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    begin
      (response.body.to_s.empty? ? nil : Plaid::Types::WatchlistScreeningEntityUpdateResponse.load(response.body))
    rescue ::JSON::ParserError
      raise Plaid::Errors::ResponseError.new(response.body, code: code, headers: response.to_hash)
    end
  else
    error_class = Plaid::Errors::ResponseError.subclass_for_code(code)
    error_types = {
      400 => Plaid::Types::PlaidError,
      401 => Plaid::Types::PlaidError,
      429 => Plaid::Types::PlaidError,
      500 => Plaid::Types::PlaidError,
      (400..499) => Plaid::Types::PlaidError,
      (500..599) => Plaid::Types::PlaidError
    }
    error_body = Plaid::Errors::ResponseError.load_error_body(code, response.body, error_types)
    raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
  end
end