mirror of
https://github.com/ngrok/ngrok-api-java.git
synced 2026-06-16 16:54:37 +00:00
cut new release for ngrok-api-java
This commit is contained in:
@@ -112,27 +112,16 @@ public class Ngrok {
|
||||
}
|
||||
|
||||
/**
|
||||
* Endpoint Configurations are a reusable group of modules that encapsulate how
|
||||
* traffic to a domain or address is handled. Endpoint configurations are only
|
||||
* applied to Domains and TCP Addresses they have been attached to.
|
||||
* Endpoints provides an API for querying the endpoint objects
|
||||
* which define what tunnel or edge is used to serve a hostport.
|
||||
* Only active endpoints associated with a tunnel or backend are returned.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-configurations">https://ngrok.com/docs/api#api-endpoint-configurations</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoints">https://ngrok.com/docs/api#api-endpoints</a>.
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointConfigurations endpointConfigurations() {
|
||||
return new EndpointConfigurations(this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for EventStreams.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-streams">https://ngrok.com/docs/api#api-event-streams</a>.
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EventStreams eventStreams() {
|
||||
return new EventStreams(this.apiClient);
|
||||
public Endpoints endpoints() {
|
||||
return new Endpoints(this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,7 +186,7 @@ public class Ngrok {
|
||||
|
||||
/**
|
||||
* An IP restriction is a restriction placed on the CIDRs that are allowed to
|
||||
* initate traffic to a specific aspect of your ngrok account. An IP
|
||||
* initiate traffic to a specific aspect of your ngrok account. An IP
|
||||
* restriction has a type which defines the ingress it applies to. IP
|
||||
* restrictions can be used to enforce the source IPs that can make API
|
||||
* requests, log in to the dashboard, start ngrok agents, and connect to your
|
||||
@@ -329,150 +318,354 @@ public class Ngrok {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a namespace object for PointcfgModule.
|
||||
* Creates a namespace object for Backends.
|
||||
*
|
||||
* @return a namespace object
|
||||
*/
|
||||
public PointcfgModuleNamespace pointcfgModule() {
|
||||
return new PointcfgModuleNamespace();
|
||||
public BackendsNamespace backends() {
|
||||
return new BackendsNamespace();
|
||||
}
|
||||
|
||||
/**
|
||||
* A namespace object for PointcfgModule.
|
||||
* Creates a namespace object for Edges.
|
||||
*
|
||||
* @return a namespace object
|
||||
*/
|
||||
public class PointcfgModuleNamespace {
|
||||
private PointcfgModuleNamespace() {}
|
||||
public EdgesNamespace edges() {
|
||||
return new EdgesNamespace();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a namespace object for EdgeModules.
|
||||
*
|
||||
* @return a namespace object
|
||||
*/
|
||||
public EdgeModulesNamespace edgeModules() {
|
||||
return new EdgeModulesNamespace();
|
||||
}
|
||||
|
||||
/**
|
||||
* A namespace object for Backends.
|
||||
*/
|
||||
public class BackendsNamespace {
|
||||
private BackendsNamespace() {}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointLoggingModule}.
|
||||
* A Failover backend defines failover behavior within a list of referenced
|
||||
* backends. Traffic is sent to the first backend in the list. If that backend
|
||||
* is offline or no connection can be established, ngrok attempts to connect to
|
||||
* the next backend in the list until one is successful.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-logging-module">https://ngrok.com/docs/api#api-endpoint-logging-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-failover-backends">https://ngrok.com/docs/api#api-failover-backends</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointLoggingModule logging() {
|
||||
return new EndpointLoggingModule(Ngrok.this.apiClient);
|
||||
public FailoverBackends failover() {
|
||||
return new FailoverBackends(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointCircuitBreakerModule}.
|
||||
* Creates a service client for {@link HttpResponseBackends}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module">https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-http-response-backends">https://ngrok.com/docs/api#api-http-response-backends</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointCircuitBreakerModule circuitBreaker() {
|
||||
return new EndpointCircuitBreakerModule(Ngrok.this.apiClient);
|
||||
public HttpResponseBackends httpResponse() {
|
||||
return new HttpResponseBackends(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointCompressionModule}.
|
||||
* A Tunnel Group Backend balances traffic among all online tunnels that match
|
||||
* a label selector.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-compression-module">https://ngrok.com/docs/api#api-endpoint-compression-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnel-group-backends">https://ngrok.com/docs/api#api-tunnel-group-backends</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointCompressionModule compression() {
|
||||
return new EndpointCompressionModule(Ngrok.this.apiClient);
|
||||
public TunnelGroupBackends tunnelGroup() {
|
||||
return new TunnelGroupBackends(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointTlsTerminationModule}.
|
||||
* A Weighted Backend balances traffic among the referenced backends. Traffic
|
||||
* is assigned proportionally to each based on its weight. The percentage of
|
||||
* traffic is calculated by dividing a backend's weight by the sum of all
|
||||
* weights.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-tls-termination-module">https://ngrok.com/docs/api#api-endpoint-tls-termination-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-weighted-backends">https://ngrok.com/docs/api#api-weighted-backends</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointTlsTerminationModule tlsTermination() {
|
||||
return new EndpointTlsTerminationModule(Ngrok.this.apiClient);
|
||||
public WeightedBackends weighted() {
|
||||
return new WeightedBackends(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* A namespace object for Edges.
|
||||
*/
|
||||
public class EdgesNamespace {
|
||||
private EdgesNamespace() {}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgesHttpsRoutes}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https-routes">https://ngrok.com/docs/api#api-edges-https-routes</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgesHttpsRoutes httpsRoutes() {
|
||||
return new EdgesHttpsRoutes(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointIpPolicyModule}.
|
||||
* Creates a service client for {@link EdgesHttps}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-ip-policy-module">https://ngrok.com/docs/api#api-endpoint-ip-policy-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https">https://ngrok.com/docs/api#api-edges-https</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointIpPolicyModule ipPolicy() {
|
||||
return new EndpointIpPolicyModule(Ngrok.this.apiClient);
|
||||
public EdgesHttps https() {
|
||||
return new EdgesHttps(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointMutualTlsModule}.
|
||||
* Creates a service client for {@link EdgesTcp}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-mutual-tls-module">https://ngrok.com/docs/api#api-endpoint-mutual-tls-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tcp">https://ngrok.com/docs/api#api-edges-tcp</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointMutualTlsModule mutualTls() {
|
||||
return new EndpointMutualTlsModule(Ngrok.this.apiClient);
|
||||
public EdgesTcp tcp() {
|
||||
return new EdgesTcp(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointRequestHeadersModule}.
|
||||
* Creates a service client for {@link EdgesTls}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-request-headers-module">https://ngrok.com/docs/api#api-endpoint-request-headers-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tls">https://ngrok.com/docs/api#api-edges-tls</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointRequestHeadersModule requestHeaders() {
|
||||
return new EndpointRequestHeadersModule(Ngrok.this.apiClient);
|
||||
public EdgesTls tls() {
|
||||
return new EdgesTls(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* A namespace object for EdgeModules.
|
||||
*/
|
||||
public class EdgeModulesNamespace {
|
||||
private EdgeModulesNamespace() {}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link HttpsEdgeMutualTlsModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-https-edge-mutual-tls-module">https://ngrok.com/docs/api#api-https-edge-mutual-tls-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public HttpsEdgeMutualTlsModule httpsEdgeMutualTls() {
|
||||
return new HttpsEdgeMutualTlsModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointResponseHeadersModule}.
|
||||
* Creates a service client for {@link HttpsEdgeTlsTerminationModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-response-headers-module">https://ngrok.com/docs/api#api-endpoint-response-headers-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-https-edge-tls-termination-module">https://ngrok.com/docs/api#api-https-edge-tls-termination-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointResponseHeadersModule responseHeaders() {
|
||||
return new EndpointResponseHeadersModule(Ngrok.this.apiClient);
|
||||
public HttpsEdgeTlsTerminationModule httpsEdgeTlsTermination() {
|
||||
return new HttpsEdgeTlsTerminationModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointOAuthModule}.
|
||||
* Creates a service client for {@link EdgeRouteBackendModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-o-auth-module">https://ngrok.com/docs/api#api-endpoint-o-auth-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-backend-module">https://ngrok.com/docs/api#api-edge-route-backend-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointOAuthModule oauth() {
|
||||
return new EndpointOAuthModule(Ngrok.this.apiClient);
|
||||
public EdgeRouteBackendModule httpsEdgeRouteBackend() {
|
||||
return new EdgeRouteBackendModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointWebhookValidationModule}.
|
||||
* Creates a service client for {@link EdgeRouteIpRestrictionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-webhook-validation-module">https://ngrok.com/docs/api#api-endpoint-webhook-validation-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-ip-restriction-module">https://ngrok.com/docs/api#api-edge-route-ip-restriction-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointWebhookValidationModule webhookValidation() {
|
||||
return new EndpointWebhookValidationModule(Ngrok.this.apiClient);
|
||||
public EdgeRouteIpRestrictionModule httpsEdgeRouteIpRestriction() {
|
||||
return new EdgeRouteIpRestrictionModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointSamlModule}.
|
||||
* Creates a service client for {@link EdgeRouteRequestHeadersModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-saml-module">https://ngrok.com/docs/api#api-endpoint-saml-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-request-headers-module">https://ngrok.com/docs/api#api-edge-route-request-headers-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointSamlModule saml() {
|
||||
return new EndpointSamlModule(Ngrok.this.apiClient);
|
||||
public EdgeRouteRequestHeadersModule httpsEdgeRouteRequestHeaders() {
|
||||
return new EdgeRouteRequestHeadersModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EndpointOidcModule}.
|
||||
* Creates a service client for {@link EdgeRouteResponseHeadersModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-oidc-module">https://ngrok.com/docs/api#api-endpoint-oidc-module</a>
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-response-headers-module">https://ngrok.com/docs/api#api-edge-route-response-headers-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EndpointOidcModule oidc() {
|
||||
return new EndpointOidcModule(Ngrok.this.apiClient);
|
||||
public EdgeRouteResponseHeadersModule httpsEdgeRouteResponseHeaders() {
|
||||
return new EdgeRouteResponseHeadersModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteCompressionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-compression-module">https://ngrok.com/docs/api#api-edge-route-compression-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteCompressionModule httpsEdgeRouteCompression() {
|
||||
return new EdgeRouteCompressionModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteCircuitBreakerModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module">https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteCircuitBreakerModule httpsEdgeRouteCircuitBreaker() {
|
||||
return new EdgeRouteCircuitBreakerModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteWebhookVerificationModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-webhook-verification-module">https://ngrok.com/docs/api#api-edge-route-webhook-verification-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteWebhookVerificationModule httpsEdgeRouteWebhookVerification() {
|
||||
return new EdgeRouteWebhookVerificationModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteOAuthModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-o-auth-module">https://ngrok.com/docs/api#api-edge-route-o-auth-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteOAuthModule httpsEdgeRouteOauth() {
|
||||
return new EdgeRouteOAuthModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteSamlModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-saml-module">https://ngrok.com/docs/api#api-edge-route-saml-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteSamlModule httpsEdgeRouteSaml() {
|
||||
return new EdgeRouteSamlModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteOidcModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-oidc-module">https://ngrok.com/docs/api#api-edge-route-oidc-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteOidcModule httpsEdgeRouteOidc() {
|
||||
return new EdgeRouteOidcModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link EdgeRouteWebsocketTcpConverterModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-websocket-tcp-converter-module">https://ngrok.com/docs/api#api-edge-route-websocket-tcp-converter-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public EdgeRouteWebsocketTcpConverterModule httpsEdgeRouteWebsocketTcpConverter() {
|
||||
return new EdgeRouteWebsocketTcpConverterModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TcpEdgeBackendModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-backend-module">https://ngrok.com/docs/api#api-tcp-edge-backend-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TcpEdgeBackendModule tcpEdgeBackend() {
|
||||
return new TcpEdgeBackendModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TcpEdgeIpRestrictionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module">https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TcpEdgeIpRestrictionModule tcpEdgeIpRestriction() {
|
||||
return new TcpEdgeIpRestrictionModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TlsEdgeBackendModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-backend-module">https://ngrok.com/docs/api#api-tls-edge-backend-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TlsEdgeBackendModule tlsEdgeBackend() {
|
||||
return new TlsEdgeBackendModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TlsEdgeIpRestrictionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-ip-restriction-module">https://ngrok.com/docs/api#api-tls-edge-ip-restriction-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TlsEdgeIpRestrictionModule tlsEdgeIpRestriction() {
|
||||
return new TlsEdgeIpRestrictionModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TlsEdgeMutualTlsModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module">https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TlsEdgeMutualTlsModule tlsEdgeMutualTls() {
|
||||
return new TlsEdgeMutualTlsModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for {@link TlsEdgeTlsTerminationModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-tls-termination-module">https://ngrok.com/docs/api#api-tls-edge-tls-termination-module</a>
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public TlsEdgeTlsTerminationModule tlsEdgeTlsTermination() {
|
||||
return new TlsEdgeTlsTerminationModule(Ngrok.this.apiClient);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,287 @@
|
||||
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 Endpoint} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class Endpoint {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("region")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String region;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
@JsonProperty("updated_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime updatedAt;
|
||||
@JsonProperty("public_url")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI publicUrl;
|
||||
@JsonProperty("proto")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String proto;
|
||||
@JsonProperty("hostport")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String hostport;
|
||||
@JsonProperty("type")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String type;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("domain")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> domain;
|
||||
@JsonProperty("tcp_addr")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> tcpAddr;
|
||||
@JsonProperty("tunnel")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> tunnel;
|
||||
@JsonProperty("edge")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> edge;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link Endpoint}.
|
||||
*
|
||||
* @param id unique endpoint resource identifier
|
||||
* @param region identifier of the region this endpoint belongs to
|
||||
* @param createdAt timestamp when the endpoint was created in RFC 3339 format
|
||||
* @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 metadata user-supplied metadata of the associated tunnel or edge object
|
||||
* @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
|
||||
*/
|
||||
@JsonCreator
|
||||
public Endpoint(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("region") final String region,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("updated_at") final java.time.OffsetDateTime updatedAt,
|
||||
@JsonProperty("public_url") final java.net.URI publicUrl,
|
||||
@JsonProperty("proto") final String proto,
|
||||
@JsonProperty("hostport") final String hostport,
|
||||
@JsonProperty("type") final String type,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@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
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.region = Objects.requireNonNull(region, "region is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt is required");
|
||||
this.publicUrl = Objects.requireNonNull(publicUrl, "publicUrl is required");
|
||||
this.proto = Objects.requireNonNull(proto, "proto is required");
|
||||
this.hostport = Objects.requireNonNull(hostport, "hostport is required");
|
||||
this.type = Objects.requireNonNull(type, "type is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* unique endpoint resource identifier
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* identifier of the region this endpoint belongs to
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getRegion() {
|
||||
return this.region;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the endpoint was created in RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getCreatedAt() {
|
||||
return this.createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the endpoint was updated in RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getUpdatedAt() {
|
||||
return this.updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the hostport served by this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getPublicUrl() {
|
||||
return this.publicUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* protocol served by this endpoint. one of <code>http</code>, <code>https</code>,
|
||||
* <code>tcp</code>, or <code>tls</code>
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getProto() {
|
||||
return this.proto;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostport served by this endpoint (hostname:port)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getHostport() {
|
||||
return this.hostport;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether the endpoint is <code>ephemeral</code> (served directly by an
|
||||
* agent-initiated tunnel) or <code>edge</code> (served by an edge)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* user-supplied metadata of the associated tunnel or edge object
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* the domain reserved for this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getDomain() {
|
||||
return this.domain;
|
||||
}
|
||||
|
||||
/**
|
||||
* the address reserved for this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getTcpAddr() {
|
||||
return this.tcpAddr;
|
||||
}
|
||||
|
||||
/**
|
||||
* the tunnel serving requests to this endpoint, if this is an ephemeral endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getTunnel() {
|
||||
return this.tunnel;
|
||||
}
|
||||
|
||||
/**
|
||||
* the edge serving requests to this endpoint, if this is an edge endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getEdge() {
|
||||
return this.edge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Endpoint other = (Endpoint) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.region.equals(other.region)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.updatedAt.equals(other.updatedAt)&&
|
||||
this.publicUrl.equals(other.publicUrl)&&
|
||||
this.proto.equals(other.proto)&&
|
||||
this.hostport.equals(other.hostport)&&
|
||||
this.type.equals(other.type)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.domain.equals(other.domain)&&
|
||||
this.tcpAddr.equals(other.tcpAddr)&&
|
||||
this.tunnel.equals(other.tunnel)&&
|
||||
this.edge.equals(other.edge);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.region,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.publicUrl,
|
||||
this.proto,
|
||||
this.hostport,
|
||||
this.type,
|
||||
this.metadata,
|
||||
this.domain,
|
||||
this.tcpAddr,
|
||||
this.tunnel,
|
||||
this.edge
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Endpoint{" +
|
||||
"id='" + this.id +
|
||||
"', region='" + this.region +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', updatedAt='" + this.updatedAt +
|
||||
"', publicUrl='" + this.publicUrl +
|
||||
"', proto='" + this.proto +
|
||||
"', hostport='" + this.hostport +
|
||||
"', type='" + this.type +
|
||||
"', metadata='" + this.metadata +
|
||||
"', 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)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
+18
-19
@@ -9,30 +9,30 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointLogging} resource.
|
||||
* A class encapsulating the {@link EndpointBackend} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointLogging {
|
||||
public class EndpointBackend {
|
||||
@JsonProperty("enabled")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Boolean> enabled;
|
||||
@JsonProperty("event_streams")
|
||||
@JsonProperty("backend")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<Ref> eventStreams;
|
||||
private final Ref backend;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointLogging}.
|
||||
* Creates a new instance of {@link EndpointBackend}.
|
||||
*
|
||||
* @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 eventStreams list of all EventStreams that will be used to configure and export this endpoint's logs
|
||||
* @param backend backend to be used to back this endpoint
|
||||
*/
|
||||
@JsonCreator
|
||||
public EndpointLogging(
|
||||
public EndpointBackend(
|
||||
@JsonProperty("enabled") final Optional<Boolean> enabled,
|
||||
@JsonProperty("event_streams") final java.util.List<Ref> eventStreams
|
||||
@JsonProperty("backend") final Ref backend
|
||||
) {
|
||||
this.enabled = enabled != null ? enabled : Optional.empty();
|
||||
this.eventStreams = Objects.requireNonNull(eventStreams, "eventStreams is required");
|
||||
this.backend = Objects.requireNonNull(backend, "backend is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,13 +46,12 @@ public class EndpointLogging {
|
||||
}
|
||||
|
||||
/**
|
||||
* list of all EventStreams that will be used to configure and export this
|
||||
* endpoint's logs
|
||||
* backend to be used to back this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<Ref>}
|
||||
* @return the value of the property as a {@link Ref}
|
||||
*/
|
||||
public java.util.List<Ref> getEventStreams() {
|
||||
return this.eventStreams;
|
||||
public Ref getBackend() {
|
||||
return this.backend;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,10 +63,10 @@ public class EndpointLogging {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointLogging other = (EndpointLogging) o;
|
||||
final EndpointBackend other = (EndpointBackend) o;
|
||||
return
|
||||
this.enabled.equals(other.enabled)&&
|
||||
this.eventStreams.equals(other.eventStreams);
|
||||
this.backend.equals(other.backend);
|
||||
|
||||
}
|
||||
|
||||
@@ -75,15 +74,15 @@ public class EndpointLogging {
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.enabled,
|
||||
this.eventStreams
|
||||
this.backend
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointLogging{" +
|
||||
return "EndpointBackend{" +
|
||||
"enabled='" + this.enabled.map(Object::toString).orElse("(null)") +
|
||||
"', eventStreams='" + this.eventStreams +
|
||||
"', backend='" + this.backend +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
+34
-37
@@ -9,16 +9,16 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointLoggingMutate} resource.
|
||||
* A class encapsulating the {@link EndpointBackendMutate} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointLoggingMutate {
|
||||
public class EndpointBackendMutate {
|
||||
/**
|
||||
* Builder class for {@link EndpointLoggingMutate}.
|
||||
* Builder class for {@link EndpointBackendMutate}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<Boolean> enabled = Optional.empty();
|
||||
private Optional<java.util.List<String>> eventStreamIds = Optional.empty();
|
||||
private Optional<String> backendId = Optional.empty();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
@@ -49,44 +49,42 @@ public class EndpointLoggingMutate {
|
||||
}
|
||||
|
||||
/**
|
||||
* list of all EventStreams that will be used to configure and export this
|
||||
* endpoint's logs
|
||||
* backend to be used to back this endpoint
|
||||
*
|
||||
* @param eventStreamIds the value of the <code>event_stream_ids</code> parameter as a {@link java.util.List<String>}
|
||||
* @param backendId the value of the <code>backend_id</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder eventStreamIds(final java.util.List<String> eventStreamIds) {
|
||||
this.eventStreamIds = Optional.of(Objects.requireNonNull(eventStreamIds, "eventStreamIds is required"));
|
||||
public Builder backendId(final String backendId) {
|
||||
this.backendId = Optional.of(Objects.requireNonNull(backendId, "backendId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* list of all EventStreams that will be used to configure and export this
|
||||
* endpoint's logs
|
||||
* backend to be used to back this endpoint
|
||||
*
|
||||
* @param eventStreamIds the value of the <code>event_stream_ids</code> parameter as a {@link java.util.List<String>}, wrapped in an {@link Optional}
|
||||
* @param backendId the value of the <code>backend_id</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder eventStreamIds(final Optional<java.util.List<String>> eventStreamIds) {
|
||||
this.eventStreamIds = Objects.requireNonNull(eventStreamIds, "eventStreamIds is required");
|
||||
public Builder backendId(final Optional<String> backendId) {
|
||||
this.backendId = Objects.requireNonNull(backendId, "backendId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointLoggingMutate} instance.
|
||||
* Constructs the {@link EndpointBackendMutate} instance.
|
||||
*
|
||||
* @return a new {@link EndpointLoggingMutate}
|
||||
* @return a new {@link EndpointBackendMutate}
|
||||
*/
|
||||
public EndpointLoggingMutate build() {
|
||||
return new EndpointLoggingMutate(
|
||||
public EndpointBackendMutate build() {
|
||||
return new EndpointBackendMutate(
|
||||
this.enabled,
|
||||
this.eventStreamIds.orElse(java.util.Collections.emptyList())
|
||||
this.backendId.orElse("")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointLoggingMutate} type.
|
||||
* Creates a new builder for the {@link EndpointBackendMutate} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
@@ -99,23 +97,23 @@ public class EndpointLoggingMutate {
|
||||
@JsonProperty("enabled")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Boolean> enabled;
|
||||
@JsonProperty("event_stream_ids")
|
||||
@JsonProperty("backend_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> eventStreamIds;
|
||||
private final String backendId;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointLoggingMutate}.
|
||||
* Creates a new instance of {@link EndpointBackendMutate}.
|
||||
*
|
||||
* @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 eventStreamIds list of all EventStreams that will be used to configure and export this endpoint's logs
|
||||
* @param backendId backend to be used to back this endpoint
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointLoggingMutate(
|
||||
private EndpointBackendMutate(
|
||||
@JsonProperty("enabled") final Optional<Boolean> enabled,
|
||||
@JsonProperty("event_stream_ids") final java.util.List<String> eventStreamIds
|
||||
@JsonProperty("backend_id") final String backendId
|
||||
) {
|
||||
this.enabled = enabled != null ? enabled : Optional.empty();
|
||||
this.eventStreamIds = Objects.requireNonNull(eventStreamIds, "eventStreamIds is required");
|
||||
this.backendId = Objects.requireNonNull(backendId, "backendId is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,13 +127,12 @@ public class EndpointLoggingMutate {
|
||||
}
|
||||
|
||||
/**
|
||||
* list of all EventStreams that will be used to configure and export this
|
||||
* endpoint's logs
|
||||
* backend to be used to back this endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<String>}
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEventStreamIds() {
|
||||
return this.eventStreamIds;
|
||||
public String getBackendId() {
|
||||
return this.backendId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -147,10 +144,10 @@ public class EndpointLoggingMutate {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointLoggingMutate other = (EndpointLoggingMutate) o;
|
||||
final EndpointBackendMutate other = (EndpointBackendMutate) o;
|
||||
return
|
||||
this.enabled.equals(other.enabled)&&
|
||||
this.eventStreamIds.equals(other.eventStreamIds);
|
||||
this.backendId.equals(other.backendId);
|
||||
|
||||
}
|
||||
|
||||
@@ -158,15 +155,15 @@ public class EndpointLoggingMutate {
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.enabled,
|
||||
this.eventStreamIds
|
||||
this.backendId
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointLoggingMutate{" +
|
||||
return "EndpointBackendMutate{" +
|
||||
"enabled='" + this.enabled.map(Object::toString).orElse("(null)") +
|
||||
"', eventStreamIds='" + this.eventStreamIds +
|
||||
"', backendId='" + this.backendId +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
+20
-20
@@ -9,13 +9,13 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointConfigurationList} resource.
|
||||
* A class encapsulating the {@link EndpointList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointConfigurationList implements Pageable {
|
||||
@JsonProperty("endpoint_configurations")
|
||||
public class EndpointList implements Pageable {
|
||||
@JsonProperty("endpoints")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<EndpointConfiguration> endpointConfigurations;
|
||||
private final java.util.List<Endpoint> endpoints;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@@ -24,34 +24,34 @@ public class EndpointConfigurationList implements Pageable {
|
||||
private final Optional<java.net.URI> nextPageUri;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointConfigurationList}.
|
||||
* Creates a new instance of {@link EndpointList}.
|
||||
*
|
||||
* @param endpointConfigurations the list of all endpoint configurations on this account
|
||||
* @param uri URI of the endpoint configurations list API resource
|
||||
* @param endpoints the list of all active endpoints on this account
|
||||
* @param uri URI of the endpoints list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public EndpointConfigurationList(
|
||||
@JsonProperty("endpoint_configurations") final java.util.List<EndpointConfiguration> endpointConfigurations,
|
||||
public EndpointList(
|
||||
@JsonProperty("endpoints") final java.util.List<Endpoint> endpoints,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.endpointConfigurations = Objects.requireNonNull(endpointConfigurations, "endpointConfigurations is required");
|
||||
this.endpoints = Objects.requireNonNull(endpoints, "endpoints is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all endpoint configurations on this account
|
||||
* the list of all active endpoints on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<EndpointConfiguration>}
|
||||
* @return the value of the property as a {@link java.util.List<Endpoint>}
|
||||
*/
|
||||
public java.util.List<EndpointConfiguration> getEndpointConfigurations() {
|
||||
return this.endpointConfigurations;
|
||||
public java.util.List<Endpoint> getEndpoints() {
|
||||
return this.endpoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the endpoint configurations list API resource
|
||||
* URI of the endpoints list API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
@@ -77,9 +77,9 @@ public class EndpointConfigurationList implements Pageable {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointConfigurationList other = (EndpointConfigurationList) o;
|
||||
final EndpointList other = (EndpointList) o;
|
||||
return
|
||||
this.endpointConfigurations.equals(other.endpointConfigurations)&&
|
||||
this.endpoints.equals(other.endpoints)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
@@ -88,7 +88,7 @@ public class EndpointConfigurationList implements Pageable {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.endpointConfigurations,
|
||||
this.endpoints,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
@@ -96,8 +96,8 @@ public class EndpointConfigurationList implements Pageable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointConfigurationList{" +
|
||||
"endpointConfigurations='" + this.endpointConfigurations +
|
||||
return "EndpointList{" +
|
||||
"endpoints='" + this.endpoints +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
@@ -0,0 +1,178 @@
|
||||
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 EndpointTlsTerminationAtEdge} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointTlsTerminationAtEdge {
|
||||
/**
|
||||
* Builder class for {@link EndpointTlsTerminationAtEdge}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<Boolean> enabled = Optional.empty();
|
||||
private Optional<String> minVersion = Optional.empty();
|
||||
|
||||
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 minimum TLS version used for termination and advertised to the client during
|
||||
* the TLS handshake. if unspecified, ngrok will choose an industry-safe default.
|
||||
* This value must be null if <code>terminate_at</code> is set to
|
||||
* <code>upstream</code>.
|
||||
*
|
||||
* @param minVersion the value of the <code>min_version</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder minVersion(final String minVersion) {
|
||||
this.minVersion = Optional.of(Objects.requireNonNull(minVersion, "minVersion is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The minimum TLS version used for termination and advertised to the client during
|
||||
* the TLS handshake. if unspecified, ngrok will choose an industry-safe default.
|
||||
* This value must be null if <code>terminate_at</code> is set to
|
||||
* <code>upstream</code>.
|
||||
*
|
||||
* @param minVersion the value of the <code>min_version</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder minVersion(final Optional<String> minVersion) {
|
||||
this.minVersion = Objects.requireNonNull(minVersion, "minVersion is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointTlsTerminationAtEdge} instance.
|
||||
*
|
||||
* @return a new {@link EndpointTlsTerminationAtEdge}
|
||||
*/
|
||||
public EndpointTlsTerminationAtEdge build() {
|
||||
return new EndpointTlsTerminationAtEdge(
|
||||
this.enabled,
|
||||
this.minVersion
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointTlsTerminationAtEdge} 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("min_version")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> minVersion;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointTlsTerminationAtEdge}.
|
||||
*
|
||||
* @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 minVersion The minimum TLS version used for termination and advertised to the client during the TLS handshake. if unspecified, ngrok will choose an industry-safe default. This value must be null if <code>terminate_at</code> is set to <code>upstream</code>.
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointTlsTerminationAtEdge(
|
||||
@JsonProperty("enabled") final Optional<Boolean> enabled,
|
||||
@JsonProperty("min_version") final Optional<String> minVersion
|
||||
) {
|
||||
this.enabled = enabled != null ? enabled : Optional.empty();
|
||||
this.minVersion = minVersion != null ? minVersion : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* <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 minimum TLS version used for termination and advertised to the client during
|
||||
* the TLS handshake. if unspecified, ngrok will choose an industry-safe default.
|
||||
* This value must be null if <code>terminate_at</code> is set to
|
||||
* <code>upstream</code>.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getMinVersion() {
|
||||
return this.minVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointTlsTerminationAtEdge other = (EndpointTlsTerminationAtEdge) o;
|
||||
return
|
||||
this.enabled.equals(other.enabled)&&
|
||||
this.minVersion.equals(other.minVersion);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.enabled,
|
||||
this.minVersion
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointTlsTerminationAtEdge{" +
|
||||
"enabled='" + this.enabled.map(Object::toString).orElse("(null)") +
|
||||
"', minVersion='" + this.minVersion.orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class EndpointWebhookValidation {
|
||||
* endpoint. Value must be one of the supported providers: <code>SLACK</code>,
|
||||
* <code>SNS</code>, <code>STRIPE</code>, <code>GITHUB</code>, <code>TWILIO</code>,
|
||||
* <code>SHOPIFY</code>, <code>GITLAB</code>, <code>INTERCOM</code>,
|
||||
* <code>SENDGRID</code>, <code>XERO</code>.
|
||||
* <code>SENDGRID</code>, <code>XERO</code>, <code>PAGERDUTY</code>.
|
||||
*
|
||||
* @param provider the value of the <code>provider</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
@@ -69,7 +69,7 @@ public class EndpointWebhookValidation {
|
||||
* endpoint. Value must be one of the supported providers: <code>SLACK</code>,
|
||||
* <code>SNS</code>, <code>STRIPE</code>, <code>GITHUB</code>, <code>TWILIO</code>,
|
||||
* <code>SHOPIFY</code>, <code>GITLAB</code>, <code>INTERCOM</code>,
|
||||
* <code>SENDGRID</code>, <code>XERO</code>.
|
||||
* <code>SENDGRID</code>, <code>XERO</code>, <code>PAGERDUTY</code>.
|
||||
*
|
||||
* @param provider the value of the <code>provider</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
@@ -142,7 +142,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: <code>SLACK</code>, <code>SNS</code>, <code>STRIPE</code>, <code>GITHUB</code>, <code>TWILIO</code>, <code>SHOPIFY</code>, <code>GITLAB</code>, <code>INTERCOM</code>, <code>SENDGRID</code>, <code>XERO</code>.
|
||||
* @param provider a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers: <code>SLACK</code>, <code>SNS</code>, <code>STRIPE</code>, <code>GITHUB</code>, <code>TWILIO</code>, <code>SHOPIFY</code>, <code>GITLAB</code>, <code>INTERCOM</code>, <code>SENDGRID</code>, <code>XERO</code>, <code>PAGERDUTY</code>.
|
||||
* @param secret a string secret used to validate requests from the given provider. All providers except AWS SNS require a secret
|
||||
*/
|
||||
@JsonCreator
|
||||
@@ -171,7 +171,7 @@ public class EndpointWebhookValidation {
|
||||
* endpoint. Value must be one of the supported providers: <code>SLACK</code>,
|
||||
* <code>SNS</code>, <code>STRIPE</code>, <code>GITHUB</code>, <code>TWILIO</code>,
|
||||
* <code>SHOPIFY</code>, <code>GITLAB</code>, <code>INTERCOM</code>,
|
||||
* <code>SENDGRID</code>, <code>XERO</code>.
|
||||
* <code>SENDGRID</code>, <code>XERO</code>, <code>PAGERDUTY</code>.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
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 EndpointWebsocketTcpConverter} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointWebsocketTcpConverter {
|
||||
/**
|
||||
* Builder class for {@link EndpointWebsocketTcpConverter}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<Boolean> enabled = Optional.empty();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointWebsocketTcpConverter} instance.
|
||||
*
|
||||
* @return a new {@link EndpointWebsocketTcpConverter}
|
||||
*/
|
||||
public EndpointWebsocketTcpConverter build() {
|
||||
return new EndpointWebsocketTcpConverter(
|
||||
this.enabled
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointWebsocketTcpConverter} 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;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointWebsocketTcpConverter}.
|
||||
*
|
||||
* @param enabled <code>true</code> if the module will be applied to traffic, <code>false</code> to disable. default <code>true</code> if unspecified
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointWebsocketTcpConverter(
|
||||
@JsonProperty("enabled") final Optional<Boolean> enabled
|
||||
) {
|
||||
this.enabled = enabled != null ? enabled : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* <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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointWebsocketTcpConverter other = (EndpointWebsocketTcpConverter) o;
|
||||
return
|
||||
this.enabled.equals(other.enabled);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.enabled
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointWebsocketTcpConverter{" +
|
||||
"enabled='" + this.enabled.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
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 EventStream} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EventStream {
|
||||
@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("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("description")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String description;
|
||||
@JsonProperty("fields")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> fields;
|
||||
@JsonProperty("event_type")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String eventType;
|
||||
@JsonProperty("destination_ids")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> destinationIds;
|
||||
@JsonProperty("sampling_rate")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final double samplingRate;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EventStream}.
|
||||
*
|
||||
* @param id Unique identifier for this Event Stream.
|
||||
* @param uri URI of the Event Stream API resource.
|
||||
* @param createdAt Timestamp when the Event Stream was created, RFC 3339 format.
|
||||
* @param metadata Arbitrary user-defined machine-readable data of this Event Stream. Optional, max 4096 bytes.
|
||||
* @param description Human-readable description of the Event Stream. Optional, max 255 bytes.
|
||||
* @param fields A list of protocol-specific fields you want to collect on each event.
|
||||
* @param eventType The protocol that determines which events will be collected. Supported values are <code>tcp_connection_closed</code> and <code>http_request_complete</code>.
|
||||
* @param destinationIds A list of Event Destination IDs which should be used for this Event Stream. Event Streams are required to have at least one Event Destination.
|
||||
* @param samplingRate The percentage of all events you would like to capture. Valid values range from 0.01, representing 1% of all events to 1.00, representing 100% of all events.
|
||||
*/
|
||||
@JsonCreator
|
||||
public EventStream(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("fields") final java.util.List<String> fields,
|
||||
@JsonProperty("event_type") final String eventType,
|
||||
@JsonProperty("destination_ids") final java.util.List<String> destinationIds,
|
||||
@JsonProperty("sampling_rate") final Double samplingRate
|
||||
) {
|
||||
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.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.description = Objects.requireNonNull(description, "description is required");
|
||||
this.fields = Objects.requireNonNull(fields, "fields is required");
|
||||
this.eventType = Objects.requireNonNull(eventType, "eventType is required");
|
||||
this.destinationIds = Objects.requireNonNull(destinationIds, "destinationIds is required");
|
||||
this.samplingRate = Objects.requireNonNull(samplingRate, "samplingRate is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier for this Event Stream.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the Event Stream 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 Event Stream 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
|
||||
* 4096 bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable description of the Event Stream. Optional, max 255 bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of protocol-specific fields you want to collect on each event.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<String>}
|
||||
*/
|
||||
public java.util.List<String> getFields() {
|
||||
return this.fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* The protocol that determines which events will be collected. Supported values
|
||||
* are <code>tcp_connection_closed</code> and <code>http_request_complete</code>.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getEventType() {
|
||||
return this.eventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<String>}
|
||||
*/
|
||||
public java.util.List<String> getDestinationIds() {
|
||||
return this.destinationIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* The percentage of all events you would like to capture. Valid values range from
|
||||
* 0.01, representing 1% of all events to 1.00, representing 100% of all events.
|
||||
*
|
||||
* @return the value of the property as a {@link double}
|
||||
*/
|
||||
public double getSamplingRate() {
|
||||
return this.samplingRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EventStream other = (EventStream) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.fields.equals(other.fields)&&
|
||||
this.eventType.equals(other.eventType)&&
|
||||
this.destinationIds.equals(other.destinationIds)&&
|
||||
this.samplingRate == other.samplingRate;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.createdAt,
|
||||
this.metadata,
|
||||
this.description,
|
||||
this.fields,
|
||||
this.eventType,
|
||||
this.destinationIds,
|
||||
this.samplingRate
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EventStream{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', metadata='" + this.metadata +
|
||||
"', description='" + this.description +
|
||||
"', fields='" + this.fields +
|
||||
"', eventType='" + this.eventType +
|
||||
"', destinationIds='" + this.destinationIds +
|
||||
"', samplingRate='" + this.samplingRate +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
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 FailoverBackend} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class FailoverBackend {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String 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 String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> backends;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link FailoverBackend}.
|
||||
*
|
||||
* @param id unique identifier for this Failover backend
|
||||
* @param uri URI of the FailoverBackend 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 backends the ids of the child backends in order
|
||||
*/
|
||||
@JsonCreator
|
||||
public FailoverBackend(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final String uri,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("backends") final java.util.List<String> backends
|
||||
) {
|
||||
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 = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier for this Failover backend
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the FailoverBackend API resource
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String 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}
|
||||
*/
|
||||
public 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}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends in order
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<String>}
|
||||
*/
|
||||
public java.util.List<String> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final FailoverBackend other = (FailoverBackend) 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.backends.equals(other.backends);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.createdAt,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.backends
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FailoverBackend{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', backends='" + this.backends +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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 FailoverBackendList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class FailoverBackendList implements Pageable {
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<FailoverBackend> 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 FailoverBackendList}.
|
||||
*
|
||||
* @param backends the list of all Failover backends on this account
|
||||
* @param uri URI of the Failover backends list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public FailoverBackendList(
|
||||
@JsonProperty("backends") final java.util.List<FailoverBackend> backends,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all Failover backends on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<FailoverBackend>}
|
||||
*/
|
||||
public java.util.List<FailoverBackend> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the Failover 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 FailoverBackendList other = (FailoverBackendList) 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 "FailoverBackendList{" +
|
||||
"backends='" + this.backends +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
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 HttpResponseBackend} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class HttpResponseBackend {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String 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 String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("body")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String body;
|
||||
@JsonProperty("headers")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.Map<String, String> headers;
|
||||
@JsonProperty("status_code")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final int statusCode;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link HttpResponseBackend}.
|
||||
*
|
||||
* @param id the value of the <code>id</code> parameter as a {@link String}
|
||||
* @param uri URI of the HTTPResponseBackend 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 body body to return as fixed content
|
||||
* @param headers headers to return
|
||||
* @param statusCode status code to return
|
||||
*/
|
||||
@JsonCreator
|
||||
public HttpResponseBackend(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final String uri,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("body") final String body,
|
||||
@JsonProperty("headers") final java.util.Map<String, String> headers,
|
||||
@JsonProperty("status_code") final Integer statusCode
|
||||
) {
|
||||
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 = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.body = Objects.requireNonNull(body, "body is required");
|
||||
this.headers = Objects.requireNonNull(headers, "headers is required");
|
||||
this.statusCode = Objects.requireNonNull(statusCode, "statusCode is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>id</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the HTTPResponseBackend API resource
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String 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}
|
||||
*/
|
||||
public 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}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* body to return as fixed content
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getBody() {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* headers to return
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.Map<String, String>}
|
||||
*/
|
||||
public java.util.Map<String, String> getHeaders() {
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* status code to return
|
||||
*
|
||||
* @return the value of the property as a {@link int}
|
||||
*/
|
||||
public int getStatusCode() {
|
||||
return this.statusCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final HttpResponseBackend other = (HttpResponseBackend) 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.body.equals(other.body)&&
|
||||
this.headers.equals(other.headers)&&
|
||||
this.statusCode == other.statusCode;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.createdAt,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.body,
|
||||
this.headers,
|
||||
this.statusCode
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HttpResponseBackend{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', body='" + this.body +
|
||||
"', headers='" + this.headers +
|
||||
"', statusCode='" + this.statusCode +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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 HttpResponseBackendList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class HttpResponseBackendList implements Pageable {
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<HttpResponseBackend> 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 HttpResponseBackendList}.
|
||||
*
|
||||
* @param backends the value of the <code>backends</code> parameter as a {@link java.util.List<HttpResponseBackend>}
|
||||
* @param uri the value of the <code>uri</code> parameter as a {@link java.net.URI}
|
||||
* @param nextPageUri the value of the <code>next_page_uri</code> parameter as a {@link java.net.URI}
|
||||
*/
|
||||
@JsonCreator
|
||||
public HttpResponseBackendList(
|
||||
@JsonProperty("backends") final java.util.List<HttpResponseBackend> backends,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>backends</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<HttpResponseBackend>}
|
||||
*/
|
||||
public java.util.List<HttpResponseBackend> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>uri</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>nextPageUri</code> property.
|
||||
*
|
||||
* @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 HttpResponseBackendList other = (HttpResponseBackendList) 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 "HttpResponseBackendList{" +
|
||||
"backends='" + this.backends +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
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 HttpsEdge} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class HttpsEdge {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("description")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String createdAt;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String uri;
|
||||
@JsonProperty("hostports")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.util.List<String>> hostports;
|
||||
@JsonProperty("mutual_tls")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointMutualTls> mutualTls;
|
||||
@JsonProperty("tls_termination")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointTlsTermination> tlsTermination;
|
||||
@JsonProperty("routes")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<HttpsEdgeRoute> routes;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link HttpsEdge}.
|
||||
*
|
||||
* @param id unique identifier of this edge
|
||||
* @param description human-readable description of what this edge will be used for; optional, max 255 bytes.
|
||||
* @param metadata arbitrary user-defined machine-readable data of this edge; optional, max 4096 bytes.
|
||||
* @param createdAt timestamp when the edge configuration was created, RFC 3339 format
|
||||
* @param uri URI of the edge API resource
|
||||
* @param hostports hostports served by this edge
|
||||
* @param mutualTls edge modules
|
||||
* @param tlsTermination the value of the <code>tls_termination</code> parameter as a {@link EndpointTlsTermination}
|
||||
* @param routes routes
|
||||
*/
|
||||
@JsonCreator
|
||||
public HttpsEdge(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("created_at") final String createdAt,
|
||||
@JsonProperty("uri") final String uri,
|
||||
@JsonProperty("hostports") final Optional<java.util.List<String>> hostports,
|
||||
@JsonProperty("mutual_tls") final Optional<EndpointMutualTls> mutualTls,
|
||||
@JsonProperty("tls_termination") final Optional<EndpointTlsTermination> tlsTermination,
|
||||
@JsonProperty("routes") final java.util.List<HttpsEdgeRoute> routes
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.description = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.hostports = hostports != null ? hostports : Optional.empty();
|
||||
this.mutualTls = mutualTls != null ? mutualTls : Optional.empty();
|
||||
this.tlsTermination = tlsTermination != null ? tlsTermination : Optional.empty();
|
||||
this.routes = Objects.requireNonNull(routes, "routes is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier of this edge
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge; optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the edge configuration was created, RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getCreatedAt() {
|
||||
return this.createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the edge API resource
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<String>} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.util.List<String>> getHostports() {
|
||||
return this.hostports;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointMutualTls} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointMutualTls> getMutualTls() {
|
||||
return this.mutualTls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>tlsTermination</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointTlsTermination} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointTlsTermination> getTlsTermination() {
|
||||
return this.tlsTermination;
|
||||
}
|
||||
|
||||
/**
|
||||
* routes
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<HttpsEdgeRoute>}
|
||||
*/
|
||||
public java.util.List<HttpsEdgeRoute> getRoutes() {
|
||||
return this.routes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final HttpsEdge other = (HttpsEdge) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.hostports.equals(other.hostports)&&
|
||||
this.mutualTls.equals(other.mutualTls)&&
|
||||
this.tlsTermination.equals(other.tlsTermination)&&
|
||||
this.routes.equals(other.routes);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.createdAt,
|
||||
this.uri,
|
||||
this.hostports,
|
||||
this.mutualTls,
|
||||
this.tlsTermination,
|
||||
this.routes
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HttpsEdge{" +
|
||||
"id='" + this.id +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', uri='" + this.uri +
|
||||
"', hostports='" + this.hostports.map(Object::toString).orElse("(null)") +
|
||||
"', mutualTls='" + this.mutualTls.map(Object::toString).orElse("(null)") +
|
||||
"', tlsTermination='" + this.tlsTermination.map(Object::toString).orElse("(null)") +
|
||||
"', routes='" + this.routes +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
+22
-22
@@ -9,13 +9,13 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EventStreamList} resource.
|
||||
* A class encapsulating the {@link HttpsEdgeList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EventStreamList implements Pageable {
|
||||
@JsonProperty("event_streams")
|
||||
public class HttpsEdgeList implements Pageable {
|
||||
@JsonProperty("https_edges")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<EventStream> eventStreams;
|
||||
private final java.util.List<HttpsEdge> httpsEdges;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@@ -24,34 +24,34 @@ public class EventStreamList implements Pageable {
|
||||
private final Optional<java.net.URI> nextPageUri;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EventStreamList}.
|
||||
* Creates a new instance of {@link HttpsEdgeList}.
|
||||
*
|
||||
* @param eventStreams The list of all Event Streams on this account.
|
||||
* @param uri URI of the Event Stream list API resource.
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page.
|
||||
* @param httpsEdges the list of all HTTPS Edges on this account
|
||||
* @param uri URI of the HTTPS Edge list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public EventStreamList(
|
||||
@JsonProperty("event_streams") final java.util.List<EventStream> eventStreams,
|
||||
public HttpsEdgeList(
|
||||
@JsonProperty("https_edges") final java.util.List<HttpsEdge> httpsEdges,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.eventStreams = Objects.requireNonNull(eventStreams, "eventStreams is required");
|
||||
this.httpsEdges = Objects.requireNonNull(httpsEdges, "httpsEdges is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* The list of all Event Streams on this account.
|
||||
* the list of all HTTPS Edges on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<EventStream>}
|
||||
* @return the value of the property as a {@link java.util.List<HttpsEdge>}
|
||||
*/
|
||||
public java.util.List<EventStream> getEventStreams() {
|
||||
return this.eventStreams;
|
||||
public java.util.List<HttpsEdge> getHttpsEdges() {
|
||||
return this.httpsEdges;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the Event Stream list API resource.
|
||||
* URI of the HTTPS Edge list API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
@@ -60,7 +60,7 @@ public class EventStreamList implements Pageable {
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the next page, or null if there is no next page.
|
||||
* 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}
|
||||
*/
|
||||
@@ -77,9 +77,9 @@ public class EventStreamList implements Pageable {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EventStreamList other = (EventStreamList) o;
|
||||
final HttpsEdgeList other = (HttpsEdgeList) o;
|
||||
return
|
||||
this.eventStreams.equals(other.eventStreams)&&
|
||||
this.httpsEdges.equals(other.httpsEdges)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
@@ -88,7 +88,7 @@ public class EventStreamList implements Pageable {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.eventStreams,
|
||||
this.httpsEdges,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
@@ -96,8 +96,8 @@ public class EventStreamList implements Pageable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EventStreamList{" +
|
||||
"eventStreams='" + this.eventStreams +
|
||||
return "HttpsEdgeList{" +
|
||||
"httpsEdges='" + this.httpsEdges +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
+155
-137
@@ -9,28 +9,40 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* A class encapsulating the {@link EndpointConfiguration} resource.
|
||||
* A class encapsulating the {@link HttpsEdgeRoute} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointConfiguration {
|
||||
public class HttpsEdgeRoute {
|
||||
@JsonProperty("edge_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String edgeId;
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("type")
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String type;
|
||||
private final String createdAt;
|
||||
@JsonProperty("match_type")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String matchType;
|
||||
@JsonProperty("match")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String match;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String uri;
|
||||
@JsonProperty("description")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("created_at")
|
||||
@JsonProperty("backend")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
@JsonProperty("uri")
|
||||
private final Optional<EndpointBackend> backend;
|
||||
@JsonProperty("ip_restriction")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
private final Optional<EndpointIpPolicy> ipRestriction;
|
||||
@JsonProperty("circuit_breaker")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointCircuitBreaker> circuitBreaker;
|
||||
@@ -43,96 +55,99 @@ public class EndpointConfiguration {
|
||||
@JsonProperty("response_headers")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointResponseHeaders> responseHeaders;
|
||||
@JsonProperty("ip_policy")
|
||||
@JsonProperty("webhook_verification")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointIpPolicy> ipPolicy;
|
||||
@JsonProperty("mutual_tls")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointMutualTls> mutualTls;
|
||||
@JsonProperty("tls_termination")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointTlsTermination> tlsTermination;
|
||||
@JsonProperty("webhook_validation")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointWebhookValidation> webhookValidation;
|
||||
private final Optional<EndpointWebhookValidation> webhookVerification;
|
||||
@JsonProperty("oauth")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointOAuth> oauth;
|
||||
@JsonProperty("logging")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointLogging> logging;
|
||||
@JsonProperty("saml")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointSaml> saml;
|
||||
@JsonProperty("oidc")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointOidc> oidc;
|
||||
@JsonProperty("websocket_tcp_converter")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointWebsocketTcpConverter> websocketTcpConverter;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointConfiguration}.
|
||||
* Creates a new instance of {@link HttpsEdgeRoute}.
|
||||
*
|
||||
* @param id unique identifier of this endpoint configuration
|
||||
* @param type they type of traffic this endpoint configuration can be applied to. one of: <code>http</code>, <code>https</code>, <code>tcp</code>
|
||||
* @param description human-readable description of what this endpoint configuration will be do when applied or what traffic it will be applied to. Optional, max 255 bytes
|
||||
* @param metadata arbitrary user-defined machine-readable data of this endpoint configuration. Optional, max 4096 bytes.
|
||||
* @param createdAt timestamp when the endpoint configuration was created, RFC 3339 format
|
||||
* @param uri URI of the endpoint configuration API resource
|
||||
* @param edgeId unique identifier of this edge
|
||||
* @param id unique identifier of this edge route
|
||||
* @param createdAt timestamp when the edge configuration was created, RFC 3339 format
|
||||
* @param matchType Type of match to use for this route. Valid values are "exact_path" and "path_prefix".
|
||||
* @param match Route selector: "/blog" or "example.com" or "example.com/blog"
|
||||
* @param uri URI of the edge API resource
|
||||
* @param description human-readable description of what this edge will be used for; optional, max 255 bytes.
|
||||
* @param metadata arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
|
||||
* @param backend backend module configuration or <code>null</code>
|
||||
* @param ipRestriction ip restriction module configuration or <code>null</code>
|
||||
* @param circuitBreaker circuit breaker module configuration or <code>null</code>
|
||||
* @param compression compression module configuration or <code>null</code>
|
||||
* @param requestHeaders request headers module configuration or <code>null</code>
|
||||
* @param responseHeaders response headers module configuration or <code>null</code>
|
||||
* @param ipPolicy ip policy module configuration or <code>null</code>
|
||||
* @param mutualTls mutual TLS module configuration or <code>null</code>
|
||||
* @param tlsTermination TLS termination module configuration or <code>null</code>
|
||||
* @param webhookValidation webhook validation module configuration or <code>null</code>
|
||||
* @param webhookVerification webhook verification module configuration or <code>null</code>
|
||||
* @param oauth oauth module configuration or <code>null</code>
|
||||
* @param logging logging module configuration or <code>null</code>
|
||||
* @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>
|
||||
*/
|
||||
@JsonCreator
|
||||
public EndpointConfiguration(
|
||||
public HttpsEdgeRoute(
|
||||
@JsonProperty("edge_id") final String edgeId,
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("type") final String type,
|
||||
@JsonProperty("created_at") final String createdAt,
|
||||
@JsonProperty("match_type") final String matchType,
|
||||
@JsonProperty("match") final String match,
|
||||
@JsonProperty("uri") final String uri,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("backend") final Optional<EndpointBackend> backend,
|
||||
@JsonProperty("ip_restriction") final Optional<EndpointIpPolicy> ipRestriction,
|
||||
@JsonProperty("circuit_breaker") final Optional<EndpointCircuitBreaker> circuitBreaker,
|
||||
@JsonProperty("compression") final Optional<EndpointCompression> compression,
|
||||
@JsonProperty("request_headers") final Optional<EndpointRequestHeaders> requestHeaders,
|
||||
@JsonProperty("response_headers") final Optional<EndpointResponseHeaders> responseHeaders,
|
||||
@JsonProperty("ip_policy") final Optional<EndpointIpPolicy> ipPolicy,
|
||||
@JsonProperty("mutual_tls") final Optional<EndpointMutualTls> mutualTls,
|
||||
@JsonProperty("tls_termination") final Optional<EndpointTlsTermination> tlsTermination,
|
||||
@JsonProperty("webhook_validation") final Optional<EndpointWebhookValidation> webhookValidation,
|
||||
@JsonProperty("webhook_verification") final Optional<EndpointWebhookValidation> webhookVerification,
|
||||
@JsonProperty("oauth") final Optional<EndpointOAuth> oauth,
|
||||
@JsonProperty("logging") final Optional<EndpointLogging> logging,
|
||||
@JsonProperty("saml") final Optional<EndpointSaml> saml,
|
||||
@JsonProperty("oidc") final Optional<EndpointOidc> oidc
|
||||
@JsonProperty("oidc") final Optional<EndpointOidc> oidc,
|
||||
@JsonProperty("websocket_tcp_converter") final Optional<EndpointWebsocketTcpConverter> websocketTcpConverter
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.type = Objects.requireNonNull(type, "type is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.matchType = Objects.requireNonNull(matchType, "matchType is required");
|
||||
this.match = Objects.requireNonNull(match, "match is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.description = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.backend = backend != null ? backend : Optional.empty();
|
||||
this.ipRestriction = ipRestriction != null ? ipRestriction : Optional.empty();
|
||||
this.circuitBreaker = circuitBreaker != null ? circuitBreaker : Optional.empty();
|
||||
this.compression = compression != null ? compression : Optional.empty();
|
||||
this.requestHeaders = requestHeaders != null ? requestHeaders : Optional.empty();
|
||||
this.responseHeaders = responseHeaders != null ? responseHeaders : Optional.empty();
|
||||
this.ipPolicy = ipPolicy != null ? ipPolicy : Optional.empty();
|
||||
this.mutualTls = mutualTls != null ? mutualTls : Optional.empty();
|
||||
this.tlsTermination = tlsTermination != null ? tlsTermination : Optional.empty();
|
||||
this.webhookValidation = webhookValidation != null ? webhookValidation : Optional.empty();
|
||||
this.webhookVerification = webhookVerification != null ? webhookVerification : Optional.empty();
|
||||
this.oauth = oauth != null ? oauth : Optional.empty();
|
||||
this.logging = logging != null ? logging : Optional.empty();
|
||||
this.saml = saml != null ? saml : Optional.empty();
|
||||
this.oidc = oidc != null ? oidc : Optional.empty();
|
||||
this.websocketTcpConverter = websocketTcpConverter != null ? websocketTcpConverter : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier of this endpoint configuration
|
||||
* unique identifier of this edge
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getEdgeId() {
|
||||
return this.edgeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier of this edge route
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
@@ -141,18 +156,45 @@ public class EndpointConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* they type of traffic this endpoint configuration can be applied to. one of:
|
||||
* <code>http</code>, <code>https</code>, <code>tcp</code>
|
||||
* timestamp when the edge configuration was created, RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getType() {
|
||||
return this.type;
|
||||
public String getCreatedAt() {
|
||||
return this.createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this endpoint configuration will be do when
|
||||
* applied or what traffic it will be applied to. Optional, max 255 bytes
|
||||
* Type of match to use for this route. Valid values are "exact_path" and
|
||||
* "path_prefix".
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getMatchType() {
|
||||
return this.matchType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Route selector: "/blog" or "example.com" or "example.com/blog"
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getMatch() {
|
||||
return this.match;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the edge API resource
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
@@ -161,8 +203,8 @@ public class EndpointConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this endpoint configuration.
|
||||
* Optional, max 4096 bytes.
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
@@ -171,21 +213,21 @@ public class EndpointConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the endpoint configuration was created, RFC 3339 format
|
||||
* backend module configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
* @return the value of the property as a {@link EndpointBackend} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.time.OffsetDateTime getCreatedAt() {
|
||||
return this.createdAt;
|
||||
public Optional<EndpointBackend> getBackend() {
|
||||
return this.backend;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the endpoint configuration API resource
|
||||
* ip restriction module configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
* @return the value of the property as a {@link EndpointIpPolicy} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
public Optional<EndpointIpPolicy> getIpRestriction() {
|
||||
return this.ipRestriction;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,39 +267,12 @@ public class EndpointConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* ip policy module configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointIpPolicy} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointIpPolicy> getIpPolicy() {
|
||||
return this.ipPolicy;
|
||||
}
|
||||
|
||||
/**
|
||||
* mutual TLS module configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointMutualTls} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointMutualTls> getMutualTls() {
|
||||
return this.mutualTls;
|
||||
}
|
||||
|
||||
/**
|
||||
* TLS termination module configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointTlsTermination} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointTlsTermination> getTlsTermination() {
|
||||
return this.tlsTermination;
|
||||
}
|
||||
|
||||
/**
|
||||
* webhook validation module configuration or <code>null</code>
|
||||
* webhook verification module configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointWebhookValidation} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointWebhookValidation> getWebhookValidation() {
|
||||
return this.webhookValidation;
|
||||
public Optional<EndpointWebhookValidation> getWebhookVerification() {
|
||||
return this.webhookVerification;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,15 +284,6 @@ public class EndpointConfiguration {
|
||||
return this.oauth;
|
||||
}
|
||||
|
||||
/**
|
||||
* logging module configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointLogging} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointLogging> getLogging() {
|
||||
return this.logging;
|
||||
}
|
||||
|
||||
/**
|
||||
* saml module configuration or <code>null</code>
|
||||
*
|
||||
@@ -296,6 +302,15 @@ public class EndpointConfiguration {
|
||||
return this.oidc;
|
||||
}
|
||||
|
||||
/**
|
||||
* websocket to tcp adapter configuration or <code>null</code>
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointWebsocketTcpConverter} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointWebsocketTcpConverter> getWebsocketTcpConverter() {
|
||||
return this.websocketTcpConverter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -305,74 +320,77 @@ public class EndpointConfiguration {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointConfiguration other = (EndpointConfiguration) o;
|
||||
final HttpsEdgeRoute other = (HttpsEdgeRoute) o;
|
||||
return
|
||||
this.edgeId.equals(other.edgeId)&&
|
||||
this.id.equals(other.id)&&
|
||||
this.type.equals(other.type)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.matchType.equals(other.matchType)&&
|
||||
this.match.equals(other.match)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.backend.equals(other.backend)&&
|
||||
this.ipRestriction.equals(other.ipRestriction)&&
|
||||
this.circuitBreaker.equals(other.circuitBreaker)&&
|
||||
this.compression.equals(other.compression)&&
|
||||
this.requestHeaders.equals(other.requestHeaders)&&
|
||||
this.responseHeaders.equals(other.responseHeaders)&&
|
||||
this.ipPolicy.equals(other.ipPolicy)&&
|
||||
this.mutualTls.equals(other.mutualTls)&&
|
||||
this.tlsTermination.equals(other.tlsTermination)&&
|
||||
this.webhookValidation.equals(other.webhookValidation)&&
|
||||
this.webhookVerification.equals(other.webhookVerification)&&
|
||||
this.oauth.equals(other.oauth)&&
|
||||
this.logging.equals(other.logging)&&
|
||||
this.saml.equals(other.saml)&&
|
||||
this.oidc.equals(other.oidc);
|
||||
this.oidc.equals(other.oidc)&&
|
||||
this.websocketTcpConverter.equals(other.websocketTcpConverter);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.edgeId,
|
||||
this.id,
|
||||
this.type,
|
||||
this.createdAt,
|
||||
this.matchType,
|
||||
this.match,
|
||||
this.uri,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.createdAt,
|
||||
this.uri,
|
||||
this.backend,
|
||||
this.ipRestriction,
|
||||
this.circuitBreaker,
|
||||
this.compression,
|
||||
this.requestHeaders,
|
||||
this.responseHeaders,
|
||||
this.ipPolicy,
|
||||
this.mutualTls,
|
||||
this.tlsTermination,
|
||||
this.webhookValidation,
|
||||
this.webhookVerification,
|
||||
this.oauth,
|
||||
this.logging,
|
||||
this.saml,
|
||||
this.oidc
|
||||
this.oidc,
|
||||
this.websocketTcpConverter
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointConfiguration{" +
|
||||
"id='" + this.id +
|
||||
"', type='" + this.type +
|
||||
return "HttpsEdgeRoute{" +
|
||||
"edgeId='" + this.edgeId +
|
||||
"', id='" + this.id +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', matchType='" + this.matchType +
|
||||
"', match='" + this.match +
|
||||
"', uri='" + this.uri +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', uri='" + this.uri +
|
||||
"', backend='" + this.backend.map(Object::toString).orElse("(null)") +
|
||||
"', ipRestriction='" + this.ipRestriction.map(Object::toString).orElse("(null)") +
|
||||
"', circuitBreaker='" + this.circuitBreaker.map(Object::toString).orElse("(null)") +
|
||||
"', compression='" + this.compression.map(Object::toString).orElse("(null)") +
|
||||
"', requestHeaders='" + this.requestHeaders.map(Object::toString).orElse("(null)") +
|
||||
"', responseHeaders='" + this.responseHeaders.map(Object::toString).orElse("(null)") +
|
||||
"', ipPolicy='" + this.ipPolicy.map(Object::toString).orElse("(null)") +
|
||||
"', mutualTls='" + this.mutualTls.map(Object::toString).orElse("(null)") +
|
||||
"', tlsTermination='" + this.tlsTermination.map(Object::toString).orElse("(null)") +
|
||||
"', webhookValidation='" + this.webhookValidation.map(Object::toString).orElse("(null)") +
|
||||
"', webhookVerification='" + this.webhookVerification.map(Object::toString).orElse("(null)") +
|
||||
"', oauth='" + this.oauth.map(Object::toString).orElse("(null)") +
|
||||
"', logging='" + this.logging.map(Object::toString).orElse("(null)") +
|
||||
"', saml='" + this.saml.map(Object::toString).orElse("(null)") +
|
||||
"', oidc='" + this.oidc.map(Object::toString).orElse("(null)") +
|
||||
"', websocketTcpConverter='" + this.websocketTcpConverter.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -28,9 +28,6 @@ public class IpPolicy {
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("action")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String action;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link IpPolicy}.
|
||||
@@ -40,7 +37,6 @@ public class IpPolicy {
|
||||
* @param createdAt timestamp when the IP policy was created, RFC 3339 format
|
||||
* @param description human-readable description of the source IPs of this IP policy. optional, max 255 bytes.
|
||||
* @param metadata arbitrary user-defined machine-readable data of this IP policy. optional, max 4096 bytes.
|
||||
* @param action the IP policy action. Supported values are <code>allow</code> or <code>deny</code>
|
||||
*/
|
||||
@JsonCreator
|
||||
public IpPolicy(
|
||||
@@ -48,15 +44,13 @@ public class IpPolicy {
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("action") final String action
|
||||
@JsonProperty("metadata") final String metadata
|
||||
) {
|
||||
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 = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.action = Objects.requireNonNull(action, "action is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,16 +100,6 @@ public class IpPolicy {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* the IP policy action. Supported values are <code>allow</code> or
|
||||
* <code>deny</code>
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getAction() {
|
||||
return this.action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -131,8 +115,7 @@ public class IpPolicy {
|
||||
this.uri.equals(other.uri)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.action.equals(other.action);
|
||||
this.metadata.equals(other.metadata);
|
||||
|
||||
}
|
||||
|
||||
@@ -143,8 +126,7 @@ public class IpPolicy {
|
||||
this.uri,
|
||||
this.createdAt,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.action
|
||||
this.metadata
|
||||
);
|
||||
}
|
||||
|
||||
@@ -156,7 +138,6 @@ public class IpPolicy {
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', action='" + this.action +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public class IpPolicyRule {
|
||||
@JsonProperty("ip_policy")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Ref ipPolicy;
|
||||
@JsonProperty("action")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String action;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link IpPolicyRule}.
|
||||
@@ -45,6 +48,7 @@ public class IpPolicyRule {
|
||||
* @param metadata arbitrary user-defined machine-readable data of this IP policy rule. optional, max 4096 bytes.
|
||||
* @param cidr an IP or IP range specified in CIDR notation. IPv4 and IPv6 are both supported.
|
||||
* @param ipPolicy object describing the IP policy this IP Policy Rule belongs to
|
||||
* @param action the action to apply to the policy rule, either <code>allow</code> or <code>deny</code>
|
||||
*/
|
||||
@JsonCreator
|
||||
public IpPolicyRule(
|
||||
@@ -54,7 +58,8 @@ public class IpPolicyRule {
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("cidr") final String cidr,
|
||||
@JsonProperty("ip_policy") final Ref ipPolicy
|
||||
@JsonProperty("ip_policy") final Ref ipPolicy,
|
||||
@JsonProperty("action") final String action
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
@@ -63,6 +68,7 @@ public class IpPolicyRule {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.cidr = Objects.requireNonNull(cidr, "cidr is required");
|
||||
this.ipPolicy = Objects.requireNonNull(ipPolicy, "ipPolicy is required");
|
||||
this.action = Objects.requireNonNull(action, "action is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,6 +136,16 @@ public class IpPolicyRule {
|
||||
return this.ipPolicy;
|
||||
}
|
||||
|
||||
/**
|
||||
* the action to apply to the policy rule, either <code>allow</code> or
|
||||
* <code>deny</code>
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getAction() {
|
||||
return this.action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -147,7 +163,8 @@ public class IpPolicyRule {
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.cidr.equals(other.cidr)&&
|
||||
this.ipPolicy.equals(other.ipPolicy);
|
||||
this.ipPolicy.equals(other.ipPolicy)&&
|
||||
this.action.equals(other.action);
|
||||
|
||||
}
|
||||
|
||||
@@ -160,7 +177,8 @@ public class IpPolicyRule {
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.cidr,
|
||||
this.ipPolicy
|
||||
this.ipPolicy,
|
||||
this.action
|
||||
);
|
||||
}
|
||||
|
||||
@@ -174,6 +192,7 @@ public class IpPolicyRule {
|
||||
"', metadata='" + this.metadata +
|
||||
"', cidr='" + this.cidr +
|
||||
"', ipPolicy='" + this.ipPolicy +
|
||||
"', action='" + this.action +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,6 @@ public class ReservedAddr {
|
||||
@JsonProperty("region")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String region;
|
||||
@JsonProperty("endpoint_configuration")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> endpointConfiguration;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link ReservedAddr}.
|
||||
@@ -48,7 +45,6 @@ public class ReservedAddr {
|
||||
* @param metadata arbitrary user-defined machine-readable data of this reserved address. Optional, max 4096 bytes.
|
||||
* @param addr hostname:port of the reserved address that was assigned at creation time
|
||||
* @param region reserve the address in this geographic ngrok datacenter. Optional, default is us. (au, eu, ap, us, jp, in, sa)
|
||||
* @param endpointConfiguration object reference to the endpoint configuration that will be applied to traffic to this address
|
||||
*/
|
||||
@JsonCreator
|
||||
public ReservedAddr(
|
||||
@@ -58,8 +54,7 @@ public class ReservedAddr {
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("addr") final String addr,
|
||||
@JsonProperty("region") final String region,
|
||||
@JsonProperty("endpoint_configuration") final Optional<Ref> endpointConfiguration
|
||||
@JsonProperty("region") final String region
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
@@ -68,7 +63,6 @@ public class ReservedAddr {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.addr = Objects.requireNonNull(addr, "addr is required");
|
||||
this.region = Objects.requireNonNull(region, "region is required");
|
||||
this.endpointConfiguration = endpointConfiguration != null ? endpointConfiguration : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,16 +130,6 @@ public class ReservedAddr {
|
||||
return this.region;
|
||||
}
|
||||
|
||||
/**
|
||||
* object reference to the endpoint configuration that will be applied to traffic
|
||||
* to this address
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getEndpointConfiguration() {
|
||||
return this.endpointConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -163,8 +147,7 @@ public class ReservedAddr {
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.addr.equals(other.addr)&&
|
||||
this.region.equals(other.region)&&
|
||||
this.endpointConfiguration.equals(other.endpointConfiguration);
|
||||
this.region.equals(other.region);
|
||||
|
||||
}
|
||||
|
||||
@@ -177,8 +160,7 @@ public class ReservedAddr {
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.addr,
|
||||
this.region,
|
||||
this.endpointConfiguration
|
||||
this.region
|
||||
);
|
||||
}
|
||||
|
||||
@@ -192,7 +174,6 @@ public class ReservedAddr {
|
||||
"', metadata='" + this.metadata +
|
||||
"', addr='" + this.addr +
|
||||
"', region='" + this.region +
|
||||
"', endpointConfiguration='" + this.endpointConfiguration.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,12 +37,6 @@ public class ReservedDomain {
|
||||
@JsonProperty("cname_target")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> cnameTarget;
|
||||
@JsonProperty("http_endpoint_configuration")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> httpEndpointConfiguration;
|
||||
@JsonProperty("https_endpoint_configuration")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> httpsEndpointConfiguration;
|
||||
@JsonProperty("certificate")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> certificate;
|
||||
@@ -67,8 +61,6 @@ public class ReservedDomain {
|
||||
* @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 httpEndpointConfiguration object referencing the endpoint configuration applied to http traffic on this domain
|
||||
* @param httpsEndpointConfiguration object referencing the endpoint configuration applied to https traffic on this domain
|
||||
* @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
|
||||
@@ -84,8 +76,6 @@ public class ReservedDomain {
|
||||
@JsonProperty("domain") final String domain,
|
||||
@JsonProperty("region") final String region,
|
||||
@JsonProperty("cname_target") final Optional<String> cnameTarget,
|
||||
@JsonProperty("http_endpoint_configuration") final Optional<Ref> httpEndpointConfiguration,
|
||||
@JsonProperty("https_endpoint_configuration") final Optional<Ref> httpsEndpointConfiguration,
|
||||
@JsonProperty("certificate") final Optional<Ref> certificate,
|
||||
@JsonProperty("certificate_management_policy") final Optional<ReservedDomainCertPolicy> certificateManagementPolicy,
|
||||
@JsonProperty("certificate_management_status") final Optional<ReservedDomainCertStatus> certificateManagementStatus,
|
||||
@@ -99,8 +89,6 @@ public class ReservedDomain {
|
||||
this.domain = Objects.requireNonNull(domain, "domain is required");
|
||||
this.region = Objects.requireNonNull(region, "region is required");
|
||||
this.cnameTarget = cnameTarget != null ? cnameTarget : Optional.empty();
|
||||
this.httpEndpointConfiguration = httpEndpointConfiguration != null ? httpEndpointConfiguration : Optional.empty();
|
||||
this.httpsEndpointConfiguration = httpsEndpointConfiguration != null ? httpsEndpointConfiguration : Optional.empty();
|
||||
this.certificate = certificate != null ? certificate : Optional.empty();
|
||||
this.certificateManagementPolicy = certificateManagementPolicy != null ? certificateManagementPolicy : Optional.empty();
|
||||
this.certificateManagementStatus = certificateManagementStatus != null ? certificateManagementStatus : Optional.empty();
|
||||
@@ -182,26 +170,6 @@ public class ReservedDomain {
|
||||
return this.cnameTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* object referencing the endpoint configuration applied to http traffic on this
|
||||
* domain
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getHttpEndpointConfiguration() {
|
||||
return this.httpEndpointConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* object referencing the endpoint configuration applied to https traffic on this
|
||||
* domain
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getHttpsEndpointConfiguration() {
|
||||
return this.httpsEndpointConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* object referencing the TLS certificate used for connections to this domain. This
|
||||
* can be either a user-uploaded certificate, the most recently issued automatic
|
||||
@@ -264,8 +232,6 @@ public class ReservedDomain {
|
||||
this.domain.equals(other.domain)&&
|
||||
this.region.equals(other.region)&&
|
||||
this.cnameTarget.equals(other.cnameTarget)&&
|
||||
this.httpEndpointConfiguration.equals(other.httpEndpointConfiguration)&&
|
||||
this.httpsEndpointConfiguration.equals(other.httpsEndpointConfiguration)&&
|
||||
this.certificate.equals(other.certificate)&&
|
||||
this.certificateManagementPolicy.equals(other.certificateManagementPolicy)&&
|
||||
this.certificateManagementStatus.equals(other.certificateManagementStatus)&&
|
||||
@@ -284,8 +250,6 @@ public class ReservedDomain {
|
||||
this.domain,
|
||||
this.region,
|
||||
this.cnameTarget,
|
||||
this.httpEndpointConfiguration,
|
||||
this.httpsEndpointConfiguration,
|
||||
this.certificate,
|
||||
this.certificateManagementPolicy,
|
||||
this.certificateManagementStatus,
|
||||
@@ -304,8 +268,6 @@ public class ReservedDomain {
|
||||
"', domain='" + this.domain +
|
||||
"', region='" + this.region +
|
||||
"', cnameTarget='" + this.cnameTarget.orElse("(null)") +
|
||||
"', httpEndpointConfiguration='" + this.httpEndpointConfiguration.map(Object::toString).orElse("(null)") +
|
||||
"', httpsEndpointConfiguration='" + this.httpsEndpointConfiguration.map(Object::toString).orElse("(null)") +
|
||||
"', certificate='" + this.certificate.map(Object::toString).orElse("(null)") +
|
||||
"', certificateManagementPolicy='" + this.certificateManagementPolicy.map(Object::toString).orElse("(null)") +
|
||||
"', certificateManagementStatus='" + this.certificateManagementStatus.map(Object::toString).orElse("(null)") +
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
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 TcpEdge} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TcpEdge {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("description")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@JsonProperty("hostports")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.util.List<String>> hostports;
|
||||
@JsonProperty("backend")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointBackend> backend;
|
||||
@JsonProperty("ip_restriction")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointIpPolicy> ipRestriction;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link TcpEdge}.
|
||||
*
|
||||
* @param id unique identifier of this edge
|
||||
* @param description human-readable description of what this edge will be used for; optional, max 255 bytes.
|
||||
* @param metadata arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
|
||||
* @param createdAt timestamp when the edge was created, RFC 3339 format
|
||||
* @param uri URI of the edge API resource
|
||||
* @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}
|
||||
*/
|
||||
@JsonCreator
|
||||
public TcpEdge(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@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
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.description = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.hostports = hostports != null ? hostports : Optional.empty();
|
||||
this.backend = backend != null ? backend : Optional.empty();
|
||||
this.ipRestriction = ipRestriction != null ? ipRestriction : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier of this edge
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the edge 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the edge API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<String>} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.util.List<String>> getHostports() {
|
||||
return this.hostports;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointBackend} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointBackend> getBackend() {
|
||||
return this.backend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>ipRestriction</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointIpPolicy} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointIpPolicy> getIpRestriction() {
|
||||
return this.ipRestriction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final TcpEdge other = (TcpEdge) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.hostports.equals(other.hostports)&&
|
||||
this.backend.equals(other.backend)&&
|
||||
this.ipRestriction.equals(other.ipRestriction);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.createdAt,
|
||||
this.uri,
|
||||
this.hostports,
|
||||
this.backend,
|
||||
this.ipRestriction
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TcpEdge{" +
|
||||
"id='" + this.id +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', uri='" + this.uri +
|
||||
"', hostports='" + this.hostports.map(Object::toString).orElse("(null)") +
|
||||
"', backend='" + this.backend.map(Object::toString).orElse("(null)") +
|
||||
"', ipRestriction='" + this.ipRestriction.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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 TcpEdgeList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TcpEdgeList implements Pageable {
|
||||
@JsonProperty("tcp_edges")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<TcpEdge> tcpEdges;
|
||||
@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 TcpEdgeList}.
|
||||
*
|
||||
* @param tcpEdges the list of all TCP Edges on this account
|
||||
* @param uri URI of the TCP Edge list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public TcpEdgeList(
|
||||
@JsonProperty("tcp_edges") final java.util.List<TcpEdge> tcpEdges,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.tcpEdges = Objects.requireNonNull(tcpEdges, "tcpEdges is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all TCP Edges on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<TcpEdge>}
|
||||
*/
|
||||
public java.util.List<TcpEdge> getTcpEdges() {
|
||||
return this.tcpEdges;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the TCP Edge 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 TcpEdgeList other = (TcpEdgeList) o;
|
||||
return
|
||||
this.tcpEdges.equals(other.tcpEdges)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.tcpEdges,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TcpEdgeList{" +
|
||||
"tcpEdges='" + this.tcpEdges +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
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 TlsEdge} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TlsEdge {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("description")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI uri;
|
||||
@JsonProperty("hostports")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.util.List<String>> hostports;
|
||||
@JsonProperty("backend")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointBackend> backend;
|
||||
@JsonProperty("ip_restriction")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointIpPolicy> ipRestriction;
|
||||
@JsonProperty("mutual_tls")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointMutualTls> mutualTls;
|
||||
@JsonProperty("tls_termination")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointTlsTermination> tlsTermination;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link TlsEdge}.
|
||||
*
|
||||
* @param id unique identifier of this edge
|
||||
* @param description human-readable description of what this edge will be used for; optional, max 255 bytes.
|
||||
* @param metadata arbitrary user-defined machine-readable data of this edge. Optional, max 4096 bytes.
|
||||
* @param createdAt timestamp when the edge configuration was created, RFC 3339 format
|
||||
* @param uri URI of the edge API resource
|
||||
* @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 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}
|
||||
*/
|
||||
@JsonCreator
|
||||
public TlsEdge(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@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("mutual_tls") final Optional<EndpointMutualTls> mutualTls,
|
||||
@JsonProperty("tls_termination") final Optional<EndpointTlsTermination> tlsTermination
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.description = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.hostports = hostports != null ? hostports : Optional.empty();
|
||||
this.backend = backend != null ? backend : Optional.empty();
|
||||
this.ipRestriction = ipRestriction != null ? ipRestriction : Optional.empty();
|
||||
this.mutualTls = mutualTls != null ? mutualTls : Optional.empty();
|
||||
this.tlsTermination = tlsTermination != null ? tlsTermination : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier of this edge
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the edge configuration 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the edge API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<String>} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.util.List<String>> getHostports() {
|
||||
return this.hostports;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointBackend} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointBackend> getBackend() {
|
||||
return this.backend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>ipRestriction</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointIpPolicy} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointIpPolicy> getIpRestriction() {
|
||||
return this.ipRestriction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>mutualTls</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointMutualTls} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointMutualTls> getMutualTls() {
|
||||
return this.mutualTls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>tlsTermination</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointTlsTermination} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointTlsTermination> getTlsTermination() {
|
||||
return this.tlsTermination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final TlsEdge other = (TlsEdge) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.hostports.equals(other.hostports)&&
|
||||
this.backend.equals(other.backend)&&
|
||||
this.ipRestriction.equals(other.ipRestriction)&&
|
||||
this.mutualTls.equals(other.mutualTls)&&
|
||||
this.tlsTermination.equals(other.tlsTermination);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.createdAt,
|
||||
this.uri,
|
||||
this.hostports,
|
||||
this.backend,
|
||||
this.ipRestriction,
|
||||
this.mutualTls,
|
||||
this.tlsTermination
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TlsEdge{" +
|
||||
"id='" + this.id +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', uri='" + this.uri +
|
||||
"', hostports='" + this.hostports.map(Object::toString).orElse("(null)") +
|
||||
"', backend='" + this.backend.map(Object::toString).orElse("(null)") +
|
||||
"', ipRestriction='" + this.ipRestriction.map(Object::toString).orElse("(null)") +
|
||||
"', mutualTls='" + this.mutualTls.map(Object::toString).orElse("(null)") +
|
||||
"', tlsTermination='" + this.tlsTermination.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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 TlsEdgeList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TlsEdgeList implements Pageable {
|
||||
@JsonProperty("tls_edges")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<TlsEdge> tlsEdges;
|
||||
@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 TlsEdgeList}.
|
||||
*
|
||||
* @param tlsEdges the list of all TLS Edges on this account
|
||||
* @param uri URI of the TLS Edge list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public TlsEdgeList(
|
||||
@JsonProperty("tls_edges") final java.util.List<TlsEdge> tlsEdges,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.tlsEdges = Objects.requireNonNull(tlsEdges, "tlsEdges is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all TLS Edges on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<TlsEdge>}
|
||||
*/
|
||||
public java.util.List<TlsEdge> getTlsEdges() {
|
||||
return this.tlsEdges;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the TLS Edge 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 TlsEdgeList other = (TlsEdgeList) o;
|
||||
return
|
||||
this.tlsEdges.equals(other.tlsEdges)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.tlsEdges,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TlsEdgeList{" +
|
||||
"tlsEdges='" + this.tlsEdges +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -34,17 +34,33 @@ public class Tunnel {
|
||||
@JsonProperty("tunnel_session")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Ref tunnelSession;
|
||||
@JsonProperty("endpoint")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> endpoint;
|
||||
@JsonProperty("labels")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.Map<String, String> labels;
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.util.List<Ref>> backends;
|
||||
@JsonProperty("forwards_to")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String forwardsTo;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link Tunnel}.
|
||||
*
|
||||
* @param id unique tunnel resource identifier
|
||||
* @param publicUrl URL of the tunnel's public endpoint
|
||||
* @param publicUrl URL of the ephemeral tunnel's public endpoint
|
||||
* @param startedAt timestamp when the tunnel was initiated in RFC 3339 format
|
||||
* @param metadata user-supplied metadata for the tunnel defined in the ngrok configuration file. See the tunnel <a href="https://ngrok.com/docs#tunnel-definitions-metadata">metadata configuration option</a> In API version 0, this value was instead pulled from the top-level <a href="https://ngrok.com/docs#config_metadata">metadata configuration option</a>.
|
||||
* @param proto tunnel protocol. one of <code>http</code>, <code>https</code>, <code>tcp</code> or <code>tls</code>
|
||||
* @param proto tunnel protocol for ephemeral tunnels. one of <code>http</code>, <code>https</code>, <code>tcp</code> or <code>tls</code>
|
||||
* @param region identifier of tune region where the tunnel is running
|
||||
* @param tunnelSession reference object pointing to the tunnel session on which this tunnel was started
|
||||
* @param endpoint the ephemeral endpoint this tunnel is associated with, if this is an agent-initiated tunnel
|
||||
* @param labels the labels the tunnel group backends will match against, if this is a backend tunnel
|
||||
* @param backends tunnel group backends served by this backend tunnel
|
||||
* @param forwardsTo upstream address the ngrok agent forwards traffic over this tunnel to. this may be expressed as a URL or a network address.
|
||||
*/
|
||||
@JsonCreator
|
||||
public Tunnel(
|
||||
@@ -54,7 +70,11 @@ public class Tunnel {
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("proto") final String proto,
|
||||
@JsonProperty("region") final String region,
|
||||
@JsonProperty("tunnel_session") final Ref tunnelSession
|
||||
@JsonProperty("tunnel_session") final Ref tunnelSession,
|
||||
@JsonProperty("endpoint") final Optional<Ref> endpoint,
|
||||
@JsonProperty("labels") final java.util.Map<String, String> labels,
|
||||
@JsonProperty("backends") final Optional<java.util.List<Ref>> backends,
|
||||
@JsonProperty("forwards_to") final String forwardsTo
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.publicUrl = Objects.requireNonNull(publicUrl, "publicUrl is required");
|
||||
@@ -63,6 +83,10 @@ public class Tunnel {
|
||||
this.proto = Objects.requireNonNull(proto, "proto is required");
|
||||
this.region = Objects.requireNonNull(region, "region is required");
|
||||
this.tunnelSession = Objects.requireNonNull(tunnelSession, "tunnelSession is required");
|
||||
this.endpoint = endpoint != null ? endpoint : Optional.empty();
|
||||
this.labels = Objects.requireNonNull(labels, "labels is required");
|
||||
this.backends = backends != null ? backends : Optional.empty();
|
||||
this.forwardsTo = Objects.requireNonNull(forwardsTo, "forwardsTo is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +99,7 @@ public class Tunnel {
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the tunnel's public endpoint
|
||||
* URL of the ephemeral tunnel's public endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
@@ -106,8 +130,8 @@ public class Tunnel {
|
||||
}
|
||||
|
||||
/**
|
||||
* tunnel protocol. one of <code>http</code>, <code>https</code>, <code>tcp</code>
|
||||
* or <code>tls</code>
|
||||
* tunnel protocol for ephemeral tunnels. one of <code>http</code>,
|
||||
* <code>https</code>, <code>tcp</code> or <code>tls</code>
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
@@ -133,6 +157,45 @@ public class Tunnel {
|
||||
return this.tunnelSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ephemeral endpoint this tunnel is associated with, if this is an
|
||||
* agent-initiated tunnel
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getEndpoint() {
|
||||
return this.endpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* the labels the tunnel group backends will match against, if this is a backend
|
||||
* tunnel
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.Map<String, String>}
|
||||
*/
|
||||
public java.util.Map<String, String> getLabels() {
|
||||
return this.labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* tunnel group backends served by this backend tunnel
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<Ref>} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<java.util.List<Ref>> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
/**
|
||||
* upstream address the ngrok agent forwards traffic over this tunnel to. this may
|
||||
* be expressed as a URL or a network address.
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getForwardsTo() {
|
||||
return this.forwardsTo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -150,7 +213,11 @@ public class Tunnel {
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.proto.equals(other.proto)&&
|
||||
this.region.equals(other.region)&&
|
||||
this.tunnelSession.equals(other.tunnelSession);
|
||||
this.tunnelSession.equals(other.tunnelSession)&&
|
||||
this.endpoint.equals(other.endpoint)&&
|
||||
this.labels.equals(other.labels)&&
|
||||
this.backends.equals(other.backends)&&
|
||||
this.forwardsTo.equals(other.forwardsTo);
|
||||
|
||||
}
|
||||
|
||||
@@ -163,7 +230,11 @@ public class Tunnel {
|
||||
this.metadata,
|
||||
this.proto,
|
||||
this.region,
|
||||
this.tunnelSession
|
||||
this.tunnelSession,
|
||||
this.endpoint,
|
||||
this.labels,
|
||||
this.backends,
|
||||
this.forwardsTo
|
||||
);
|
||||
}
|
||||
|
||||
@@ -177,6 +248,10 @@ public class Tunnel {
|
||||
"', proto='" + this.proto +
|
||||
"', region='" + this.region +
|
||||
"', tunnelSession='" + this.tunnelSession +
|
||||
"', endpoint='" + this.endpoint.map(Object::toString).orElse("(null)") +
|
||||
"', labels='" + this.labels +
|
||||
"', backends='" + this.backends.map(Object::toString).orElse("(null)") +
|
||||
"', forwardsTo='" + this.forwardsTo +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
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 TunnelGroupBackend} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TunnelGroupBackend {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String 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 String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("labels")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.Map<String, String> labels;
|
||||
@JsonProperty("tunnels")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<Ref> tunnels;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link TunnelGroupBackend}.
|
||||
*
|
||||
* @param id unique identifier for this TunnelGroup backend
|
||||
* @param uri URI of the TunnelGroupBackend 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 labels labels to watch for tunnels on, e.g. app->foo, dc->bar
|
||||
* @param tunnels tunnels matching this backend
|
||||
*/
|
||||
@JsonCreator
|
||||
public TunnelGroupBackend(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final String uri,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("labels") final java.util.Map<String, String> labels,
|
||||
@JsonProperty("tunnels") final java.util.List<Ref> tunnels
|
||||
) {
|
||||
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 = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.labels = Objects.requireNonNull(labels, "labels is required");
|
||||
this.tunnels = Objects.requireNonNull(tunnels, "tunnels is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier for this TunnelGroup backend
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the TunnelGroupBackend API resource
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String 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}
|
||||
*/
|
||||
public 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}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* labels to watch for tunnels on, e.g. app->foo, dc->bar
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.Map<String, String>}
|
||||
*/
|
||||
public java.util.Map<String, String> getLabels() {
|
||||
return this.labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* tunnels matching this backend
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<Ref>}
|
||||
*/
|
||||
public java.util.List<Ref> getTunnels() {
|
||||
return this.tunnels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final TunnelGroupBackend other = (TunnelGroupBackend) 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.labels.equals(other.labels)&&
|
||||
this.tunnels.equals(other.tunnels);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.createdAt,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.labels,
|
||||
this.tunnels
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TunnelGroupBackend{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', labels='" + this.labels +
|
||||
"', tunnels='" + this.tunnels +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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 TunnelGroupBackendList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TunnelGroupBackendList implements Pageable {
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<TunnelGroupBackend> 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 TunnelGroupBackendList}.
|
||||
*
|
||||
* @param backends the list of all TunnelGroup backends on this account
|
||||
* @param uri URI of the TunnelGroup backends list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public TunnelGroupBackendList(
|
||||
@JsonProperty("backends") final java.util.List<TunnelGroupBackend> backends,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all TunnelGroup backends on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<TunnelGroupBackend>}
|
||||
*/
|
||||
public java.util.List<TunnelGroupBackend> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the TunnelGroup 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 TunnelGroupBackendList other = (TunnelGroupBackendList) 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 "TunnelGroupBackendList{" +
|
||||
"backends='" + this.backends +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
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 WeightedBackend} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class WeightedBackend {
|
||||
@JsonProperty("id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String id;
|
||||
@JsonProperty("uri")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String 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 String description;
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String metadata;
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.Map<String, Long> backends;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link WeightedBackend}.
|
||||
*
|
||||
* @param id unique identifier for this Weighted backend
|
||||
* @param uri URI of the WeightedBackend 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 backends the ids of the child backends to their weights (0-10000)
|
||||
*/
|
||||
@JsonCreator
|
||||
public WeightedBackend(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final String uri,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("backends") final java.util.Map<String, Long> backends
|
||||
) {
|
||||
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 = Objects.requireNonNull(description, "description is required");
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* unique identifier for this Weighted backend
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the WeightedBackend API resource
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String 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}
|
||||
*/
|
||||
public 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}
|
||||
*/
|
||||
public String getMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends to their weights (0-10000)
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.Map<String, Long>}
|
||||
*/
|
||||
public java.util.Map<String, Long> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final WeightedBackend other = (WeightedBackend) 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.backends.equals(other.backends);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.createdAt,
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.backends
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WeightedBackend{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', description='" + this.description +
|
||||
"', metadata='" + this.metadata +
|
||||
"', backends='" + this.backends +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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 WeightedBackendList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class WeightedBackendList implements Pageable {
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<WeightedBackend> 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 WeightedBackendList}.
|
||||
*
|
||||
* @param backends the list of all Weighted backends on this account
|
||||
* @param uri URI of the Weighted backends list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public WeightedBackendList(
|
||||
@JsonProperty("backends") final java.util.List<WeightedBackend> backends,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* the list of all Weighted backends on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List<WeightedBackend>}
|
||||
*/
|
||||
public java.util.List<WeightedBackend> getBackends() {
|
||||
return this.backends;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the Weighted 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 WeightedBackendList other = (WeightedBackendList) 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 "WeightedBackendList{" +
|
||||
"backends='" + this.backends +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
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 EdgeRouteBackendModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-backend-module">https://ngrok.com/docs/api#api-edge-route-backend-module</a>.
|
||||
*/
|
||||
public class EdgeRouteBackendModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EdgeRouteBackendModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EdgeRouteBackendModule(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 EndpointBackendMutate module = null;
|
||||
|
||||
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 EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointBackendMutate module) {
|
||||
this.module = 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 EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointBackendMutate> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointBackend}
|
||||
*/
|
||||
public CompletionStage<EndpointBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/backend",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointBackend 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-backend-module-replace">https://ngrok.com/docs/api#api-edge-route-backend-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 EndpointBackend}
|
||||
*/
|
||||
public CompletionStage<EndpointBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/backend",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointBackend 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-backend-module-get">https://ngrok.com/docs/api#api-edge-route-backend-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 + "/backend",
|
||||
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-backend-module-delete">https://ngrok.com/docs/api#api-edge-route-backend-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
|
||||
);
|
||||
}
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointCircuitBreakerModule}.
|
||||
* An API client for {@link EdgeRouteCircuitBreakerModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module">https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module">https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module</a>.
|
||||
*/
|
||||
public class EndpointCircuitBreakerModule {
|
||||
public class EdgeRouteCircuitBreakerModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointCircuitBreakerModule.
|
||||
* Creates a new sub-client for EdgeRouteCircuitBreakerModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointCircuitBreakerModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteCircuitBreakerModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointCircuitBreakerModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointCircuitBreaker module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointCircuitBreakerModule {
|
||||
public CompletionStage<EndpointCircuitBreaker> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/circuit_breaker",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/circuit_breaker",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointCircuitBreakerModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module-replace">https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module-replace">https://ngrok.com/docs/api#api-edge-route-circuit-breaker-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointCircuitBreakerModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointCircuitBreakerModule {
|
||||
public CompletionStage<EndpointCircuitBreaker> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/circuit_breaker",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/circuit_breaker",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointCircuitBreaker.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointCircuitBreakerModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module-get">https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module-get">https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointCircuitBreakerModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointCircuitBreakerModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/circuit_breaker",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/circuit_breaker",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointCircuitBreakerModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module-delete">https://ngrok.com/docs/api#api-endpoint-circuit-breaker-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module-delete">https://ngrok.com/docs/api#api-edge-route-circuit-breaker-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointCompressionModule}.
|
||||
* An API client for {@link EdgeRouteCompressionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-compression-module">https://ngrok.com/docs/api#api-endpoint-compression-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-compression-module">https://ngrok.com/docs/api#api-edge-route-compression-module</a>.
|
||||
*/
|
||||
public class EndpointCompressionModule {
|
||||
public class EdgeRouteCompressionModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointCompressionModule.
|
||||
* Creates a new sub-client for EdgeRouteCompressionModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointCompressionModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteCompressionModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointCompressionModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointCompression module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointCompressionModule {
|
||||
public CompletionStage<EndpointCompression> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/compression",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/compression",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointCompressionModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-compression-module-replace">https://ngrok.com/docs/api#api-endpoint-compression-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-compression-module-replace">https://ngrok.com/docs/api#api-edge-route-compression-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointCompressionModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointCompressionModule {
|
||||
public CompletionStage<EndpointCompression> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/compression",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/compression",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointCompression.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointCompressionModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-compression-module-get">https://ngrok.com/docs/api#api-endpoint-compression-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-compression-module-get">https://ngrok.com/docs/api#api-edge-route-compression-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointCompressionModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointCompressionModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/compression",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/compression",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointCompressionModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-compression-module-delete">https://ngrok.com/docs/api#api-endpoint-compression-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-compression-module-delete">https://ngrok.com/docs/api#api-edge-route-compression-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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,246 @@
|
||||
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 EdgeRouteIpRestrictionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-ip-restriction-module">https://ngrok.com/docs/api#api-edge-route-ip-restriction-module</a>.
|
||||
*/
|
||||
public class EdgeRouteIpRestrictionModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EdgeRouteIpRestrictionModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EdgeRouteIpRestrictionModule(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 EndpointIpPolicyMutate module = null;
|
||||
|
||||
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 EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointIpPolicyMutate module) {
|
||||
this.module = 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 EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointIpPolicyMutate> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointIpPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointIpPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/ip_restriction",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointIpPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointIpPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointIpPolicy 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-ip-restriction-module-replace">https://ngrok.com/docs/api#api-edge-route-ip-restriction-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 EndpointIpPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointIpPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/ip_restriction",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointIpPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointIpPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointIpPolicy 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-ip-restriction-module-get">https://ngrok.com/docs/api#api-edge-route-ip-restriction-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 + "/ip_restriction",
|
||||
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-ip-restriction-module-delete">https://ngrok.com/docs/api#api-edge-route-ip-restriction-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
|
||||
);
|
||||
}
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointOAuthModule}.
|
||||
* An API client for {@link EdgeRouteOAuthModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-o-auth-module">https://ngrok.com/docs/api#api-endpoint-o-auth-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-o-auth-module">https://ngrok.com/docs/api#api-edge-route-o-auth-module</a>.
|
||||
*/
|
||||
public class EndpointOAuthModule {
|
||||
public class EdgeRouteOAuthModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointOAuthModule.
|
||||
* Creates a new sub-client for EdgeRouteOAuthModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointOAuthModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteOAuthModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointOAuthModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointOAuth module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointOAuthModule {
|
||||
public CompletionStage<EndpointOAuth> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/oauth",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/oauth",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointOAuthModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-o-auth-module-replace">https://ngrok.com/docs/api#api-endpoint-o-auth-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-o-auth-module-replace">https://ngrok.com/docs/api#api-edge-route-o-auth-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointOAuthModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointOAuthModule {
|
||||
public CompletionStage<EndpointOAuth> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/oauth",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/oauth",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointOAuth.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointOAuthModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-o-auth-module-get">https://ngrok.com/docs/api#api-endpoint-o-auth-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-o-auth-module-get">https://ngrok.com/docs/api#api-edge-route-o-auth-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointOAuthModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointOAuthModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/oauth",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/oauth",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointOAuthModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-o-auth-module-delete">https://ngrok.com/docs/api#api-endpoint-o-auth-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-o-auth-module-delete">https://ngrok.com/docs/api#api-edge-route-o-auth-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointOidcModule}.
|
||||
* An API client for {@link EdgeRouteOidcModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-oidc-module">https://ngrok.com/docs/api#api-endpoint-oidc-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-oidc-module">https://ngrok.com/docs/api#api-edge-route-oidc-module</a>.
|
||||
*/
|
||||
public class EndpointOidcModule {
|
||||
public class EdgeRouteOidcModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointOidcModule.
|
||||
* Creates a new sub-client for EdgeRouteOidcModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointOidcModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteOidcModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointOidcModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointOidc module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointOidcModule {
|
||||
public CompletionStage<EndpointOidc> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/oidc",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/oidc",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointOidcModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-oidc-module-replace">https://ngrok.com/docs/api#api-endpoint-oidc-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-oidc-module-replace">https://ngrok.com/docs/api#api-edge-route-oidc-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointOidcModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointOidcModule {
|
||||
public CompletionStage<EndpointOidc> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/oidc",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/oidc",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointOidc.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointOidcModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-oidc-module-get">https://ngrok.com/docs/api#api-endpoint-oidc-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-oidc-module-get">https://ngrok.com/docs/api#api-edge-route-oidc-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointOidcModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointOidcModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/oidc",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/oidc",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointOidcModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-oidc-module-delete">https://ngrok.com/docs/api#api-endpoint-oidc-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-oidc-module-delete">https://ngrok.com/docs/api#api-edge-route-oidc-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointRequestHeadersModule}.
|
||||
* An API client for {@link EdgeRouteRequestHeadersModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-request-headers-module">https://ngrok.com/docs/api#api-endpoint-request-headers-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-request-headers-module">https://ngrok.com/docs/api#api-edge-route-request-headers-module</a>.
|
||||
*/
|
||||
public class EndpointRequestHeadersModule {
|
||||
public class EdgeRouteRequestHeadersModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointRequestHeadersModule.
|
||||
* Creates a new sub-client for EdgeRouteRequestHeadersModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointRequestHeadersModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteRequestHeadersModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointRequestHeadersModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointRequestHeaders module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointRequestHeadersModule {
|
||||
public CompletionStage<EndpointRequestHeaders> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/request_headers",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/request_headers",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointRequestHeadersModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-request-headers-module-replace">https://ngrok.com/docs/api#api-endpoint-request-headers-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-request-headers-module-replace">https://ngrok.com/docs/api#api-edge-route-request-headers-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointRequestHeadersModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointRequestHeadersModule {
|
||||
public CompletionStage<EndpointRequestHeaders> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/request_headers",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/request_headers",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointRequestHeaders.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointRequestHeadersModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-request-headers-module-get">https://ngrok.com/docs/api#api-endpoint-request-headers-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-request-headers-module-get">https://ngrok.com/docs/api#api-edge-route-request-headers-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointRequestHeadersModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointRequestHeadersModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/request_headers",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/request_headers",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointRequestHeadersModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-request-headers-module-delete">https://ngrok.com/docs/api#api-endpoint-request-headers-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-request-headers-module-delete">https://ngrok.com/docs/api#api-edge-route-request-headers-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointResponseHeadersModule}.
|
||||
* An API client for {@link EdgeRouteResponseHeadersModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-response-headers-module">https://ngrok.com/docs/api#api-endpoint-response-headers-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-response-headers-module">https://ngrok.com/docs/api#api-edge-route-response-headers-module</a>.
|
||||
*/
|
||||
public class EndpointResponseHeadersModule {
|
||||
public class EdgeRouteResponseHeadersModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointResponseHeadersModule.
|
||||
* Creates a new sub-client for EdgeRouteResponseHeadersModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointResponseHeadersModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteResponseHeadersModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointResponseHeadersModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointResponseHeaders module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointResponseHeadersModule {
|
||||
public CompletionStage<EndpointResponseHeaders> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/response_headers",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/response_headers",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointResponseHeadersModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-response-headers-module-replace">https://ngrok.com/docs/api#api-endpoint-response-headers-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-response-headers-module-replace">https://ngrok.com/docs/api#api-edge-route-response-headers-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointResponseHeadersModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointResponseHeadersModule {
|
||||
public CompletionStage<EndpointResponseHeaders> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/response_headers",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/response_headers",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointResponseHeaders.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointResponseHeadersModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-response-headers-module-get">https://ngrok.com/docs/api#api-endpoint-response-headers-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-response-headers-module-get">https://ngrok.com/docs/api#api-edge-route-response-headers-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointResponseHeadersModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointResponseHeadersModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/response_headers",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/response_headers",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointResponseHeadersModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-response-headers-module-delete">https://ngrok.com/docs/api#api-endpoint-response-headers-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-response-headers-module-delete">https://ngrok.com/docs/api#api-edge-route-response-headers-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointSamlModule}.
|
||||
* An API client for {@link EdgeRouteSamlModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-saml-module">https://ngrok.com/docs/api#api-endpoint-saml-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-saml-module">https://ngrok.com/docs/api#api-edge-route-saml-module</a>.
|
||||
*/
|
||||
public class EndpointSamlModule {
|
||||
public class EdgeRouteSamlModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointSamlModule.
|
||||
* Creates a new sub-client for EdgeRouteSamlModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointSamlModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteSamlModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointSamlModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointSamlMutate module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointSamlModule {
|
||||
public CompletionStage<EndpointSaml> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/saml",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/saml",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointSamlModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-saml-module-replace">https://ngrok.com/docs/api#api-endpoint-saml-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-saml-module-replace">https://ngrok.com/docs/api#api-edge-route-saml-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointSamlModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointSamlModule {
|
||||
public CompletionStage<EndpointSaml> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/saml",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/saml",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointSaml.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointSamlModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-saml-module-get">https://ngrok.com/docs/api#api-endpoint-saml-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-saml-module-get">https://ngrok.com/docs/api#api-edge-route-saml-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointSamlModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointSamlModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/saml",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/saml",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointSamlModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-saml-module-delete">https://ngrok.com/docs/api#api-endpoint-saml-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-saml-module-delete">https://ngrok.com/docs/api#api-edge-route-saml-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
+31
-13
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointWebhookValidationModule}.
|
||||
* An API client for {@link EdgeRouteWebhookVerificationModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-webhook-validation-module">https://ngrok.com/docs/api#api-endpoint-webhook-validation-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-webhook-verification-module">https://ngrok.com/docs/api#api-edge-route-webhook-verification-module</a>.
|
||||
*/
|
||||
public class EndpointWebhookValidationModule {
|
||||
public class EdgeRouteWebhookVerificationModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointWebhookValidationModule.
|
||||
* Creates a new sub-client for EdgeRouteWebhookVerificationModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointWebhookValidationModule(final NgrokApiClient apiClient) {
|
||||
public EdgeRouteWebhookVerificationModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,12 +32,15 @@ public class EndpointWebhookValidationModule {
|
||||
* A builder object encapsulating state for an unsent Replace API call.
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String edgeId;
|
||||
private final String id;
|
||||
private EndpointWebhookValidation module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String edgeId,
|
||||
final String id
|
||||
) {
|
||||
this.edgeId = Objects.requireNonNull(edgeId, "edgeId is required");
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ public class EndpointWebhookValidationModule {
|
||||
public CompletionStage<EndpointWebhookValidation> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/webhook_validation",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/webhook_verification",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,15 +101,18 @@ public class EndpointWebhookValidationModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-webhook-validation-module-replace">https://ngrok.com/docs/api#api-endpoint-webhook-validation-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-webhook-verification-module-replace">https://ngrok.com/docs/api#api-edge-route-webhook-verification-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
|
||||
);
|
||||
}
|
||||
@@ -115,11 +121,14 @@ public class EndpointWebhookValidationModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ public class EndpointWebhookValidationModule {
|
||||
public CompletionStage<EndpointWebhookValidation> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/webhook_validation",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/webhook_verification",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointWebhookValidation.class)
|
||||
@@ -156,15 +165,18 @@ public class EndpointWebhookValidationModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-webhook-validation-module-get">https://ngrok.com/docs/api#api-endpoint-webhook-validation-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-webhook-verification-module-get">https://ngrok.com/docs/api#api-edge-route-webhook-verification-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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
|
||||
);
|
||||
}
|
||||
@@ -173,11 +185,14 @@ public class EndpointWebhookValidationModule {
|
||||
* 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");
|
||||
}
|
||||
|
||||
@@ -189,7 +204,7 @@ public class EndpointWebhookValidationModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/webhook_validation",
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/webhook_verification",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,15 +228,18 @@ public class EndpointWebhookValidationModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-webhook-validation-module-delete">https://ngrok.com/docs/api#api-endpoint-webhook-validation-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-webhook-verification-module-delete">https://ngrok.com/docs/api#api-edge-route-webhook-verification-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @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,246 @@
|
||||
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 EdgeRouteWebsocketTcpConverterModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edge-route-websocket-tcp-converter-module">https://ngrok.com/docs/api#api-edge-route-websocket-tcp-converter-module</a>.
|
||||
*/
|
||||
public class EdgeRouteWebsocketTcpConverterModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EdgeRouteWebsocketTcpConverterModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EdgeRouteWebsocketTcpConverterModule(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 EndpointWebsocketTcpConverter module = null;
|
||||
|
||||
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 EndpointWebsocketTcpConverter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointWebsocketTcpConverter module) {
|
||||
this.module = 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 EndpointWebsocketTcpConverter}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointWebsocketTcpConverter> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointWebsocketTcpConverter}
|
||||
*/
|
||||
public CompletionStage<EndpointWebsocketTcpConverter> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/websocket_tcp_converter",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointWebsocketTcpConverter.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointWebsocketTcpConverter}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointWebsocketTcpConverter 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-websocket-tcp-converter-module-replace">https://ngrok.com/docs/api#api-edge-route-websocket-tcp-converter-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 EndpointWebsocketTcpConverter}
|
||||
*/
|
||||
public CompletionStage<EndpointWebsocketTcpConverter> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/https/" + this.edgeId + "/routes/" + this.id + "/websocket_tcp_converter",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointWebsocketTcpConverter.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointWebsocketTcpConverter}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointWebsocketTcpConverter 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-websocket-tcp-converter-module-get">https://ngrok.com/docs/api#api-edge-route-websocket-tcp-converter-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 + "/websocket_tcp_converter",
|
||||
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-websocket-tcp-converter-module-delete">https://ngrok.com/docs/api#api-edge-route-websocket-tcp-converter-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
|
||||
);
|
||||
}
|
||||
}
|
||||
+204
-232
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EventStreams}.
|
||||
* An API client for {@link EdgesHttps}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-streams">https://ngrok.com/docs/api#api-event-streams</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https">https://ngrok.com/docs/api#api-edges-https</a>.
|
||||
*/
|
||||
public class EventStreams {
|
||||
public class EdgesHttps {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EventStreams.
|
||||
* Creates a new sub-client for EdgesHttps.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EventStreams(final NgrokApiClient apiClient) {
|
||||
public EdgesHttps(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -32,43 +32,19 @@ public class EventStreams {
|
||||
* A builder object encapsulating state for an unsent Create API call.
|
||||
*/
|
||||
public class CreateCallBuilder {
|
||||
private String metadata = "";
|
||||
private String description = "";
|
||||
private java.util.List<String> fields = java.util.Collections.emptyList();
|
||||
private String eventType = "";
|
||||
private java.util.List<String> destinationIds = java.util.Collections.emptyList();
|
||||
private double samplingRate = 0.0d;
|
||||
private String metadata = "";
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTerminationAtEdge> tlsTermination = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
|
||||
* 4096 bytes.
|
||||
*
|
||||
* @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 = Objects.requireNonNull(metadata, "metadata is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
|
||||
* 4096 bytes.
|
||||
*
|
||||
* @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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable description of the Event Stream. Optional, max 255 bytes.
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @param description the value of the description parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -79,7 +55,8 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable description of the Event Stream. Optional, max 255 bytes.
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @param description the value of the description parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -90,128 +67,123 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of protocol-specific fields you want to collect on each event.
|
||||
* arbitrary user-defined machine-readable data of this edge; optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @param fields the value of the fields parameter as a {@link java.util.List<String>}
|
||||
* @param metadata the value of the metadata parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder fields(final java.util.List<String> fields) {
|
||||
this.fields = Objects.requireNonNull(fields, "fields is required");
|
||||
public CreateCallBuilder metadata(final String metadata) {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of protocol-specific fields you want to collect on each event.
|
||||
* arbitrary user-defined machine-readable data of this edge; optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @param fields the value of the fields parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @param metadata the value of the metadata parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder fields(final Optional<java.util.List<String>> fields) {
|
||||
this.fields = Objects.requireNonNull(fields, "fields is required").orElse(java.util.Collections.emptyList());
|
||||
public CreateCallBuilder metadata(final Optional<String> metadata) {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The protocol that determines which events will be collected. Supported values
|
||||
* are <code>tcp_connection_closed</code> and <code>http_request_complete</code>.
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param eventType the value of the event_type parameter as a {@link String}
|
||||
* @param hostports the value of the hostports parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder eventType(final String eventType) {
|
||||
this.eventType = Objects.requireNonNull(eventType, "eventType is required");
|
||||
public CreateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Optional.ofNullable(hostports);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The protocol that determines which events will be collected. Supported values
|
||||
* are <code>tcp_connection_closed</code> and <code>http_request_complete</code>.
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param eventType the value of the event_type parameter as an {@link Optional} of {@link String}
|
||||
* @param hostports the value of the hostports parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder eventType(final Optional<String> eventType) {
|
||||
this.eventType = Objects.requireNonNull(eventType, "eventType is required").orElse("");
|
||||
public CreateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* edge modules
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as a {@link java.util.List<String>}
|
||||
* @param mutualTls the value of the mutual_tls parameter as a {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder destinationIds(final java.util.List<String> destinationIds) {
|
||||
this.destinationIds = Objects.requireNonNull(destinationIds, "destinationIds is required");
|
||||
public CreateCallBuilder mutualTls(final EndpointMutualTlsMutate mutualTls) {
|
||||
this.mutualTls = Optional.ofNullable(mutualTls);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* edge modules
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @param mutualTls the value of the mutual_tls parameter as an {@link Optional} of {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder destinationIds(final Optional<java.util.List<String>> destinationIds) {
|
||||
this.destinationIds = Objects.requireNonNull(destinationIds, "destinationIds is required").orElse(java.util.Collections.emptyList());
|
||||
public CreateCallBuilder mutualTls(final Optional<EndpointMutualTlsMutate> mutualTls) {
|
||||
this.mutualTls = Objects.requireNonNull(mutualTls, "mutualTls is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The percentage of all events you would like to capture. Valid values range from
|
||||
* 0.01, representing 1% of all events to 1.00, representing 100% of all events.
|
||||
* Sets the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param samplingRate the value of the sampling_rate parameter as a {@link double}
|
||||
* @param tlsTermination the value of the tls_termination parameter as a {@link EndpointTlsTerminationAtEdge}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder samplingRate(final double samplingRate) {
|
||||
this.samplingRate = Objects.requireNonNull(samplingRate, "samplingRate is required");
|
||||
public CreateCallBuilder tlsTermination(final EndpointTlsTerminationAtEdge tlsTermination) {
|
||||
this.tlsTermination = Optional.ofNullable(tlsTermination);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The percentage of all events you would like to capture. Valid values range from
|
||||
* 0.01, representing 1% of all events to 1.00, representing 100% of all events.
|
||||
* Sets (or unsets) the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param samplingRate the value of the sampling_rate parameter as an {@link Optional} of {@link double}
|
||||
* @param tlsTermination the value of the tls_termination parameter as an {@link Optional} of {@link EndpointTlsTerminationAtEdge}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder samplingRate(final Optional<Double> samplingRate) {
|
||||
this.samplingRate = Objects.requireNonNull(samplingRate, "samplingRate is required").orElse(0.0d);
|
||||
public CreateCallBuilder tlsTermination(final Optional<EndpointTlsTerminationAtEdge> tlsTermination) {
|
||||
this.tlsTermination = Objects.requireNonNull(tlsTermination, "tlsTermination is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EventStream}
|
||||
* @return a {@link CompletionStage} of {@link HttpsEdge}
|
||||
*/
|
||||
public CompletionStage<EventStream> call() {
|
||||
public CompletionStage<HttpsEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/event_streams",
|
||||
"/edges/https",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("fields", Optional.of(this.fields)),
|
||||
new AbstractMap.SimpleEntry<>("event_type", Optional.of(this.eventType)),
|
||||
new AbstractMap.SimpleEntry<>("destination_ids", Optional.of(this.destinationIds)),
|
||||
new AbstractMap.SimpleEntry<>("sampling_rate", Optional.of(this.samplingRate))
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("hostports", this.hostports.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("mutual_tls", this.mutualTls.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity()))
|
||||
),
|
||||
Optional.of(EventStream.class)
|
||||
Optional.of(HttpsEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EventStream}
|
||||
* @return {@link HttpsEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EventStream blockingCall() throws InterruptedException {
|
||||
public HttpsEdge blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
@@ -221,10 +193,9 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Event Stream. It will not apply to anything until you associate it
|
||||
* with one or more Endpoint Configs.
|
||||
* Create an HTTPS Edge
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-streams-create">https://ngrok.com/docs/api#api-event-streams-create</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https-create">https://ngrok.com/docs/api#api-edges-https-create</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
@@ -234,63 +205,6 @@ public class EventStreams {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,
|
||||
"/event_streams/" + 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 Event Stream. Associated Event Destinations will be preserved.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-streams-delete">https://ngrok.com/docs/api#api-event-streams-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.
|
||||
*/
|
||||
@@ -306,25 +220,25 @@ public class EventStreams {
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EventStream}
|
||||
* @return a {@link CompletionStage} of {@link HttpsEdge}
|
||||
*/
|
||||
public CompletionStage<EventStream> call() {
|
||||
public CompletionStage<HttpsEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/event_streams/" + this.id,
|
||||
"/edges/https/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EventStream.class)
|
||||
Optional.of(HttpsEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EventStream}
|
||||
* @return {@link HttpsEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EventStream blockingCall() throws InterruptedException {
|
||||
public HttpsEdge blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
@@ -334,9 +248,9 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get detailed information about an Event Stream by ID.
|
||||
* Get an HTTPS Edge by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-streams-get">https://ngrok.com/docs/api#api-event-streams-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https-get">https://ngrok.com/docs/api#api-edges-https-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
@@ -407,28 +321,28 @@ public class EventStreams {
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of a {@link Page} of {@link EventStreamList}
|
||||
* @return a {@link CompletionStage} of a {@link Page} of {@link HttpsEdgeList}
|
||||
*/
|
||||
public CompletionStage<Page<EventStreamList>> call() {
|
||||
public CompletionStage<Page<HttpsEdgeList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/event_streams",
|
||||
"/edges/https",
|
||||
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(EventStreamList.class)
|
||||
Optional.of(HttpsEdgeList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link EventStreamList}
|
||||
* @return a {@link Page} of {@link HttpsEdgeList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<EventStreamList> blockingCall() throws InterruptedException {
|
||||
public Page<HttpsEdgeList> blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
@@ -438,9 +352,9 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Event Streams available on this account.
|
||||
* Returns a list of all HTTPS Edges on this account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-streams-list">https://ngrok.com/docs/api#api-event-streams-list</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https-list">https://ngrok.com/docs/api#api-edges-https-list</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
@@ -455,11 +369,11 @@ public class EventStreams {
|
||||
*/
|
||||
public class UpdateCallBuilder {
|
||||
private final String id;
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<java.util.List<String>> fields = Optional.empty();
|
||||
private Optional<java.util.List<String>> destinationIds = Optional.empty();
|
||||
private Optional<Double> samplingRate = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTerminationAtEdge> tlsTermination = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
@@ -468,31 +382,8 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
|
||||
* 4096 bytes.
|
||||
*
|
||||
* @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.ofNullable(metadata);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
|
||||
* 4096 bytes.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable description of the Event Stream. Optional, max 255 bytes.
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @param description the value of the description parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -503,7 +394,8 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable description of the Event Stream. Optional, max 255 bytes.
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @param description the value of the description parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -514,103 +406,123 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of protocol-specific fields you want to collect on each event.
|
||||
* arbitrary user-defined machine-readable data of this edge; optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @param fields the value of the fields parameter as a {@link java.util.List<String>}
|
||||
* @param metadata the value of the metadata parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder fields(final java.util.List<String> fields) {
|
||||
this.fields = Optional.ofNullable(fields);
|
||||
public UpdateCallBuilder metadata(final String metadata) {
|
||||
this.metadata = Optional.ofNullable(metadata);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of protocol-specific fields you want to collect on each event.
|
||||
* arbitrary user-defined machine-readable data of this edge; optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @param fields the value of the fields parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @param metadata the value of the metadata parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder fields(final Optional<java.util.List<String>> fields) {
|
||||
this.fields = Objects.requireNonNull(fields, "fields is required");
|
||||
public UpdateCallBuilder metadata(final Optional<String> metadata) {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as a {@link java.util.List<String>}
|
||||
* @param hostports the value of the hostports parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder destinationIds(final java.util.List<String> destinationIds) {
|
||||
this.destinationIds = Optional.ofNullable(destinationIds);
|
||||
public UpdateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Optional.ofNullable(hostports);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @param hostports the value of the hostports parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder destinationIds(final Optional<java.util.List<String>> destinationIds) {
|
||||
this.destinationIds = Objects.requireNonNull(destinationIds, "destinationIds is required");
|
||||
public UpdateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The percentage of all events you would like to capture. Valid values range from
|
||||
* 0.01, representing 1% of all events to 1.00, representing 100% of all events.
|
||||
* edge modules
|
||||
*
|
||||
* @param samplingRate the value of the sampling_rate parameter as a {@link double}
|
||||
* @param mutualTls the value of the mutual_tls parameter as a {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder samplingRate(final double samplingRate) {
|
||||
this.samplingRate = Optional.ofNullable(samplingRate);
|
||||
public UpdateCallBuilder mutualTls(final EndpointMutualTlsMutate mutualTls) {
|
||||
this.mutualTls = Optional.ofNullable(mutualTls);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The percentage of all events you would like to capture. Valid values range from
|
||||
* 0.01, representing 1% of all events to 1.00, representing 100% of all events.
|
||||
* edge modules
|
||||
*
|
||||
* @param samplingRate the value of the sampling_rate parameter as an {@link Optional} of {@link double}
|
||||
* @param mutualTls the value of the mutual_tls parameter as an {@link Optional} of {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder samplingRate(final Optional<Double> samplingRate) {
|
||||
this.samplingRate = Objects.requireNonNull(samplingRate, "samplingRate is required");
|
||||
public UpdateCallBuilder mutualTls(final Optional<EndpointMutualTlsMutate> mutualTls) {
|
||||
this.mutualTls = Objects.requireNonNull(mutualTls, "mutualTls is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param tlsTermination the value of the tls_termination parameter as a {@link EndpointTlsTerminationAtEdge}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder tlsTermination(final EndpointTlsTerminationAtEdge tlsTermination) {
|
||||
this.tlsTermination = Optional.ofNullable(tlsTermination);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param tlsTermination the value of the tls_termination parameter as an {@link Optional} of {@link EndpointTlsTerminationAtEdge}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder tlsTermination(final Optional<EndpointTlsTerminationAtEdge> tlsTermination) {
|
||||
this.tlsTermination = Objects.requireNonNull(tlsTermination, "tlsTermination is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EventStream}
|
||||
* @return a {@link CompletionStage} of {@link HttpsEdge}
|
||||
*/
|
||||
public CompletionStage<EventStream> call() {
|
||||
public CompletionStage<HttpsEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/event_streams/" + this.id,
|
||||
"/edges/https/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("fields", this.fields.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("destination_ids", this.destinationIds.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("sampling_rate", this.samplingRate.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("hostports", this.hostports.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("mutual_tls", this.mutualTls.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity()))
|
||||
),
|
||||
Optional.of(EventStream.class)
|
||||
Optional.of(HttpsEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EventStream}
|
||||
* @return {@link HttpsEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EventStream blockingCall() throws InterruptedException {
|
||||
public HttpsEdge blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
@@ -620,11 +532,14 @@ public class EventStreams {
|
||||
}
|
||||
|
||||
/**
|
||||
* Update attributes of an Event Stream by ID.
|
||||
* Updates an HTTPS Edge by ID. If a module is not specified in the update, it will
|
||||
* not be modified. However, each module configuration that is specified will
|
||||
* completely replace the existing value. There is no way to delete an existing
|
||||
* module via this API, instead use the delete module API.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-streams-update">https://ngrok.com/docs/api#api-event-streams-update</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https-update">https://ngrok.com/docs/api#api-edges-https-update</a>.
|
||||
*
|
||||
* @param id Unique identifier for this Event Stream.
|
||||
* @param id unique identifier of this edge
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public UpdateCallBuilder update(
|
||||
@@ -634,4 +549,61 @@ public class EventStreams {
|
||||
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/https/" + 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 HTTPS Edge by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-https-delete">https://ngrok.com/docs/api#api-edges-https-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
|
||||
);
|
||||
}
|
||||
}
|
||||
+366
-456
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,609 @@
|
||||
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 EdgesTcp}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tcp">https://ngrok.com/docs/api#api-edges-tcp</a>.
|
||||
*/
|
||||
public class EdgesTcp {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EdgesTcp.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EdgesTcp(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 String description = "";
|
||||
private String metadata = "";
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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 = Objects.requireNonNull(description, "description is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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 = Objects.requireNonNull(metadata, "metadata is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Optional.ofNullable(hostports);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as a {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backend(final EndpointBackendMutate backend) {
|
||||
this.backend = Optional.ofNullable(backend);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as an {@link Optional} of {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backend(final Optional<EndpointBackendMutate> backend) {
|
||||
this.backend = Objects.requireNonNull(backend, "backend is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as a {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ipRestriction(final EndpointIpPolicyMutate ipRestriction) {
|
||||
this.ipRestriction = Optional.ofNullable(ipRestriction);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as an {@link Optional} of {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ipRestriction(final Optional<EndpointIpPolicyMutate> ipRestriction) {
|
||||
this.ipRestriction = Objects.requireNonNull(ipRestriction, "ipRestriction is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link TcpEdge}
|
||||
*/
|
||||
public CompletionStage<TcpEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/edges/tcp",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("hostports", this.hostports.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("backend", this.backend.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TcpEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TcpEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TcpEdge 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 TCP Edge
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tcp-create">https://ngrok.com/docs/api#api-edges-tcp-create</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public CreateCallBuilder create(
|
||||
) {
|
||||
return new CreateCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 TcpEdge}
|
||||
*/
|
||||
public CompletionStage<TcpEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tcp/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(TcpEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TcpEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TcpEdge 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 a TCP Edge by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tcp-get">https://ngrok.com/docs/api#api-edges-tcp-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.ofNullable(beforeId);
|
||||
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.ofNullable(limit);
|
||||
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 TcpEdgeList}
|
||||
*/
|
||||
public CompletionStage<Page<TcpEdgeList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tcp",
|
||||
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(TcpEdgeList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link TcpEdgeList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<TcpEdgeList> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all TCP Edges on this account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tcp-list">https://ngrok.com/docs/api#api-edges-tcp-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<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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.ofNullable(description);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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 edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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.ofNullable(metadata);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Optional.ofNullable(hostports);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as a {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backend(final EndpointBackendMutate backend) {
|
||||
this.backend = Optional.ofNullable(backend);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as an {@link Optional} of {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backend(final Optional<EndpointBackendMutate> backend) {
|
||||
this.backend = Objects.requireNonNull(backend, "backend is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as a {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder ipRestriction(final EndpointIpPolicyMutate ipRestriction) {
|
||||
this.ipRestriction = Optional.ofNullable(ipRestriction);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as an {@link Optional} of {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder ipRestriction(final Optional<EndpointIpPolicyMutate> ipRestriction) {
|
||||
this.ipRestriction = Objects.requireNonNull(ipRestriction, "ipRestriction is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link TcpEdge}
|
||||
*/
|
||||
public CompletionStage<TcpEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/edges/tcp/" + 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<>("hostports", this.hostports.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("backend", this.backend.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("ip_restriction", this.ipRestriction.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TcpEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TcpEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TcpEdge 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a TCP Edge by ID. If a module is not specified in the update, it will
|
||||
* not be modified. However, each module configuration that is specified will
|
||||
* completely replace the existing value. There is no way to delete an existing
|
||||
* module via this API, instead use the delete module API.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tcp-update">https://ngrok.com/docs/api#api-edges-tcp-update</a>.
|
||||
*
|
||||
* @param id unique identifier of this edge
|
||||
* @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,
|
||||
"/edges/tcp/" + 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 TCP Edge by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tcp-delete">https://ngrok.com/docs/api#api-edges-tcp-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,705 @@
|
||||
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 EdgesTls}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tls">https://ngrok.com/docs/api#api-edges-tls</a>.
|
||||
*/
|
||||
public class EdgesTls {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EdgesTls.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EdgesTls(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 String description = "";
|
||||
private String metadata = "";
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTermination> tlsTermination = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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 = Objects.requireNonNull(description, "description is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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 = Objects.requireNonNull(metadata, "metadata is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Optional.ofNullable(hostports);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as a {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backend(final EndpointBackendMutate backend) {
|
||||
this.backend = Optional.ofNullable(backend);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as an {@link Optional} of {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backend(final Optional<EndpointBackendMutate> backend) {
|
||||
this.backend = Objects.requireNonNull(backend, "backend is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as a {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ipRestriction(final EndpointIpPolicyMutate ipRestriction) {
|
||||
this.ipRestriction = Optional.ofNullable(ipRestriction);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as an {@link Optional} of {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ipRestriction(final Optional<EndpointIpPolicyMutate> ipRestriction) {
|
||||
this.ipRestriction = Objects.requireNonNull(ipRestriction, "ipRestriction is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>mutual_tls</code> parameter.
|
||||
*
|
||||
* @param mutualTls the value of the mutual_tls parameter as a {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder mutualTls(final EndpointMutualTlsMutate mutualTls) {
|
||||
this.mutualTls = Optional.ofNullable(mutualTls);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>mutual_tls</code> parameter.
|
||||
*
|
||||
* @param mutualTls the value of the mutual_tls parameter as an {@link Optional} of {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder mutualTls(final Optional<EndpointMutualTlsMutate> mutualTls) {
|
||||
this.mutualTls = Objects.requireNonNull(mutualTls, "mutualTls is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param tlsTermination the value of the tls_termination parameter as a {@link EndpointTlsTermination}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder tlsTermination(final EndpointTlsTermination tlsTermination) {
|
||||
this.tlsTermination = Optional.ofNullable(tlsTermination);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param tlsTermination the value of the tls_termination parameter as an {@link Optional} of {@link EndpointTlsTermination}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder tlsTermination(final Optional<EndpointTlsTermination> tlsTermination) {
|
||||
this.tlsTermination = Objects.requireNonNull(tlsTermination, "tlsTermination is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link TlsEdge}
|
||||
*/
|
||||
public CompletionStage<TlsEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/edges/tls",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("hostports", this.hostports.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<>("mutual_tls", this.mutualTls.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TlsEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TlsEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TlsEdge 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 TLS Edge
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tls-create">https://ngrok.com/docs/api#api-edges-tls-create</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public CreateCallBuilder create(
|
||||
) {
|
||||
return new CreateCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 TlsEdge}
|
||||
*/
|
||||
public CompletionStage<TlsEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tls/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(TlsEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TlsEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TlsEdge 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 a TLS Edge by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tls-get">https://ngrok.com/docs/api#api-edges-tls-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.ofNullable(beforeId);
|
||||
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.ofNullable(limit);
|
||||
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 TlsEdgeList}
|
||||
*/
|
||||
public CompletionStage<Page<TlsEdgeList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tls",
|
||||
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(TlsEdgeList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link TlsEdgeList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<TlsEdgeList> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all TLS Edges on this account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tls-list">https://ngrok.com/docs/api#api-edges-tls-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<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTermination> tlsTermination = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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.ofNullable(description);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* human-readable description of what this edge will be used for; optional, max 255
|
||||
* bytes.
|
||||
*
|
||||
* @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 edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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.ofNullable(metadata);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
|
||||
* bytes.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Optional.ofNullable(hostports);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostports served by this edge
|
||||
*
|
||||
* @param hostports the value of the hostports parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as a {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backend(final EndpointBackendMutate backend) {
|
||||
this.backend = Optional.ofNullable(backend);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge modules
|
||||
*
|
||||
* @param backend the value of the backend parameter as an {@link Optional} of {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backend(final Optional<EndpointBackendMutate> backend) {
|
||||
this.backend = Objects.requireNonNull(backend, "backend is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as a {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder ipRestriction(final EndpointIpPolicyMutate ipRestriction) {
|
||||
this.ipRestriction = Optional.ofNullable(ipRestriction);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>ip_restriction</code> parameter.
|
||||
*
|
||||
* @param ipRestriction the value of the ip_restriction parameter as an {@link Optional} of {@link EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder ipRestriction(final Optional<EndpointIpPolicyMutate> ipRestriction) {
|
||||
this.ipRestriction = Objects.requireNonNull(ipRestriction, "ipRestriction is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>mutual_tls</code> parameter.
|
||||
*
|
||||
* @param mutualTls the value of the mutual_tls parameter as a {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder mutualTls(final EndpointMutualTlsMutate mutualTls) {
|
||||
this.mutualTls = Optional.ofNullable(mutualTls);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>mutual_tls</code> parameter.
|
||||
*
|
||||
* @param mutualTls the value of the mutual_tls parameter as an {@link Optional} of {@link EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder mutualTls(final Optional<EndpointMutualTlsMutate> mutualTls) {
|
||||
this.mutualTls = Objects.requireNonNull(mutualTls, "mutualTls is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param tlsTermination the value of the tls_termination parameter as a {@link EndpointTlsTermination}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder tlsTermination(final EndpointTlsTermination tlsTermination) {
|
||||
this.tlsTermination = Optional.ofNullable(tlsTermination);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>tls_termination</code> parameter.
|
||||
*
|
||||
* @param tlsTermination the value of the tls_termination parameter as an {@link Optional} of {@link EndpointTlsTermination}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder tlsTermination(final Optional<EndpointTlsTermination> tlsTermination) {
|
||||
this.tlsTermination = Objects.requireNonNull(tlsTermination, "tlsTermination is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link TlsEdge}
|
||||
*/
|
||||
public CompletionStage<TlsEdge> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/edges/tls/" + 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<>("hostports", this.hostports.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<>("mutual_tls", this.mutualTls.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("tls_termination", this.tlsTermination.map(Function.identity()))
|
||||
),
|
||||
Optional.of(TlsEdge.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TlsEdge}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TlsEdge 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a TLS Edge by ID. If a module is not specified in the update, it will
|
||||
* not be modified. However, each module configuration that is specified will
|
||||
* completely replace the existing value. There is no way to delete an existing
|
||||
* module via this API, instead use the delete module API.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tls-update">https://ngrok.com/docs/api#api-edges-tls-update</a>.
|
||||
*
|
||||
* @param id unique identifier of this edge
|
||||
* @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,
|
||||
"/edges/tls/" + 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 TLS Edge by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-edges-tls-delete">https://ngrok.com/docs/api#api-edges-tls-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,191 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* Endpoints provides an API for querying the endpoint objects
|
||||
* which define what tunnel or edge is used to serve a hostport.
|
||||
* Only active endpoints associated with a tunnel or backend are returned.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoints">https://ngrok.com/docs/api#api-endpoints</a>.
|
||||
*/
|
||||
public class Endpoints {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for Endpoints.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public Endpoints(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.ofNullable(beforeId);
|
||||
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.ofNullable(limit);
|
||||
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 EndpointList}
|
||||
*/
|
||||
public CompletionStage<Page<EndpointList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoints",
|
||||
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(EndpointList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link EndpointList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<EndpointList> 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 active endpoints on the account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoints-list">https://ngrok.com/docs/api#api-endpoints-list</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ListCallBuilder list(
|
||||
) {
|
||||
return new ListCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 Endpoint}
|
||||
*/
|
||||
public CompletionStage<Endpoint> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoints/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the status of an endpoint by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoints-get">https://ngrok.com/docs/api#api-endpoints-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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -232,8 +232,7 @@ public class EventDestinations {
|
||||
|
||||
/**
|
||||
* Delete an Event Destination. If the Event Destination is still referenced by an
|
||||
* Event Stream, this will throw an error until that Event Stream has removed that
|
||||
* reference.
|
||||
* Event Subscription.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-destinations-delete">https://ngrok.com/docs/api#api-event-destinations-delete</a>.
|
||||
*
|
||||
|
||||
@@ -112,8 +112,8 @@ public class EventSubscriptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* A list of Event Destination IDs which should be used for this Event
|
||||
* Subscription.
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
@@ -124,8 +124,8 @@ public class EventSubscriptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* A list of Event Destination IDs which should be used for this Event
|
||||
* Subscription.
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
@@ -486,8 +486,8 @@ public class EventSubscriptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* A list of Event Destination IDs which should be used for this Event
|
||||
* Subscription.
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
@@ -498,8 +498,8 @@ public class EventSubscriptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Event Destination IDs which should be used for this Event Stream.
|
||||
* Event Streams are required to have at least one Event Destination.
|
||||
* A list of Event Destination IDs which should be used for this Event
|
||||
* Subscription.
|
||||
*
|
||||
* @param destinationIds the value of the destination_ids parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
|
||||
@@ -0,0 +1,505 @@
|
||||
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 Failover backend defines failover behavior within a list of referenced
|
||||
* backends. Traffic is sent to the first backend in the list. If that backend
|
||||
* is offline or no connection can be established, ngrok attempts to connect to
|
||||
* the next backend in the list until one is successful.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-failover-backends">https://ngrok.com/docs/api#api-failover-backends</a>.
|
||||
*/
|
||||
public class FailoverBackends {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for FailoverBackends.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public FailoverBackends(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 String description = "";
|
||||
private String metadata = "";
|
||||
private java.util.List<String> backends = java.util.Collections.emptyList();
|
||||
|
||||
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 = 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").orElse("");
|
||||
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 = 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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends in order
|
||||
*
|
||||
* @param backends the value of the backends parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backends(final java.util.List<String> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends in order
|
||||
*
|
||||
* @param backends the value of the backends parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backends(final Optional<java.util.List<String>> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link FailoverBackend}
|
||||
*/
|
||||
public CompletionStage<FailoverBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/backends/failover",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("backends", Optional.of(this.backends))
|
||||
),
|
||||
Optional.of(FailoverBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link FailoverBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public FailoverBackend 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 Failover backend
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-failover-backends-create">https://ngrok.com/docs/api#api-failover-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/failover/" + 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 Failover backend by ID. TODO what if used?
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-failover-backends-delete">https://ngrok.com/docs/api#api-failover-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 FailoverBackend}
|
||||
*/
|
||||
public CompletionStage<FailoverBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/failover/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(FailoverBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link FailoverBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public FailoverBackend 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 Failover backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-failover-backends-get">https://ngrok.com/docs/api#api-failover-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.ofNullable(beforeId);
|
||||
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.ofNullable(limit);
|
||||
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 FailoverBackendList}
|
||||
*/
|
||||
public CompletionStage<Page<FailoverBackendList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/failover",
|
||||
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(FailoverBackendList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link FailoverBackendList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<FailoverBackendList> 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 Failover backends on this account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-failover-backends-list">https://ngrok.com/docs/api#api-failover-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 java.util.List<String> backends = java.util.Collections.emptyList();
|
||||
|
||||
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.ofNullable(description);
|
||||
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.ofNullable(metadata);
|
||||
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 ids of the child backends in order
|
||||
*
|
||||
* @param backends the value of the backends parameter as a {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backends(final java.util.List<String> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends in order
|
||||
*
|
||||
* @param backends the value of the backends parameter as an {@link Optional} of {@link java.util.List<String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backends(final Optional<java.util.List<String>> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link FailoverBackend}
|
||||
*/
|
||||
public CompletionStage<FailoverBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/backends/failover/" + 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<>("backends", Optional.of(this.backends))
|
||||
),
|
||||
Optional.of(FailoverBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link FailoverBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public FailoverBackend 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 Failover backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-failover-backends-update">https://ngrok.com/docs/api#api-failover-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,598 @@
|
||||
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 HttpResponseBackends}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-http-response-backends">https://ngrok.com/docs/api#api-http-response-backends</a>.
|
||||
*/
|
||||
public class HttpResponseBackends {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for HttpResponseBackends.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public HttpResponseBackends(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 String description = "";
|
||||
private String metadata = "";
|
||||
private String body = "";
|
||||
private java.util.Map<String, String> headers = java.util.Collections.emptyMap();
|
||||
private Optional<Integer> statusCode = 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 = 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").orElse("");
|
||||
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 = 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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* body to return as fixed content
|
||||
*
|
||||
* @param body the value of the body parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder body(final String body) {
|
||||
this.body = Objects.requireNonNull(body, "body is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* body to return as fixed content
|
||||
*
|
||||
* @param body the value of the body parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder body(final Optional<String> body) {
|
||||
this.body = Objects.requireNonNull(body, "body is required").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* headers to return
|
||||
*
|
||||
* @param headers the value of the headers parameter as a {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder headers(final java.util.Map<String, String> headers) {
|
||||
this.headers = Objects.requireNonNull(headers, "headers is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* headers to return
|
||||
*
|
||||
* @param headers the value of the headers parameter as an {@link Optional} of {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder headers(final Optional<java.util.Map<String, String>> headers) {
|
||||
this.headers = Objects.requireNonNull(headers, "headers is required").orElse(java.util.Collections.emptyMap());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* status code to return
|
||||
*
|
||||
* @param statusCode the value of the status_code parameter as a {@link int}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder statusCode(final int statusCode) {
|
||||
this.statusCode = Optional.ofNullable(statusCode);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* status code to return
|
||||
*
|
||||
* @param statusCode the value of the status_code parameter as an {@link Optional} of {@link int}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder statusCode(final Optional<Integer> statusCode) {
|
||||
this.statusCode = Objects.requireNonNull(statusCode, "statusCode is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link HttpResponseBackend}
|
||||
*/
|
||||
public CompletionStage<HttpResponseBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/backends/http_response",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("body", Optional.of(this.body)),
|
||||
new AbstractMap.SimpleEntry<>("headers", Optional.of(this.headers)),
|
||||
new AbstractMap.SimpleEntry<>("status_code", this.statusCode.map(Function.identity()))
|
||||
),
|
||||
Optional.of(HttpResponseBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link HttpResponseBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public HttpResponseBackend 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 Create API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-http-response-backends-create">https://ngrok.com/docs/api#api-http-response-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/http_response/" + 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-http-response-backends-delete">https://ngrok.com/docs/api#api-http-response-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 HttpResponseBackend}
|
||||
*/
|
||||
public CompletionStage<HttpResponseBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/http_response/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(HttpResponseBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link HttpResponseBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public HttpResponseBackend 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-http-response-backends-get">https://ngrok.com/docs/api#api-http-response-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.ofNullable(beforeId);
|
||||
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.ofNullable(limit);
|
||||
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 HttpResponseBackendList}
|
||||
*/
|
||||
public CompletionStage<Page<HttpResponseBackendList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/http_response",
|
||||
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(HttpResponseBackendList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link HttpResponseBackendList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<HttpResponseBackendList> 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 List API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-http-response-backends-list">https://ngrok.com/docs/api#api-http-response-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> body = Optional.empty();
|
||||
private Optional<java.util.Map<String, String>> headers = Optional.empty();
|
||||
private Optional<Integer> statusCode = 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.ofNullable(description);
|
||||
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.ofNullable(metadata);
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* body to return as fixed content
|
||||
*
|
||||
* @param body the value of the body parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder body(final String body) {
|
||||
this.body = Optional.ofNullable(body);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* body to return as fixed content
|
||||
*
|
||||
* @param body the value of the body parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder body(final Optional<String> body) {
|
||||
this.body = Objects.requireNonNull(body, "body is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* headers to return
|
||||
*
|
||||
* @param headers the value of the headers parameter as a {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder headers(final java.util.Map<String, String> headers) {
|
||||
this.headers = Optional.ofNullable(headers);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* headers to return
|
||||
*
|
||||
* @param headers the value of the headers parameter as an {@link Optional} of {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder headers(final Optional<java.util.Map<String, String>> headers) {
|
||||
this.headers = Objects.requireNonNull(headers, "headers is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* status code to return
|
||||
*
|
||||
* @param statusCode the value of the status_code parameter as a {@link int}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder statusCode(final int statusCode) {
|
||||
this.statusCode = Optional.ofNullable(statusCode);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* status code to return
|
||||
*
|
||||
* @param statusCode the value of the status_code parameter as an {@link Optional} of {@link int}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder statusCode(final Optional<Integer> statusCode) {
|
||||
this.statusCode = Objects.requireNonNull(statusCode, "statusCode is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link HttpResponseBackend}
|
||||
*/
|
||||
public CompletionStage<HttpResponseBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/backends/http_response/" + 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<>("body", this.body.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("headers", this.headers.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("status_code", this.statusCode.map(Function.identity()))
|
||||
),
|
||||
Optional.of(HttpResponseBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link HttpResponseBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public HttpResponseBackend 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 Update API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-http-response-backends-update">https://ngrok.com/docs/api#api-http-response-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,228 @@
|
||||
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 HttpsEdgeMutualTlsModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-https-edge-mutual-tls-module">https://ngrok.com/docs/api#api-https-edge-mutual-tls-module</a>.
|
||||
*/
|
||||
public class HttpsEdgeMutualTlsModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for HttpsEdgeMutualTlsModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public HttpsEdgeMutualTlsModule(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 EndpointMutualTlsMutate module = null;
|
||||
|
||||
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 EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointMutualTlsMutate module) {
|
||||
this.module = 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 EndpointMutualTlsMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointMutualTlsMutate> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointMutualTls}
|
||||
*/
|
||||
public CompletionStage<EndpointMutualTls> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/https/" + this.id + "/mutual_tls",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointMutualTls.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointMutualTls}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointMutualTls 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-https-edge-mutual-tls-module-replace">https://ngrok.com/docs/api#api-https-edge-mutual-tls-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 EndpointMutualTls}
|
||||
*/
|
||||
public CompletionStage<EndpointMutualTls> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/https/" + this.id + "/mutual_tls",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointMutualTls.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointMutualTls}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointMutualTls 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-https-edge-mutual-tls-module-get">https://ngrok.com/docs/api#api-https-edge-mutual-tls-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/https/" + this.id + "/mutual_tls",
|
||||
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-https-edge-mutual-tls-module-delete">https://ngrok.com/docs/api#api-https-edge-mutual-tls-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,228 @@
|
||||
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 HttpsEdgeTlsTerminationModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-https-edge-tls-termination-module">https://ngrok.com/docs/api#api-https-edge-tls-termination-module</a>.
|
||||
*/
|
||||
public class HttpsEdgeTlsTerminationModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for HttpsEdgeTlsTerminationModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public HttpsEdgeTlsTerminationModule(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 EndpointTlsTerminationAtEdge module = null;
|
||||
|
||||
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 EndpointTlsTerminationAtEdge}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointTlsTerminationAtEdge module) {
|
||||
this.module = 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 EndpointTlsTerminationAtEdge}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointTlsTerminationAtEdge> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointTlsTermination}
|
||||
*/
|
||||
public CompletionStage<EndpointTlsTermination> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/https/" + this.id + "/tls_termination",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointTlsTermination.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointTlsTermination}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointTlsTermination 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-https-edge-tls-termination-module-replace">https://ngrok.com/docs/api#api-https-edge-tls-termination-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 EndpointTlsTermination}
|
||||
*/
|
||||
public CompletionStage<EndpointTlsTermination> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/https/" + this.id + "/tls_termination",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointTlsTermination.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointTlsTermination}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointTlsTermination 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-https-edge-tls-termination-module-get">https://ngrok.com/docs/api#api-https-edge-tls-termination-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/https/" + this.id + "/tls_termination",
|
||||
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-https-edge-tls-termination-module-delete">https://ngrok.com/docs/api#api-https-edge-tls-termination-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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -38,12 +38,9 @@ public class IpPolicies {
|
||||
public class CreateCallBuilder {
|
||||
private String description = "";
|
||||
private String metadata = "";
|
||||
private final String action;
|
||||
|
||||
private CreateCallBuilder(
|
||||
final String action
|
||||
) {
|
||||
this.action = Objects.requireNonNull(action, "action is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,8 +103,7 @@ public class IpPolicies {
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("action", Optional.of(this.action))
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata))
|
||||
),
|
||||
Optional.of(IpPolicy.class)
|
||||
);
|
||||
@@ -134,14 +130,11 @@ public class IpPolicies {
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-ip-policies-create">https://ngrok.com/docs/api#api-ip-policies-create</a>.
|
||||
*
|
||||
* @param action the IP policy action. Supported values are <code>allow</code> or <code>deny</code>
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public CreateCallBuilder create(
|
||||
final String action
|
||||
) {
|
||||
return new CreateCallBuilder(
|
||||
action
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ public class IpPolicyRules {
|
||||
private String metadata = "";
|
||||
private final String cidr;
|
||||
private final String ipPolicyId;
|
||||
private Optional<String> action = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
final String cidr,
|
||||
@@ -94,6 +95,30 @@ public class IpPolicyRules {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the action to apply to the policy rule, either <code>allow</code> or
|
||||
* <code>deny</code>
|
||||
*
|
||||
* @param action the value of the action parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder action(final String action) {
|
||||
this.action = Optional.ofNullable(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the action to apply to the policy rule, either <code>allow</code> or
|
||||
* <code>deny</code>
|
||||
*
|
||||
* @param action the value of the action parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder action(final Optional<String> action) {
|
||||
this.action = Objects.requireNonNull(action, "action is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -108,7 +133,8 @@ public class IpPolicyRules {
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("cidr", Optional.of(this.cidr)),
|
||||
new AbstractMap.SimpleEntry<>("ip_policy_id", Optional.of(this.ipPolicyId))
|
||||
new AbstractMap.SimpleEntry<>("ip_policy_id", Optional.of(this.ipPolicyId)),
|
||||
new AbstractMap.SimpleEntry<>("action", this.action.map(Function.identity()))
|
||||
),
|
||||
Optional.of(IpPolicyRule.class)
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An IP restriction is a restriction placed on the CIDRs that are allowed to
|
||||
* initate traffic to a specific aspect of your ngrok account. An IP
|
||||
* initiate traffic to a specific aspect of your ngrok account. An IP
|
||||
* restriction has a type which defines the ingress it applies to. IP
|
||||
* restrictions can be used to enforce the source IPs that can make API
|
||||
* requests, log in to the dashboard, start ngrok agents, and connect to your
|
||||
|
||||
@@ -37,7 +37,6 @@ public class ReservedAddrs {
|
||||
private String description = "";
|
||||
private String metadata = "";
|
||||
private String region = "";
|
||||
private Optional<String> endpointConfigurationId = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
@@ -113,30 +112,6 @@ public class ReservedAddrs {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type tcp that will be used to handle inbound
|
||||
* traffic to this address
|
||||
*
|
||||
* @param endpointConfigurationId the value of the endpoint_configuration_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder endpointConfigurationId(final String endpointConfigurationId) {
|
||||
this.endpointConfigurationId = Optional.ofNullable(endpointConfigurationId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type tcp that will be used to handle inbound
|
||||
* traffic to this address
|
||||
*
|
||||
* @param endpointConfigurationId the value of the endpoint_configuration_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder endpointConfigurationId(final Optional<String> endpointConfigurationId) {
|
||||
this.endpointConfigurationId = Objects.requireNonNull(endpointConfigurationId, "endpointConfigurationId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -150,8 +125,7 @@ public class ReservedAddrs {
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("region", Optional.of(this.region)),
|
||||
new AbstractMap.SimpleEntry<>("endpoint_configuration_id", this.endpointConfigurationId.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("region", Optional.of(this.region))
|
||||
),
|
||||
Optional.of(ReservedAddr.class)
|
||||
);
|
||||
@@ -408,7 +382,6 @@ public class ReservedAddrs {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> endpointConfigurationId = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
@@ -462,30 +435,6 @@ public class ReservedAddrs {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type tcp that will be used to handle inbound
|
||||
* traffic to this address
|
||||
*
|
||||
* @param endpointConfigurationId the value of the endpoint_configuration_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder endpointConfigurationId(final String endpointConfigurationId) {
|
||||
this.endpointConfigurationId = Optional.ofNullable(endpointConfigurationId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type tcp that will be used to handle inbound
|
||||
* traffic to this address
|
||||
*
|
||||
* @param endpointConfigurationId the value of the endpoint_configuration_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder endpointConfigurationId(final Optional<String> endpointConfigurationId) {
|
||||
this.endpointConfigurationId = Objects.requireNonNull(endpointConfigurationId, "endpointConfigurationId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -498,8 +447,7 @@ public class ReservedAddrs {
|
||||
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<>("endpoint_configuration_id", this.endpointConfigurationId.map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity()))
|
||||
),
|
||||
Optional.of(ReservedAddr.class)
|
||||
);
|
||||
@@ -535,61 +483,4 @@ public class ReservedAddrs {
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent DeleteEndpointConfig API call.
|
||||
*/
|
||||
public class DeleteEndpointConfigCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private DeleteEndpointConfigCallBuilder(
|
||||
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,
|
||||
"/reserved_addrs/" + this.id + "/endpoint_configuration",
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detach the endpoint configuration attached to a reserved address.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-reserved-addrs-delete-endpoint-config">https://ngrok.com/docs/api#api-reserved-addrs-delete-endpoint-config</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteEndpointConfigCallBuilder deleteEndpointConfig(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteEndpointConfigCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ public class ReservedDomains {
|
||||
private String region = "";
|
||||
private String description = "";
|
||||
private String metadata = "";
|
||||
private Optional<String> httpEndpointConfigurationId = Optional.empty();
|
||||
private Optional<String> httpsEndpointConfigurationId = Optional.empty();
|
||||
private Optional<String> certificateId = Optional.empty();
|
||||
private Optional<ReservedDomainCertPolicy> certificateManagementPolicy = Optional.empty();
|
||||
|
||||
@@ -120,54 +118,6 @@ public class ReservedDomains {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type http that will be used to handle inbound
|
||||
* http traffic to this domain
|
||||
*
|
||||
* @param httpEndpointConfigurationId the value of the http_endpoint_configuration_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder httpEndpointConfigurationId(final String httpEndpointConfigurationId) {
|
||||
this.httpEndpointConfigurationId = Optional.ofNullable(httpEndpointConfigurationId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type http that will be used to handle inbound
|
||||
* http traffic to this domain
|
||||
*
|
||||
* @param httpEndpointConfigurationId the value of the http_endpoint_configuration_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder httpEndpointConfigurationId(final Optional<String> httpEndpointConfigurationId) {
|
||||
this.httpEndpointConfigurationId = Objects.requireNonNull(httpEndpointConfigurationId, "httpEndpointConfigurationId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type https that will be used to handle
|
||||
* inbound https traffic to this domain
|
||||
*
|
||||
* @param httpsEndpointConfigurationId the value of the https_endpoint_configuration_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder httpsEndpointConfigurationId(final String httpsEndpointConfigurationId) {
|
||||
this.httpsEndpointConfigurationId = Optional.ofNullable(httpsEndpointConfigurationId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type https that will be used to handle
|
||||
* inbound https traffic to this domain
|
||||
*
|
||||
* @param httpsEndpointConfigurationId the value of the https_endpoint_configuration_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder httpsEndpointConfigurationId(final Optional<String> httpsEndpointConfigurationId) {
|
||||
this.httpsEndpointConfigurationId = Objects.requireNonNull(httpsEndpointConfigurationId, "httpsEndpointConfigurationId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a user-uploaded TLS certificate to use for connections to targeting this
|
||||
* domain. Optional, mutually exclusive with
|
||||
@@ -235,8 +185,6 @@ public class ReservedDomains {
|
||||
new AbstractMap.SimpleEntry<>("region", Optional.of(this.region)),
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("http_endpoint_configuration_id", this.httpEndpointConfigurationId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("https_endpoint_configuration_id", this.httpsEndpointConfigurationId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("certificate_id", this.certificateId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("certificate_management_policy", this.certificateManagementPolicy.map(Function.identity()))
|
||||
),
|
||||
@@ -498,8 +446,6 @@ public class ReservedDomains {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> httpEndpointConfigurationId = Optional.empty();
|
||||
private Optional<String> httpsEndpointConfigurationId = Optional.empty();
|
||||
private Optional<String> certificateId = Optional.empty();
|
||||
private Optional<ReservedDomainCertPolicy> certificateManagementPolicy = Optional.empty();
|
||||
|
||||
@@ -555,54 +501,6 @@ public class ReservedDomains {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type http that will be used to handle inbound
|
||||
* http traffic to this domain
|
||||
*
|
||||
* @param httpEndpointConfigurationId the value of the http_endpoint_configuration_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder httpEndpointConfigurationId(final String httpEndpointConfigurationId) {
|
||||
this.httpEndpointConfigurationId = Optional.ofNullable(httpEndpointConfigurationId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type http that will be used to handle inbound
|
||||
* http traffic to this domain
|
||||
*
|
||||
* @param httpEndpointConfigurationId the value of the http_endpoint_configuration_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder httpEndpointConfigurationId(final Optional<String> httpEndpointConfigurationId) {
|
||||
this.httpEndpointConfigurationId = Objects.requireNonNull(httpEndpointConfigurationId, "httpEndpointConfigurationId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type https that will be used to handle
|
||||
* inbound https traffic to this domain
|
||||
*
|
||||
* @param httpsEndpointConfigurationId the value of the https_endpoint_configuration_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder httpsEndpointConfigurationId(final String httpsEndpointConfigurationId) {
|
||||
this.httpsEndpointConfigurationId = Optional.ofNullable(httpsEndpointConfigurationId);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of an endpoint configuration of type https that will be used to handle
|
||||
* inbound https traffic to this domain
|
||||
*
|
||||
* @param httpsEndpointConfigurationId the value of the https_endpoint_configuration_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder httpsEndpointConfigurationId(final Optional<String> httpsEndpointConfigurationId) {
|
||||
this.httpsEndpointConfigurationId = Objects.requireNonNull(httpsEndpointConfigurationId, "httpsEndpointConfigurationId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a user-uploaded TLS certificate to use for connections to targeting this
|
||||
* domain. Optional, mutually exclusive with
|
||||
@@ -668,8 +566,6 @@ public class ReservedDomains {
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("http_endpoint_configuration_id", this.httpEndpointConfigurationId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("https_endpoint_configuration_id", this.httpsEndpointConfigurationId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("certificate_id", this.certificateId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("certificate_management_policy", this.certificateManagementPolicy.map(Function.identity()))
|
||||
),
|
||||
@@ -821,118 +717,4 @@ public class ReservedDomains {
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent DeleteHttpEndpointConfig API call.
|
||||
*/
|
||||
public class DeleteHttpEndpointConfigCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private DeleteHttpEndpointConfigCallBuilder(
|
||||
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,
|
||||
"/reserved_domains/" + this.id + "/http_endpoint_configuration",
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detach the http endpoint configuration attached to a reserved domain.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config">https://ngrok.com/docs/api#api-reserved-domains-delete-http-endpoint-config</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteHttpEndpointConfigCallBuilder deleteHttpEndpointConfig(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteHttpEndpointConfigCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent DeleteHttpsEndpointConfig API call.
|
||||
*/
|
||||
public class DeleteHttpsEndpointConfigCallBuilder {
|
||||
private final String id;
|
||||
|
||||
private DeleteHttpsEndpointConfigCallBuilder(
|
||||
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,
|
||||
"/reserved_domains/" + this.id + "/https_endpoint_configuration",
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detach the https endpoint configuration attached to a reserved domain.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config">https://ngrok.com/docs/api#api-reserved-domains-delete-https-endpoint-config</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteHttpsEndpointConfigCallBuilder deleteHttpsEndpointConfig(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteHttpsEndpointConfigCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+26
-26
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointLoggingModule}.
|
||||
* An API client for {@link TcpEdgeBackendModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-logging-module">https://ngrok.com/docs/api#api-endpoint-logging-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-backend-module">https://ngrok.com/docs/api#api-tcp-edge-backend-module</a>.
|
||||
*/
|
||||
public class EndpointLoggingModule {
|
||||
public class TcpEdgeBackendModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointLoggingModule.
|
||||
* Creates a new sub-client for TcpEdgeBackendModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointLoggingModule(final NgrokApiClient apiClient) {
|
||||
public TcpEdgeBackendModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class EndpointLoggingModule {
|
||||
*/
|
||||
public class ReplaceCallBuilder {
|
||||
private final String id;
|
||||
private EndpointLoggingMutate module = null;
|
||||
private EndpointBackendMutate module = null;
|
||||
|
||||
private ReplaceCallBuilder(
|
||||
final String id
|
||||
@@ -44,10 +44,10 @@ public class EndpointLoggingModule {
|
||||
/**
|
||||
* Sets the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as a {@link EndpointLoggingMutate}
|
||||
* @param module the value of the module parameter as a {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointLoggingMutate module) {
|
||||
public ReplaceCallBuilder module(final EndpointBackendMutate module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required");
|
||||
return this;
|
||||
}
|
||||
@@ -55,10 +55,10 @@ public class EndpointLoggingModule {
|
||||
/**
|
||||
* Sets (or unsets) the <code>module</code> parameter.
|
||||
*
|
||||
* @param module the value of the module parameter as an {@link Optional} of {@link EndpointLoggingMutate}
|
||||
* @param module the value of the module parameter as an {@link Optional} of {@link EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointLoggingMutate> module) {
|
||||
public ReplaceCallBuilder module(final Optional<EndpointBackendMutate> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
@@ -66,27 +66,27 @@ public class EndpointLoggingModule {
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointLogging}
|
||||
* @return a {@link CompletionStage} of {@link EndpointBackend}
|
||||
*/
|
||||
public CompletionStage<EndpointLogging> call() {
|
||||
public CompletionStage<EndpointBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/logging",
|
||||
"/edges/tcp/" + this.id + "/backend",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointLogging.class)
|
||||
Optional.of(EndpointBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointLogging}
|
||||
* @return {@link EndpointBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointLogging blockingCall() throws InterruptedException {
|
||||
public EndpointBackend blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
@@ -98,7 +98,7 @@ public class EndpointLoggingModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-logging-module-replace">https://ngrok.com/docs/api#api-endpoint-logging-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-backend-module-replace">https://ngrok.com/docs/api#api-tcp-edge-backend-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
|
||||
@@ -126,25 +126,25 @@ public class EndpointLoggingModule {
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointLogging}
|
||||
* @return a {@link CompletionStage} of {@link EndpointBackend}
|
||||
*/
|
||||
public CompletionStage<EndpointLogging> call() {
|
||||
public CompletionStage<EndpointBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/logging",
|
||||
"/edges/tcp/" + this.id + "/backend",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointLogging.class)
|
||||
Optional.of(EndpointBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointLogging}
|
||||
* @return {@link EndpointBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointLogging blockingCall() throws InterruptedException {
|
||||
public EndpointBackend blockingCall() throws InterruptedException {
|
||||
try {
|
||||
return call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
@@ -156,7 +156,7 @@ public class EndpointLoggingModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-logging-module-get">https://ngrok.com/docs/api#api-endpoint-logging-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-backend-module-get">https://ngrok.com/docs/api#api-tcp-edge-backend-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
@@ -189,7 +189,7 @@ public class EndpointLoggingModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/logging",
|
||||
"/edges/tcp/" + this.id + "/backend",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,7 +213,7 @@ public class EndpointLoggingModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-logging-module-delete">https://ngrok.com/docs/api#api-endpoint-logging-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-backend-module-delete">https://ngrok.com/docs/api#api-tcp-edge-backend-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
+11
-11
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointIpPolicyModule}.
|
||||
* An API client for {@link TcpEdgeIpRestrictionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-ip-policy-module">https://ngrok.com/docs/api#api-endpoint-ip-policy-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module">https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module</a>.
|
||||
*/
|
||||
public class EndpointIpPolicyModule {
|
||||
public class TcpEdgeIpRestrictionModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointIpPolicyModule.
|
||||
* Creates a new sub-client for TcpEdgeIpRestrictionModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointIpPolicyModule(final NgrokApiClient apiClient) {
|
||||
public TcpEdgeIpRestrictionModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class EndpointIpPolicyModule {
|
||||
public CompletionStage<EndpointIpPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/ip_policy",
|
||||
"/edges/tcp/" + this.id + "/ip_restriction",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,7 +98,7 @@ public class EndpointIpPolicyModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-ip-policy-module-replace">https://ngrok.com/docs/api#api-endpoint-ip-policy-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module-replace">https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-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
|
||||
@@ -131,7 +131,7 @@ public class EndpointIpPolicyModule {
|
||||
public CompletionStage<EndpointIpPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/ip_policy",
|
||||
"/edges/tcp/" + this.id + "/ip_restriction",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointIpPolicy.class)
|
||||
@@ -156,7 +156,7 @@ public class EndpointIpPolicyModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-ip-policy-module-get">https://ngrok.com/docs/api#api-endpoint-ip-policy-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module-get">https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
@@ -189,7 +189,7 @@ public class EndpointIpPolicyModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/ip_policy",
|
||||
"/edges/tcp/" + this.id + "/ip_restriction",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,7 +213,7 @@ public class EndpointIpPolicyModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-ip-policy-module-delete">https://ngrok.com/docs/api#api-endpoint-ip-policy-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module-delete">https://ngrok.com/docs/api#api-tcp-edge-ip-restriction-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
@@ -0,0 +1,228 @@
|
||||
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 TlsEdgeBackendModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-backend-module">https://ngrok.com/docs/api#api-tls-edge-backend-module</a>.
|
||||
*/
|
||||
public class TlsEdgeBackendModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for TlsEdgeBackendModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public TlsEdgeBackendModule(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 EndpointBackendMutate module = null;
|
||||
|
||||
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 EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointBackendMutate module) {
|
||||
this.module = 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 EndpointBackendMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointBackendMutate> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointBackend}
|
||||
*/
|
||||
public CompletionStage<EndpointBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/tls/" + this.id + "/backend",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointBackend 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-backend-module-replace">https://ngrok.com/docs/api#api-tls-edge-backend-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 EndpointBackend}
|
||||
*/
|
||||
public CompletionStage<EndpointBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tls/" + this.id + "/backend",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointBackend 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-backend-module-get">https://ngrok.com/docs/api#api-tls-edge-backend-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 + "/backend",
|
||||
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-backend-module-delete">https://ngrok.com/docs/api#api-tls-edge-backend-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,228 @@
|
||||
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 TlsEdgeIpRestrictionModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-ip-restriction-module">https://ngrok.com/docs/api#api-tls-edge-ip-restriction-module</a>.
|
||||
*/
|
||||
public class TlsEdgeIpRestrictionModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for TlsEdgeIpRestrictionModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public TlsEdgeIpRestrictionModule(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 EndpointIpPolicyMutate module = null;
|
||||
|
||||
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 EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final EndpointIpPolicyMutate module) {
|
||||
this.module = 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 EndpointIpPolicyMutate}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ReplaceCallBuilder module(final Optional<EndpointIpPolicyMutate> module) {
|
||||
this.module = Objects.requireNonNull(module, "module is required").orElse(null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link EndpointIpPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointIpPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/edges/tls/" + this.id + "/ip_restriction",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
),
|
||||
Optional.of(EndpointIpPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointIpPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointIpPolicy 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-ip-restriction-module-replace">https://ngrok.com/docs/api#api-tls-edge-ip-restriction-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 EndpointIpPolicy}
|
||||
*/
|
||||
public CompletionStage<EndpointIpPolicy> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/edges/tls/" + this.id + "/ip_restriction",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointIpPolicy.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link EndpointIpPolicy}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public EndpointIpPolicy 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-ip-restriction-module-get">https://ngrok.com/docs/api#api-tls-edge-ip-restriction-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 + "/ip_restriction",
|
||||
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-ip-restriction-module-delete">https://ngrok.com/docs/api#api-tls-edge-ip-restriction-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
|
||||
);
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointMutualTlsModule}.
|
||||
* An API client for {@link TlsEdgeMutualTlsModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-mutual-tls-module">https://ngrok.com/docs/api#api-endpoint-mutual-tls-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module">https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module</a>.
|
||||
*/
|
||||
public class EndpointMutualTlsModule {
|
||||
public class TlsEdgeMutualTlsModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointMutualTlsModule.
|
||||
* Creates a new sub-client for TlsEdgeMutualTlsModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointMutualTlsModule(final NgrokApiClient apiClient) {
|
||||
public TlsEdgeMutualTlsModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class EndpointMutualTlsModule {
|
||||
public CompletionStage<EndpointMutualTls> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/mutual_tls",
|
||||
"/edges/tls/" + this.id + "/mutual_tls",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,7 +98,7 @@ public class EndpointMutualTlsModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-mutual-tls-module-replace">https://ngrok.com/docs/api#api-endpoint-mutual-tls-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module-replace">https://ngrok.com/docs/api#api-tls-edge-mutual-tls-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
|
||||
@@ -131,7 +131,7 @@ public class EndpointMutualTlsModule {
|
||||
public CompletionStage<EndpointMutualTls> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/mutual_tls",
|
||||
"/edges/tls/" + this.id + "/mutual_tls",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointMutualTls.class)
|
||||
@@ -156,7 +156,7 @@ public class EndpointMutualTlsModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-mutual-tls-module-get">https://ngrok.com/docs/api#api-endpoint-mutual-tls-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module-get">https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
@@ -189,7 +189,7 @@ public class EndpointMutualTlsModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/mutual_tls",
|
||||
"/edges/tls/" + this.id + "/mutual_tls",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,7 +213,7 @@ public class EndpointMutualTlsModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-mutual-tls-module-delete">https://ngrok.com/docs/api#api-endpoint-mutual-tls-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module-delete">https://ngrok.com/docs/api#api-tls-edge-mutual-tls-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
+11
-11
@@ -12,19 +12,19 @@ import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* An API client for {@link EndpointTlsTerminationModule}.
|
||||
* An API client for {@link TlsEdgeTlsTerminationModule}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-tls-termination-module">https://ngrok.com/docs/api#api-endpoint-tls-termination-module</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-tls-termination-module">https://ngrok.com/docs/api#api-tls-edge-tls-termination-module</a>.
|
||||
*/
|
||||
public class EndpointTlsTerminationModule {
|
||||
public class TlsEdgeTlsTerminationModule {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for EndpointTlsTerminationModule.
|
||||
* Creates a new sub-client for TlsEdgeTlsTerminationModule.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public EndpointTlsTerminationModule(final NgrokApiClient apiClient) {
|
||||
public TlsEdgeTlsTerminationModule(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class EndpointTlsTerminationModule {
|
||||
public CompletionStage<EndpointTlsTermination> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PUT,
|
||||
"/endpoint_configurations/" + this.id + "/tls_termination",
|
||||
"/edges/tls/" + this.id + "/tls_termination",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("module", Optional.of(this.module))
|
||||
@@ -98,7 +98,7 @@ public class EndpointTlsTerminationModule {
|
||||
/**
|
||||
* Creates a call builder for the Replace API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-tls-termination-module-replace">https://ngrok.com/docs/api#api-endpoint-tls-termination-module-replace</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-tls-termination-module-replace">https://ngrok.com/docs/api#api-tls-edge-tls-termination-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
|
||||
@@ -131,7 +131,7 @@ public class EndpointTlsTerminationModule {
|
||||
public CompletionStage<EndpointTlsTermination> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/endpoint_configurations/" + this.id + "/tls_termination",
|
||||
"/edges/tls/" + this.id + "/tls_termination",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(EndpointTlsTermination.class)
|
||||
@@ -156,7 +156,7 @@ public class EndpointTlsTerminationModule {
|
||||
/**
|
||||
* Creates a call builder for the Get API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-tls-termination-module-get">https://ngrok.com/docs/api#api-endpoint-tls-termination-module-get</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-tls-termination-module-get">https://ngrok.com/docs/api#api-tls-edge-tls-termination-module-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
@@ -189,7 +189,7 @@ public class EndpointTlsTerminationModule {
|
||||
public CompletionStage<Void> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.DELETE,
|
||||
"/endpoint_configurations/" + this.id + "/tls_termination",
|
||||
"/edges/tls/" + this.id + "/tls_termination",
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
@@ -213,7 +213,7 @@ public class EndpointTlsTerminationModule {
|
||||
/**
|
||||
* Creates a call builder for the Delete API operation.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-endpoint-tls-termination-module-delete">https://ngrok.com/docs/api#api-endpoint-tls-termination-module-delete</a>.
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tls-edge-tls-termination-module-delete">https://ngrok.com/docs/api#api-tls-edge-tls-termination-module-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
@@ -0,0 +1,503 @@
|
||||
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 Tunnel Group Backend balances traffic among all online tunnels that match
|
||||
* a label selector.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnel-group-backends">https://ngrok.com/docs/api#api-tunnel-group-backends</a>.
|
||||
*/
|
||||
public class TunnelGroupBackends {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for TunnelGroupBackends.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public TunnelGroupBackends(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 String description = "";
|
||||
private String metadata = "";
|
||||
private java.util.Map<String, String> labels = java.util.Collections.emptyMap();
|
||||
|
||||
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 = 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").orElse("");
|
||||
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 = 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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* labels to watch for tunnels on, e.g. app->foo, dc->bar
|
||||
*
|
||||
* @param labels the value of the labels parameter as a {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder labels(final java.util.Map<String, String> labels) {
|
||||
this.labels = Objects.requireNonNull(labels, "labels is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* labels to watch for tunnels on, e.g. app->foo, dc->bar
|
||||
*
|
||||
* @param labels the value of the labels parameter as an {@link Optional} of {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder labels(final Optional<java.util.Map<String, String>> labels) {
|
||||
this.labels = Objects.requireNonNull(labels, "labels is required").orElse(java.util.Collections.emptyMap());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link TunnelGroupBackend}
|
||||
*/
|
||||
public CompletionStage<TunnelGroupBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/backends/tunnel_group",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("labels", Optional.of(this.labels))
|
||||
),
|
||||
Optional.of(TunnelGroupBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TunnelGroupBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TunnelGroupBackend 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 TunnelGroup backend
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnel-group-backends-create">https://ngrok.com/docs/api#api-tunnel-group-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/tunnel_group/" + 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 TunnelGroup backend by ID. TODO what if used?
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnel-group-backends-delete">https://ngrok.com/docs/api#api-tunnel-group-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 TunnelGroupBackend}
|
||||
*/
|
||||
public CompletionStage<TunnelGroupBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/tunnel_group/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(TunnelGroupBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TunnelGroupBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TunnelGroupBackend 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 TunnelGroup backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnel-group-backends-get">https://ngrok.com/docs/api#api-tunnel-group-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.ofNullable(beforeId);
|
||||
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.ofNullable(limit);
|
||||
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 TunnelGroupBackendList}
|
||||
*/
|
||||
public CompletionStage<Page<TunnelGroupBackendList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/tunnel_group",
|
||||
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(TunnelGroupBackendList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link TunnelGroupBackendList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<TunnelGroupBackendList> 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 TunnelGroup backends on this account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnel-group-backends-list">https://ngrok.com/docs/api#api-tunnel-group-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 java.util.Map<String, String> labels = java.util.Collections.emptyMap();
|
||||
|
||||
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.ofNullable(description);
|
||||
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.ofNullable(metadata);
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* labels to watch for tunnels on, e.g. app->foo, dc->bar
|
||||
*
|
||||
* @param labels the value of the labels parameter as a {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder labels(final java.util.Map<String, String> labels) {
|
||||
this.labels = Objects.requireNonNull(labels, "labels is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* labels to watch for tunnels on, e.g. app->foo, dc->bar
|
||||
*
|
||||
* @param labels the value of the labels parameter as an {@link Optional} of {@link java.util.Map<String, String>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder labels(final Optional<java.util.Map<String, String>> labels) {
|
||||
this.labels = Objects.requireNonNull(labels, "labels is required").orElse(java.util.Collections.emptyMap());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link TunnelGroupBackend}
|
||||
*/
|
||||
public CompletionStage<TunnelGroupBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/backends/tunnel_group/" + 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<>("labels", Optional.of(this.labels))
|
||||
),
|
||||
Optional.of(TunnelGroupBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link TunnelGroupBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public TunnelGroupBackend 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 TunnelGroup backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnel-group-backends-update">https://ngrok.com/docs/api#api-tunnel-group-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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -129,4 +129,62 @@ public class Tunnels {
|
||||
return new ListCallBuilder(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 Tunnel}
|
||||
*/
|
||||
public CompletionStage<Tunnel> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/tunnels/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(Tunnel.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link Tunnel}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Tunnel 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 status of a tunnel by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-tunnels-get">https://ngrok.com/docs/api#api-tunnels-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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,505 @@
|
||||
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 Weighted Backend balances traffic among the referenced backends. Traffic
|
||||
* is assigned proportionally to each based on its weight. The percentage of
|
||||
* traffic is calculated by dividing a backend's weight by the sum of all
|
||||
* weights.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-weighted-backends">https://ngrok.com/docs/api#api-weighted-backends</a>.
|
||||
*/
|
||||
public class WeightedBackends {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for WeightedBackends.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public WeightedBackends(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 String description = "";
|
||||
private String metadata = "";
|
||||
private java.util.Map<String, Long> backends = java.util.Collections.emptyMap();
|
||||
|
||||
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 = 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").orElse("");
|
||||
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 = 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").orElse("");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends to their weights (0-10000)
|
||||
*
|
||||
* @param backends the value of the backends parameter as a {@link java.util.Map<String, Long>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backends(final java.util.Map<String, Long> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends to their weights (0-10000)
|
||||
*
|
||||
* @param backends the value of the backends parameter as an {@link Optional} of {@link java.util.Map<String, Long>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder backends(final Optional<java.util.Map<String, Long>> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required").orElse(java.util.Collections.emptyMap());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link WeightedBackend}
|
||||
*/
|
||||
public CompletionStage<WeightedBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.POST,
|
||||
"/backends/weighted",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", Optional.of(this.description)),
|
||||
new AbstractMap.SimpleEntry<>("metadata", Optional.of(this.metadata)),
|
||||
new AbstractMap.SimpleEntry<>("backends", Optional.of(this.backends))
|
||||
),
|
||||
Optional.of(WeightedBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link WeightedBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public WeightedBackend 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 Weighted backend
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-weighted-backends-create">https://ngrok.com/docs/api#api-weighted-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/weighted/" + 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 Weighted backend by ID. TODO what if used?
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-weighted-backends-delete">https://ngrok.com/docs/api#api-weighted-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 WeightedBackend}
|
||||
*/
|
||||
public CompletionStage<WeightedBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/weighted/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(WeightedBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link WeightedBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public WeightedBackend 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 Weighted backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-weighted-backends-get">https://ngrok.com/docs/api#api-weighted-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.ofNullable(beforeId);
|
||||
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.ofNullable(limit);
|
||||
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 WeightedBackendList}
|
||||
*/
|
||||
public CompletionStage<Page<WeightedBackendList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/backends/weighted",
|
||||
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(WeightedBackendList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link WeightedBackendList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<WeightedBackendList> 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 Weighted backends on this account
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-weighted-backends-list">https://ngrok.com/docs/api#api-weighted-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 java.util.Map<String, Long> backends = java.util.Collections.emptyMap();
|
||||
|
||||
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.ofNullable(description);
|
||||
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.ofNullable(metadata);
|
||||
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 ids of the child backends to their weights (0-10000)
|
||||
*
|
||||
* @param backends the value of the backends parameter as a {@link java.util.Map<String, Long>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backends(final java.util.Map<String, Long> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the ids of the child backends to their weights (0-10000)
|
||||
*
|
||||
* @param backends the value of the backends parameter as an {@link Optional} of {@link java.util.Map<String, Long>}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder backends(final Optional<java.util.Map<String, Long>> backends) {
|
||||
this.backends = Objects.requireNonNull(backends, "backends is required").orElse(java.util.Collections.emptyMap());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of {@link WeightedBackend}
|
||||
*/
|
||||
public CompletionStage<WeightedBackend> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.PATCH,
|
||||
"/backends/weighted/" + 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<>("backends", Optional.of(this.backends))
|
||||
),
|
||||
Optional.of(WeightedBackend.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link WeightedBackend}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public WeightedBackend 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 Weighted backend by ID
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-weighted-backends-update">https://ngrok.com/docs/api#api-weighted-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
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user