Class EventGridPublisherClientBuilder
- All Implemented Interfaces:
com.azure.core.client.traits.AzureKeyCredentialTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.AzureSasCredentialTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.ConfigurationTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.EndpointTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>,com.azure.core.client.traits.TokenCredentialTrait<EventGridPublisherClientBuilder>
- See Also:
-
EventGridPublisherAsyncClientEventGridEventCloudEvent
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance with default building settings. -
Method Summary
Modifier and TypeMethodDescriptionaddPolicy(com.azure.core.http.policy.HttpPipelinePolicy httpPipelinePolicy) Adds apipeline policyto apply on each request sent.EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent>Build aCloudEventpublisher client with asynchronous publishing methods and the current settings.EventGridPublisherClient<com.azure.core.models.CloudEvent>Build aCloudEventpublisher client with synchronous publishing methods and the current settings.EventGridPublisherAsyncClient<com.azure.core.util.BinaryData>Build a custom event publisher client with asynchronous publishing methods and the current settings.EventGridPublisherClient<com.azure.core.util.BinaryData>Build a custom event publisher client with synchronous publishing methods and the current settings.Build anEventGridEventpublisher client with asynchronous publishing methods and the current settings.Build anEventGridEventpublisher client with synchronous publishing methods and the current settings.clientOptions(com.azure.core.util.ClientOptions clientOptions) Allows for setting common properties such as application ID, headers, proxy configuration, etc.configuration(com.azure.core.util.Configuration configuration) Set the configuration of HTTP and Azure values.credential(com.azure.core.credential.AzureKeyCredential credential) Set the domain or topic authentication using a key obtained from Azure CLI, Azure portal, or the ARM SDKs.credential(com.azure.core.credential.AzureSasCredential credential) Set the domain or topic authentication using an already obtained Shared Access Signature token.credential(com.azure.core.credential.TokenCredential credential) Sets theTokenCredentialused to authorize requests sent to the service.Set the domain or topic endpoint.httpClient(com.azure.core.http.HttpClient httpClient) Sets theHttpClientto use for sending and receiving requests to and from the service.httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) Sets thelogging configurationto use when sending and receiving requests to and from the service.pipeline(com.azure.core.http.HttpPipeline httpPipeline) Sets theHttpPipelineto use for the service client.retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) Sets theRetryOptionsfor all the requests made through the client.retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy) Add a custom retry policy to the pipeline.serviceVersion(EventGridServiceVersion serviceVersion) Set the service version to use for requests to the event grid service.
-
Constructor Details
-
EventGridPublisherClientBuilder
public EventGridPublisherClientBuilder()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.
-
-
Method Details
-
addPolicy
public EventGridPublisherClientBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy httpPipelinePolicy) Adds apipeline policyto apply on each request sent.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipelineis specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipelineis specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipelineis specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Specified by:
addPolicyin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>- Parameters:
httpPipelinePolicy- Apipeline policy.- Returns:
- the builder itself.
-
retryPolicy
public EventGridPublisherClientBuilder retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy) Add a custom retry policy to the pipeline. The default isRetryPolicy(). Setting this is mutually exclusive with usingretryOptions(RetryOptions).- Parameters:
retryPolicy- the retry policy to add.- Returns:
- the builder itself.
-
retryOptions
public EventGridPublisherClientBuilder retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) Sets theRetryOptionsfor all the requests made through the client.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipelineis specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipelineis specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipelineis specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.Setting this is mutually exclusive with using
retryPolicy(RetryPolicy).- Specified by:
retryOptionsin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>- Parameters:
retryOptions- TheRetryOptionsto use for all the requests made through the client.- Returns:
- the builder itself.
-
clientOptions
public EventGridPublisherClientBuilder clientOptions(com.azure.core.util.ClientOptions clientOptions) Allows for setting common properties such as application ID, headers, proxy configuration, etc. Note that it is recommended that this method be called with an instance of theHttpClientOptionsclass (a subclass of theClientOptionsbase class). The HttpClientOptions subclass provides more configuration options suitable for HTTP clients, which is applicable for any class that implements this HttpTrait interface.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipelineis specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipelineis specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipelineis specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Specified by:
clientOptionsin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>- Parameters:
clientOptions- A configured instance ofHttpClientOptions.- Returns:
- The updated EventGridPublisherClientBuilder object.
- See Also:
-
HttpClientOptions
-
configuration
public EventGridPublisherClientBuilder configuration(com.azure.core.util.Configuration configuration) Set the configuration of HTTP and Azure values. A default is already set.- Specified by:
configurationin interfacecom.azure.core.client.traits.ConfigurationTrait<EventGridPublisherClientBuilder>- Parameters:
configuration- the configuration to use.- Returns:
- the builder itself.
-
credential
public EventGridPublisherClientBuilder credential(com.azure.core.credential.AzureKeyCredential credential) Set the domain or topic authentication using a key obtained from Azure CLI, Azure portal, or the ARM SDKs.- Specified by:
credentialin interfacecom.azure.core.client.traits.AzureKeyCredentialTrait<EventGridPublisherClientBuilder>- Parameters:
credential- the key credential to use to authorize the publisher client.- Returns:
- the builder itself.
-
credential
public EventGridPublisherClientBuilder credential(com.azure.core.credential.AzureSasCredential credential) Set the domain or topic authentication using an already obtained Shared Access Signature token.- Specified by:
credentialin interfacecom.azure.core.client.traits.AzureSasCredentialTrait<EventGridPublisherClientBuilder>- Parameters:
credential- the sas credential to use.- Returns:
- the builder itself.
-
credential
public EventGridPublisherClientBuilder credential(com.azure.core.credential.TokenCredential credential) Sets theTokenCredentialused to authorize requests sent to the service. Refer to the Azure SDK for Java identity and authentication documentation for more details on proper usage of theTokenCredentialtype.- Specified by:
credentialin interfacecom.azure.core.client.traits.TokenCredentialTrait<EventGridPublisherClientBuilder>- Parameters:
credential-TokenCredentialused to authorize requests sent to the service.- Returns:
- the builder itself.
-
endpoint
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.- Specified by:
endpointin interfacecom.azure.core.client.traits.EndpointTrait<EventGridPublisherClientBuilder>- Parameters:
endpoint- the endpoint as a url.- Returns:
- the builder itself.
- Throws:
NullPointerException- ifendpointis null.IllegalArgumentException- ifendpointcannot be parsed into a valid URL.
-
httpClient
Sets theHttpClientto use for sending and receiving requests to and from the service.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipelineis specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipelineis specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipelineis specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Specified by:
httpClientin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>- Parameters:
httpClient- TheHttpClientto use for requests.- Returns:
- the builder itself.
-
httpLogOptions
public EventGridPublisherClientBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions httpLogOptions) Sets thelogging configurationto use when sending and receiving requests to and from the service. If alogLevelis not provided, default value ofHttpLogDetailLevel.NONEis set.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipelineis specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipelineis specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipelineis specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Specified by:
httpLogOptionsin interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>- Parameters:
httpLogOptions- Thelogging configurationto use when sending and receiving requests to and from the service.- Returns:
- the builder itself.
-
pipeline
Sets theHttpPipelineto use for the service client.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipelineis specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipelineis specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipelineis specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Specified by:
pipelinein interfacecom.azure.core.client.traits.HttpTrait<EventGridPublisherClientBuilder>- Parameters:
httpPipeline-HttpPipelineto use for sending service requests and receiving responses.- Returns:
- the builder itself.
-
serviceVersion
Set the service version to use for requests to the event grid service. SeeEventGridServiceVersionfor more information about possible service versions.- Parameters:
serviceVersion- the service version to set. By default this will use the latest available version.- Returns:
- the builder itself
-
buildCloudEventPublisherAsyncClient
public EventGridPublisherAsyncClient<com.azure.core.models.CloudEvent> buildCloudEventPublisherAsyncClient()Build aCloudEventpublisher 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 anAzureSasCredentialor aAzureKeyCredentialat the respective methods. All other settings have defaults and are optional.- Returns:
- a publisher client with asynchronous publishing methods.
-
buildEventGridEventPublisherAsyncClient
Build anEventGridEventpublisher 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 anAzureSasCredentialor aAzureKeyCredentialat the respective methods. All other settings have defaults and are optional.- Returns:
- a publisher client with asynchronous publishing methods.
-
buildCustomEventPublisherAsyncClient
public EventGridPublisherAsyncClient<com.azure.core.util.BinaryData> buildCustomEventPublisherAsyncClient()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 anAzureSasCredentialor aAzureKeyCredentialat the respective methods. All other settings have defaults and are optional.- Returns:
- a publisher client with asynchronous publishing methods.
-
buildCloudEventPublisherClient
Build aCloudEventpublisher 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:
- a publisher client with synchronous publishing methods.
-
buildEventGridEventPublisherClient
Build anEventGridEventpublisher 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:
- a publisher client with synchronous publishing methods.
-
buildCustomEventPublisherClient
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:
- a publisher client with synchronous publishing methods.
-