Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions azure-eventgrid/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
include *.rst
include azure/__init__.py

5 changes: 2 additions & 3 deletions azure-eventgrid/azure/eventgrid/event_grid_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ def publish_events(
body_content = self._serialize.body(events, '[EventGridEvent]')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
raise HttpOperationError(self._deserialize, response)
Expand Down
88 changes: 86 additions & 2 deletions azure-eventgrid/azure/eventgrid/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,32 @@
from .service_bus_active_messages_available_with_no_listeners_event_data_py3 import ServiceBusActiveMessagesAvailableWithNoListenersEventData
from .service_bus_deadletter_messages_available_with_no_listeners_event_data_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData
from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData
from .media_job_error_detail_py3 import MediaJobErrorDetail
from .media_job_error_py3 import MediaJobError
from .media_job_output_py3 import MediaJobOutput
from .media_job_output_asset_py3 import MediaJobOutputAsset
from .media_job_output_state_change_event_data_py3 import MediaJobOutputStateChangeEventData
from .media_job_scheduled_event_data_py3 import MediaJobScheduledEventData
from .media_job_processing_event_data_py3 import MediaJobProcessingEventData
from .media_job_canceling_event_data_py3 import MediaJobCancelingEventData
from .media_job_finished_event_data_py3 import MediaJobFinishedEventData
from .media_job_canceled_event_data_py3 import MediaJobCanceledEventData
from .media_job_errored_event_data_py3 import MediaJobErroredEventData
from .media_job_output_canceled_event_data_py3 import MediaJobOutputCanceledEventData
from .media_job_output_canceling_event_data_py3 import MediaJobOutputCancelingEventData
from .media_job_output_errored_event_data_py3 import MediaJobOutputErroredEventData
from .media_job_output_finished_event_data_py3 import MediaJobOutputFinishedEventData
from .media_job_output_processing_event_data_py3 import MediaJobOutputProcessingEventData
from .media_job_output_scheduled_event_data_py3 import MediaJobOutputScheduledEventData
from .media_live_event_encoder_connected_event_data_py3 import MediaLiveEventEncoderConnectedEventData
from .media_live_event_connection_rejected_event_data_py3 import MediaLiveEventConnectionRejectedEventData
from .media_live_event_encoder_disconnected_event_data_py3 import MediaLiveEventEncoderDisconnectedEventData
from .media_live_event_incoming_stream_received_event_data_py3 import MediaLiveEventIncomingStreamReceivedEventData
from .media_live_event_incoming_streams_out_of_sync_event_data_py3 import MediaLiveEventIncomingStreamsOutOfSyncEventData
from .media_live_event_incoming_video_streams_out_of_sync_event_data_py3 import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData
from .media_live_event_incoming_data_chunk_dropped_event_data_py3 import MediaLiveEventIncomingDataChunkDroppedEventData
from .media_live_event_ingest_heartbeat_event_data_py3 import MediaLiveEventIngestHeartbeatEventData
from .media_live_event_track_discontinuity_detected_event_data_py3 import MediaLiveEventTrackDiscontinuityDetectedEventData
except (SyntaxError, ImportError):
from .storage_blob_created_event_data import StorageBlobCreatedEventData
from .storage_blob_deleted_event_data import StorageBlobDeletedEventData
Expand Down Expand Up @@ -87,8 +113,37 @@
from .service_bus_active_messages_available_with_no_listeners_event_data import ServiceBusActiveMessagesAvailableWithNoListenersEventData
from .service_bus_deadletter_messages_available_with_no_listeners_event_data import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData
from .media_job_state_change_event_data import MediaJobStateChangeEventData
from .media_job_error_detail import MediaJobErrorDetail
from .media_job_error import MediaJobError
from .media_job_output import MediaJobOutput
from .media_job_output_asset import MediaJobOutputAsset
from .media_job_output_state_change_event_data import MediaJobOutputStateChangeEventData
from .media_job_scheduled_event_data import MediaJobScheduledEventData
from .media_job_processing_event_data import MediaJobProcessingEventData
from .media_job_canceling_event_data import MediaJobCancelingEventData
from .media_job_finished_event_data import MediaJobFinishedEventData
from .media_job_canceled_event_data import MediaJobCanceledEventData
from .media_job_errored_event_data import MediaJobErroredEventData
from .media_job_output_canceled_event_data import MediaJobOutputCanceledEventData
from .media_job_output_canceling_event_data import MediaJobOutputCancelingEventData
from .media_job_output_errored_event_data import MediaJobOutputErroredEventData
from .media_job_output_finished_event_data import MediaJobOutputFinishedEventData
from .media_job_output_processing_event_data import MediaJobOutputProcessingEventData
from .media_job_output_scheduled_event_data import MediaJobOutputScheduledEventData
from .media_live_event_encoder_connected_event_data import MediaLiveEventEncoderConnectedEventData
from .media_live_event_connection_rejected_event_data import MediaLiveEventConnectionRejectedEventData
from .media_live_event_encoder_disconnected_event_data import MediaLiveEventEncoderDisconnectedEventData
from .media_live_event_incoming_stream_received_event_data import MediaLiveEventIncomingStreamReceivedEventData
from .media_live_event_incoming_streams_out_of_sync_event_data import MediaLiveEventIncomingStreamsOutOfSyncEventData
from .media_live_event_incoming_video_streams_out_of_sync_event_data import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData
from .media_live_event_incoming_data_chunk_dropped_event_data import MediaLiveEventIncomingDataChunkDroppedEventData
from .media_live_event_ingest_heartbeat_event_data import MediaLiveEventIngestHeartbeatEventData
from .media_live_event_track_discontinuity_detected_event_data import MediaLiveEventTrackDiscontinuityDetectedEventData
from .event_grid_client_enums import (
JobState,
MediaJobState,
MediaJobErrorCode,
MediaJobErrorCategory,
MediaJobRetry,
)

__all__ = [
Expand Down Expand Up @@ -130,5 +185,34 @@
'ServiceBusActiveMessagesAvailableWithNoListenersEventData',
'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData',
'MediaJobStateChangeEventData',
'JobState',
'MediaJobErrorDetail',
'MediaJobError',
'MediaJobOutput',
'MediaJobOutputAsset',
'MediaJobOutputStateChangeEventData',
'MediaJobScheduledEventData',
'MediaJobProcessingEventData',
'MediaJobCancelingEventData',
'MediaJobFinishedEventData',
'MediaJobCanceledEventData',
'MediaJobErroredEventData',
'MediaJobOutputCanceledEventData',
'MediaJobOutputCancelingEventData',
'MediaJobOutputErroredEventData',
'MediaJobOutputFinishedEventData',
'MediaJobOutputProcessingEventData',
'MediaJobOutputScheduledEventData',
'MediaLiveEventEncoderConnectedEventData',
'MediaLiveEventConnectionRejectedEventData',
'MediaLiveEventEncoderDisconnectedEventData',
'MediaLiveEventIncomingStreamReceivedEventData',
'MediaLiveEventIncomingStreamsOutOfSyncEventData',
'MediaLiveEventIncomingVideoStreamsOutOfSyncEventData',
'MediaLiveEventIncomingDataChunkDroppedEventData',
'MediaLiveEventIngestHeartbeatEventData',
'MediaLiveEventTrackDiscontinuityDetectedEventData',
'MediaJobState',
'MediaJobErrorCode',
'MediaJobErrorCategory',
'MediaJobRetry',
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from enum import Enum


class JobState(str, Enum):
class MediaJobState(str, Enum):

canceled = "Canceled" #: The job was canceled. This is a final state for the job.
canceling = "Canceling" #: The job is in the process of being canceled. This is a transient state for the job.
Expand All @@ -21,3 +21,31 @@ class JobState(str, Enum):
processing = "Processing" #: The job is processing. This is a transient state for the job.
queued = "Queued" #: The job is in a queued state, waiting for resources to become available. This is a transient state.
scheduled = "Scheduled" #: The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states.


class MediaJobErrorCode(str, Enum):

service_error = "ServiceError" #: Fatal service error, please contact support.
service_transient_error = "ServiceTransientError" #: Transient error, please retry, if retry is unsuccessful, please contact support.
download_not_accessible = "DownloadNotAccessible" #: While trying to download the input files, the files were not accessible, please check the availability of the source.
download_transient_error = "DownloadTransientError" #: While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source.
upload_not_accessible = "UploadNotAccessible" #: While trying to upload the output files, the destination was not reachable, please check the availability of the destination.
upload_transient_error = "UploadTransientError" #: While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination.
configuration_unsupported = "ConfigurationUnsupported" #: There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration.
content_malformed = "ContentMalformed" #: There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files.
content_unsupported = "ContentUnsupported" #: There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files.


class MediaJobErrorCategory(str, Enum):

service = "Service" #: The error is service related.
download = "Download" #: The error is download related.
upload = "Upload" #: The error is upload related.
configuration = "Configuration" #: The error is configuration related.
content = "Content" #: The error is related to data in the input files.


class MediaJobRetry(str, Enum):

do_not_retry = "DoNotRetry" #: Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected.
may_retry = "MayRetry" #: Issue may be resolved after waiting for a period of time and resubmitting the same Job.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .media_job_state_change_event_data import MediaJobStateChangeEventData


class MediaJobCanceledEventData(MediaJobStateChangeEventData):
"""Job canceled event data.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar previous_state: The previous state of the Job. Possible values
include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing',
'Queued', 'Scheduled'
:vartype previous_state: str or ~azure.eventgrid.models.MediaJobState
:ivar state: The new state of the Job. Possible values include:
'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued',
'Scheduled'
:vartype state: str or ~azure.eventgrid.models.MediaJobState
:param correlation_data: Gets the Job correlation data.
:type correlation_data: dict[str, str]
:param outputs: Gets the Job outputs.
:type outputs: list[~azure.eventgrid.models.MediaJobOutput]
"""

_validation = {
'previous_state': {'readonly': True},
'state': {'readonly': True},
}

_attribute_map = {
'previous_state': {'key': 'previousState', 'type': 'MediaJobState'},
'state': {'key': 'state', 'type': 'MediaJobState'},
'correlation_data': {'key': 'correlationData', 'type': '{str}'},
'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'},
}

def __init__(self, **kwargs):
super(MediaJobCanceledEventData, self).__init__(**kwargs)
self.outputs = kwargs.get('outputs', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData


class MediaJobCanceledEventData(MediaJobStateChangeEventData):
"""Job canceled event data.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar previous_state: The previous state of the Job. Possible values
include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing',
'Queued', 'Scheduled'
:vartype previous_state: str or ~azure.eventgrid.models.MediaJobState
:ivar state: The new state of the Job. Possible values include:
'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued',
'Scheduled'
:vartype state: str or ~azure.eventgrid.models.MediaJobState
:param correlation_data: Gets the Job correlation data.
:type correlation_data: dict[str, str]
:param outputs: Gets the Job outputs.
:type outputs: list[~azure.eventgrid.models.MediaJobOutput]
"""

_validation = {
'previous_state': {'readonly': True},
'state': {'readonly': True},
}

_attribute_map = {
'previous_state': {'key': 'previousState', 'type': 'MediaJobState'},
'state': {'key': 'state', 'type': 'MediaJobState'},
'correlation_data': {'key': 'correlationData', 'type': '{str}'},
'outputs': {'key': 'outputs', 'type': '[MediaJobOutput]'},
}

def __init__(self, *, correlation_data=None, outputs=None, **kwargs) -> None:
super(MediaJobCanceledEventData, self).__init__(correlation_data=correlation_data, **kwargs)
self.outputs = outputs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .media_job_state_change_event_data import MediaJobStateChangeEventData


class MediaJobCancelingEventData(MediaJobStateChangeEventData):
"""Job canceling event data.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar previous_state: The previous state of the Job. Possible values
include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing',
'Queued', 'Scheduled'
:vartype previous_state: str or ~azure.eventgrid.models.MediaJobState
:ivar state: The new state of the Job. Possible values include:
'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued',
'Scheduled'
:vartype state: str or ~azure.eventgrid.models.MediaJobState
:param correlation_data: Gets the Job correlation data.
:type correlation_data: dict[str, str]
"""

_validation = {
'previous_state': {'readonly': True},
'state': {'readonly': True},
}

_attribute_map = {
'previous_state': {'key': 'previousState', 'type': 'MediaJobState'},
'state': {'key': 'state', 'type': 'MediaJobState'},
'correlation_data': {'key': 'correlationData', 'type': '{str}'},
}

def __init__(self, **kwargs):
super(MediaJobCancelingEventData, self).__init__(**kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData


class MediaJobCancelingEventData(MediaJobStateChangeEventData):
"""Job canceling event data.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar previous_state: The previous state of the Job. Possible values
include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing',
'Queued', 'Scheduled'
:vartype previous_state: str or ~azure.eventgrid.models.MediaJobState
:ivar state: The new state of the Job. Possible values include:
'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued',
'Scheduled'
:vartype state: str or ~azure.eventgrid.models.MediaJobState
:param correlation_data: Gets the Job correlation data.
:type correlation_data: dict[str, str]
"""

_validation = {
'previous_state': {'readonly': True},
'state': {'readonly': True},
}

_attribute_map = {
'previous_state': {'key': 'previousState', 'type': 'MediaJobState'},
'state': {'key': 'state', 'type': 'MediaJobState'},
'correlation_data': {'key': 'correlationData', 'type': '{str}'},
}

def __init__(self, *, correlation_data=None, **kwargs) -> None:
super(MediaJobCancelingEventData, self).__init__(correlation_data=correlation_data, **kwargs)
Loading