com.pulumi.azure.webpubsub.outputs.HubEventHandler Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.webpubsub.outputs;
import com.pulumi.azure.webpubsub.outputs.HubEventHandlerAuth;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class HubEventHandler {
/**
* @return An `auth` block as defined below.
*
*/
private @Nullable HubEventHandlerAuth auth;
/**
* @return Specifies the list of system events. Supported values are `connect`, `connected` and `disconnected`.
*
*/
private @Nullable List systemEvents;
/**
* @return The Event Handler URL Template. Two predefined parameters `{hub}` and `{event}` are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: `http://example.com/api/{hub}/{event}`.
*
*/
private String urlTemplate;
/**
* @return Specifies the matching event names. There are 3 kind of patterns supported: * `*` matches any event name * `,` Combine multiple events with `,` for example `event1,event2`, it matches event `event1` and `event2` * The single event name, for example `event1`, it matches `event1`.
*
*/
private @Nullable String userEventPattern;
private HubEventHandler() {}
/**
* @return An `auth` block as defined below.
*
*/
public Optional auth() {
return Optional.ofNullable(this.auth);
}
/**
* @return Specifies the list of system events. Supported values are `connect`, `connected` and `disconnected`.
*
*/
public List systemEvents() {
return this.systemEvents == null ? List.of() : this.systemEvents;
}
/**
* @return The Event Handler URL Template. Two predefined parameters `{hub}` and `{event}` are available to use in the template. The value of the EventHandler URL is dynamically calculated when the client request comes in. Example: `http://example.com/api/{hub}/{event}`.
*
*/
public String urlTemplate() {
return this.urlTemplate;
}
/**
* @return Specifies the matching event names. There are 3 kind of patterns supported: * `*` matches any event name * `,` Combine multiple events with `,` for example `event1,event2`, it matches event `event1` and `event2` * The single event name, for example `event1`, it matches `event1`.
*
*/
public Optional userEventPattern() {
return Optional.ofNullable(this.userEventPattern);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(HubEventHandler defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable HubEventHandlerAuth auth;
private @Nullable List systemEvents;
private String urlTemplate;
private @Nullable String userEventPattern;
public Builder() {}
public Builder(HubEventHandler defaults) {
Objects.requireNonNull(defaults);
this.auth = defaults.auth;
this.systemEvents = defaults.systemEvents;
this.urlTemplate = defaults.urlTemplate;
this.userEventPattern = defaults.userEventPattern;
}
@CustomType.Setter
public Builder auth(@Nullable HubEventHandlerAuth auth) {
this.auth = auth;
return this;
}
@CustomType.Setter
public Builder systemEvents(@Nullable List systemEvents) {
this.systemEvents = systemEvents;
return this;
}
public Builder systemEvents(String... systemEvents) {
return systemEvents(List.of(systemEvents));
}
@CustomType.Setter
public Builder urlTemplate(String urlTemplate) {
if (urlTemplate == null) {
throw new MissingRequiredPropertyException("HubEventHandler", "urlTemplate");
}
this.urlTemplate = urlTemplate;
return this;
}
@CustomType.Setter
public Builder userEventPattern(@Nullable String userEventPattern) {
this.userEventPattern = userEventPattern;
return this;
}
public HubEventHandler build() {
final var _resultValue = new HubEventHandler();
_resultValue.auth = auth;
_resultValue.systemEvents = systemEvents;
_resultValue.urlTemplate = urlTemplate;
_resultValue.userEventPattern = userEventPattern;
return _resultValue;
}
}
}