Class: Azure::CognitiveServices::ContentModerator::V1_0::Reviews

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.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.

This API is currently available in:

  • West US - westus.api.cognitive.microsoft.com

  • East US 2 - eastus2.api.cognitive.microsoft.com

  • West Central US - westcentralus.api.cognitive.microsoft.com

  • West Europe - westeurope.api.cognitive.microsoft.com

  • Southeast Asia - southeastasia.api.cognitive.microsoft.com .

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Reviews

Creates and initializes a new instance of the Reviews class.

Parameters:

  • client

    service class for accessing basic functionality.



35
36
37
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 35

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientContentModeratorClient (readonly)

Returns reference to the ContentModeratorClient.

Returns:



40
41
42
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 40

def client
  @client
end

Instance Method Details

#add_video_frame(team_name, review_id, timescale: nil, custom_headers: nil) ⇒ Object

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • timescale (Integer) (defaults to: nil)

    Timescale of the video you are adding frames to.

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

    A hash of custom headers that



753
754
755
756
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 753

def add_video_frame(team_name, review_id, timescale:nil, custom_headers:nil)
  response = add_video_frame_async(team_name, review_id, timescale:timescale, custom_headers:custom_headers).value!
  nil
end

#add_video_frame_async(team_name, review_id, timescale: nil, custom_headers: nil) ⇒ Concurrent::Promise

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • timescale (Integer) (defaults to: nil)

    Timescale of the video you are adding frames to.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



834
835
836
837
838
839
840
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
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 834

def add_video_frame_async(team_name, review_id, timescale:nil, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_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/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_id},
      query_params: {'timescale' => timescale},
      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?

    result
  end

  promise.execute
end

#add_video_frame_stream(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale: nil, custom_headers: nil) ⇒ Object

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • frame_image_zip

    Zip file containing frame images.

  • frame_metadata (String)

    Metadata of the frame.

  • timescale (Integer) (defaults to: nil)

    Timescale of the video .

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

    A hash of custom headers that



1729
1730
1731
1732
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1729

def add_video_frame_stream(content_type, team_name, review_id, frame_image_zip, , timescale:nil, custom_headers:nil)
  response = add_video_frame_stream_async(content_type, team_name, review_id, frame_image_zip, , timescale:timescale, custom_headers:custom_headers).value!
  nil
end

#add_video_frame_stream_async(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale: nil, custom_headers: nil) ⇒ Concurrent::Promise

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • frame_image_zip

    Zip file containing frame images.

  • frame_metadata (String)

    Metadata of the frame.

  • timescale (Integer) (defaults to: nil)

    Timescale of the video .

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1774

def add_video_frame_stream_async(content_type, team_name, review_id, frame_image_zip, , timescale:nil, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'content_type is nil' if content_type.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_id.nil?
  fail ArgumentError, 'frame_image_zip is nil' if frame_image_zip.nil?
  fail ArgumentError, 'frame_metadata is nil' if .nil?


  request_headers = {}
  request_headers['Content-Type'] = 'multipart/form-data'

  # 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?

  # Set Form Data
  form_data = {}
  form_data['frameImageZip'] = frame_image_zip.to_s unless frame_image_zip.to_s.nil?
  form_data['frameMetadata'] =  unless .nil?

  path_template = 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_id},
      query_params: {'timescale' => timescale},
      headers: request_headers.merge(custom_headers || {}),
      body: URI.encode_www_form(form_data),
      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 == 204
      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?

    result
  end

  promise.execute
end

#add_video_frame_stream_with_http_info(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • frame_image_zip

    Zip file containing frame images.

  • frame_metadata (String)

    Metadata of the frame.

  • timescale (Integer) (defaults to: nil)

    Timescale of the video .

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1752
1753
1754
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1752

def add_video_frame_stream_with_http_info(content_type, team_name, review_id, frame_image_zip, , timescale:nil, custom_headers:nil)
  add_video_frame_stream_async(content_type, team_name, review_id, frame_image_zip, , timescale:timescale, custom_headers:custom_headers).value!
end

