# Class PubsubTarget (2.20.0)

2.20.0 (latest) 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.1 2.13.5 2.12.0 2.11.3 2.10.0 2.9.1 2.8.0 2.7.3 2.6.4 2.5.1 2.4.0 2.3.4 2.2.0 2.1.1 2.0.0 1.3.2 1.2.1

    PubsubTarget(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Pub/Sub target. The job will be delivered by publishing a
message to the given Pub/Sub topic.

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `topic_name` | `str` Required. The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's `PublishRequest.name `__, for example `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in the same project as the Cloud Scheduler job. |
| `data` | `bytes` The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. |
| `attributes` | `MutableMapping[str, str]` Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. |

## Classes

### AttributesEntry

    AttributesEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The abstract base class for a message.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `kwargs` | `dict` Keys and values corresponding to the fields of the message. |
| `mapping` | ``Union[dict, `.Message`]`` A dictionary or message to be used to determine the values for this message. |
| `ignore_unknown_fields` | `Optional(bool)` If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. |