mirror of
https://github.com/ngrok/ngrok-api-java.git
synced 2026-05-17 16:50:39 +00:00
Update generated files
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
<!-- Code generated for API Clients. DO NOT EDIT. -->
|
||||
|
||||
## 0.9.0
|
||||
|
||||
ENHANCEMENTS:
|
||||
|
||||
* Added support for the Bot User API. The Bot User API allows you to manage the bots that are registered to your ngrok account. You can automate the creation, management, and deletion of bot users in your account.
|
||||
|
||||
## 0.8.0
|
||||
|
||||
ENHANCEMENTS:
|
||||
|
||||
@@ -301,6 +301,13 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- Prevent gpg from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -119,6 +119,17 @@ public class Ngrok {
|
||||
return new TunnelSessions(this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for BotUsers.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-bot-users">https://ngrok.com/docs/api#api-bot-users</a>.
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public BotUsers botUsers() {
|
||||
return new BotUsers(this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Certificate Authorities are x509 certificates that are used to sign other
|
||||
* x509 certificates. Attach a Certificate Authority to the Mutual TLS module
|
||||
@@ -400,6 +411,18 @@ public class Ngrok {
|
||||
return new HttpResponseBackends(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* A static backend sends traffic to a TCP address (hostname and port) that
|
||||
* is reachable on the public internet.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-static-backends">https://ngrok.com/docs/api#api-static-backends</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public StaticBackends staticAddress() {
|
||||
return new StaticBackends(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Tunnel Group Backend balances traffic among all online tunnels that match
|
||||
* a label selector.
|
||||
@@ -627,6 +650,17 @@ public class Ngrok {
|
||||
return new EdgeRouteWebsocketTcpConverterModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteUserAgentFilterModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module">https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteUserAgentFilterModule httpsEdgeRouteUserAgentFilter() {
|
||||
return new EdgeRouteUserAgentFilterModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TcpEdgeBackendModule}.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link BotUser} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BotUser {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@JsonProperty("name")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String name;
|
||||
@JsonProperty("active")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final boolean active;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link BotUser}.
|
||||
*
|
||||
* @param id unique API key resource identifier
|
||||
* @param uri URI to the API resource of this bot user
|
||||
* @param name human-readable name used to identify the bot
|
||||
* @param active whether or not the bot is active
|
||||
* @param createdAt timestamp when the api key was created, RFC 3339 format
|
||||
*/
|
||||
@JsonCreator
|
||||
public BotUser(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("name") final String name,
|
||||
@JsonProperty("active") final Boolean active,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
this.active = Objects.requireNonNull(active, "active is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* unique API key resource identifier
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI to the API resource of this bot user
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable name used to identify the bot
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether or not the bot is active
|
||||
*
|
||||
* @return the value of the property as a {@link boolean}
|
||||
*/
|
||||
public boolean getActive() {
|
||||
return this.active;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the api key was created, RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getCreatedAt() {
|
||||
return this.createdAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final BotUser other = (BotUser) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.name.equals(other.name)&&
|
||||
this.active == other.active&&
|
||||
this.createdAt.equals(other.createdAt);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.name,
|
||||
this.active,
|
||||
this.createdAt
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BotUser{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', name='" + this.name +
|
||||
"', active='" + this.active +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link BotUserList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BotUserList implements Pageable {
|
||||
@JsonProperty("bot_users")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<BotUser> botUsers;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@JsonProperty("next_page_uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.net.URI> nextPageUri;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link BotUserList}.
|
||||
*
|
||||
* @param botUsers the list of all bot users on this account
|
||||
* @param uri URI of the bot users list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public BotUserList(
|
||||
@JsonProperty("bot_users") final java.util.List<BotUser> botUsers,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.botUsers = botUsers != null ? botUsers : java.util.Collections.emptyList();
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all bot users on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link BotUser}
|
||||
*/
|
||||
public java.util.List<BotUser> getBotUsers() {
|
||||
return this.botUsers;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the bot users list API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the next page, or null if there is no next page
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.net.URI> getNextPageUri() {
|
||||
return this.nextPageUri;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final BotUserList other = (BotUserList) o;
|
||||
return
|
||||
this.botUsers.equals(other.botUsers)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.botUsers,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BotUserList{" +
|
||||
"botUsers='" + this.botUsers +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointAction} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointAction {
|
||||
/**
|
||||
* Builder class for {@link EndpointAction}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<String> type = Optional.empty();
|
||||
private Optional<java.lang.Object> config = Optional.empty();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* the type of action on the policy rule.
|
||||
*
|
||||
* @param type the value of the <code>type</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder type(final String type) {
|
||||
this.type = Optional.of(Objects.requireNonNull(type, "type is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the type of action on the policy rule.
|
||||
*
|
||||
* @param type the value of the <code>type</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder type(final Optional<String> type) {
|
||||
this.type = Objects.requireNonNull(type, "type is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the configuration for the action on the policy rule.
|
||||
*
|
||||
* @param config the value of the <code>config</code> parameter as a {@link java.lang.Object}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder config(final java.lang.Object config) {
|
||||
this.config = Optional.of(Objects.requireNonNull(config, "config is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the configuration for the action on the policy rule.
|
||||
*
|
||||
* @param config the value of the <code>config</code> parameter as a {@link java.lang.Object}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder config(final Optional<java.lang.Object> config) {
|
||||
this.config = Objects.requireNonNull(config, "config is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointAction} instance.
|
||||
*
|
||||
* @return a new {@link EndpointAction}
|
||||
*/
|
||||
public EndpointAction build() {
|
||||
return new EndpointAction(
|
||||
this.type.orElse(""),
|
||||
this.config.orElse(null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointAction} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("type")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String type;
|
||||
@JsonProperty("config")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.lang.Object config;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointAction}.
|
||||
*
|
||||
* @param type the type of action on the policy rule.
|
||||
* @param config the configuration for the action on the policy rule.
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointAction(
|
||||
@JsonProperty("type") final String type,
|
||||
@JsonProperty("config") final java.lang.Object config
|
||||
) {
|
||||
this.type = Objects.requireNonNull(type, "type is required");
|
||||
this.config = Objects.requireNonNull(config, "config is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* the type of action on the policy rule.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* the configuration for the action on the policy rule.
|
||||
*
|
||||
* @return the value of the property as a {@link java.lang.Object}
|
||||
*/
|
||||
public java.lang.Object getConfig() {
|
||||
return this.config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointAction other = (EndpointAction) o;
|
||||
return
|
||||
this.type.equals(other.type)&&
|
||||
this.config.equals(other.config);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.type,
|
||||
this.config
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointAction{" +
|
||||
"type='" + this.type +
|
||||
"', config='" + this.config +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointPolicy} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointPolicy {
|
||||
/**
|
||||
* Builder class for {@link EndpointPolicy}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<Boolean> enabled = Optional.empty();
|
||||
private java.util.List<EndpointRule> inbound = java.util.Collections.emptyList();
|
||||
private java.util.List<EndpointRule> outbound = java.util.Collections.emptyList();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>true</code> if the module will be applied to traffic, <code>false</code>
|
||||
* to disable. default <code>true</code> if unspecified
|
||||
*
|
||||
* @param enabled the value of the <code>enabled</code> parameter as a {@link boolean}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder enabled(final boolean enabled) {
|
||||
this.enabled = Optional.of(Objects.requireNonNull(enabled, "enabled is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>true</code> if the module will be applied to traffic, <code>false</code>
|
||||
* to disable. default <code>true</code> if unspecified
|
||||
*
|
||||
* @param enabled the value of the <code>enabled</code> parameter as a {@link boolean}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder enabled(final Optional<Boolean> enabled) {
|
||||
this.enabled = Objects.requireNonNull(enabled, "enabled is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the inbound rules of the traffic policy.
|
||||
*
|
||||
* @param inbound the value of the <code>inbound</code> parameter as a {@link java.util.List} of {@link EndpointRule}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder inbound(final java.util.List<EndpointRule> inbound) {
|
||||
this.inbound = Objects.requireNonNull(inbound, "inbound is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the inbound rules of the traffic policy.
|
||||
*
|
||||
* @param inbound the value of the <code>inbound</code> parameter as a {@link java.util.List} of {@link EndpointRule}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder inbound(final Optional<java.util.List<EndpointRule>> inbound) {
|
||||
this.inbound = Objects.requireNonNull(inbound, "inbound is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the outbound rules on the traffic policy.
|
||||
*
|
||||
* @param outbound the value of the <code>outbound</code> parameter as a {@link java.util.List} of {@link EndpointRule}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder outbound(final java.util.List<EndpointRule> outbound) {
|
||||
this.outbound = Objects.requireNonNull(outbound, "outbound is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the outbound rules on the traffic policy.
|
||||
*
|
||||
* @param outbound the value of the <code>outbound</code> parameter as a {@link java.util.List} of {@link EndpointRule}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder outbound(final Optional<java.util.List<EndpointRule>> outbound) {
|
||||
this.outbound = Objects.requireNonNull(outbound, "outbound is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointPolicy} instance.
|
||||
*
|
||||
* @return a new {@link EndpointPolicy}
|
||||
*/
|
||||
public EndpointPolicy build() {
|
||||
return new EndpointPolicy(
|
||||
this.enabled,
|
||||
this.inbound,
|
||||
this.outbound
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointPolicy} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("enabled")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Boolean> enabled;
|
||||
@JsonProperty("inbound")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<EndpointRule> inbound;
|
||||
@JsonProperty("outbound")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<EndpointRule> outbound;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointPolicy}.
|
||||
*
|
||||
* @param enabled <code>true</code> if the module will be applied to traffic, <code>false</code> to disable. default <code>true</code> if unspecified
|
||||
* @param inbound the inbound rules of the traffic policy.
|
||||
* @param outbound the outbound rules on the traffic policy.
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointPolicy(
|
||||
@JsonProperty("enabled") final Optional<Boolean> enabled,
|
||||
@JsonProperty("inbound") final java.util.List<EndpointRule> inbound,
|
||||
@JsonProperty("outbound") final java.util.List<EndpointRule> outbound
|
||||
) {
|
||||
this.enabled = enabled != null ? enabled : Optional.empty();
|
||||
this.inbound = inbound != null ? inbound : java.util.Collections.emptyList();
|
||||
this.outbound = outbound != null ? outbound : java.util.Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>true</code> if the module will be applied to traffic, <code>false</code>
|
||||
* to disable. default <code>true</code> if unspecified
|
||||
*
|
||||
* @return the value of the property as a {@link boolean} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Boolean> getEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* the inbound rules of the traffic policy.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link EndpointRule}
|
||||
*/
|
||||
public java.util.List<EndpointRule> getInbound() {
|
||||
return this.inbound;
|
||||
}
|
||||
|
||||
/**
|
||||
* the outbound rules on the traffic policy.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link EndpointRule}
|
||||
*/
|
||||
public java.util.List<EndpointRule> getOutbound() {
|
||||
return this.outbound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointPolicy other = (EndpointPolicy) o;
|
||||
return
|
||||
this.enabled.equals(other.enabled)&&
|
||||
this.inbound.equals(other.inbound)&&
|
||||
this.outbound.equals(other.outbound);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.enabled,
|
||||
this.inbound,
|
||||
this.outbound
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointPolicy{" +
|
||||
"enabled='" + this.enabled.map(Object::toString).orElse("(null)") +
|
||||
"', inbound='" + this.inbound +
|
||||
"', outbound='" + this.outbound +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointRule} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointRule {
|
||||
/**
|
||||
* Builder class for {@link EndpointRule}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private java.util.List<String> expressions = java.util.Collections.emptyList();
|
||||
private java.util.List<EndpointAction> actions = java.util.Collections.emptyList();
|
||||
private Optional<String> name = Optional.empty();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* cel expressions that filter traffic the policy rule applies to.
|
||||
*
|
||||
* @param expressions the value of the <code>expressions</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder expressions(final java.util.List<String> expressions) {
|
||||
this.expressions = Objects.requireNonNull(expressions, "expressions is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* cel expressions that filter traffic the policy rule applies to.
|
||||
*
|
||||
* @param expressions the value of the <code>expressions</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder expressions(final Optional<java.util.List<String>> expressions) {
|
||||
this.expressions = Objects.requireNonNull(expressions, "expressions is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the set of actions on a policy rule.
|
||||
*
|
||||
* @param actions the value of the <code>actions</code> parameter as a {@link java.util.List} of {@link EndpointAction}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder actions(final java.util.List<EndpointAction> actions) {
|
||||
this.actions = Objects.requireNonNull(actions, "actions is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the set of actions on a policy rule.
|
||||
*
|
||||
* @param actions the value of the <code>actions</code> parameter as a {@link java.util.List} of {@link EndpointAction}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder actions(final Optional<java.util.List<EndpointAction>> actions) {
|
||||
this.actions = Objects.requireNonNull(actions, "actions is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the name of the rule that is part of the traffic policy.
|
||||
*
|
||||
* @param name the value of the <code>name</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder name(final String name) {
|
||||
this.name = Optional.of(Objects.requireNonNull(name, "name is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the name of the rule that is part of the traffic policy.
|
||||
*
|
||||
* @param name the value of the <code>name</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder name(final Optional<String> name) {
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointRule} instance.
|
||||
*
|
||||
* @return a new {@link EndpointRule}
|
||||
*/
|
||||
public EndpointRule build() {
|
||||
return new EndpointRule(
|
||||
this.expressions,
|
||||
this.actions,
|
||||
this.name.orElse("")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointRule} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("expressions")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> expressions;
|
||||
@JsonProperty("actions")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<EndpointAction> actions;
|
||||
@JsonProperty("name")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointRule}.
|
||||
*
|
||||
* @param expressions cel expressions that filter traffic the policy rule applies to.
|
||||
* @param actions the set of actions on a policy rule.
|
||||
* @param name the name of the rule that is part of the traffic policy.
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointRule(
|
||||
@JsonProperty("expressions") final java.util.List<String> expressions,
|
||||
@JsonProperty("actions") final java.util.List<EndpointAction> actions,
|
||||
@JsonProperty("name") final String name
|
||||
) {
|
||||
this.expressions = expressions != null ? expressions : java.util.Collections.emptyList();
|
||||
this.actions = actions != null ? actions : java.util.Collections.emptyList();
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* cel expressions that filter traffic the policy rule applies to.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getExpressions() {
|
||||
return this.expressions;
|
||||
}
|
||||
|
||||
/**
|
||||
* the set of actions on a policy rule.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link EndpointAction}
|
||||
*/
|
||||
public java.util.List<EndpointAction> getActions() {
|
||||
return this.actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* the name of the rule that is part of the traffic policy.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointRule other = (EndpointRule) o;
|
||||
return
|
||||
this.expressions.equals(other.expressions)&&
|
||||
this.actions.equals(other.actions)&&
|
||||
this.name.equals(other.name);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.expressions,
|
||||
this.actions,
|
||||
this.name
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointRule{" +
|
||||
"expressions='" + this.expressions +
|
||||
"', actions='" + this.actions +
|
||||
"', name='" + this.name +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointUserAgentFilter} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointUserAgentFilter {
|
||||
/**
|
||||
* Builder class for {@link EndpointUserAgentFilter}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<Boolean> enabled = Optional.empty();
|
||||
private java.util.List<String> allow = java.util.Collections.emptyList();
|
||||
private java.util.List<String> deny = java.util.Collections.emptyList();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the enabled property
|
||||
*
|
||||
* @param enabled the value of the <code>enabled</code> parameter as a {@link boolean}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder enabled(final boolean enabled) {
|
||||
this.enabled = Optional.of(Objects.requireNonNull(enabled, "enabled is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the enabled property
|
||||
*
|
||||
* @param enabled the value of the <code>enabled</code> parameter as a {@link boolean}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder enabled(final Optional<Boolean> enabled) {
|
||||
this.enabled = Objects.requireNonNull(enabled, "enabled is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the allow property
|
||||
*
|
||||
* @param allow the value of the <code>allow</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder allow(final java.util.List<String> allow) {
|
||||
this.allow = Objects.requireNonNull(allow, "allow is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the allow property
|
||||
*
|
||||
* @param allow the value of the <code>allow</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder allow(final Optional<java.util.List<String>> allow) {
|
||||
this.allow = Objects.requireNonNull(allow, "allow is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deny property
|
||||
*
|
||||
* @param deny the value of the <code>deny</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder deny(final java.util.List<String> deny) {
|
||||
this.deny = Objects.requireNonNull(deny, "deny is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deny property
|
||||
*
|
||||
* @param deny the value of the <code>deny</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder deny(final Optional<java.util.List<String>> deny) {
|
||||
this.deny = Objects.requireNonNull(deny, "deny is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointUserAgentFilter} instance.
|
||||
*
|
||||
* @return a new {@link EndpointUserAgentFilter}
|
||||
*/
|
||||
public EndpointUserAgentFilter build() {
|
||||
return new EndpointUserAgentFilter(
|
||||
this.enabled,
|
||||
this.allow,
|
||||
this.deny
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointUserAgentFilter} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("enabled")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Boolean> enabled;
|
||||
@JsonProperty("allow")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> allow;
|
||||
@JsonProperty("deny")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> deny;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointUserAgentFilter}.
|
||||
*
|
||||
* @param enabled the value of the <code>enabled</code> parameter as a {@link boolean}
|
||||
* @param allow the value of the <code>allow</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param deny the value of the <code>deny</code> parameter as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointUserAgentFilter(
|
||||
@JsonProperty("enabled") final Optional<Boolean> enabled,
|
||||
@JsonProperty("allow") final java.util.List<String> allow,
|
||||
@JsonProperty("deny") final java.util.List<String> deny
|
||||
) {
|
||||
this.enabled = enabled != null ? enabled : Optional.empty();
|
||||
this.allow = allow != null ? allow : java.util.Collections.emptyList();
|
||||
this.deny = deny != null ? deny : java.util.Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>enabled</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link boolean} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Boolean> getEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>allow</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getAllow() {
|
||||
return this.allow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>deny</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getDeny() {
|
||||
return this.deny;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointUserAgentFilter other = (EndpointUserAgentFilter) o;
|
||||
return
|
||||
this.enabled.equals(other.enabled)&&
|
||||
this.allow.equals(other.allow)&&
|
||||
this.deny.equals(other.deny);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.enabled,
|
||||
this.allow,
|
||||
this.deny
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointUserAgentFilter{" +
|
||||
"enabled='" + this.enabled.map(Object::toString).orElse("(null)") +
|
||||
"', allow='" + this.allow +
|
||||
"', deny='" + this.deny +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class EndpointWebhookValidation {
|
||||
/**
|
||||
* a string indicating which webhook provider will be sending webhooks to this
|
||||
* endpoint. Value must be one of the supported providers defined at <a
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook-verification">https://ngrok.com/docs/cloud-edge/modules/webhook-verification</a>
|
||||
*
|
||||
* @param provider the value of the <code>provider</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
@@ -67,7 +67,7 @@ public class EndpointWebhookValidation {
|
||||
/**
|
||||
* a string indicating which webhook provider will be sending webhooks to this
|
||||
* endpoint. Value must be one of the supported providers defined at <a
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook-verification">https://ngrok.com/docs/cloud-edge/modules/webhook-verification</a>
|
||||
*
|
||||
* @param provider the value of the <code>provider</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
@@ -140,7 +140,7 @@ public class EndpointWebhookValidation {
|
||||
* Creates a new instance of {@link EndpointWebhookValidation}.
|
||||
*
|
||||
* @param enabled <code>true</code> if the module will be applied to traffic, <code>false</code> to disable. default <code>true</code> if unspecified
|
||||
* @param provider a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers defined at <a href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
* @param provider a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers defined at <a href="https://ngrok.com/docs/cloud-edge/modules/webhook-verification">https://ngrok.com/docs/cloud-edge/modules/webhook-verification</a>
|
||||
* @param secret a string secret used to validate requests from the given provider. All providers except AWS SNS require a secret
|
||||
*/
|
||||
@JsonCreator
|
||||
@@ -167,7 +167,7 @@ public class EndpointWebhookValidation {
|
||||
/**
|
||||
* a string indicating which webhook provider will be sending webhooks to this
|
||||
* endpoint. Value must be one of the supported providers defined at <a
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook-verification">https://ngrok.com/docs/cloud-edge/modules/webhook-verification</a>
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
|
||||
@@ -72,6 +72,12 @@ public class HttpsEdgeRoute {
|
||||
@JsonProperty("websocket_tcp_converter")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointWebsocketTcpConverter> websocketTcpConverter;
|
||||
@JsonProperty("user_agent_filter")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointUserAgentFilter> userAgentFilter;
|
||||
@JsonProperty("policy")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointPolicy> policy;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link HttpsEdgeRoute}.
|
||||
@@ -95,6 +101,8 @@ public class HttpsEdgeRoute {
|
||||
* @param saml saml module configuration or <code>null</code>
|
||||
* @param oidc oidc module configuration or <code>null</code>
|
||||
* @param websocketTcpConverter websocket to tcp adapter configuration or <code>null</code>
|
||||
* @param userAgentFilter the value of the <code>user_agent_filter</code> parameter as a {@link EndpointUserAgentFilter}
|
||||
* @param policy the traffic policy associated with this edge or null
|
||||
*/
|
||||
@JsonCreator
|
||||
public HttpsEdgeRoute(
|
||||
@@ -116,7 +124,9 @@ public class HttpsEdgeRoute {
|
||||
@JsonProperty("oauth") final Optional<EndpointOAuth> oauth,
|
||||
@JsonProperty("saml") final Optional<EndpointSaml> saml,
|
||||
@JsonProperty("oidc") final Optional<EndpointOidc> oidc,
|
||||
@JsonProperty("websocket_tcp_converter") final Optional<EndpointWebsocketTcpConverter> websocketTcpConverter
|
||||
@JsonProperty("websocket_tcp_converter") final Optional<EndpointWebsocketTcpConverter> websocketTcpConverter,
|
||||
@JsonProperty("user_agent_filter") final Optional<EndpointUserAgentFilter> userAgentFilter,
|
||||
@JsonProperty("policy") final Optional<EndpointPolicy> policy
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
@@ -137,6 +147,8 @@ public class HttpsEdgeRoute {
|
||||
this.saml = saml != null ? saml : Optional.empty();
|
||||
this.oidc = oidc != null ? oidc : Optional.empty();
|
||||
this.websocketTcpConverter = websocketTcpConverter != null ? websocketTcpConverter : Optional.empty();
|
||||
this.userAgentFilter = userAgentFilter != null ? userAgentFilter : Optional.empty();
|
||||
this.policy = policy != null ? policy : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,6 +326,24 @@ public class HttpsEdgeRoute {
|
||||
return this.websocketTcpConverter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>userAgentFilter</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointUserAgentFilter} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointUserAgentFilter> getUserAgentFilter() {
|
||||
return this.userAgentFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointPolicy} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointPolicy> getPolicy() {
|
||||
return this.policy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -343,7 +373,9 @@ public class HttpsEdgeRoute {
|
||||
this.oauth.equals(other.oauth)&&
|
||||
this.saml.equals(other.saml)&&
|
||||
this.oidc.equals(other.oidc)&&
|
||||
this.websocketTcpConverter.equals(other.websocketTcpConverter);
|
||||
this.websocketTcpConverter.equals(other.websocketTcpConverter)&&
|
||||
this.userAgentFilter.equals(other.userAgentFilter)&&
|
||||
this.policy.equals(other.policy);
|
||||
|
||||
}
|
||||
|
||||
@@ -368,7 +400,9 @@ public class HttpsEdgeRoute {
|
||||
this.oauth,
|
||||
this.saml,
|
||||
this.oidc,
|
||||
this.websocketTcpConverter
|
||||
this.websocketTcpConverter,
|
||||
this.userAgentFilter,
|
||||
this.policy
|
||||
);
|
||||
}
|
||||
|
||||
@@ -394,6 +428,8 @@ public class HttpsEdgeRoute {
|
||||
"', saml='" + this.saml.map(Object::toString).orElse("(null)") +
|
||||
"', oidc='" + this.oidc.map(Object::toString).orElse("(null)") +
|
||||
"', websocketTcpConverter='" + this.websocketTcpConverter.map(Object::toString).orElse("(null)") +
|
||||
"', userAgentFilter='" + this.userAgentFilter.map(Object::toString).orElse("(null)") +
|
||||
"', policy='" + this.policy.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ public class ReservedDomain {
|
||||
* @param description human-readable description of what this reserved domain will be used for
|
||||
* @param metadata arbitrary user-defined machine-readable data of this reserved domain. Optional, max 4096 bytes.
|
||||
* @param domain hostname of the reserved domain
|
||||
* @param region reserve the domain in this geographic ngrok datacenter. Optional, default is us. (au, eu, ap, us, jp, in, sa)
|
||||
* @param cnameTarget DNS CNAME target for a custom hostname, or null if the reserved domain is a subdomain of *.ngrok.io
|
||||
* @param region deprecated: With the launch of the ngrok Global Network domains traffic is now handled globally. This field applied only to endpoints. Note that agents may still connect to specific regions. Optional, null by default. (au, eu, ap, us, jp, in, sa)
|
||||
* @param cnameTarget DNS CNAME target for a custom hostname, or null if the reserved domain is a subdomain of an ngrok owned domain (e.g. *.ngrok.app)
|
||||
* @param certificate object referencing the TLS certificate used for connections to this domain. This can be either a user-uploaded certificate, the most recently issued automatic one, or null otherwise.
|
||||
* @param certificateManagementPolicy configuration for automatic management of TLS certificates for this domain, or null if automatic management is disabled
|
||||
* @param certificateManagementStatus status of the automatic certificate management for this domain, or null if automatic management is disabled
|
||||
@@ -153,8 +153,10 @@ public class ReservedDomain {
|
||||
}
|
||||
|
||||
/**
|
||||
* reserve the domain in this geographic ngrok datacenter. Optional, default is us.
|
||||
* (au, eu, ap, us, jp, in, sa)
|
||||
* deprecated: With the launch of the ngrok Global Network domains traffic is now
|
||||
* handled globally. This field applied only to endpoints. Note that agents may
|
||||
* still connect to specific regions. Optional, null by default. (au, eu, ap, us,
|
||||
* jp, in, sa)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
@@ -164,7 +166,7 @@ public class ReservedDomain {
|
||||
|
||||
/**
|
||||
* DNS CNAME target for a custom hostname, or null if the reserved domain is a
|
||||
* subdomain of *.ngrok.io
|
||||
* subdomain of an ngrok owned domain (e.g. *.ngrok.app)
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link StaticBackend} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class StaticBackend {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
@JsonProperty("description")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> metadata;
|
||||
@JsonProperty("address")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String address;
|
||||
@JsonProperty("tls")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final StaticBackendTls tls;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link StaticBackend}.
|
||||
*
|
||||
* @param id unique identifier for this static backend
|
||||
* @param uri URI of the StaticBackend API resource
|
||||
* @param createdAt timestamp when the backend was created, RFC 3339 format
|
||||
* @param description human-readable description of this backend. Optional
|
||||
* @param metadata arbitrary user-defined machine-readable data of this backend. Optional
|
||||
* @param address the address to forward to
|
||||
* @param tls tls configuration to use
|
||||
*/
|
||||
@JsonCreator
|
||||
public StaticBackend(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("description") final Optional<String> description,
|
||||
@JsonProperty("metadata") final Optional<String> metadata,
|
||||
@JsonProperty("address") final String address,
|
||||
@JsonProperty("tls") final StaticBackendTls tls
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.description = description != null ? description : Optional.empty();
|
||||
this.metadata = metadata != null ? metadata : Optional.empty();
|
||||
this.address = Objects.requireNonNull(address, "address is required");
|
||||
this.tls = Objects.requireNonNull(tls, "tls is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier for this static backend
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the StaticBackend API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the backend was created, RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getCreatedAt() {
|
||||
return this.createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of this backend. Optional
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this backend. Optional
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* the address to forward to
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getAddress() {
|
||||
return this.address;
|
||||
}
|
||||
|
||||
/**
|
||||
* tls configuration to use
|
||||
*
|
||||
* @return the value of the property as a {@link StaticBackendTls}
|
||||
*/
|
||||
public StaticBackendTls getTls() {
|
||||
return this.tls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final StaticBackend other = (StaticBackend) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.address.equals(other.address)&&
|
||||
this.tls.equals(other.tls);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.createdAt,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.address,
|
||||
this.tls
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaticBackend{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', description='" + this.description.orElse("(null)") +
|
||||
"', metadata='" + this.metadata.orElse("(null)") +
|
||||
"', address='" + this.address +
|
||||
"', tls='" + this.tls +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link StaticBackendList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class StaticBackendList implements Pageable {
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<StaticBackend> backends;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@JsonProperty("next_page_uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.net.URI> nextPageUri;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link StaticBackendList}.
|
||||
*
|
||||
* @param backends the list of all static backends on this account
|
||||
* @param uri URI of the static backends list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public StaticBackendList(
|
||||
@JsonProperty("backends") final java.util.List<StaticBackend> backends,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.backends = backends != null ? backends : java.util.Collections.emptyList();
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all static backends on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link StaticBackend}
|
||||
*/
|
||||
public java.util.List<StaticBackend> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the static backends list API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the next page, or null if there is no next page
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.net.URI> getNextPageUri() {
|
||||
return this.nextPageUri;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final StaticBackendList other = (StaticBackendList) o;
|
||||
return
|
||||
this.backends.equals(other.backends)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.backends,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaticBackendList{" +
|
||||
"backends='" + this.backends +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.definitions;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link StaticBackendTls} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class StaticBackendTls {
|
||||
/**
|
||||
* Builder class for {@link StaticBackendTls}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<Boolean> enabled = Optional.empty();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* if TLS is checked
|
||||
*
|
||||
* @param enabled the value of the <code>enabled</code> parameter as a {@link boolean}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder enabled(final boolean enabled) {
|
||||
this.enabled = Optional.of(Objects.requireNonNull(enabled, "enabled is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* if TLS is checked
|
||||
*
|
||||
* @param enabled the value of the <code>enabled</code> parameter as a {@link boolean}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder enabled(final Optional<Boolean> enabled) {
|
||||
this.enabled = Objects.requireNonNull(enabled, "enabled is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link StaticBackendTls} instance.
|
||||
*
|
||||
* @return a new {@link StaticBackendTls}
|
||||
*/
|
||||
public StaticBackendTls build() {
|
||||
return new StaticBackendTls(
|
||||
this.enabled.orElse(false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link StaticBackendTls} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("enabled")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final boolean enabled;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link StaticBackendTls}.
|
||||
*
|
||||
* @param enabled if TLS is checked
|
||||
*/
|
||||
@JsonCreator
|
||||
private StaticBackendTls(
|
||||
@JsonProperty("enabled") final Boolean enabled
|
||||
) {
|
||||
this.enabled = Objects.requireNonNull(enabled, "enabled is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* if TLS is checked
|
||||
*
|
||||
* @return the value of the property as a {@link boolean}
|
||||
*/
|
||||
public boolean getEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final StaticBackendTls other = (StaticBackendTls) o;
|
||||
return
|
||||
this.enabled == other.enabled;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.enabled
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaticBackendTls{" +
|
||||
"enabled='" + this.enabled +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,9 @@ public class TcpEdge {
|
||||
@JsonProperty("ip_restriction")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointIpPolicy> ipRestriction;
|
||||
@JsonProperty("policy")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointPolicy> policy;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link TcpEdge}.
|
||||
@@ -51,6 +54,7 @@ public class TcpEdge {
|
||||
* @param hostports hostports served by this edge
|
||||
* @param backend edge modules
|
||||
* @param ipRestriction the value of the <code>ip_restriction</code> parameter as a {@link EndpointIpPolicy}
|
||||
* @param policy the traffic policy associated with this edge or null
|
||||
*/
|
||||
@JsonCreator
|
||||
public TcpEdge(
|
||||
@@ -61,7 +65,8 @@ public class TcpEdge {
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("hostports") final Optional<java.util.List<String>> hostports,
|
||||
@JsonProperty("backend") final Optional<EndpointBackend> backend,
|
||||
@JsonProperty("ip_restriction") final Optional<EndpointIpPolicy> ipRestriction
|
||||
@JsonProperty("ip_restriction") final Optional<EndpointIpPolicy> ipRestriction,
|
||||
@JsonProperty("policy") final Optional<EndpointPolicy> policy
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.description = description != null ? description : Optional.empty();
|
||||
@@ -71,6 +76,7 @@ public class TcpEdge {
|
||||
this.hostports = hostports != null ? hostports : Optional.empty();
|
||||
this.backend = backend != null ? backend : Optional.empty();
|
||||
this.ipRestriction = ipRestriction != null ? ipRestriction : Optional.empty();
|
||||
this.policy = policy != null ? policy : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,6 +153,15 @@ public class TcpEdge {
|
||||
return this.ipRestriction;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointPolicy} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointPolicy> getPolicy() {
|
||||
return this.policy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -165,7 +180,8 @@ public class TcpEdge {
|
||||
this.uri.equals(other.uri)&&
|
||||
this.hostports.equals(other.hostports)&&
|
||||
this.backend.equals(other.backend)&&
|
||||
this.ipRestriction.equals(other.ipRestriction);
|
||||
this.ipRestriction.equals(other.ipRestriction)&&
|
||||
this.policy.equals(other.policy);
|
||||
|
||||
}
|
||||
|
||||
@@ -179,7 +195,8 @@ public class TcpEdge {
|
||||
this.uri,
|
||||
this.hostports,
|
||||
this.backend,
|
||||
this.ipRestriction
|
||||
this.ipRestriction,
|
||||
this.policy
|
||||
);
|
||||
}
|
||||
|
||||
@@ -194,6 +211,7 @@ public class TcpEdge {
|
||||
"', hostports='" + this.hostports.map(Object::toString).orElse("(null)") +
|
||||
"', backend='" + this.backend.map(Object::toString).orElse("(null)") +
|
||||
"', ipRestriction='" + this.ipRestriction.map(Object::toString).orElse("(null)") +
|
||||
"', policy='" + this.policy.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ public class TlsEdge {
|
||||
@JsonProperty("tls_termination")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointTlsTermination> tlsTermination;
|
||||
@JsonProperty("policy")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointPolicy> policy;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link TlsEdge}.
|
||||
@@ -59,6 +62,7 @@ public class TlsEdge {
|
||||
* @param ipRestriction the value of the <code>ip_restriction</code> parameter as a {@link EndpointIpPolicy}
|
||||
* @param mutualTls the value of the <code>mutual_tls</code> parameter as a {@link EndpointMutualTls}
|
||||
* @param tlsTermination the value of the <code>tls_termination</code> parameter as a {@link EndpointTlsTermination}
|
||||
* @param policy the traffic policy associated with this edge or null
|
||||
*/
|
||||
@JsonCreator
|
||||
public TlsEdge(
|
||||
@@ -71,7 +75,8 @@ public class TlsEdge {
|
||||
@JsonProperty("backend") final Optional<EndpointBackend> backend,
|
||||
@JsonProperty("ip_restriction") final Optional<EndpointIpPolicy> ipRestriction,
|
||||
@JsonProperty("mutual_tls") final Optional<EndpointMutualTls> mutualTls,
|
||||
@JsonProperty("tls_termination") final Optional<EndpointTlsTermination> tlsTermination
|
||||
@JsonProperty("tls_termination") final Optional<EndpointTlsTermination> tlsTermination,
|
||||
@JsonProperty("policy") final Optional<EndpointPolicy> policy
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.description = description != null ? description : Optional.empty();
|
||||
@@ -83,6 +88,7 @@ public class TlsEdge {
|
||||
this.ipRestriction = ipRestriction != null ? ipRestriction : Optional.empty();
|
||||
this.mutualTls = mutualTls != null ? mutualTls : Optional.empty();
|
||||
this.tlsTermination = tlsTermination != null ? tlsTermination : Optional.empty();
|
||||
this.policy = policy != null ? policy : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,6 +183,15 @@ public class TlsEdge {
|
||||
return this.tlsTermination;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointPolicy} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointPolicy> getPolicy() {
|
||||
return this.policy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -197,7 +212,8 @@ public class TlsEdge {
|
||||
this.backend.equals(other.backend)&&
|
||||
this.ipRestriction.equals(other.ipRestriction)&&
|
||||
this.mutualTls.equals(other.mutualTls)&&
|
||||
this.tlsTermination.equals(other.tlsTermination);
|
||||
this.tlsTermination.equals(other.tlsTermination)&&
|
||||
this.policy.equals(other.policy);
|
||||
|
||||
}
|
||||
|
||||
@@ -213,7 +229,8 @@ public class TlsEdge {
|
||||
this.backend,
|
||||
this.ipRestriction,
|
||||
this.mutualTls,
|
||||
this.tlsTermination
|
||||
this.tlsTermination,
|
||||
this.policy
|
||||
);
|
||||
}
|
||||
|
||||
@@ -230,6 +247,7 @@ public class TlsEdge {
|
||||
"', ipRestriction='" + this.ipRestriction.map(Object::toString).orElse("(null)") +
|
||||
"', mutualTls='" + this.mutualTls.map(Object::toString).orElse("(null)") +
|
||||
"', tlsTermination='" + this.tlsTermination.map(Object::toString).orElse("(null)") +
|
||||
"', policy='" + this.policy.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,456 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.ngrok.NgrokApiClient;
|
||||
import com.ngrok.definitions.*;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link BotUsers}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-bot-users">https://ngrok.com/docs/api#api-bot-users</a>.
|
||||
*/
|
||||
public class BotUsers {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for BotUsers.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public BotUsers(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Create API call.
|
||||
*/
|
||||
public class CreateCallBuilder {
|
||||
private Optional<String> name = Optional.empty();
|
||||
private Optional<Boolean> active = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable name used to identify the bot
|
||||
*
|
||||
* @param name the value of the name parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder name(final String name) {
|
||||
this.name = Optional.of(Objects.requireNonNull(name, "name is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable name used to identify the bot
|
||||
*
|
||||
* @param name the value of the name parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder name(final Optional<String> name) {
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether or not the bot is active
|
||||
*
|
||||
* @param active the value of the active parameter as a {@link boolean}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder active(final boolean active) {
|
||||
this.active = Optional.of(Objects.requireNonNull(active, "active is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether or not the bot is active
|
||||
*
|
||||
* @param active the value of the active parameter as an {@link Optional} of {@link boolean}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder active(final Optional<Boolean> active) {
|
||||
this.active = Objects.requireNonNull(active, "active is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link BotUser}
|
||||
*/
|
||||
public CompletionStage<BotUser> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/bot_users",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("name", this.name.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("active", this.active.map(Function.identity()))
|
||||
),
|
||||
Optional.of(BotUser.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link BotUser}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public BotUser blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new bot user
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-bot-users-create">https://ngrok.com/docs/api#api-bot-users-create</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public CreateCallBuilder create(
|
||||
) {
|
||||
return new CreateCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Delete API call.
|
||||
*/
|
||||
public class DeleteCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private DeleteCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Void}
|
||||
*/
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/bot_users/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public void blockingCall() throws InterruptedException {
|
||||
try {
|
||||
call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a bot user by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-bot-users-delete">https://ngrok.com/docs/api#api-bot-users-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteCallBuilder delete(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Get API call.
|
||||
*/
|
||||
public class GetCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private GetCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link BotUser}
|
||||
*/
|
||||
public CompletionStage<BotUser> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/bot_users/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(BotUser.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link BotUser}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public BotUser blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the details of a Bot User by ID.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-bot-users-get">https://ngrok.com/docs/api#api-bot-users-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public GetCallBuilder get(
|
||||
final String id
|
||||
) {
|
||||
return new GetCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent List API call.
|
||||
*/
|
||||
public class ListCallBuilder {
|
||||
private Optional<String> beforeId = Optional.empty();
|
||||
private Optional<String> limit = Optional.empty();
|
||||
|
||||
private ListCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final String beforeId) {
|
||||
this.beforeId = Optional.of(Objects.requireNonNull(beforeId, "beforeId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final Optional<String> beforeId) {
|
||||
this.beforeId = Objects.requireNonNull(beforeId, "beforeId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final String limit) {
|
||||
this.limit = Optional.of(Objects.requireNonNull(limit, "limit is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final Optional<String> limit) {
|
||||
this.limit = Objects.requireNonNull(limit, "limit is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of a {@link Page} of {@link BotUserList}
|
||||
*/
|
||||
public CompletionStage<Page<BotUserList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/bot_users",
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("before_id", this.beforeId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("limit", this.limit.map(Function.identity()))
|
||||
),
|
||||
Stream.empty(),
|
||||
Optional.of(BotUserList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link BotUserList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<BotUserList> blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List all bot users in this account.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-bot-users-list">https://ngrok.com/docs/api#api-bot-users-list</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ListCallBuilder list(
|
||||
) {
|
||||
return new ListCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Update API call.
|
||||
*/
|
||||
public class UpdateCallBuilder {
|
||||
private final String id;
|
||||
private Optional<String> name = Optional.empty();
|
||||
private Optional<Boolean> active = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable name used to identify the bot
|
||||
*
|
||||
* @param name the value of the name parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder name(final String name) {
|
||||
this.name = Optional.of(Objects.requireNonNull(name, "name is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable name used to identify the bot
|
||||
*
|
||||
* @param name the value of the name parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder name(final Optional<String> name) {
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether or not the bot is active
|
||||
*
|
||||
* @param active the value of the active parameter as a {@link boolean}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder active(final boolean active) {
|
||||
this.active = Optional.of(Objects.requireNonNull(active, "active is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether or not the bot is active
|
||||
*
|
||||
* @param active the value of the active parameter as an {@link Optional} of {@link boolean}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder active(final Optional<Boolean> active) {
|
||||
this.active = Objects.requireNonNull(active, "active is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link BotUser}
|
||||
*/
|
||||
public CompletionStage<BotUser> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/bot_users/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("name", this.name.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("active", this.active.map(Function.identity()))
|
||||
),
|
||||
Optional.of(BotUser.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link BotUser}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public BotUser blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update attributes of a bot user by ID.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-bot-users-update">https://ngrok.com/docs/api#api-bot-users-update</a>.
|
||||
*
|
||||
* @param id the value of the <code>id</code> parameter as a {@link String}
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public UpdateCallBuilder update(
|
||||
final String id
|
||||
) {
|
||||
return new UpdateCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.ngrok.NgrokApiClient;
|
||||
import com.ngrok.definitions.*;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EdgeRoutePolicyModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-policy-module">https://ngrok.com/docs/api#api-edge-route-policy-module</a>.
|
||||
*/
|
||||
public class EdgeRoutePolicyModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EdgeRoutePolicyModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EdgeRoutePolicyModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private Optional<EndpointPolicy> module = Optional.empty();
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointPolicy module) {
|
||||
this.module = Optional.of(Objects.requireNonNull(module, "module is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointPolicy> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", this.module.map(Function.identity()))
|
||||
),
|
||||
Optional.of(EndpointPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointPolicy blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-policy-module-replace">https://ngrok.com/docs/api#api-edge-route-policy-module-replace</a>.
|
||||
*
|
||||
* @param edgeId the value of the <code>edge_id</code> parameter as a {@link String}
|
||||
* @param id the value of the <code>id</code> parameter as a {@link String}
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ReplaceCallBuilder replace(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
return new ReplaceCallBuilder(
|
||||
edgeId,
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Get API call.
|
||||
*/
|
||||
public class GetCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
|
||||
private GetCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointPolicy blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-policy-module-get">https://ngrok.com/docs/api#api-edge-route-policy-module-get</a>.
|
||||
*
|
||||
* @param edgeId unique identifier of this edge
|
||||
* @param id unique identifier of this edge route
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public GetCallBuilder get(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
return new GetCallBuilder(
|
||||
edgeId,
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Delete API call.
|
||||
*/
|
||||
public class DeleteCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
|
||||
private DeleteCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Void}
|
||||
*/
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public void blockingCall() throws InterruptedException {
|
||||
try {
|
||||
call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-policy-module-delete">https://ngrok.com/docs/api#api-edge-route-policy-module-delete</a>.
|
||||
*
|
||||
* @param edgeId unique identifier of this edge
|
||||
* @param id unique identifier of this edge route
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteCallBuilder delete(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
return new DeleteCallBuilder(
|
||||
edgeId,
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.ngrok.NgrokApiClient;
|
||||
import com.ngrok.definitions.*;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EdgeRouteUserAgentFilterModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module">https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module</a>.
|
||||
*/
|
||||
public class EdgeRouteUserAgentFilterModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EdgeRouteUserAgentFilterModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EdgeRouteUserAgentFilterModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private Optional<EndpointUserAgentFilter> module = Optional.empty();
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as a {@link EndpointUserAgentFilter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointUserAgentFilter module) {
|
||||
this.module = Optional.of(Objects.requireNonNull(module, "module is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as an {@link Optional} of {@link EndpointUserAgentFilter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointUserAgentFilter> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointUserAgentFilter}
|
||||
*/
|
||||
public CompletionStage<EndpointUserAgentFilter> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/user_agent_filter",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", this.module.map(Function.identity()))
|
||||
),
|
||||
Optional.of(EndpointUserAgentFilter.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointUserAgentFilter}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointUserAgentFilter blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module-replace">https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module-replace</a>.
|
||||
*
|
||||
* @param edgeId the value of the <code>edge_id</code> parameter as a {@link String}
|
||||
* @param id the value of the <code>id</code> parameter as a {@link String}
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ReplaceCallBuilder replace(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
return new ReplaceCallBuilder(
|
||||
edgeId,
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Get API call.
|
||||
*/
|
||||
public class GetCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
|
||||
private GetCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointUserAgentFilter}
|
||||
*/
|
||||
public CompletionStage<EndpointUserAgentFilter> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/user_agent_filter",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointUserAgentFilter.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointUserAgentFilter}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointUserAgentFilter blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module-get">https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module-get</a>.
|
||||
*
|
||||
* @param edgeId unique identifier of this edge
|
||||
* @param id unique identifier of this edge route
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public GetCallBuilder get(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
return new GetCallBuilder(
|
||||
edgeId,
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Delete API call.
|
||||
*/
|
||||
public class DeleteCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
|
||||
private DeleteCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Void}
|
||||
*/
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/user_agent_filter",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public void blockingCall() throws InterruptedException {
|
||||
try {
|
||||
call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module-delete">https://ngrok.com/docs/api#api-edge-route-user-agent-filter-module-delete</a>.
|
||||
*
|
||||
* @param edgeId unique identifier of this edge
|
||||
* @param id unique identifier of this edge route
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteCallBuilder delete(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
return new DeleteCallBuilder(
|
||||
edgeId,
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,8 @@ public class EdgesHttpsRoutes {
|
||||
private Optional<EndpointSamlMutate> saml = Optional.empty();
|
||||
private Optional<EndpointOidc> oidc = Optional.empty();
|
||||
private Optional<EndpointWebsocketTcpConverter> websocketTcpConverter = Optional.empty();
|
||||
private Optional<EndpointUserAgentFilter> userAgentFilter = Optional.empty();
|
||||
private Optional<EndpointPolicy> policy = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
final String edgeId,
|
||||
@@ -351,6 +353,50 @@ public class EdgesHttpsRoutes {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>user_agent_filter</code> parameter.
|
||||
*
|
||||
* @param userAgentFilter the value of the user_agent_filter parameter as a {@link EndpointUserAgentFilter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder userAgentFilter(final EndpointUserAgentFilter userAgentFilter) {
|
||||
this.userAgentFilter = Optional.of(Objects.requireNonNull(userAgentFilter, "userAgentFilter is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>user_agent_filter</code> parameter.
|
||||
*
|
||||
* @param userAgentFilter the value of the user_agent_filter parameter as an {@link Optional} of {@link EndpointUserAgentFilter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder userAgentFilter(final Optional<EndpointUserAgentFilter> userAgentFilter) {
|
||||
this.userAgentFilter = Objects.requireNonNull(userAgentFilter, "userAgentFilter is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder policy(final EndpointPolicy policy) {
|
||||
this.policy = Optional.of(Objects.requireNonNull(policy, "policy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder policy(final Optional<EndpointPolicy> policy) {
|
||||
this.policy = Objects.requireNonNull(policy, "policy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -376,7 +422,9 @@ public class EdgesHttpsRoutes {
|
||||
new AbstractMap.SimpleEntry<>("oauth", this.oauth.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("saml", this.saml.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("oidc", this.oidc.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("websocket_tcp_converter", this.websocketTcpConverter.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("websocket_tcp_converter", this.websocketTcpConverter.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("user_agent_filter", this.userAgentFilter.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("policy", this.policy.map(Function.identity()))
|
||||
),
|
||||
Optional.of(HttpsEdgeRoute.class)
|
||||
);
|
||||
@@ -504,6 +552,8 @@ public class EdgesHttpsRoutes {
|
||||
private Optional<EndpointSamlMutate> saml = Optional.empty();
|
||||
private Optional<EndpointOidc> oidc = Optional.empty();
|
||||
private Optional<EndpointWebsocketTcpConverter> websocketTcpConverter = Optional.empty();
|
||||
private Optional<EndpointUserAgentFilter> userAgentFilter = Optional.empty();
|
||||
private Optional<EndpointPolicy> policy = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String edgeId,
|
||||
@@ -851,6 +901,50 @@ public class EdgesHttpsRoutes {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>user_agent_filter</code> parameter.
|
||||
*
|
||||
* @param userAgentFilter the value of the user_agent_filter parameter as a {@link EndpointUserAgentFilter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder userAgentFilter(final EndpointUserAgentFilter userAgentFilter) {
|
||||
this.userAgentFilter = Optional.of(Objects.requireNonNull(userAgentFilter, "userAgentFilter is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>user_agent_filter</code> parameter.
|
||||
*
|
||||
* @param userAgentFilter the value of the user_agent_filter parameter as an {@link Optional} of {@link EndpointUserAgentFilter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder userAgentFilter(final Optional<EndpointUserAgentFilter> userAgentFilter) {
|
||||
this.userAgentFilter = Objects.requireNonNull(userAgentFilter, "userAgentFilter is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder policy(final EndpointPolicy policy) {
|
||||
this.policy = Optional.of(Objects.requireNonNull(policy, "policy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder policy(final Optional<EndpointPolicy> policy) {
|
||||
this.policy = Objects.requireNonNull(policy, "policy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -876,7 +970,9 @@ public class EdgesHttpsRoutes {
|
||||
new AbstractMap.SimpleEntry<>("oauth", this.oauth.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("saml", this.saml.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("oidc", this.oidc.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("websocket_tcp_converter", this.websocketTcpConverter.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("websocket_tcp_converter", this.websocketTcpConverter.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("user_agent_filter", this.userAgentFilter.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("policy", this.policy.map(Function.identity()))
|
||||
),
|
||||
Optional.of(HttpsEdgeRoute.class)
|
||||
);
|
||||
|
||||
@@ -39,6 +39,7 @@ public class EdgesTcp {
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
private Optional<EndpointPolicy> policy = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
@@ -158,6 +159,28 @@ public class EdgesTcp {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder policy(final EndpointPolicy policy) {
|
||||
this.policy = Optional.of(Objects.requireNonNull(policy, "policy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder policy(final Optional<EndpointPolicy> policy) {
|
||||
this.policy = Objects.requireNonNull(policy, "policy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -173,7 +196,8 @@ public class EdgesTcp {
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("hostports", Optional.of(this.hostports).filter(hostports -> !hostports.isEmpty()).map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("backend", this.backend.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("policy", this.policy.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TcpEdge.class)
|
||||
);
|
||||
@@ -376,6 +400,7 @@ public class EdgesTcp {
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
private Optional<EndpointPolicy> policy = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
@@ -497,6 +522,28 @@ public class EdgesTcp {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder policy(final EndpointPolicy policy) {
|
||||
this.policy = Optional.of(Objects.requireNonNull(policy, "policy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder policy(final Optional<EndpointPolicy> policy) {
|
||||
this.policy = Objects.requireNonNull(policy, "policy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -512,7 +559,8 @@ public class EdgesTcp {
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("hostports", Optional.of(this.hostports).filter(hostports -> !hostports.isEmpty()).map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("backend", this.backend.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("policy", this.policy.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TcpEdge.class)
|
||||
);
|
||||
|
||||
@@ -41,6 +41,7 @@ public class EdgesTls {
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTermination> tlsTermination = Optional.empty();
|
||||
private Optional<EndpointPolicy> policy = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
@@ -204,6 +205,28 @@ public class EdgesTls {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder policy(final EndpointPolicy policy) {
|
||||
this.policy = Optional.of(Objects.requireNonNull(policy, "policy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder policy(final Optional<EndpointPolicy> policy) {
|
||||
this.policy = Objects.requireNonNull(policy, "policy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -221,7 +244,8 @@ public class EdgesTls {
|
||||
new AbstractMap.SimpleEntry<>("backend", this.backend.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("mutual_tls", this.mutualTls.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("policy", this.policy.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TlsEdge.class)
|
||||
);
|
||||
@@ -426,6 +450,7 @@ public class EdgesTls {
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTermination> tlsTermination = Optional.empty();
|
||||
private Optional<EndpointPolicy> policy = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
@@ -591,6 +616,28 @@ public class EdgesTls {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder policy(final EndpointPolicy policy) {
|
||||
this.policy = Optional.of(Objects.requireNonNull(policy, "policy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the traffic policy associated with this edge or null
|
||||
*
|
||||
* @param policy the value of the policy parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder policy(final Optional<EndpointPolicy> policy) {
|
||||
this.policy = Objects.requireNonNull(policy, "policy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -608,7 +655,8 @@ public class EdgesTls {
|
||||
new AbstractMap.SimpleEntry<>("backend", this.backend.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("mutual_tls", this.mutualTls.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("policy", this.policy.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TlsEdge.class)
|
||||
);
|
||||
|
||||
@@ -71,8 +71,10 @@ public class ReservedDomains {
|
||||
}
|
||||
|
||||
/**
|
||||
* reserve the domain in this geographic ngrok datacenter. Optional, default is us.
|
||||
* (au, eu, ap, us, jp, in, sa)
|
||||
* deprecated: With the launch of the ngrok Global Network domains traffic is now
|
||||
* handled globally. This field applied only to endpoints. Note that agents may
|
||||
* still connect to specific regions. Optional, null by default. (au, eu, ap, us,
|
||||
* jp, in, sa)
|
||||
*
|
||||
* @param region the value of the region parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -83,8 +85,10 @@ public class ReservedDomains {
|
||||
}
|
||||
|
||||
/**
|
||||
* reserve the domain in this geographic ngrok datacenter. Optional, default is us.
|
||||
* (au, eu, ap, us, jp, in, sa)
|
||||
* deprecated: With the launch of the ngrok Global Network domains traffic is now
|
||||
* handled globally. This field applied only to endpoints. Note that agents may
|
||||
* still connect to specific regions. Optional, null by default. (au, eu, ap, us,
|
||||
* jp, in, sa)
|
||||
*
|
||||
* @param region the value of the region parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
|
||||
@@ -0,0 +1,553 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.ngrok.NgrokApiClient;
|
||||
import com.ngrok.definitions.*;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* A static backend sends traffic to a TCP address (hostname and port) that
|
||||
* is reachable on the public internet.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-static-backends">https://ngrok.com/docs/api#api-static-backends</a>.
|
||||
*/
|
||||
public class StaticBackends {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for StaticBackends.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public StaticBackends(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Create API call.
|
||||
*/
|
||||
public class CreateCallBuilder {
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> address = Optional.empty();
|
||||
private Optional<StaticBackendTls> tls = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of this backend. Optional
|
||||
*
|
||||
* @param description the value of the description parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder description(final String description) {
|
||||
this.description = Optional.of(Objects.requireNonNull(description, "description is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of this backend. Optional
|
||||
*
|
||||
* @param description the value of the description parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder description(final Optional<String> description) {
|
||||
this.description = Objects.requireNonNull(description, "description is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this backend. Optional
|
||||
*
|
||||
* @param metadata the value of the metadata parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder metadata(final String metadata) {
|
||||
this.metadata = Optional.of(Objects.requireNonNull(metadata, "metadata is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this backend. Optional
|
||||
*
|
||||
* @param metadata the value of the metadata parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder metadata(final Optional<String> metadata) {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the address to forward to
|
||||
*
|
||||
* @param address the value of the address parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder address(final String address) {
|
||||
this.address = Optional.of(Objects.requireNonNull(address, "address is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the address to forward to
|
||||
*
|
||||
* @param address the value of the address parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder address(final Optional<String> address) {
|
||||
this.address = Objects.requireNonNull(address, "address is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* tls configuration to use
|
||||
*
|
||||
* @param tls the value of the tls parameter as a {@link StaticBackendTls}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder tls(final StaticBackendTls tls) {
|
||||
this.tls = Optional.of(Objects.requireNonNull(tls, "tls is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* tls configuration to use
|
||||
*
|
||||
* @param tls the value of the tls parameter as an {@link Optional} of {@link StaticBackendTls}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder tls(final Optional<StaticBackendTls> tls) {
|
||||
this.tls = Objects.requireNonNull(tls, "tls is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link StaticBackend}
|
||||
*/
|
||||
public CompletionStage<StaticBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/backends/static",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("address", this.address.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls", this.tls.map(Function.identity()))
|
||||
),
|
||||
Optional.of(StaticBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link StaticBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public StaticBackend blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new static backend
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-static-backends-create">https://ngrok.com/docs/api#api-static-backends-create</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public CreateCallBuilder create(
|
||||
) {
|
||||
return new CreateCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Delete API call.
|
||||
*/
|
||||
public class DeleteCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private DeleteCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Void}
|
||||
*/
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/backends/static/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public void blockingCall() throws InterruptedException {
|
||||
try {
|
||||
call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a static backend by ID.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-static-backends-delete">https://ngrok.com/docs/api#api-static-backends-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteCallBuilder delete(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Get API call.
|
||||
*/
|
||||
public class GetCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private GetCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link StaticBackend}
|
||||
*/
|
||||
public CompletionStage<StaticBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/static/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(StaticBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link StaticBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public StaticBackend blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get detailed information about a static backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-static-backends-get">https://ngrok.com/docs/api#api-static-backends-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public GetCallBuilder get(
|
||||
final String id
|
||||
) {
|
||||
return new GetCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent List API call.
|
||||
*/
|
||||
public class ListCallBuilder {
|
||||
private Optional<String> beforeId = Optional.empty();
|
||||
private Optional<String> limit = Optional.empty();
|
||||
|
||||
private ListCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final String beforeId) {
|
||||
this.beforeId = Optional.of(Objects.requireNonNull(beforeId, "beforeId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final Optional<String> beforeId) {
|
||||
this.beforeId = Objects.requireNonNull(beforeId, "beforeId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final String limit) {
|
||||
this.limit = Optional.of(Objects.requireNonNull(limit, "limit is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final Optional<String> limit) {
|
||||
this.limit = Objects.requireNonNull(limit, "limit is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of a {@link Page} of {@link StaticBackendList}
|
||||
*/
|
||||
public CompletionStage<Page<StaticBackendList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/static",
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("before_id", this.beforeId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("limit", this.limit.map(Function.identity()))
|
||||
),
|
||||
Stream.empty(),
|
||||
Optional.of(StaticBackendList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link StaticBackendList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<StaticBackendList> blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List all static backends on this account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-static-backends-list">https://ngrok.com/docs/api#api-static-backends-list</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ListCallBuilder list(
|
||||
) {
|
||||
return new ListCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Update API call.
|
||||
*/
|
||||
public class UpdateCallBuilder {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> address = Optional.empty();
|
||||
private Optional<StaticBackendTls> tls = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of this backend. Optional
|
||||
*
|
||||
* @param description the value of the description parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder description(final String description) {
|
||||
this.description = Optional.of(Objects.requireNonNull(description, "description is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of this backend. Optional
|
||||
*
|
||||
* @param description the value of the description parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder description(final Optional<String> description) {
|
||||
this.description = Objects.requireNonNull(description, "description is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this backend. Optional
|
||||
*
|
||||
* @param metadata the value of the metadata parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder metadata(final String metadata) {
|
||||
this.metadata = Optional.of(Objects.requireNonNull(metadata, "metadata is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this backend. Optional
|
||||
*
|
||||
* @param metadata the value of the metadata parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder metadata(final Optional<String> metadata) {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the address to forward to
|
||||
*
|
||||
* @param address the value of the address parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder address(final String address) {
|
||||
this.address = Optional.of(Objects.requireNonNull(address, "address is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the address to forward to
|
||||
*
|
||||
* @param address the value of the address parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder address(final Optional<String> address) {
|
||||
this.address = Objects.requireNonNull(address, "address is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* tls configuration to use
|
||||
*
|
||||
* @param tls the value of the tls parameter as a {@link StaticBackendTls}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder tls(final StaticBackendTls tls) {
|
||||
this.tls = Optional.of(Objects.requireNonNull(tls, "tls is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* tls configuration to use
|
||||
*
|
||||
* @param tls the value of the tls parameter as an {@link Optional} of {@link StaticBackendTls}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder tls(final Optional<StaticBackendTls> tls) {
|
||||
this.tls = Objects.requireNonNull(tls, "tls is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link StaticBackend}
|
||||
*/
|
||||
public CompletionStage<StaticBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/backends/static/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("address", this.address.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls", this.tls.map(Function.identity()))
|
||||
),
|
||||
Optional.of(StaticBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link StaticBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public StaticBackend blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update static backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-static-backends-update">https://ngrok.com/docs/api#api-static-backends-update</a>.
|
||||
*
|
||||
* @param id the value of the <code>id</code> parameter as a {@link String}
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public UpdateCallBuilder update(
|
||||
final String id
|
||||
) {
|
||||
return new UpdateCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.ngrok.NgrokApiClient;
|
||||
import com.ngrok.definitions.*;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link TcpEdgePolicyModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-policy-module">https://ngrok.com/docs/api#api-tcp-edge-policy-module</a>.
|
||||
*/
|
||||
public class TcpEdgePolicyModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for TcpEdgePolicyModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public TcpEdgePolicyModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String id;
|
||||
private Optional<EndpointPolicy> module = Optional.empty();
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointPolicy module) {
|
||||
this.module = Optional.of(Objects.requireNonNull(module, "module is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointPolicy> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/tcp/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", this.module.map(Function.identity()))
|
||||
),
|
||||
Optional.of(EndpointPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointPolicy blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-policy-module-replace">https://ngrok.com/docs/api#api-tcp-edge-policy-module-replace</a>.
|
||||
*
|
||||
* @param id the value of the <code>id</code> parameter as a {@link String}
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ReplaceCallBuilder replace(
|
||||
final String id
|
||||
) {
|
||||
return new ReplaceCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Get API call.
|
||||
*/
|
||||
public class GetCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private GetCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tcp/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointPolicy blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-policy-module-get">https://ngrok.com/docs/api#api-tcp-edge-policy-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public GetCallBuilder get(
|
||||
final String id
|
||||
) {
|
||||
return new GetCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Delete API call.
|
||||
*/
|
||||
public class DeleteCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private DeleteCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Void}
|
||||
*/
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/edges/tcp/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public void blockingCall() throws InterruptedException {
|
||||
try {
|
||||
call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-policy-module-delete">https://ngrok.com/docs/api#api-tcp-edge-policy-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteCallBuilder delete(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
/* Code generated for API Clients. DO NOT EDIT. */
|
||||
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.ngrok.NgrokApiClient;
|
||||
import com.ngrok.definitions.*;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link TlsEdgePolicyModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-policy-module">https://ngrok.com/docs/api#api-tls-edge-policy-module</a>.
|
||||
*/
|
||||
public class TlsEdgePolicyModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for TlsEdgePolicyModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public TlsEdgePolicyModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String id;
|
||||
private Optional<EndpointPolicy> module = Optional.empty();
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as a {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointPolicy module) {
|
||||
this.module = Optional.of(Objects.requireNonNull(module, "module is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as an {@link Optional} of {@link EndpointPolicy}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointPolicy> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/tls/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", this.module.map(Function.identity()))
|
||||
),
|
||||
Optional.of(EndpointPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointPolicy blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-policy-module-replace">https://ngrok.com/docs/api#api-tls-edge-policy-module-replace</a>.
|
||||
*
|
||||
* @param id the value of the <code>id</code> parameter as a {@link String}
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ReplaceCallBuilder replace(
|
||||
final String id
|
||||
) {
|
||||
return new ReplaceCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Get API call.
|
||||
*/
|
||||
public class GetCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private GetCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tls/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointPolicy blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-policy-module-get">https://ngrok.com/docs/api#api-tls-edge-policy-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public GetCallBuilder get(
|
||||
final String id
|
||||
) {
|
||||
return new GetCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Delete API call.
|
||||
*/
|
||||
public class DeleteCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private DeleteCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Void}
|
||||
*/
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/edges/tls/" + this.id + "/policy",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public void blockingCall() throws InterruptedException {
|
||||
try {
|
||||
call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-policy-module-delete">https://ngrok.com/docs/api#api-tls-edge-policy-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteCallBuilder delete(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user