#add_video_frame_url(content_type, team_name, review_id, video_frame_body, timescale: nil, custom_headers: nil) ⇒ Object

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

API will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • video_frame_body (Array<VideoFrameBodyItem>)

    Body for add video frames

  • timescale (Integer) (defaults to: nil)

    Timescale of the video.

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

    A hash of custom headers that



1598
1599
1600
1601
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1598

def add_video_frame_url(content_type, team_name, review_id, video_frame_body, timescale:nil, custom_headers:nil)
  response = add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:timescale, custom_headers:custom_headers).value!
  nil
end

#add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale: nil, custom_headers: nil) ⇒ Concurrent::Promise

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

API to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • video_frame_body (Array<VideoFrameBodyItem>)

    Body for add video frames

  • timescale (Integer) (defaults to: nil)

    Timescale of the video.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1643

def add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:nil, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'content_type is nil' if content_type.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_id.nil?
  fail ArgumentError, 'video_frame_body is nil' if video_frame_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 = {
    client_side_validation: true,
    required: true,
    serialized_name: 'videoFrameBody',
    type: {
      name: 'Sequence',
      element: {
          client_side_validation: true,
          required: false,
          serialized_name: 'VideoFrameBodyItemElementType',
          type: {
            name: 'Composite',
            class_name: 'VideoFrameBodyItem'
          }
      }
    }
  }
  request_content = @client.serialize(request_mapper,  video_frame_body)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_id},
      query_params: {'timescale' => timescale},
      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 == 204
      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?

    result
  end

  promise.execute
end

#add_video_frame_url_with_http_info(content_type, team_name, review_id, video_frame_body, timescale: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Use this method to add frames for a video review.Timescale: This parameter is a factor which is used to convert the timestamp on a frame into milliseconds. Timescale is provided in the output of the Content Moderator video media processor on the Azure Media Services platform.Timescale in the Video Moderation output is Ticks/Second.

API will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • video_frame_body (Array<VideoFrameBodyItem>)

    Body for add video frames

  • timescale (Integer) (defaults to: nil)

    Timescale of the video.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1621
1622
1623
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1621

def add_video_frame_url_with_http_info(content_type, team_name, review_id, video_frame_body, timescale:nil, custom_headers:nil)
  add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:timescale, custom_headers:custom_headers).value!
end

#add_video_frame_with_http_info(team_name, review_id, timescale: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • timescale (Integer) (defaults to: nil)

    Timescale of the video you are adding frames to.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



794
795
796
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 794

def add_video_frame_with_http_info(team_name, review_id, timescale:nil, custom_headers:nil)
  add_video_frame_async(team_name, review_id, timescale:timescale, custom_headers:custom_headers).value!
end

#add_video_transcript(team_name, review_id, vttfile, custom_headers: nil) ⇒ Object

This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • vttfile

    Transcript file of the video.

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

    A hash of custom headers that



1271
1272
1273
1274
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1271

def add_video_transcript(team_name, review_id, vttfile, custom_headers:nil)
  response = add_video_transcript_async(team_name, review_id, vttfile, custom_headers:custom_headers).value!
  nil
end

#add_video_transcript_async(team_name, review_id, vttfile, custom_headers: nil) ⇒ Concurrent::Promise

This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format.

to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • vttfile

    Transcript file of the video.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1304

def add_video_transcript_async(team_name, review_id, vttfile, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_id.nil?
  content_type = 'text/plain'
  fail ArgumentError, 'vttfile is nil' if vttfile.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'text/plain'

  # 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 = {
    client_side_validation: true,
    required: true,
    serialized_name: 'VTT file',
    type: {
      name: 'Stream'
    }
  }
  request_content = @client.serialize(request_mapper,  vttfile)

  path_template = 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/transcript'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_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 == 204
      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?

    result
  end

  promise.execute
end

#add_video_transcript_moderation_result(content_type, team_name, review_id, transcript_moderation_body, custom_headers: nil) ⇒ Object

This API adds a transcript screen text result file for a video review. Transcript screen text result file is a result of Screen Text API . In order to generate transcript screen text result file , a transcript file has to be screened for profanity using Screen Text API.

