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,4 +1,8 @@
|
||||
<!-- Code generated for API Clients. DO NOT EDIT. -->
|
||||
|
||||
## 0.11.0
|
||||
* Added support for Cloud Endpoints (currently in private beta).
|
||||
|
||||
## 0.10.0
|
||||
* Renamed the Policy Module to the Traffic Policy Module on HTTP Edge Routes, TCP Edges, and TLS Edges, which allows you to configure rules that can be used to influence and control traffic to and from your upstream service. The Traffic Policy itself is now specified as either a JSON or YAML string.
|
||||
|
||||
|
||||
@@ -661,6 +661,17 @@ public class Ngrok {
|
||||
return new EdgeRouteUserAgentFilterModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteTrafficPolicyModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-traffic-policy-module">https://ngrok.com/docs/api#api-edge-route-traffic-policy-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteTrafficPolicyModule httpsEdgeRouteTrafficPolicy() {
|
||||
return new EdgeRouteTrafficPolicyModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TcpEdgeBackendModule}.
|
||||
*
|
||||
@@ -683,6 +694,17 @@ public class Ngrok {
|
||||
return new TcpEdgeIpRestrictionModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TcpEdgeTrafficPolicyModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-traffic-policy-module">https://ngrok.com/docs/api#api-tcp-edge-traffic-policy-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TcpEdgeTrafficPolicyModule tcpEdgeTrafficPolicy() {
|
||||
return new TcpEdgeTrafficPolicyModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TlsEdgeBackendModule}.
|
||||
*
|
||||
@@ -727,5 +749,16 @@ public class Ngrok {
|
||||
return new TlsEdgeTlsTerminationModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TlsEdgeTrafficPolicyModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-traffic-policy-module">https://ngrok.com/docs/api#api-tls-edge-traffic-policy-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TlsEdgeTrafficPolicyModule tlsEdgeTrafficPolicy() {
|
||||
return new TlsEdgeTrafficPolicyModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,15 +33,27 @@ public class Endpoint {
|
||||
@JsonProperty("proto")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String proto;
|
||||
@JsonProperty("scheme")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> scheme;
|
||||
@JsonProperty("hostport")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String hostport;
|
||||
@JsonProperty("host")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> host;
|
||||
@JsonProperty("port")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Long> port;
|
||||
@JsonProperty("type")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String type;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> metadata;
|
||||
@JsonProperty("description")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> description;
|
||||
@JsonProperty("domain")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> domain;
|
||||
@@ -54,6 +66,36 @@ public class Endpoint {
|
||||
@JsonProperty("edge")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> edge;
|
||||
@JsonProperty("upstream_url")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> upstreamUrl;
|
||||
@JsonProperty("upstream_proto")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> upstreamProto;
|
||||
@JsonProperty("url")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> url;
|
||||
@JsonProperty("principal")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> principal;
|
||||
@JsonProperty("principal_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> principalId;
|
||||
@JsonProperty("traffic_policy")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> trafficPolicy;
|
||||
@JsonProperty("bindings")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.util.List<String>> bindings;
|
||||
@JsonProperty("tunnel_session")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> tunnelSession;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.net.URI> uri;
|
||||
@JsonProperty("name")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> name;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link Endpoint}.
|
||||
@@ -64,13 +106,27 @@ public class Endpoint {
|
||||
* @param updatedAt timestamp when the endpoint was updated in RFC 3339 format
|
||||
* @param publicUrl URL of the hostport served by this endpoint
|
||||
* @param proto protocol served by this endpoint. one of <code>http</code>, <code>https</code>, <code>tcp</code>, or <code>tls</code>
|
||||
* @param hostport hostport served by this endpoint (hostname:port)
|
||||
* @param type whether the endpoint is <code>ephemeral</code> (served directly by an agent-initiated tunnel) or <code>edge</code> (served by an edge)
|
||||
* @param scheme the value of the <code>scheme</code> parameter as a {@link String}
|
||||
* @param hostport hostport served by this endpoint (hostname:port) -> soon to be deprecated
|
||||
* @param host the value of the <code>host</code> parameter as a {@link String}
|
||||
* @param port the value of the <code>port</code> parameter as a {@link long}
|
||||
* @param type whether the endpoint is <code>ephemeral</code> (served directly by an agent-initiated tunnel) or <code>edge</code> (served by an edge) or <code>cloud (represents a cloud endpoint)</code>
|
||||
* @param metadata user-supplied metadata of the associated tunnel or edge object
|
||||
* @param description user-supplied description of the associated tunnel
|
||||
* @param domain the domain reserved for this endpoint
|
||||
* @param tcpAddr the address reserved for this endpoint
|
||||
* @param tunnel the tunnel serving requests to this endpoint, if this is an ephemeral endpoint
|
||||
* @param edge the edge serving requests to this endpoint, if this is an edge endpoint
|
||||
* @param upstreamUrl the local address the tunnel forwards to
|
||||
* @param upstreamProto the protocol the agent uses to forward with
|
||||
* @param url the url of the endpoint
|
||||
* @param principal The ID of the owner (bot or user) that owns this endpoint
|
||||
* @param principalId TODO: deprecate me!
|
||||
* @param trafficPolicy The traffic policy attached to this endpoint
|
||||
* @param bindings the bindings associated with this endpoint
|
||||
* @param tunnelSession The tunnel session of the agent for this endpoint
|
||||
* @param uri URI of the clep API resource
|
||||
* @param name user supplied name for the endpoint
|
||||
*/
|
||||
@JsonCreator
|
||||
public Endpoint(
|
||||
@@ -80,13 +136,27 @@ public class Endpoint {
|
||||
@JsonProperty("updated_at") final Optional<java.time.OffsetDateTime> updatedAt,
|
||||
@JsonProperty("public_url") final java.net.URI publicUrl,
|
||||
@JsonProperty("proto") final String proto,
|
||||
@JsonProperty("scheme") final Optional<String> scheme,
|
||||
@JsonProperty("hostport") final String hostport,
|
||||
@JsonProperty("host") final Optional<String> host,
|
||||
@JsonProperty("port") final Optional<Long> port,
|
||||
@JsonProperty("type") final String type,
|
||||
@JsonProperty("metadata") final Optional<String> metadata,
|
||||
@JsonProperty("description") final Optional<String> description,
|
||||
@JsonProperty("domain") final Optional<Ref> domain,
|
||||
@JsonProperty("tcp_addr") final Optional<Ref> tcpAddr,
|
||||
@JsonProperty("tunnel") final Optional<Ref> tunnel,
|
||||
@JsonProperty("edge") final Optional<Ref> edge
|
||||
@JsonProperty("edge") final Optional<Ref> edge,
|
||||
@JsonProperty("upstream_url") final Optional<String> upstreamUrl,
|
||||
@JsonProperty("upstream_proto") final Optional<String> upstreamProto,
|
||||
@JsonProperty("url") final Optional<String> url,
|
||||
@JsonProperty("principal") final Optional<Ref> principal,
|
||||
@JsonProperty("principal_id") final Optional<Ref> principalId,
|
||||
@JsonProperty("traffic_policy") final Optional<String> trafficPolicy,
|
||||
@JsonProperty("bindings") final Optional<java.util.List<String>> bindings,
|
||||
@JsonProperty("tunnel_session") final Optional<Ref> tunnelSession,
|
||||
@JsonProperty("uri") final Optional<java.net.URI> uri,
|
||||
@JsonProperty("name") final Optional<String> name
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.region = region != null ? region : Optional.empty();
|
||||
@@ -94,13 +164,27 @@ public class Endpoint {
|
||||
this.updatedAt = updatedAt != null ? updatedAt : Optional.empty();
|
||||
this.publicUrl = Objects.requireNonNull(publicUrl, "publicUrl is required");
|
||||
this.proto = Objects.requireNonNull(proto, "proto is required");
|
||||
this.scheme = scheme != null ? scheme : Optional.empty();
|
||||
this.hostport = Objects.requireNonNull(hostport, "hostport is required");
|
||||
this.host = host != null ? host : Optional.empty();
|
||||
this.port = port != null ? port : Optional.empty();
|
||||
this.type = Objects.requireNonNull(type, "type is required");
|
||||
this.metadata = metadata != null ? metadata : Optional.empty();
|
||||
this.description = description != null ? description : Optional.empty();
|
||||
this.domain = domain != null ? domain : Optional.empty();
|
||||
this.tcpAddr = tcpAddr != null ? tcpAddr : Optional.empty();
|
||||
this.tunnel = tunnel != null ? tunnel : Optional.empty();
|
||||
this.edge = edge != null ? edge : Optional.empty();
|
||||
this.upstreamUrl = upstreamUrl != null ? upstreamUrl : Optional.empty();
|
||||
this.upstreamProto = upstreamProto != null ? upstreamProto : Optional.empty();
|
||||
this.url = url != null ? url : Optional.empty();
|
||||
this.principal = principal != null ? principal : Optional.empty();
|
||||
this.principalId = principalId != null ? principalId : Optional.empty();
|
||||
this.trafficPolicy = trafficPolicy != null ? trafficPolicy : Optional.empty();
|
||||
this.bindings = bindings != null ? bindings : Optional.empty();
|
||||
this.tunnelSession = tunnelSession != null ? tunnelSession : Optional.empty();
|
||||
this.uri = uri != null ? uri : Optional.empty();
|
||||
this.name = name != null ? name : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,7 +243,16 @@ public class Endpoint {
|
||||
}
|
||||
|
||||
/**
|
||||
* hostport served by this endpoint (hostname:port)
|
||||
* Fetches the value of the <code>scheme</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getScheme() {
|
||||
return this.scheme;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostport served by this endpoint (hostname:port) -> soon to be deprecated
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
@@ -167,9 +260,28 @@ public class Endpoint {
|
||||
return this.hostport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>host</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getHost() {
|
||||
return this.host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>port</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link long} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Long> getPort() {
|
||||
return this.port;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether the endpoint is <code>ephemeral</code> (served directly by an
|
||||
* agent-initiated tunnel) or <code>edge</code> (served by an edge)
|
||||
* agent-initiated tunnel) or <code>edge</code> (served by an edge) or <code>cloud
|
||||
* (represents a cloud endpoint)</code>
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
@@ -186,6 +298,15 @@ public class Endpoint {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied description of the associated tunnel
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* the domain reserved for this endpoint
|
||||
*
|
||||
@@ -222,6 +343,96 @@ public class Endpoint {
|
||||
return this.edge;
|
||||
}
|
||||
|
||||
/**
|
||||
* the local address the tunnel forwards to
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getUpstreamUrl() {
|
||||
return this.upstreamUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* the protocol the agent uses to forward with
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getUpstreamProto() {
|
||||
return this.upstreamProto;
|
||||
}
|
||||
|
||||
/**
|
||||
* the url of the endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getUrl() {
|
||||
return this.url;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the owner (bot or user) that owns this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getPrincipal() {
|
||||
return this.principal;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: deprecate me!
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getPrincipalId() {
|
||||
return this.principalId;
|
||||
}
|
||||
|
||||
/**
|
||||
* The traffic policy attached to this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getTrafficPolicy() {
|
||||
return this.trafficPolicy;
|
||||
}
|
||||
|
||||
/**
|
||||
* the bindings associated with this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.util.List<String>> getBindings() {
|
||||
return this.bindings;
|
||||
}
|
||||
|
||||
/**
|
||||
* The tunnel session of the agent for this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getTunnelSession() {
|
||||
return this.tunnelSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the clep API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.net.URI> getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* user supplied name for the endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -239,13 +450,27 @@ public class Endpoint {
|
||||
this.updatedAt.equals(other.updatedAt)&&
|
||||
this.publicUrl.equals(other.publicUrl)&&
|
||||
this.proto.equals(other.proto)&&
|
||||
this.scheme.equals(other.scheme)&&
|
||||
this.hostport.equals(other.hostport)&&
|
||||
this.host.equals(other.host)&&
|
||||
this.port.equals(other.port)&&
|
||||
this.type.equals(other.type)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.domain.equals(other.domain)&&
|
||||
this.tcpAddr.equals(other.tcpAddr)&&
|
||||
this.tunnel.equals(other.tunnel)&&
|
||||
this.edge.equals(other.edge);
|
||||
this.edge.equals(other.edge)&&
|
||||
this.upstreamUrl.equals(other.upstreamUrl)&&
|
||||
this.upstreamProto.equals(other.upstreamProto)&&
|
||||
this.url.equals(other.url)&&
|
||||
this.principal.equals(other.principal)&&
|
||||
this.principalId.equals(other.principalId)&&
|
||||
this.trafficPolicy.equals(other.trafficPolicy)&&
|
||||
this.bindings.equals(other.bindings)&&
|
||||
this.tunnelSession.equals(other.tunnelSession)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.name.equals(other.name);
|
||||
|
||||
}
|
||||
|
||||
@@ -258,13 +483,27 @@ public class Endpoint {
|
||||
this.updatedAt,
|
||||
this.publicUrl,
|
||||
this.proto,
|
||||
this.scheme,
|
||||
this.hostport,
|
||||
this.host,
|
||||
this.port,
|
||||
this.type,
|
||||
this.metadata,
|
||||
this.description,
|
||||
this.domain,
|
||||
this.tcpAddr,
|
||||
this.tunnel,
|
||||
this.edge
|
||||
this.edge,
|
||||
this.upstreamUrl,
|
||||
this.upstreamProto,
|
||||
this.url,
|
||||
this.principal,
|
||||
this.principalId,
|
||||
this.trafficPolicy,
|
||||
this.bindings,
|
||||
this.tunnelSession,
|
||||
this.uri,
|
||||
this.name
|
||||
);
|
||||
}
|
||||
|
||||
@@ -277,13 +516,27 @@ public class Endpoint {
|
||||
"', updatedAt='" + this.updatedAt.map(Object::toString).orElse("(null)") +
|
||||
"', publicUrl='" + this.publicUrl +
|
||||
"', proto='" + this.proto +
|
||||
"', scheme='" + this.scheme.orElse("(null)") +
|
||||
"', hostport='" + this.hostport +
|
||||
"', host='" + this.host.orElse("(null)") +
|
||||
"', port='" + this.port.map(Object::toString).orElse("(null)") +
|
||||
"', type='" + this.type +
|
||||
"', metadata='" + this.metadata.orElse("(null)") +
|
||||
"', description='" + this.description.orElse("(null)") +
|
||||
"', domain='" + this.domain.map(Object::toString).orElse("(null)") +
|
||||
"', tcpAddr='" + this.tcpAddr.map(Object::toString).orElse("(null)") +
|
||||
"', tunnel='" + this.tunnel.map(Object::toString).orElse("(null)") +
|
||||
"', edge='" + this.edge.map(Object::toString).orElse("(null)") +
|
||||
"', upstreamUrl='" + this.upstreamUrl.orElse("(null)") +
|
||||
"', upstreamProto='" + this.upstreamProto.orElse("(null)") +
|
||||
"', url='" + this.url.orElse("(null)") +
|
||||
"', principal='" + this.principal.map(Object::toString).orElse("(null)") +
|
||||
"', principalId='" + this.principalId.map(Object::toString).orElse("(null)") +
|
||||
"', trafficPolicy='" + this.trafficPolicy.orElse("(null)") +
|
||||
"', bindings='" + this.bindings.map(Object::toString).orElse("(null)") +
|
||||
"', tunnelSession='" + this.tunnelSession.map(Object::toString).orElse("(null)") +
|
||||
"', uri='" + this.uri.map(Object::toString).orElse("(null)") +
|
||||
"', name='" + this.name.orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class EventTargetAzureLogsIngestion {
|
||||
* @param clientSecret Client Secret for the application client
|
||||
* @param logsIngestionUri Data collection endpoint logs ingestion URI
|
||||
* @param dataCollectionRuleId Data collection rule immutable ID
|
||||
* @param dataCollectionStreamName Data collection stream name to use as destination, located instide the DCR
|
||||
* @param dataCollectionStreamName Data collection stream name to use as destination, located inside the DCR
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
@@ -115,7 +115,7 @@ public class EventTargetAzureLogsIngestion {
|
||||
* @param clientSecret Client Secret for the application client
|
||||
* @param logsIngestionUri Data collection endpoint logs ingestion URI
|
||||
* @param dataCollectionRuleId Data collection rule immutable ID
|
||||
* @param dataCollectionStreamName Data collection stream name to use as destination, located instide the DCR
|
||||
* @param dataCollectionStreamName Data collection stream name to use as destination, located inside the DCR
|
||||
*/
|
||||
@JsonCreator
|
||||
private EventTargetAzureLogsIngestion(
|
||||
@@ -180,7 +180,7 @@ public class EventTargetAzureLogsIngestion {
|
||||
}
|
||||
|
||||
/**
|
||||
* Data collection stream name to use as destination, located instide the DCR
|
||||
* Data collection stream name to use as destination, located inside the DCR
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
|
||||
@@ -51,8 +51,8 @@ public class ReservedDomainCertPolicy {
|
||||
}
|
||||
|
||||
/**
|
||||
* type of private key to use when requesting certificates. Defaults to rsa, can be
|
||||
* either rsa or ecdsa.
|
||||
* type of private key to use when requesting certificates. Defaults to ecdsa, can
|
||||
* be either rsa or ecdsa.
|
||||
*
|
||||
* @param privateKeyType the value of the <code>private_key_type</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
@@ -63,8 +63,8 @@ public class ReservedDomainCertPolicy {
|
||||
}
|
||||
|
||||
/**
|
||||
* type of private key to use when requesting certificates. Defaults to rsa, can be
|
||||
* either rsa or ecdsa.
|
||||
* type of private key to use when requesting certificates. Defaults to ecdsa, can
|
||||
* be either rsa or ecdsa.
|
||||
*
|
||||
* @param privateKeyType the value of the <code>private_key_type</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
@@ -109,7 +109,7 @@ public class ReservedDomainCertPolicy {
|
||||
* Creates a new instance of {@link ReservedDomainCertPolicy}.
|
||||
*
|
||||
* @param authority certificate authority to request certificates from. The only supported value is letsencrypt.
|
||||
* @param privateKeyType type of private key to use when requesting certificates. Defaults to rsa, can be either rsa or ecdsa.
|
||||
* @param privateKeyType type of private key to use when requesting certificates. Defaults to ecdsa, can be either rsa or ecdsa.
|
||||
*/
|
||||
@JsonCreator
|
||||
private ReservedDomainCertPolicy(
|
||||
@@ -131,8 +131,8 @@ public class ReservedDomainCertPolicy {
|
||||
}
|
||||
|
||||
/**
|
||||
* type of private key to use when requesting certificates. Defaults to rsa, can be
|
||||
* either rsa or ecdsa.
|
||||
* type of private key to use when requesting certificates. Defaults to ecdsa, can
|
||||
* be either rsa or ecdsa.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,207 @@ public class Endpoints {
|
||||
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> url = Optional.empty();
|
||||
private Optional<String> type = Optional.empty();
|
||||
private Optional<String> trafficPolicy = Optional.empty();
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<java.util.List<String>> bindings = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* the url of the endpoint
|
||||
*
|
||||
* @param url the value of the url parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder url(final String url) {
|
||||
this.url = Optional.of(Objects.requireNonNull(url, "url is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the url of the endpoint
|
||||
*
|
||||
* @param url the value of the url parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder url(final Optional<String> url) {
|
||||
this.url = Objects.requireNonNull(url, "url is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether the endpoint is <code>ephemeral</code> (served directly by an
|
||||
* agent-initiated tunnel) or <code>edge</code> (served by an edge) or <code>cloud
|
||||
* (represents a cloud endpoint)</code>
|
||||
*
|
||||
* @param type the value of the type parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder type(final String type) {
|
||||
this.type = Optional.of(Objects.requireNonNull(type, "type is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether the endpoint is <code>ephemeral</code> (served directly by an
|
||||
* agent-initiated tunnel) or <code>edge</code> (served by an edge) or <code>cloud
|
||||
* (represents a cloud endpoint)</code>
|
||||
*
|
||||
* @param type the value of the type parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder type(final Optional<String> type) {
|
||||
this.type = Objects.requireNonNull(type, "type is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The traffic policy attached to this endpoint
|
||||
*
|
||||
* @param trafficPolicy the value of the traffic_policy parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder trafficPolicy(final String trafficPolicy) {
|
||||
this.trafficPolicy = Optional.of(Objects.requireNonNull(trafficPolicy, "trafficPolicy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The traffic policy attached to this endpoint
|
||||
*
|
||||
* @param trafficPolicy the value of the traffic_policy parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder trafficPolicy(final Optional<String> trafficPolicy) {
|
||||
this.trafficPolicy = Objects.requireNonNull(trafficPolicy, "trafficPolicy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied description of the associated tunnel
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied description of the associated tunnel
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied metadata of the associated tunnel or edge object
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied metadata of the associated tunnel or edge object
|
||||
*
|
||||
* @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 bindings associated with this endpoint
|
||||
*
|
||||
* @param bindings the value of the bindings parameter as a {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder bindings(final java.util.List<String> bindings) {
|
||||
this.bindings = Optional.of(Objects.requireNonNull(bindings, "bindings is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the bindings associated with this endpoint
|
||||
*
|
||||
* @param bindings the value of the bindings parameter as an {@link Optional} of {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder bindings(final Optional<java.util.List<String>> bindings) {
|
||||
this.bindings = Objects.requireNonNull(bindings, "bindings is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Endpoint}
|
||||
*/
|
||||
public CompletionStage<Endpoint> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/endpoints",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("url", this.url.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("type", this.type.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("traffic_policy", this.trafficPolicy.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("bindings", Optional.of(this.bindings).filter(bindings -> !bindings.isEmpty()).map(Function.identity()))
|
||||
),
|
||||
Optional.of(Endpoint.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link Endpoint}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Endpoint 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 an endpoint, currently available only for cloud endpoints
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoints-create">https://ngrok.com/docs/api#api-endpoints-create</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public CreateCallBuilder create(
|
||||
) {
|
||||
return new CreateCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent List API call.
|
||||
*/
|
||||
@@ -190,4 +391,240 @@ public class Endpoints {
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent Update API call.
|
||||
*/
|
||||
public class UpdateCallBuilder {
|
||||
private final String id;
|
||||
private Optional<String> url = Optional.empty();
|
||||
private Optional<String> trafficPolicy = Optional.empty();
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<java.util.List<String>> bindings = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* the url of the endpoint
|
||||
*
|
||||
* @param url the value of the url parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder url(final String url) {
|
||||
this.url = Optional.of(Objects.requireNonNull(url, "url is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the url of the endpoint
|
||||
*
|
||||
* @param url the value of the url parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder url(final Optional<String> url) {
|
||||
this.url = Objects.requireNonNull(url, "url is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The traffic policy attached to this endpoint
|
||||
*
|
||||
* @param trafficPolicy the value of the traffic_policy parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder trafficPolicy(final String trafficPolicy) {
|
||||
this.trafficPolicy = Optional.of(Objects.requireNonNull(trafficPolicy, "trafficPolicy is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The traffic policy attached to this endpoint
|
||||
*
|
||||
* @param trafficPolicy the value of the traffic_policy parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder trafficPolicy(final Optional<String> trafficPolicy) {
|
||||
this.trafficPolicy = Objects.requireNonNull(trafficPolicy, "trafficPolicy is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied description of the associated tunnel
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied description of the associated tunnel
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied metadata of the associated tunnel or edge object
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied metadata of the associated tunnel or edge object
|
||||
*
|
||||
* @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 bindings associated with this endpoint
|
||||
*
|
||||
* @param bindings the value of the bindings parameter as a {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder bindings(final java.util.List<String> bindings) {
|
||||
this.bindings = Optional.of(Objects.requireNonNull(bindings, "bindings is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the bindings associated with this endpoint
|
||||
*
|
||||
* @param bindings the value of the bindings parameter as an {@link Optional} of {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder bindings(final Optional<java.util.List<String>> bindings) {
|
||||
this.bindings = Objects.requireNonNull(bindings, "bindings is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link Endpoint}
|
||||
*/
|
||||
public CompletionStage<Endpoint> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/endpoints/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("url", this.url.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("traffic_policy", this.trafficPolicy.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("bindings", Optional.of(this.bindings).filter(bindings -> !bindings.isEmpty()).map(Function.identity()))
|
||||
),
|
||||
Optional.of(Endpoint.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link Endpoint}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Endpoint 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 an Endpoint by ID, currently available only for cloud endpoints
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoints-update">https://ngrok.com/docs/api#api-endpoints-update</a>.
|
||||
*
|
||||
* @param id unique endpoint resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public UpdateCallBuilder update(
|
||||
final String id
|
||||
) {
|
||||
return new UpdateCallBuilder(
|
||||
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,
|
||||
"/endpoints/" + 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 an Endpoint by ID, currently available only for cloud endpoints
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoints-delete">https://ngrok.com/docs/api#api-endpoints-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