ReviewsOperations Class

ReviewsOperations operations.

Inheritance
builtins.object
ReviewsOperations

Constructor

ReviewsOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

content_type

The content type. Constant value: "text/plain".

Methods

add_video_frame

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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

add_video_frame_stream

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.

add_video_frame_url

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.

add_video_transcript

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.

add_video_transcript_moderation_result

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.

create_job

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.

CallBack Schemas

Job Completion CallBack Sample


{
"JobId": "
create_reviews

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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

create_video_reviews

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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

get_job_details

Get the Job Details for a Job Id.

get_review

Returns review details for the review Id passed.

get_video_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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

publish_video_review

Publish video review to make it available for review.

add_video_frame

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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

add_video_frame(team_name, review_id, timescale=None, custom_headers=None, raw=False, **operation_config)

Parameters

team_name
str
Required

Your team name.

review_id
str
Required

Id of the review.

timescale
int
default value: None

Timescale of the video you are adding frames to.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

add_video_frame_stream

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.

add_video_frame_stream(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale=None, custom_headers=None, raw=False, **operation_config)

Parameters

content_type
str
Required

The content type.

team_name
str
Required

Your team name.

review_id
str
Required

Id of the review.

frame_image_zip
<xref:Generator>
Required

Zip file containing frame images.

frame_metadata
str
Required

Metadata of the frame.

timescale
int
default value: None

Timescale of the video .

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

add_video_frame_url

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.

add_video_frame_url(content_type, team_name, review_id, video_frame_body, timescale=None, custom_headers=None, raw=False, **operation_config)

Parameters

content_type
str
Required

The content type.

team_name
str
Required

Your team name.

review_id
str
Required

Id of the review.

video_frame_body
list[VideoFrameBodyItem]
Required

Body for add video frames API

timescale
int
default value: None

Timescale of the video.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

add_video_transcript

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.

add_video_transcript(team_name, review_id, vt_tfile, custom_headers=None, raw=False, callback=None, **operation_config)

Parameters

team_name
str
Required

Your team name.

review_id
str
Required

Id of the review.

vt_tfile
<xref:Generator>
Required

Transcript file of the video.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

callback
<xref:Callable>[<xref:Bytes>, <xref:response=None>]
default value: None

When specified, will be called with each chunk of data that is streamed. The callback should take two arguments, the bytes of the current chunk of data and the response object. If the data is uploading, response will be None.

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

add_video_transcript_moderation_result

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.

add_video_transcript_moderation_result(content_type, team_name, review_id, transcript_moderation_body, custom_headers=None, raw=False, **operation_config)

Parameters

content_type
str
Required

The content type.

team_name
str
Required

Your team name.

review_id
str
Required

Id of the review.

transcript_moderation_body
list[TranscriptModerationBodyItem]
Required

Body for add video transcript moderation result API

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

create_job

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.

CallBack Schemas

Job Completion CallBack Sample


{
"JobId": "
create_job(team_name, content_type, content_id, workflow_name, job_content_type, content_value, call_back_endpoint=None, custom_headers=None, raw=False, **operation_config)

Parameters

team_name
str
Required

Your team name.

content_type
str
Required

Image, Text or Video. Possible values include: 'Image', 'Text', 'Video'

content_id
str
Required

Id/Name to identify the content submitted.

workflow_name
str
Required

Workflow Name that you want to invoke.

job_content_type
str
Required

The content type. Possible values include: 'application/json', 'image/jpeg'

content_value
str
Required

Content to evaluate for a job.

call_back_endpoint
str
default value: None

Callback endpoint for posting the create job result.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

JobId or ClientRawResponse if raw=true

Return type

Exceptions

create_reviews

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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

create_reviews(url_content_type, team_name, create_review_body, sub_team=None, custom_headers=None, raw=False, **operation_config)

Parameters

url_content_type
str
Required

The content type.

team_name
str
Required

Your team name.

create_review_body
list[CreateReviewBodyItem]
Required

Body for create reviews API

sub_team
str
default value: None

SubTeam of your team, you want to assign the created review to.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

list[str],

Exceptions

create_video_reviews

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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

create_video_reviews(content_type, team_name, create_video_reviews_body, sub_team=None, custom_headers=None, raw=False, **operation_config)

Parameters

content_type
str
Required

The content type.

team_name
str
Required

Your team name.

create_video_reviews_body
list[CreateVideoReviewsBodyItem]
Required

Body for create reviews API

sub_team
str
default value: None

SubTeam of your team, you want to assign the created review to.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

list[str],

Exceptions

get_job_details

Get the Job Details for a Job Id.

get_job_details(team_name, job_id, custom_headers=None, raw=False, **operation_config)

Parameters

team_name
str
Required

Your Team Name.

job_id
str
Required

Id of the job.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Job or ClientRawResponse if raw=true

Return type

Job,

Exceptions

get_review

Returns review details for the review Id passed.

get_review(team_name, review_id, custom_headers=None, raw=False, **operation_config)

Parameters

team_name
str
Required

Your Team Name.

review_id
str
Required

Id of the review.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Review or ClientRawResponse if raw=true

Return type

Exceptions

get_video_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.

CallBack Schemas

Review Completion CallBack Sample

{
"ReviewId": "

get_video_frames(team_name, review_id, start_seed=None, no_of_records=None, filter=None, custom_headers=None, raw=False, **operation_config)

Parameters

team_name
str
Required

Your team name.

review_id
str
Required

Id of the review.

start_seed
int
default value: None

Time stamp of the frame from where you want to start fetching the frames.

no_of_records
int
default value: None

Number of frames to fetch.

filter
str
default value: None

Get frames filtered by tags.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Frames or ClientRawResponse if raw=true

Return type

Exceptions

publish_video_review

Publish video review to make it available for review.

publish_video_review(team_name, review_id, custom_headers=None, raw=False, **operation_config)

Parameters

team_name
str
Required

Your team name.

review_id
str
Required

Id of the review.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

Attributes

models

models = <module 'azure.cognitiveservices.vision.contentmoderator.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.12\\x64\\lib\\site-packages\\azure\\cognitiveservices\\vision\\contentmoderator\\models\\__init__.py'>