### YamlMime:JavaType uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder" name: "EventGridPublisherClientBuilder" nameWithType: "EventGridPublisherClientBuilder" summary: "A Builder class to create service clients that can publish events to EventGrid." inheritances: - "" inheritedClassMethods: - classRef: "java.lang.Object" methodsRef: - "clone" - "equals" - "finalize" - "getClass" - "hashCode" - "notify" - "notifyAll" - "toString" - "wait" - "wait" - "wait" syntax: "public final class **EventGridPublisherClientBuilder**
implements <>, <>, <>, <>, <>, <>" constructors: - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.EventGridPublisherClientBuilder()" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.EventGridPublisherClientBuilder()" name: "EventGridPublisherClientBuilder()" nameWithType: "EventGridPublisherClientBuilder.EventGridPublisherClientBuilder()" summary: "Construct a new instance with default building settings." syntax: "public EventGridPublisherClientBuilder()" desc: "Construct a new instance with default building settings. The endpoint and one credential method must be set in order for the client to be built." methods: - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.addPolicy(com.azure.core.http.policy.HttpPipelinePolicy)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.addPolicy(HttpPipelinePolicy httpPipelinePolicy)" name: "addPolicy(HttpPipelinePolicy httpPipelinePolicy)" nameWithType: "EventGridPublisherClientBuilder.addPolicy(HttpPipelinePolicy httpPipelinePolicy)" parameters: - name: "httpPipelinePolicy" type: "" syntax: "public EventGridPublisherClientBuilder addPolicy(HttpPipelinePolicy httpPipelinePolicy)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCloudEventPublisherAsyncClient()" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCloudEventPublisherAsyncClient()" name: "buildCloudEventPublisherAsyncClient()" nameWithType: "EventGridPublisherClientBuilder.buildCloudEventPublisherAsyncClient()" summary: "Build a publisher client with asynchronous publishing methods and the current settings." syntax: "public EventGridPublisherAsyncClient buildCloudEventPublisherAsyncClient()" desc: "Build a publisher client with asynchronous publishing methods and the current settings. An endpoint must be set, and either a pipeline with correct authentication must be set, or a credential must be set in the form of an or a at the respective methods. All other settings have defaults and are optional." returns: description: "a publisher client with asynchronous publishing methods." type: "<>" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCloudEventPublisherClient()" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCloudEventPublisherClient()" name: "buildCloudEventPublisherClient()" nameWithType: "EventGridPublisherClientBuilder.buildCloudEventPublisherClient()" summary: "Build a publisher client with synchronous publishing methods and the current settings." syntax: "public EventGridPublisherClient buildCloudEventPublisherClient()" desc: "Build a publisher client with synchronous publishing methods and the current settings. Endpoint and a credential must be set (either keyCredential or sharedAccessSignatureCredential), all other settings have defaults and/or are optional." returns: description: "a publisher client with synchronous publishing methods." type: "<>" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCustomEventPublisherAsyncClient()" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCustomEventPublisherAsyncClient()" name: "buildCustomEventPublisherAsyncClient()" nameWithType: "EventGridPublisherClientBuilder.buildCustomEventPublisherAsyncClient()" summary: "Build a custom event publisher client with asynchronous publishing methods and the current settings." syntax: "public EventGridPublisherAsyncClient buildCustomEventPublisherAsyncClient()" desc: "Build a custom event publisher client with asynchronous publishing methods and the current settings. An endpoint must be set, and either a pipeline with correct authentication must be set, or a credential must be set in the form of an or a at the respective methods. All other settings have defaults and are optional." returns: description: "a publisher client with asynchronous publishing methods." type: "<>" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCustomEventPublisherClient()" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildCustomEventPublisherClient()" name: "buildCustomEventPublisherClient()" nameWithType: "EventGridPublisherClientBuilder.buildCustomEventPublisherClient()" summary: "Build a custom event publisher client with synchronous publishing methods and the current settings." syntax: "public EventGridPublisherClient buildCustomEventPublisherClient()" desc: "Build a custom event publisher client with synchronous publishing methods and the current settings. Endpoint and a credential must be set (either keyCredential or sharedAccessSignatureCredential), all other settings have defaults and/or are optional." returns: description: "a publisher client with synchronous publishing methods." type: "<>" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildEventGridEventPublisherAsyncClient()" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildEventGridEventPublisherAsyncClient()" name: "buildEventGridEventPublisherAsyncClient()" nameWithType: "EventGridPublisherClientBuilder.buildEventGridEventPublisherAsyncClient()" summary: "Build an publisher client with asynchronous publishing methods and the current settings." syntax: "public EventGridPublisherAsyncClient buildEventGridEventPublisherAsyncClient()" desc: "Build an publisher client with asynchronous publishing methods and the current settings. An endpoint must be set, and either a pipeline with correct authentication must be set, or a credential must be set in the form of an or a at the respective methods. All other settings have defaults and are optional." returns: description: "a publisher client with asynchronous publishing methods." type: "<>" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildEventGridEventPublisherClient()" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.buildEventGridEventPublisherClient()" name: "buildEventGridEventPublisherClient()" nameWithType: "EventGridPublisherClientBuilder.buildEventGridEventPublisherClient()" summary: "Build an publisher client with synchronous publishing methods and the current settings." syntax: "public EventGridPublisherClient buildEventGridEventPublisherClient()" desc: "Build an publisher client with synchronous publishing methods and the current settings. Endpoint and a credential must be set (either keyCredential or sharedAccessSignatureCredential), all other settings have defaults and/or are optional." returns: description: "a publisher client with synchronous publishing methods." type: "<>" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.clientOptions(com.azure.core.util.ClientOptions)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.clientOptions(ClientOptions clientOptions)" name: "clientOptions(ClientOptions clientOptions)" nameWithType: "EventGridPublisherClientBuilder.clientOptions(ClientOptions clientOptions)" parameters: - name: "clientOptions" type: "" syntax: "public EventGridPublisherClientBuilder clientOptions(ClientOptions clientOptions)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.configuration(com.azure.core.util.Configuration)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.configuration(Configuration configuration)" name: "configuration(Configuration configuration)" nameWithType: "EventGridPublisherClientBuilder.configuration(Configuration configuration)" parameters: - name: "configuration" type: "" syntax: "public EventGridPublisherClientBuilder configuration(Configuration configuration)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.credential(com.azure.core.credential.AzureKeyCredential)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.credential(AzureKeyCredential credential)" name: "credential(AzureKeyCredential credential)" nameWithType: "EventGridPublisherClientBuilder.credential(AzureKeyCredential credential)" parameters: - name: "credential" type: "" syntax: "public EventGridPublisherClientBuilder credential(AzureKeyCredential credential)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.credential(com.azure.core.credential.AzureSasCredential)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.credential(AzureSasCredential credential)" name: "credential(AzureSasCredential credential)" nameWithType: "EventGridPublisherClientBuilder.credential(AzureSasCredential credential)" parameters: - name: "credential" type: "" syntax: "public EventGridPublisherClientBuilder credential(AzureSasCredential credential)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.credential(com.azure.core.credential.TokenCredential)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.credential(TokenCredential credential)" name: "credential(TokenCredential credential)" nameWithType: "EventGridPublisherClientBuilder.credential(TokenCredential credential)" parameters: - name: "credential" type: "" syntax: "public EventGridPublisherClientBuilder credential(TokenCredential credential)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.endpoint(java.lang.String)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.endpoint(String endpoint)" name: "endpoint(String endpoint)" nameWithType: "EventGridPublisherClientBuilder.endpoint(String endpoint)" summary: "Set the domain or topic endpoint." parameters: - description: "the endpoint as a url." name: "endpoint" type: "String" syntax: "public EventGridPublisherClientBuilder endpoint(String endpoint)" desc: "Set the domain or topic endpoint. This is the address to publish events to. It must be the full url of the endpoint instead of just the hostname." returns: description: "the builder itself." type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.httpClient(com.azure.core.http.HttpClient)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.httpClient(HttpClient httpClient)" name: "httpClient(HttpClient httpClient)" nameWithType: "EventGridPublisherClientBuilder.httpClient(HttpClient httpClient)" parameters: - name: "httpClient" type: "" syntax: "public EventGridPublisherClientBuilder httpClient(HttpClient httpClient)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.httpLogOptions(com.azure.core.http.policy.HttpLogOptions)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.httpLogOptions(HttpLogOptions httpLogOptions)" name: "httpLogOptions(HttpLogOptions httpLogOptions)" nameWithType: "EventGridPublisherClientBuilder.httpLogOptions(HttpLogOptions httpLogOptions)" parameters: - name: "httpLogOptions" type: "" syntax: "public EventGridPublisherClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.pipeline(com.azure.core.http.HttpPipeline)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.pipeline(HttpPipeline httpPipeline)" name: "pipeline(HttpPipeline httpPipeline)" nameWithType: "EventGridPublisherClientBuilder.pipeline(HttpPipeline httpPipeline)" parameters: - name: "httpPipeline" type: "" syntax: "public EventGridPublisherClientBuilder pipeline(HttpPipeline httpPipeline)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.retryOptions(com.azure.core.http.policy.RetryOptions)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.retryOptions(RetryOptions retryOptions)" name: "retryOptions(RetryOptions retryOptions)" nameWithType: "EventGridPublisherClientBuilder.retryOptions(RetryOptions retryOptions)" parameters: - name: "retryOptions" type: "" syntax: "public EventGridPublisherClientBuilder retryOptions(RetryOptions retryOptions)" returns: type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.retryPolicy(com.azure.core.http.policy.RetryPolicy)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.retryPolicy(RetryPolicy retryPolicy)" name: "retryPolicy(RetryPolicy retryPolicy)" nameWithType: "EventGridPublisherClientBuilder.retryPolicy(RetryPolicy retryPolicy)" summary: "Add a custom retry policy to the pipeline." parameters: - description: "the retry policy to add." name: "retryPolicy" type: "" syntax: "public EventGridPublisherClientBuilder retryPolicy(RetryPolicy retryPolicy)" desc: "Add a custom retry policy to the pipeline. The default is . Setting this is mutually exclusive with using ." returns: description: "the builder itself." type: "" - uid: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.serviceVersion(com.azure.messaging.eventgrid.EventGridServiceVersion)" fullName: "com.azure.messaging.eventgrid.EventGridPublisherClientBuilder.serviceVersion(EventGridServiceVersion serviceVersion)" name: "serviceVersion(EventGridServiceVersion serviceVersion)" nameWithType: "EventGridPublisherClientBuilder.serviceVersion(EventGridServiceVersion serviceVersion)" summary: "Set the service version to use for requests to the event grid service." parameters: - description: "the service version to set. By default this will use the latest available version." name: "serviceVersion" type: "" syntax: "public EventGridPublisherClientBuilder serviceVersion(EventGridServiceVersion serviceVersion)" desc: "Set the service version to use for requests to the event grid service. See for more information about possible service versions." returns: description: "the builder itself" type: "" type: "class" desc: "A Builder class to create service clients that can publish events to EventGrid. This builder will construct publishers for , , and custom events. It will do for both sync and async clients.\n\n**Sample: Create a asynchronous publisher client.**\n\n```java\n// Create a client to send events of EventGridEvent schema\n EventGridPublisherAsyncClient eventGridEventPublisherClient = new EventGridPublisherClientBuilder()\n .endpoint(System.getenv(\"AZURE_EVENTGRID_EVENT_ENDPOINT\")) // make sure it accepts EventGridEvent\n .credential(new AzureKeyCredential(System.getenv(\"AZURE_EVENTGRID_EVENT_KEY\")))\n .buildEventGridEventPublisherAsyncClient();\n```\n\n**Sample: Create a synchronous client**\n\n```java\n// Create a client to send events of CloudEvent schema (com.azure.core.models.CloudEvent)\n EventGridPublisherClient cloudEventPublisherClient = new EventGridPublisherClientBuilder()\n .endpoint(System.getenv(\"AZURE_EVENTGRID_CLOUDEVENT_ENDPOINT\")) // make sure it accepts CloudEvent\n .credential(new AzureKeyCredential(System.getenv(\"AZURE_EVENTGRID_CLOUDEVENT_KEY\")))\n .buildCloudEventPublisherClient();\n```\n\n**Sample: Create a custom event asynchronous client**\n\n```java\n// Create a client to send events of custom event\n EventGridPublisherAsyncClient customEventPublisherClient = new EventGridPublisherClientBuilder()\n .endpoint(System.getenv(\"AZURE_CUSTOM_EVENT_ENDPOINT\")) // make sure it accepts custom events\n .credential(new AzureKeyCredential(System.getenv(\"AZURE_CUSTOM_EVENT_KEY\")))\n .buildCustomEventPublisherAsyncClient();\n```" implements: - "<>" - "<>" - "<>" - "<>" - "<>" - "<>" metadata: {} package: "com.azure.messaging.eventgrid" artifact: com.azure:azure-messaging-eventgrid:4.24.0