# Eventarc Publishing v1 API - Class PublishRequest (2.0.0-beta08)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-beta08 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.PublishRequest)
- [2.0.0-beta07](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/2.0.0-beta07/Google.Cloud.Eventarc.Publishing.V1.PublishRequest)
- [1.0.0-beta02](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/1.0.0-beta02/Google.Cloud.Eventarc.Publishing.V1.PublishRequest)

    public sealed class PublishRequest : IMessage<PublishRequest>, IEquatable<PublishRequest>, IDeepCloneable<PublishRequest>, IBufferMessage, IMessage

Reference documentation and code samples for the Eventarc Publishing v1 API class PublishRequest.

The request message for the Publish method.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> PublishRequest

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[PublishRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.PublishRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PublishRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.PublishRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[PublishRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.PublishRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Eventarc.Publishing.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1)

## Assembly

Google.Cloud.Eventarc.Publishing.V1.dll

## Constructors

### PublishRequest()

    public PublishRequest()

### PublishRequest(PublishRequest)

    public PublishRequest(PublishRequest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.PublishRequest` |

## Properties

### AvroMessage

    public ByteString AvroMessage { get; set; }

The Avro format of the CloudEvent being published. Specification can
be found here:
<https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md>

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` |   |

### FormatCase

    public PublishRequest.FormatOneofCase FormatCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.PublishRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.PublishRequest.FormatOneofCase` |   |

### HasAvroMessage

    public bool HasAvroMessage { get; }

Gets whether the "avro_message" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasJsonMessage

    public bool HasJsonMessage { get; }

Gets whether the "json_message" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### JsonMessage

    public string JsonMessage { get; set; }

The JSON format of the CloudEvent being published. Specification can be
found here:
<https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md>

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### MessageBus

    public string MessageBus { get; set; }

Required. The full name of the message bus to publish events to. Format:
`projects/{project}/locations/{location}/messageBuses/{messageBus}`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ProtoMessage

    public CloudEvent ProtoMessage { get; set; }

The Protobuf format of the CloudEvent being published. Specification can
be found here:
<https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md>

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Eventarc.Publishing.V1/latest/Google.Cloud.Eventarc.Publishing.V1.CloudEvent` |   |