Class: Azure::CognitiveServices::ContentModerator::V1_0::Reviews
- Inherits:
-
Object
- Object
- Azure::CognitiveServices::ContentModerator::V1_0::Reviews
- 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.
Instance Attribute Summary collapse
-
#client ⇒ ContentModeratorClient
readonly
Reference to the ContentModeratorClient.
Instance Method Summary collapse
-
#add_video_frame(team_name, review_id, timescale: nil, custom_headers: nil) ⇒ Object
The reviews created would show up for Reviewers on your team.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#get_job_details(team_name, job_id, custom_headers: nil) ⇒ Job
Get the Job Details for a Job Id.
-
#get_job_details_async(team_name, job_id, custom_headers: nil) ⇒ Concurrent::Promise
Get the Job Details for a Job Id.
-
#get_job_details_with_http_info(team_name, job_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get the Job Details for a Job Id.
-
#get_review(team_name, review_id, custom_headers: nil) ⇒ Review
Returns review details for the review Id passed.
-
#get_review_async(team_name, review_id, custom_headers: nil) ⇒ Concurrent::Promise
Returns review details for the review Id passed.
-
#get_review_with_http_info(team_name, review_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Returns review details for the review Id passed.
-
#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.
-
#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.
-
#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.
-
#initialize(client) ⇒ Reviews
constructor
Creates and initializes a new instance of the Reviews class.
-
#publish_video_review(team_name, review_id, custom_headers: nil) ⇒ Object
Publish video review to make it available for review.
-
#publish_video_review_async(team_name, review_id, custom_headers: nil) ⇒ Concurrent::Promise
Publish video review to make it available for review.
-
#publish_video_review_with_http_info(team_name, review_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Publish video review to make it available for review.
Constructor Details
#initialize(client) ⇒ Reviews
Creates and initializes a new instance of the Reviews class.
27 28 29 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 27 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ ContentModeratorClient (readonly)
Returns reference to the ContentModeratorClient.
32 33 34 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 32 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.
745 746 747 748 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 745 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.
826 827 828 829 830 831 832 833 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 826 def add_video_frame_async(team_name, review_id, timescale:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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.
1721 1722 1723 1724 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1721 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.
1766 1767 1768 1769 1770 1771 1772 1773 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1766 def add_video_frame_stream_async(content_type, team_name, review_id, frame_image_zip, , timescale:nil, 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, '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('{Endpoint}', @client.endpoint) = { 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, ) 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.
1744 1745 1746 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1744 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.
1590 1591 1592 1593 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1590 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.
1635 1636 1637 1638 1639 1640 1641 1642 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1635 def add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:nil, 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, '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('{Endpoint}', @client.endpoint) = { 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, ) 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.
1613 1614 1615 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1613 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.
786 787 788 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 786 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.
1263 1264 1265 1266 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1263 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.
1296 1297 1298 1299 1300 1301 1302 1303 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1296 def add_video_transcript_async(team_name, review_id, vttfile, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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.
1143 1144 1145 1146 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1143 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.
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1184 def add_video_transcript_moderation_result_async(content_type, team_name, review_id, transcript_moderation_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, '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('{Endpoint}', @client.endpoint) = { 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, ) 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.
1164 1165 1166 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1164 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.
1280 1281 1282 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1280 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.
502 503 504 505 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 502 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.
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 645 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.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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., 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.
574 575 576 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 574 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.
255 256 257 258 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 255 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.
342 343 344 345 346 347 348 349 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 342 def create_reviews_async(url_content_type, team_name, create_review_body, sub_team:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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., 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.
299 300 301 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 299 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.
1393 1394 1395 1396 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1393 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.
1480 1481 1482 1483 1484 1485 1486 1487 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1480 def create_video_reviews_async(content_type, team_name, create_video_reviews_body, sub_team:nil, 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, '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('{Endpoint}', @client.endpoint) = { 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, ) 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., 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.
1437 1438 1439 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1437 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.
135 136 137 138 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 135 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.
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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 164 def get_job_details_async(team_name, job_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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., 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.
150 151 152 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 150 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.
44 45 46 47 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 44 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.
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 123 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 73 def get_review_async(team_name, review_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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., 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.
59 60 61 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 59 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.
908 909 910 911 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 908 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.
995 996 997 998 999 1000 1001 1002 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 995 def get_video_frames_async(team_name, review_id, start_seed:nil, no_of_records:nil, filter:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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., 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.
952 953 954 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 952 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.
1057 1058 1059 1060 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1057 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.
1086 1087 1088 1089 1090 1091 1092 1093 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 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1086 def publish_video_review_async(team_name, review_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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('{Endpoint}', @client.endpoint) = { 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, ) 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.
1072 1073 1074 |
# File 'lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb', line 1072 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 |