for add video transcript moderation result API will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • transcript_moderation_body (Array<TranscriptModerationBodyItem>)

    Body

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

    A hash of custom headers that



1151
1152
1153
1154
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1151

def add_video_transcript_moderation_result(content_type, team_name, review_id, transcript_moderation_body, custom_headers:nil)
  response = add_video_transcript_moderation_result_async(content_type, team_name, review_id, transcript_moderation_body, custom_headers:custom_headers).value!
  nil
end

#add_video_transcript_moderation_result_async(content_type, team_name, review_id, transcript_moderation_body, custom_headers: nil) ⇒ Concurrent::Promise

This API adds a transcript screen text result file for a video review. Transcript screen text result file is a result of Screen Text API . In order to generate transcript screen text result file , a transcript file has to be screened for profanity using Screen Text API.

for add video transcript moderation result API to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • transcript_moderation_body (Array<TranscriptModerationBodyItem>)

    Body

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1192

def add_video_transcript_moderation_result_async(content_type, team_name, review_id, transcript_moderation_body, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'content_type is nil' if content_type.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_id.nil?
  fail ArgumentError, 'transcript_moderation_body is nil' if transcript_moderation_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 = {
    client_side_validation: true,
    required: true,
    serialized_name: 'transcriptModerationBody',
    type: {
      name: 'Sequence',
      element: {
          client_side_validation: true,
          required: false,
          serialized_name: 'TranscriptModerationBodyItemElementType',
          type: {
            name: 'Composite',
            class_name: 'TranscriptModerationBodyItem'
          }
      }
    }
  }
  request_content = @client.serialize(request_mapper,  transcript_moderation_body)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/transcriptmoderationresult'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_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 == 204
      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?

    result
  end

  promise.execute
end

#add_video_transcript_moderation_result_with_http_info(content_type, team_name, review_id, transcript_moderation_body, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

This API adds a transcript screen text result file for a video review. Transcript screen text result file is a result of Screen Text API . In order to generate transcript screen text result file , a transcript file has to be screened for profanity using Screen Text API.

for add video transcript moderation result API will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • transcript_moderation_body (Array<TranscriptModerationBodyItem>)

    Body

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1172
1173
1174
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1172

def add_video_transcript_moderation_result_with_http_info(content_type, team_name, review_id, transcript_moderation_body, custom_headers:nil)
  add_video_transcript_moderation_result_async(content_type, team_name, review_id, transcript_moderation_body, custom_headers:custom_headers).value!
end

#add_video_transcript_with_http_info(team_name, review_id, vttfile, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

This API adds a transcript file (text version of all the words spoken in a video) to a video review. The file should be a valid WebVTT format.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • vttfile

    Transcript file of the video.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1288
1289
1290
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1288

def add_video_transcript_with_http_info(team_name, review_id, vttfile, custom_headers:nil)
  add_video_transcript_async(team_name, review_id, vttfile, custom_headers:custom_headers).value!
end

#create_job(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint: nil, custom_headers: nil) ⇒ JobId

A job Id will be returned for the content posted on this endpoint.

Once the content is evaluated against the Workflow provided the review will be created or ignored based on the workflow expression.

<h3>CallBack Schemas </h3>

<p> <h4>Job Completion CallBack Sample</h4><br/>

{<br/> “JobId”: “<Job Id>,<br/> ”ReviewId“: ”<Review Id, if the Job resulted in a Review to be created>“,<br/> ”WorkFlowId“: ”default“,<br/> ”Status“: ”<This will be one of Complete, InProgress, Error>“,<br/> ”ContentType“: ”Image“,<br/> ”ContentId“: ”<This is the ContentId that was specified on input>“,<br/> ”CallBackType“: ”Job“,<br/> ”Metadata“: {<br/> ”adultscore“: ”0.xxx“,<br/> ”a“: ”False“,<br/> ”racyscore“: ”0.xxx“,<br/> ”r“: ”True“<br/> }<br/> }<br/>

</p> <p> <h4>Review Completion CallBack Sample</h4><br/>

{ “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”, “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

‘Image’, ‘Text’, ‘Video’ ‘application/json’, ‘image/jpeg’ job result. will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • content_type (Enum)

    Image, Text or Video. Possible values include:

  • content_id (String)

    Id/Name to identify the content submitted.

  • workflow_name (String)

    Workflow Name that you want to invoke.

  • job_content_type (Enum)

    The content type. Possible values include:

  • content (Content)

    Content to evaluate.

  • call_back_endpoint (String) (defaults to: nil)

    Callback endpoint for posting the create

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

    A hash of custom headers that

Returns:

  • (JobId)

    operation results.



510
511
512
513
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 510

def create_job(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint:nil, custom_headers:nil)
  response = create_job_async(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint:call_back_endpoint, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_job_async(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint: nil, custom_headers: nil) ⇒ Concurrent::Promise

A job Id will be returned for the content posted on this endpoint.

Once the content is evaluated against the Workflow provided the review will be created or ignored based on the workflow expression.

<h3>CallBack Schemas </h3>

<p> <h4>Job Completion CallBack Sample</h4><br/>

{<br/> “JobId”: “<Job Id>,<br/> ”ReviewId“: ”<Review Id, if the Job resulted in a Review to be created>“,<br/> ”WorkFlowId“: ”default“,<br/> ”Status“: ”<This will be one of Complete, InProgress, Error>“,<br/> ”ContentType“: ”Image“,<br/> ”ContentId“: ”<This is the ContentId that was specified on input>“,<br/> ”CallBackType“: ”Job“,<br/> ”Metadata“: {<br/> ”adultscore“: ”0.xxx“,<br/> ”a“: ”False“,<br/> ”racyscore“: ”0.xxx“,<br/> ”r“: ”True“<br/> }<br/> }<br/>

</p> <p> <h4>Review Completion CallBack Sample</h4><br/>

{ “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”, “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

‘Image’, ‘Text’, ‘Video’ ‘application/json’, ‘image/jpeg’ job result. to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • content_type (Enum)

    Image, Text or Video. Possible values include:

  • content_id (String)

    Id/Name to identify the content submitted.

  • workflow_name (String)

    Workflow Name that you want to invoke.

  • job_content_type (Enum)

    The content type. Possible values include:

  • content (Content)

    Content to evaluate.

  • call_back_endpoint (String) (defaults to: nil)

    Callback endpoint for posting the create

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
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
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 653

def create_job_async(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint:nil, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'content_type is nil' if content_type.nil?
  fail ArgumentError, 'content_id is nil' if content_id.nil?
  fail ArgumentError, 'workflow_name is nil' if workflow_name.nil?
  fail ArgumentError, 'job_content_type is nil' if job_content_type.nil?
  fail ArgumentError, 'content is nil' if content.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'] = job_content_type.to_s unless job_content_type.to_s.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

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

  path_template = 'contentmoderator/review/v1.0/teams/{teamName}/jobs'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name},
      query_params: {'ContentType' => content_type,'ContentId' => content_id,'WorkflowName' => workflow_name,'CallBackEndpoint' => call_back_endpoint},
      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::JobId.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_job_with_http_info(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

A job Id will be returned for the content posted on this endpoint.

Once the content is evaluated against the Workflow provided the review will be created or ignored based on the workflow expression.

<h3>CallBack Schemas </h3>

<p> <h4>Job Completion CallBack Sample</h4><br/>

{<br/> “JobId”: “<Job Id>,<br/> ”ReviewId“: ”<Review Id, if the Job resulted in a Review to be created>“,<br/> ”WorkFlowId“: ”default“,<br/> ”Status“: ”<This will be one of Complete, InProgress, Error>“,<br/> ”ContentType“: ”Image“,<br/> ”ContentId“: ”<This is the ContentId that was specified on input>“,<br/> ”CallBackType“: ”Job“,<br/> ”Metadata“: {<br/> ”adultscore“: ”0.xxx“,<br/> ”a“: ”False“,<br/> ”racyscore“: ”0.xxx“,<br/> ”r“: ”True“<br/> }<br/> }<br/>

</p> <p> <h4>Review Completion CallBack Sample</h4><br/>

{ “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”, “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

‘Image’, ‘Text’, ‘Video’ ‘application/json’, ‘image/jpeg’ job result. will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • content_type (Enum)

    Image, Text or Video. Possible values include:

  • content_id (String)

    Id/Name to identify the content submitted.

  • workflow_name (String)

    Workflow Name that you want to invoke.

  • job_content_type (Enum)

    The content type. Possible values include:

  • content (Content)

    Content to evaluate.

  • call_back_endpoint (String) (defaults to: nil)

    Callback endpoint for posting the create

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



582
583
584
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 582

def create_job_with_http_info(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint:nil, custom_headers:nil)
  create_job_async(team_name, content_type, content_id, workflow_name, job_content_type, content, call_back_endpoint:call_back_endpoint, custom_headers:custom_headers).value!
end

#create_reviews(url_content_type, team_name, create_review_body, sub_team: nil, custom_headers: nil) ⇒ Array

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

reviews API review to. will be added to the HTTP request.

Parameters:

  • url_content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • create_review_body (Array<CreateReviewBodyItem>)

    Body for create

  • sub_team (String) (defaults to: nil)

    SubTeam of your team, you want to assign the created

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



263
264
265
266
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 263

def create_reviews(url_content_type, team_name, create_review_body, sub_team:nil, custom_headers:nil)
  response = create_reviews_async(url_content_type, team_name, create_review_body, sub_team:sub_team, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_reviews_async(url_content_type, team_name, create_review_body, sub_team: nil, custom_headers: nil) ⇒ Concurrent::Promise

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

reviews API review to. to the HTTP request.

Parameters:

  • url_content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • create_review_body (Array<CreateReviewBodyItem>)

    Body for create

  • sub_team (String) (defaults to: nil)

    SubTeam of your team, you want to assign the created

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 350

def create_reviews_async(url_content_type, team_name, create_review_body, sub_team:nil, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'url_content_type is nil' if url_content_type.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'create_review_body is nil' if create_review_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['UrlContentType'] = url_content_type unless url_content_type.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = {
    client_side_validation: true,
    required: true,
    serialized_name: 'createReviewBody',
    type: {
      name: 'Sequence',
      element: {
          client_side_validation: true,
          required: false,
          serialized_name: 'CreateReviewBodyItemElementType',
          type: {
            name: 'Composite',
            class_name: 'CreateReviewBodyItem'
          }
      }
    }
  }
  request_content = @client.serialize(request_mapper,  create_review_body)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'contentmoderator/review/v1.0/teams/{teamName}/reviews'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name},
      query_params: {'subTeam' => sub_team},
      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 = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'StringElementType',
                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

#create_reviews_with_http_info(url_content_type, team_name, create_review_body, sub_team: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

reviews API review to. will be added to the HTTP request.

Parameters:

  • url_content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • create_review_body (Array<CreateReviewBodyItem>)

    Body for create

  • sub_team (String) (defaults to: nil)

    SubTeam of your team, you want to assign the created

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



307
308
309
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 307

def create_reviews_with_http_info(url_content_type, team_name, create_review_body, sub_team:nil, custom_headers:nil)
  create_reviews_async(url_content_type, team_name, create_review_body, sub_team:sub_team, custom_headers:custom_headers).value!
end

#create_video_reviews(content_type, team_name, create_video_reviews_body, sub_team: nil, custom_headers: nil) ⇒ Array

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

create reviews API review to. will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • create_video_reviews_body (Array<CreateVideoReviewsBodyItem>)

    Body for

  • sub_team (String) (defaults to: nil)

    SubTeam of your team, you want to assign the created

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



1401
1402
1403
1404
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1401

def create_video_reviews(content_type, team_name, create_video_reviews_body, sub_team:nil, custom_headers:nil)
  response = create_video_reviews_async(content_type, team_name, create_video_reviews_body, sub_team:sub_team, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_video_reviews_async(content_type, team_name, create_video_reviews_body, sub_team: nil, custom_headers: nil) ⇒ Concurrent::Promise

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

create reviews API review to. to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • create_video_reviews_body (Array<CreateVideoReviewsBodyItem>)

    Body for

  • sub_team (String) (defaults to: nil)

    SubTeam of your team, you want to assign the created

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1488

def create_video_reviews_async(content_type, team_name, create_video_reviews_body, sub_team:nil, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'content_type is nil' if content_type.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'create_video_reviews_body is nil' if create_video_reviews_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 = {
    client_side_validation: true,
    required: true,
    serialized_name: 'CreateVideoReviewsBody',
    type: {
      name: 'Sequence',
      element: {
          client_side_validation: true,
          required: false,
          serialized_name: 'CreateVideoReviewsBodyItemElementType',
          type: {
            name: 'Composite',
            class_name: 'CreateVideoReviewsBodyItem'
          }
      }
    }
  }
  request_content = @client.serialize(request_mapper,  create_video_reviews_body)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'contentmoderator/review/v1.0/teams/{teamName}/reviews'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name},
      query_params: {'subTeam' => sub_team},
      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 = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'StringElementType',
                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

#create_video_reviews_with_http_info(content_type, team_name, create_video_reviews_body, sub_team: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

create reviews API review to. will be added to the HTTP request.

Parameters:

  • content_type (String)

    The content type.

  • team_name (String)

    Your team name.

  • create_video_reviews_body (Array<CreateVideoReviewsBodyItem>)

    Body for

  • sub_team (String) (defaults to: nil)

    SubTeam of your team, you want to assign the created

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1445
1446
1447
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1445

def create_video_reviews_with_http_info(content_type, team_name, create_video_reviews_body, sub_team:nil, custom_headers:nil)
  create_video_reviews_async(content_type, team_name, create_video_reviews_body, sub_team:sub_team, custom_headers:custom_headers).value!
end

#get_job_details(team_name, job_id, custom_headers: nil) ⇒ Job

Get the Job Details for a Job Id.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your Team Name.

  • job_id (String)

    Id of the job.

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

    A hash of custom headers that

Returns:

  • (Job)

    operation results.



143
144
145
146
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 143

def get_job_details(team_name, job_id, custom_headers:nil)
  response = get_job_details_async(team_name, job_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_job_details_async(team_name, job_id, custom_headers: nil) ⇒ Concurrent::Promise

Get the Job Details for a Job Id.

to the HTTP request.

Parameters:

  • team_name (String)

    Your Team Name.

  • job_id (String)

    Id of the job.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
217
218
219
220
221
222
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 172

def get_job_details_async(team_name, job_id, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'job_id is nil' if job_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/review/v1.0/teams/{teamName}/jobs/{JobId}'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'JobId' => job_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::Job.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_job_details_with_http_info(team_name, job_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the Job Details for a Job Id.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your Team Name.

  • job_id (String)

    Id of the job.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



158
159
160
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 158

def get_job_details_with_http_info(team_name, job_id, custom_headers:nil)
  get_job_details_async(team_name, job_id, custom_headers:custom_headers).value!
end

#get_review(team_name, review_id, custom_headers: nil) ⇒ Review

Returns review details for the review Id passed.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your Team Name.

  • review_id (String)

    Id of the review.

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

    A hash of custom headers that

Returns:

  • (Review)

    operation results.



52
53
54
55
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 52

def get_review(team_name, review_id, custom_headers:nil)
  response = get_review_async(team_name, review_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_review_async(team_name, review_id, custom_headers: nil) ⇒ Concurrent::Promise

Returns review details for the review Id passed.

to the HTTP request.

Parameters:

  • team_name (String)

    Your Team Name.

  • review_id (String)

    Id of the review.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
123
124
125
126
127
128
129
130
131
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 81

def get_review_async(team_name, review_id, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_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/review/v1.0/teams/{teamName}/reviews/{reviewId}'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_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::Review.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_review_with_http_info(team_name, review_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns review details for the review Id passed.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your Team Name.

  • review_id (String)

    Id of the review.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



67
68
69
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 67

def get_review_with_http_info(team_name, review_id, custom_headers:nil)
  get_review_async(team_name, review_id, custom_headers:custom_headers).value!
end

#get_video_frames(team_name, review_id, start_seed: nil, no_of_records: nil, filter: nil, custom_headers: nil) ⇒ Frames

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

start fetching the frames. will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • start_seed (Integer) (defaults to: nil)

    Time stamp of the frame from where you want to

  • no_of_records (Integer) (defaults to: nil)

    Number of frames to fetch.

  • filter (String) (defaults to: nil)

    Get frames filtered by tags.

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

    A hash of custom headers that

Returns:

  • (Frames)

    operation results.



916
917
918
919
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 916

def get_video_frames(team_name, review_id, start_seed:nil, no_of_records:nil, filter:nil, custom_headers:nil)
  response = get_video_frames_async(team_name, review_id, start_seed:start_seed, no_of_records:no_of_records, filter:filter, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_video_frames_async(team_name, review_id, start_seed: nil, no_of_records: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

start fetching the frames. to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • start_seed (Integer) (defaults to: nil)

    Time stamp of the frame from where you want to

  • no_of_records (Integer) (defaults to: nil)

    Number of frames to fetch.

  • filter (String) (defaults to: nil)

    Get frames filtered by tags.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
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
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1003

def get_video_frames_async(team_name, review_id, start_seed:nil, no_of_records:nil, filter:nil, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_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/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_id},
      query_params: {'startSeed' => start_seed,'noOfRecords' => no_of_records,'filter' => filter},
      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::Frames.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_video_frames_with_http_info(team_name, review_id, start_seed: nil, no_of_records: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

<h3>CallBack Schemas </h3> <h4>Review Completion CallBack Sample</h4> <p> {<br/> “ReviewId”: “<Review Id>”,<br/> “ModifiedOn”: “2016-10-11T22:36:32.9934851Z”,<br/> “ModifiedBy”: “<Name of the Reviewer>”,<br/> “CallBackType”: “Review”,<br/> “ContentId”: “<The ContentId that was specified input>”,<br/> “Metadata”: {<br/> “adultscore”: “0.xxx”,<br/> “a”: “False”,<br/> “racyscore”: “0.xxx”,<br/> “r”: “True”<br/> },<br/> “ReviewerResultTags”: {<br/> “a”: “False”,<br/> “r”: “True”<br/> }<br/> }<br/>

</p>.

start fetching the frames. will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • start_seed (Integer) (defaults to: nil)

    Time stamp of the frame from where you want to

  • no_of_records (Integer) (defaults to: nil)

    Number of frames to fetch.

  • filter (String) (defaults to: nil)

    Get frames filtered by tags.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



960
961
962
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 960

def get_video_frames_with_http_info(team_name, review_id, start_seed:nil, no_of_records:nil, filter:nil, custom_headers:nil)
  get_video_frames_async(team_name, review_id, start_seed:start_seed, no_of_records:no_of_records, filter:filter, custom_headers:custom_headers).value!
end

#publish_video_review(team_name, review_id, custom_headers: nil) ⇒ Object

Publish video review to make it available for review.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

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

    A hash of custom headers that



1065
1066
1067
1068
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1065

def publish_video_review(team_name, review_id, custom_headers:nil)
  response = publish_video_review_async(team_name, review_id, custom_headers:custom_headers).value!
  nil
end

#publish_video_review_async(team_name, review_id, custom_headers: nil) ⇒ Concurrent::Promise

Publish video review to make it available for review.

to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1094

def publish_video_review_async(team_name, review_id, custom_headers:nil)
  fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
  fail ArgumentError, 'team_name is nil' if team_name.nil?
  fail ArgumentError, 'review_id is nil' if review_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/review/v1.0/teams/{teamName}/reviews/{reviewId}/publish'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'teamName' => team_name,'reviewId' => review_id},
      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 == 204
      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?

    result
  end

  promise.execute
end

#publish_video_review_with_http_info(team_name, review_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Publish video review to make it available for review.

will be added to the HTTP request.

Parameters:

  • team_name (String)

    Your team name.

  • review_id (String)

    Id of the review.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1080
1081
1082
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1080

def publish_video_review_with_http_info(team_name, review_id, custom_headers:nil)
  publish_video_review_async(team_name, review_id, custom_headers:custom_headers).value!
end