Class: Azure::CognitiveServices::ContentModerator::V1_0::ListManagementTermLists

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb

Overview

You use the API to scan your content as it is generated. Content Moderator then processes your content and sends the results along with relevant information either back to your systems or to the built-in review tool. You can use this information to take decisions e.g. take it down, send to human judge, etc.

When using the API, images need to have a minimum of 128 pixels and a maximum file size of 4MB. Text can be at most 1024 characters long. If the content passed to the text API or the image API exceeds the size limits, the API will return an error code that informs about the issue.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ListManagementTermLists

Creates and initializes a new instance of the ListManagementTermLists class.

Parameters:

  • client

    service class for accessing basic functionality.



27
28
29
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 27

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientContentModeratorClient (readonly)

Returns reference to the ContentModeratorClient.

Returns:



32
33
34
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 32

def client
  @client
end

Instance Method Details

#create(content_type, body, custom_headers: nil) ⇒ TermList

Creates a Term List

will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • body (Body)

    Schema of the body.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (TermList)

    operation results.



331
332
333
334
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 331

def create(content_type, body, custom_headers:nil)
  response = create_async(content_type, body, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_async(content_type, body, custom_headers: nil) ⇒ Concurrent::Promise

Creates a Term List

to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • body (Body)

    Schema of the body.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 360

def create_async(content_type, body, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'content_type is nil' if content_type.nil?
  fail ArgumentError, 'body is nil' if body.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['Content-Type'] = content_type unless content_type.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::Body.mapper()
  request_content = @client.serialize(request_mapper,  body)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'contentmoderator/lists/v1.0/termlists'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_with_http_info(content_type, body, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a Term List

will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • body (Body)

    Schema of the body.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



346
347
348
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 346

def create_with_http_info(content_type, body, custom_headers:nil)
  create_async(content_type, body, custom_headers:custom_headers).value!
end

#delete(list_id, custom_headers: nil) ⇒ String

Deletes term list with the list Id equal to list Id passed.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (String)

    operation results.



133
134
135
136
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 133

def delete(list_id, custom_headers:nil)
  response = delete_async(list_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_async(list_id, custom_headers: nil) ⇒ Concurrent::Promise

Deletes term list with the list Id equal to list Id passed.

to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



160
161
162
163
164
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
213
214
215
216
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 160

def delete_async(list_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'list_id is nil' if list_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'contentmoderator/lists/v1.0/termlists/{listId}'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'listId' => list_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#delete_with_http_info(list_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes term list with the list Id equal to list Id passed.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



147
148
149
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 147

def delete_with_http_info(list_id, custom_headers:nil)
  delete_async(list_id, custom_headers:custom_headers).value!
end

#get_all_term_lists(custom_headers: nil) ⇒ Array

gets all the Term Lists

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



427
428
429
430
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 427

def get_all_term_lists(custom_headers:nil)
  response = get_all_term_lists_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_all_term_lists_async(custom_headers: nil) ⇒ Concurrent::Promise

gets all the Term Lists

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 452

def get_all_term_lists_async(custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'contentmoderator/lists/v1.0/termlists'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'TermListElementType',
                type: {
                  name: 'Composite',
                  class_name: 'TermList'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_all_term_lists_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

gets all the Term Lists

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



440
441
442
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 440

def get_all_term_lists_with_http_info(custom_headers:nil)
  get_all_term_lists_async(custom_headers:custom_headers).value!
end

#get_details(list_id, custom_headers: nil) ⇒ TermList

Returns list Id details of the term list with list Id equal to list Id passed.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (TermList)

    operation results.



44
45
46
47
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 44

def get_details(list_id, custom_headers:nil)
  response = get_details_async(list_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_details_async(list_id, custom_headers: nil) ⇒ Concurrent::Promise

Returns list Id details of the term list with list Id equal to list Id passed.

to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 73

def get_details_async(list_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'list_id is nil' if list_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'contentmoderator/lists/v1.0/termlists/{listId}'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'listId' => list_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_details_with_http_info(list_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns list Id details of the term list with list Id equal to list Id passed.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



59
60
61
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 59

def get_details_with_http_info(list_id, custom_headers:nil)
  get_details_async(list_id, custom_headers:custom_headers).value!
end

#refresh_index_method(list_id, language, custom_headers: nil) ⇒ RefreshIndex

Refreshes the index of the list with list Id equal to list ID passed.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • language (String)

    Language of the terms.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (RefreshIndex)

    operation results.



527
528
529
530
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 527

def refresh_index_method(list_id, language, custom_headers:nil)
  response = refresh_index_method_async(list_id, language, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#refresh_index_method_async(list_id, language, custom_headers: nil) ⇒ Concurrent::Promise

Refreshes the index of the list with list Id equal to list ID passed.

to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • language (String)

    Language of the terms.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



556
557
558
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
606
607
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 556

def refresh_index_method_async(list_id, language, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'list_id is nil' if list_id.nil?
  fail ArgumentError, 'language is nil' if language.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'contentmoderator/lists/v1.0/termlists/{listId}/RefreshIndex'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'listId' => list_id},
      query_params: {'language' => language},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::RefreshIndex.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#refresh_index_method_with_http_info(list_id, language, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Refreshes the index of the list with list Id equal to list ID passed.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • language (String)

    Language of the terms.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



542
543
544
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 542

def refresh_index_method_with_http_info(list_id, language, custom_headers:nil)
  refresh_index_method_async(list_id, language, custom_headers:custom_headers).value!
end

#update(list_id, content_type, body, custom_headers: nil) ⇒ TermList

Updates an Term List.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • content_type (String)

    The content type.

  • body (Body)

    Schema of the body.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (TermList)

    operation results.



229
230
231
232
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 229

def update(list_id, content_type, body, custom_headers:nil)
  response = update_async(list_id, content_type, body, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(list_id, content_type, body, custom_headers: nil) ⇒ Concurrent::Promise

Updates an Term List.

to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • content_type (String)

    The content type.

  • body (Body)

    Schema of the body.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 260

def update_async(list_id, content_type, body, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'list_id is nil' if list_id.nil?
  fail ArgumentError, 'content_type is nil' if content_type.nil?
  fail ArgumentError, 'body is nil' if body.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['Content-Type'] = content_type unless content_type.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::Body.mapper()
  request_content = @client.serialize(request_mapper,  body)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'contentmoderator/lists/v1.0/termlists/{listId}'

  request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'listId' => list_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(list_id, content_type, body, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates an Term List.

will be added to the HTTP request.

Parameters:

  • list_id (String)

    List Id of the image list.

  • content_type (String)

    The content type.

  • body (Body)

    Schema of the body.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



245
246
247
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb', line 245

def update_with_http_info(list_id, content_type, body, custom_headers:nil)
  update_async(list_id, content_type, body, custom_headers:custom_headers).value!
end