Skip to content

update_event_destination

update_event_destination(
    configuration_set_name: ConfigurationSetNameOrArn,
    event_destination_name: EventDestinationName,
    *,
    config_overrides: Optional[PinpointSMSVoiceV2ClientConfig] = None,
    enabled: Optional[bool] = None,
    matching_event_types: Optional[EventTypeList] = None,
    cloud_watch_logs_destination: Optional[CloudWatchLogsDestination] = None,
    kinesis_firehose_destination: Optional[KinesisFirehoseDestination] = None,
    sns_destination: Optional[SnsDestination] = None,
) -> UpdateEventDestinationResult

Updates an existing event destination in a configuration set. You can update the IAM role ARN for CloudWatch Logs and Firehose. You can also enable or disable the event destination.

You may want to update an event destination to change its matching event types or updating the destination resource ARN. You can't change an event destination's type between CloudWatch Logs, Firehose, and Amazon SNS.

Parameters:

  • configuration_set_name (ConfigurationSetNameOrArn) –

    The configuration set to update with the new event destination. Valid values for this can be the ConfigurationSetName or ConfigurationSetArn.

  • event_destination_name (EventDestinationName) –

    The name to use for the event destination.

  • enabled (Optional[bool], default: None ) –

    When set to true logging is enabled.

  • matching_event_types (Optional[EventTypeList], default: None ) –

    An array of event types that determine which events to log.

    The TEXT_SENT event type is not supported.

  • cloud_watch_logs_destination (Optional[CloudWatchLogsDestination], default: None ) –

    An object that contains information about an event destination that sends data to CloudWatch Logs.

  • kinesis_firehose_destination (Optional[KinesisFirehoseDestination], default: None ) –

    An object that contains information about an event destination for logging to Firehose.

  • sns_destination (Optional[SnsDestination], default: None ) –

    An object that contains information about an event destination that sends data to Amazon SNS.

Raises:

  • AccessDeniedException –

    The request was denied because you don't have sufficient permissions to access the resource.

  • ConflictException –

    Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time or it could be that the requested action isn't valid for the current state or configuration of the resource.

  • InternalServerException –

    The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.

  • ResourceNotFoundException –

    A requested resource couldn't be found.

  • ThrottlingException –

    An error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    A validation exception for a field.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_pinpoint_sms_voice_v2/_services/pinpoint_sms_voice_v2.py
def update_event_destination(
    self,
    configuration_set_name: "capo_pinpoint_sms_voice_v2.types.configuration_set_name_or_arn.ConfigurationSetNameOrArn",
    event_destination_name: "capo_pinpoint_sms_voice_v2.types.event_destination_name.EventDestinationName",
    *,
    config_overrides: Optional[PinpointSMSVoiceV2ClientConfig] = None,
    enabled: Optional[bool] = None,
    matching_event_types: Optional[
        "capo_pinpoint_sms_voice_v2.types.event_type_list.EventTypeList"
    ] = None,
    cloud_watch_logs_destination: Optional[
        "capo_pinpoint_sms_voice_v2.types.cloud_watch_logs_destination.CloudWatchLogsDestination"
    ] = None,
    kinesis_firehose_destination: Optional[
        "capo_pinpoint_sms_voice_v2.types.kinesis_firehose_destination.KinesisFirehoseDestination"
    ] = None,
    sns_destination: Optional[
        "capo_pinpoint_sms_voice_v2.types.sns_destination.SnsDestination"
    ] = None,
) -> "capo_pinpoint_sms_voice_v2.types.update_event_destination_result.UpdateEventDestinationResult":
    """<p>Updates an existing event destination in a configuration set. You can update the IAM role ARN for CloudWatch Logs and Firehose. You can also enable or disable the event destination.</p> <p>You may want to update an event destination to change its matching event types or updating the destination resource ARN. You can't change an event destination's type between CloudWatch Logs, Firehose, and Amazon SNS.</p>

    Args:
        configuration_set_name: <p>The configuration set to update with the new event destination. Valid values for this can be the ConfigurationSetName or ConfigurationSetArn.</p>
        event_destination_name: <p>The name to use for the event destination.</p>
        enabled: <p>When set to true logging is enabled.</p>
        matching_event_types: <p>An array of event types that determine which events to log.</p> <note> <p>The <code>TEXT_SENT</code> event type is not supported.</p> </note>
        cloud_watch_logs_destination: <p>An object that contains information about an event destination that sends data to CloudWatch Logs.</p>
        kinesis_firehose_destination: <p>An object that contains information about an event destination for logging to Firehose.</p>
        sns_destination: <p>An object that contains information about an event destination that sends data to Amazon SNS.</p>

    Raises:
        capo_pinpoint_sms_voice_v2.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because you don't have sufficient permissions to access the resource.</p>
        capo_pinpoint_sms_voice_v2.errors.conflict_exception.ConflictException: <p>Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time or it could be that the requested action isn't valid for the current state or configuration of the resource.</p>
        capo_pinpoint_sms_voice_v2.errors.internal_server_exception.InternalServerException: <p>The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.</p>
        capo_pinpoint_sms_voice_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>A requested resource couldn't be found.</p>
        capo_pinpoint_sms_voice_v2.errors.throttling_exception.ThrottlingException: <p>An error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_pinpoint_sms_voice_v2.errors.validation_exception.ValidationException: <p>A validation exception for a field.</p>
        capo_pinpoint_sms_voice_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_pinpoint_sms_voice_v2.types.update_event_destination_request.UpdateEventDestinationRequest]",
    ) -> OperationResponse[
        "capo_pinpoint_sms_voice_v2.types.update_event_destination_result.UpdateEventDestinationResult"
    ]:
        import capo_pinpoint_sms_voice_v2._operations.pinpoint_sms_voice_v2.update_event_destination

        output, http_response = (
            capo_pinpoint_sms_voice_v2._operations.pinpoint_sms_voice_v2.update_event_destination.update_event_destination(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEventDestination")
    )
    input_: capo_pinpoint_sms_voice_v2.types.update_event_destination_request.UpdateEventDestinationRequest = {
        "configuration_set_name": configuration_set_name,
        "event_destination_name": event_destination_name,
    }
    if enabled is not None:
        input_["enabled"] = enabled
    if matching_event_types is not None:
        input_["matching_event_types"] = matching_event_types
    if cloud_watch_logs_destination is not None:
        input_["cloud_watch_logs_destination"] = cloud_watch_logs_destination
    if kinesis_firehose_destination is not None:
        input_["kinesis_firehose_destination"] = kinesis_firehose_destination
    if sns_destination is not None:
        input_["sns_destination"] = sns_destination

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output