mirror of
https://github.com/ngrok/ngrok-api-java.git
synced 2026-06-16 16:54:37 +00:00
Update generated files
This commit is contained in:
@@ -29,6 +29,10 @@ In your Maven `pom.xml` file, add:
|
||||
|
||||
See the above URL for the latest version of the API client.
|
||||
|
||||
## Support
|
||||
|
||||
The best place to get support using this library is through the [ngrok Slack Community](https://ngrok.com/slack). If you find any bugs, please contribute by opening a [new GitHub issue](https://github.com/ngrok/ngrok-api-java/issues/new/choose).
|
||||
|
||||
## Documentation
|
||||
|
||||
All objects, methods and properties are documented with Javadoc for
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ngrok</groupId>
|
||||
<artifactId>ngrok-api-java</artifactId>
|
||||
<version>0.6.1-SNAPSHOT</version>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
|
||||
<name>ngrok Java API client</name>
|
||||
<description>ngrok API client for Java applications</description>
|
||||
|
||||
@@ -82,6 +82,28 @@ public class Ngrok {
|
||||
return new ApiKeys(this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for ApplicationSessions.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-sessions">https://ngrok.com/docs/api#api-application-sessions</a>.
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public ApplicationSessions applicationSessions() {
|
||||
return new ApplicationSessions(this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a service client for ApplicationUsers.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-users">https://ngrok.com/docs/api#api-application-users</a>.
|
||||
*
|
||||
* @return a service client
|
||||
*/
|
||||
public ApplicationUsers applicationUsers() {
|
||||
return new ApplicationUsers(this.apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* Certificate Authorities are x509 certificates that are used to sign other
|
||||
* x509 certificates. Attach a Certificate Authority to the Mutual TLS module
|
||||
|
||||
@@ -31,6 +31,9 @@ public class ApiKey {
|
||||
@JsonProperty("token")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> token;
|
||||
@JsonProperty("owner_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> ownerId;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link ApiKey}.
|
||||
@@ -41,6 +44,7 @@ public class ApiKey {
|
||||
* @param metadata arbitrary user-defined data of this API key. optional, max 4096 bytes
|
||||
* @param createdAt timestamp when the api key was created, RFC 3339 format
|
||||
* @param token the bearer token that can be placed into the Authorization header to authenticate request to the ngrok API. <strong>This value is only available one time, on the API response from key creation. Otherwise it is null.</strong>
|
||||
* @param ownerId If supplied at credential creation, ownership will be assigned to the specified User or Bot. Only admins may specify an owner other than themselves. Defaults to the authenticated User or Bot.
|
||||
*/
|
||||
@JsonCreator
|
||||
public ApiKey(
|
||||
@@ -49,7 +53,8 @@ public class ApiKey {
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("token") final Optional<String> token
|
||||
@JsonProperty("token") final Optional<String> token,
|
||||
@JsonProperty("owner_id") final Optional<String> ownerId
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
@@ -57,6 +62,7 @@ public class ApiKey {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.token = token != null ? token : Optional.empty();
|
||||
this.ownerId = ownerId != null ? ownerId : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,6 +122,17 @@ public class ApiKey {
|
||||
return this.token;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getOwnerId() {
|
||||
return this.ownerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -132,7 +149,8 @@ public class ApiKey {
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.token.equals(other.token);
|
||||
this.token.equals(other.token)&&
|
||||
this.ownerId.equals(other.ownerId);
|
||||
|
||||
}
|
||||
|
||||
@@ -144,7 +162,8 @@ public class ApiKey {
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.createdAt,
|
||||
this.token
|
||||
this.token,
|
||||
this.ownerId
|
||||
);
|
||||
}
|
||||
|
||||
@@ -157,6 +176,7 @@ public class ApiKey {
|
||||
"', metadata='" + this.metadata +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', token='" + this.token.orElse("(null)") +
|
||||
"', ownerId='" + this.ownerId.orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
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 ApplicationSession} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ApplicationSession {
|
||||
@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("public_url")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.net.URI publicUrl;
|
||||
@JsonProperty("browser_session")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final BrowserSession browserSession;
|
||||
@JsonProperty("application_user")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> applicationUser;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
@JsonProperty("last_active")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime lastActive;
|
||||
@JsonProperty("expires_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime expiresAt;
|
||||
@JsonProperty("endpoint")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> endpoint;
|
||||
@JsonProperty("edge")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> edge;
|
||||
@JsonProperty("route")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Ref> route;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link ApplicationSession}.
|
||||
*
|
||||
* @param id unique application session resource identifier
|
||||
* @param uri URI of the application session API resource
|
||||
* @param publicUrl URL of the hostport served by this endpoint
|
||||
* @param browserSession browser session details of the application session
|
||||
* @param applicationUser application user this session is associated with
|
||||
* @param createdAt timestamp when the user was created in RFC 3339 format
|
||||
* @param lastActive timestamp when the user was last active in RFC 3339 format
|
||||
* @param expiresAt timestamp when session expires in RFC 3339 format
|
||||
* @param endpoint ephemeral endpoint this session is associated with
|
||||
* @param edge edge this session is associated with, null if the endpoint is agent-initiated
|
||||
* @param route route this session is associated with, null if the endpoint is agent-initiated
|
||||
*/
|
||||
@JsonCreator
|
||||
public ApplicationSession(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("public_url") final java.net.URI publicUrl,
|
||||
@JsonProperty("browser_session") final BrowserSession browserSession,
|
||||
@JsonProperty("application_user") final Optional<Ref> applicationUser,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("last_active") final java.time.OffsetDateTime lastActive,
|
||||
@JsonProperty("expires_at") final java.time.OffsetDateTime expiresAt,
|
||||
@JsonProperty("endpoint") final Optional<Ref> endpoint,
|
||||
@JsonProperty("edge") final Optional<Ref> edge,
|
||||
@JsonProperty("route") final Optional<Ref> route
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.publicUrl = Objects.requireNonNull(publicUrl, "publicUrl is required");
|
||||
this.browserSession = Objects.requireNonNull(browserSession, "browserSession is required");
|
||||
this.applicationUser = applicationUser != null ? applicationUser : Optional.empty();
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.lastActive = Objects.requireNonNull(lastActive, "lastActive is required");
|
||||
this.expiresAt = Objects.requireNonNull(expiresAt, "expiresAt is required");
|
||||
this.endpoint = endpoint != null ? endpoint : Optional.empty();
|
||||
this.edge = edge != null ? edge : Optional.empty();
|
||||
this.route = route != null ? route : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* unique application session resource identifier
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the application session API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* browser session details of the application session
|
||||
*
|
||||
* @return the value of the property as a {@link BrowserSession}
|
||||
*/
|
||||
public BrowserSession getBrowserSession() {
|
||||
return this.browserSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* application user this session is associated with
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getApplicationUser() {
|
||||
return this.applicationUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the user 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 user was last active in RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getLastActive() {
|
||||
return this.lastActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when session expires in RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getExpiresAt() {
|
||||
return this.expiresAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* ephemeral endpoint this session is associated with
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getEndpoint() {
|
||||
return this.endpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* edge this session is associated with, null if the endpoint is agent-initiated
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getEdge() {
|
||||
return this.edge;
|
||||
}
|
||||
|
||||
/**
|
||||
* route this session is associated with, null if the endpoint is agent-initiated
|
||||
*
|
||||
* @return the value of the property as a {@link Ref} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Ref> getRoute() {
|
||||
return this.route;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final ApplicationSession other = (ApplicationSession) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.publicUrl.equals(other.publicUrl)&&
|
||||
this.browserSession.equals(other.browserSession)&&
|
||||
this.applicationUser.equals(other.applicationUser)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.lastActive.equals(other.lastActive)&&
|
||||
this.expiresAt.equals(other.expiresAt)&&
|
||||
this.endpoint.equals(other.endpoint)&&
|
||||
this.edge.equals(other.edge)&&
|
||||
this.route.equals(other.route);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.publicUrl,
|
||||
this.browserSession,
|
||||
this.applicationUser,
|
||||
this.createdAt,
|
||||
this.lastActive,
|
||||
this.expiresAt,
|
||||
this.endpoint,
|
||||
this.edge,
|
||||
this.route
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ApplicationSession{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', publicUrl='" + this.publicUrl +
|
||||
"', browserSession='" + this.browserSession +
|
||||
"', applicationUser='" + this.applicationUser.map(Object::toString).orElse("(null)") +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', lastActive='" + this.lastActive +
|
||||
"', expiresAt='" + this.expiresAt +
|
||||
"', endpoint='" + this.endpoint.map(Object::toString).orElse("(null)") +
|
||||
"', edge='" + this.edge.map(Object::toString).orElse("(null)") +
|
||||
"', route='" + this.route.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 ApplicationSessionList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ApplicationSessionList implements Pageable {
|
||||
@JsonProperty("application_sessions")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<ApplicationSession> applicationSessions;
|
||||
@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 ApplicationSessionList}.
|
||||
*
|
||||
* @param applicationSessions list of all application sessions on this account
|
||||
* @param uri URI of the application session list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public ApplicationSessionList(
|
||||
@JsonProperty("application_sessions") final java.util.List<ApplicationSession> applicationSessions,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.applicationSessions = applicationSessions != null ? applicationSessions : java.util.Collections.emptyList();
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* list of all application sessions on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link ApplicationSession}
|
||||
*/
|
||||
public java.util.List<ApplicationSession> getApplicationSessions() {
|
||||
return this.applicationSessions;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the application session 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 ApplicationSessionList other = (ApplicationSessionList) o;
|
||||
return
|
||||
this.applicationSessions.equals(other.applicationSessions)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.applicationSessions,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ApplicationSessionList{" +
|
||||
"applicationSessions='" + this.applicationSessions +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
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 ApplicationUser} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ApplicationUser {
|
||||
@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("identity_provider")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final IdentityProvider identityProvider;
|
||||
@JsonProperty("provider_user_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String providerUserId;
|
||||
@JsonProperty("username")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String username;
|
||||
@JsonProperty("email")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String email;
|
||||
@JsonProperty("name")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String name;
|
||||
@JsonProperty("created_at")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime createdAt;
|
||||
@JsonProperty("last_active")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime lastActive;
|
||||
@JsonProperty("last_login")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.time.OffsetDateTime lastLogin;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link ApplicationUser}.
|
||||
*
|
||||
* @param id unique application user resource identifier
|
||||
* @param uri URI of the application user API resource
|
||||
* @param identityProvider identity provider that the user authenticated with
|
||||
* @param providerUserId unique user identifier
|
||||
* @param username user username
|
||||
* @param email user email
|
||||
* @param name user common name
|
||||
* @param createdAt timestamp when the user was created in RFC 3339 format
|
||||
* @param lastActive timestamp when the user was last active in RFC 3339 format
|
||||
* @param lastLogin timestamp when the user last signed-in in RFC 3339 format
|
||||
*/
|
||||
@JsonCreator
|
||||
public ApplicationUser(
|
||||
@JsonProperty("id") final String id,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("identity_provider") final IdentityProvider identityProvider,
|
||||
@JsonProperty("provider_user_id") final String providerUserId,
|
||||
@JsonProperty("username") final String username,
|
||||
@JsonProperty("email") final String email,
|
||||
@JsonProperty("name") final String name,
|
||||
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
|
||||
@JsonProperty("last_active") final java.time.OffsetDateTime lastActive,
|
||||
@JsonProperty("last_login") final java.time.OffsetDateTime lastLogin
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.identityProvider = Objects.requireNonNull(identityProvider, "identityProvider is required");
|
||||
this.providerUserId = Objects.requireNonNull(providerUserId, "providerUserId is required");
|
||||
this.username = Objects.requireNonNull(username, "username is required");
|
||||
this.email = Objects.requireNonNull(email, "email is required");
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
|
||||
this.lastActive = Objects.requireNonNull(lastActive, "lastActive is required");
|
||||
this.lastLogin = Objects.requireNonNull(lastLogin, "lastLogin is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* unique application user resource identifier
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the application user API resource
|
||||
*
|
||||
* @return the value of the property as a {@link java.net.URI}
|
||||
*/
|
||||
public java.net.URI getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* identity provider that the user authenticated with
|
||||
*
|
||||
* @return the value of the property as a {@link IdentityProvider}
|
||||
*/
|
||||
public IdentityProvider getIdentityProvider() {
|
||||
return this.identityProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* unique user identifier
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getProviderUserId() {
|
||||
return this.providerUserId;
|
||||
}
|
||||
|
||||
/**
|
||||
* user username
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getUsername() {
|
||||
return this.username;
|
||||
}
|
||||
|
||||
/**
|
||||
* user email
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getEmail() {
|
||||
return this.email;
|
||||
}
|
||||
|
||||
/**
|
||||
* user common name
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the user 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 user was last active in RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getLastActive() {
|
||||
return this.lastActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* timestamp when the user last signed-in in RFC 3339 format
|
||||
*
|
||||
* @return the value of the property as a {@link java.time.OffsetDateTime}
|
||||
*/
|
||||
public java.time.OffsetDateTime getLastLogin() {
|
||||
return this.lastLogin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final ApplicationUser other = (ApplicationUser) o;
|
||||
return
|
||||
this.id.equals(other.id)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.identityProvider.equals(other.identityProvider)&&
|
||||
this.providerUserId.equals(other.providerUserId)&&
|
||||
this.username.equals(other.username)&&
|
||||
this.email.equals(other.email)&&
|
||||
this.name.equals(other.name)&&
|
||||
this.createdAt.equals(other.createdAt)&&
|
||||
this.lastActive.equals(other.lastActive)&&
|
||||
this.lastLogin.equals(other.lastLogin);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.id,
|
||||
this.uri,
|
||||
this.identityProvider,
|
||||
this.providerUserId,
|
||||
this.username,
|
||||
this.email,
|
||||
this.name,
|
||||
this.createdAt,
|
||||
this.lastActive,
|
||||
this.lastLogin
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ApplicationUser{" +
|
||||
"id='" + this.id +
|
||||
"', uri='" + this.uri +
|
||||
"', identityProvider='" + this.identityProvider +
|
||||
"', providerUserId='" + this.providerUserId +
|
||||
"', username='" + this.username +
|
||||
"', email='" + this.email +
|
||||
"', name='" + this.name +
|
||||
"', createdAt='" + this.createdAt +
|
||||
"', lastActive='" + this.lastActive +
|
||||
"', lastLogin='" + this.lastLogin +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -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 ApplicationUserList} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ApplicationUserList implements Pageable {
|
||||
@JsonProperty("application_users")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<ApplicationUser> applicationUsers;
|
||||
@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 ApplicationUserList}.
|
||||
*
|
||||
* @param applicationUsers list of all application users on this account
|
||||
* @param uri URI of the application user list API resource
|
||||
* @param nextPageUri URI of the next page, or null if there is no next page
|
||||
*/
|
||||
@JsonCreator
|
||||
public ApplicationUserList(
|
||||
@JsonProperty("application_users") final java.util.List<ApplicationUser> applicationUsers,
|
||||
@JsonProperty("uri") final java.net.URI uri,
|
||||
@JsonProperty("next_page_uri") final Optional<java.net.URI> nextPageUri
|
||||
) {
|
||||
this.applicationUsers = applicationUsers != null ? applicationUsers : java.util.Collections.emptyList();
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
this.nextPageUri = nextPageUri != null ? nextPageUri : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* list of all application users on this account
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link ApplicationUser}
|
||||
*/
|
||||
public java.util.List<ApplicationUser> getApplicationUsers() {
|
||||
return this.applicationUsers;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the application user 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 ApplicationUserList other = (ApplicationUserList) o;
|
||||
return
|
||||
this.applicationUsers.equals(other.applicationUsers)&&
|
||||
this.uri.equals(other.uri)&&
|
||||
this.nextPageUri.equals(other.nextPageUri);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.applicationUsers,
|
||||
this.uri,
|
||||
this.nextPageUri
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ApplicationUserList{" +
|
||||
"applicationUsers='" + this.applicationUsers +
|
||||
"', uri='" + this.uri +
|
||||
"', nextPageUri='" + this.nextPageUri.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 BrowserSession} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class BrowserSession {
|
||||
@JsonProperty("user_agent")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final UserAgent userAgent;
|
||||
@JsonProperty("ip_address")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String ipAddress;
|
||||
@JsonProperty("location")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Location> location;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link BrowserSession}.
|
||||
*
|
||||
* @param userAgent HTTP User-Agent data
|
||||
* @param ipAddress IP address
|
||||
* @param location IP geolocation data
|
||||
*/
|
||||
@JsonCreator
|
||||
public BrowserSession(
|
||||
@JsonProperty("user_agent") final UserAgent userAgent,
|
||||
@JsonProperty("ip_address") final String ipAddress,
|
||||
@JsonProperty("location") final Optional<Location> location
|
||||
) {
|
||||
this.userAgent = Objects.requireNonNull(userAgent, "userAgent is required");
|
||||
this.ipAddress = Objects.requireNonNull(ipAddress, "ipAddress is required");
|
||||
this.location = location != null ? location : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP User-Agent data
|
||||
*
|
||||
* @return the value of the property as a {@link UserAgent}
|
||||
*/
|
||||
public UserAgent getUserAgent() {
|
||||
return this.userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* IP address
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getIpAddress() {
|
||||
return this.ipAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* IP geolocation data
|
||||
*
|
||||
* @return the value of the property as a {@link Location} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Location> getLocation() {
|
||||
return this.location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final BrowserSession other = (BrowserSession) o;
|
||||
return
|
||||
this.userAgent.equals(other.userAgent)&&
|
||||
this.ipAddress.equals(other.ipAddress)&&
|
||||
this.location.equals(other.location);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.userAgent,
|
||||
this.ipAddress,
|
||||
this.location
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BrowserSession{" +
|
||||
"userAgent='" + this.userAgent +
|
||||
"', ipAddress='" + this.ipAddress +
|
||||
"', location='" + this.location.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,9 @@ public class Credential {
|
||||
@JsonProperty("acl")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> acl;
|
||||
@JsonProperty("owner_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> ownerId;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link Credential}.
|
||||
@@ -44,7 +47,8 @@ public class Credential {
|
||||
* @param description human-readable description of who or what will use the credential to authenticate. Optional, max 255 bytes.
|
||||
* @param metadata arbitrary user-defined machine-readable data of this credential. Optional, max 4096 bytes.
|
||||
* @param token the credential's authtoken that can be used to authenticate an ngrok agent. <strong>This value is only available one time, on the API response from credential creation, otherwise it is null.</strong>
|
||||
* @param acl optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the <code>bind</code> rule. The <code>bind</code> rule allows the caller to restrict what domains and addresses the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>, <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of <code>'*'</code> is equivalent to no acl at all and will explicitly permit all actions.
|
||||
* @param acl optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the <code>bind</code> rule. The <code>bind</code> rule allows the caller to restrict what domains, addresses, and labels the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>, <code>y.example.com</code>, <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard key and/or value to match multiple labels. For example, you may specify a rule of <code>bind:*=example</code> which will allow <code>x=example</code>, <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to no acl at all and will explicitly permit all actions.
|
||||
* @param ownerId If supplied at credential creation, ownership will be assigned to the specified User or Bot. Only admins may specify an owner other than themselves. Defaults to the authenticated User or Bot.
|
||||
*/
|
||||
@JsonCreator
|
||||
public Credential(
|
||||
@@ -54,7 +58,8 @@ public class Credential {
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("token") final Optional<String> token,
|
||||
@JsonProperty("acl") final java.util.List<String> acl
|
||||
@JsonProperty("acl") final java.util.List<String> acl,
|
||||
@JsonProperty("owner_id") final Optional<String> ownerId
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
@@ -63,6 +68,7 @@ public class Credential {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.token = token != null ? token : Optional.empty();
|
||||
this.acl = acl != null ? acl : java.util.Collections.emptyList();
|
||||
this.ownerId = ownerId != null ? ownerId : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,15 +132,18 @@ public class Credential {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
@@ -142,6 +151,17 @@ public class Credential {
|
||||
return this.acl;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getOwnerId() {
|
||||
return this.ownerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -159,7 +179,8 @@ public class Credential {
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.token.equals(other.token)&&
|
||||
this.acl.equals(other.acl);
|
||||
this.acl.equals(other.acl)&&
|
||||
this.ownerId.equals(other.ownerId);
|
||||
|
||||
}
|
||||
|
||||
@@ -172,7 +193,8 @@ public class Credential {
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.token,
|
||||
this.acl
|
||||
this.acl,
|
||||
this.ownerId
|
||||
);
|
||||
}
|
||||
|
||||
@@ -186,6 +208,7 @@ public class Credential {
|
||||
"', metadata='" + this.metadata +
|
||||
"', token='" + this.token.orElse("(null)") +
|
||||
"', acl='" + this.acl +
|
||||
"', ownerId='" + this.ownerId.orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
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 EndpointOAuthAmazon} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointOAuthAmazon {
|
||||
/**
|
||||
* Builder class for {@link EndpointOAuthAmazon}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<String> clientId = Optional.empty();
|
||||
private Optional<String> clientSecret = Optional.empty();
|
||||
private java.util.List<String> scopes = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailAddresses = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailDomains = java.util.Collections.emptyList();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final String clientId) {
|
||||
this.clientId = Optional.of(Objects.requireNonNull(clientId, "clientId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final Optional<String> clientId) {
|
||||
this.clientId = Objects.requireNonNull(clientId, "clientId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final String clientSecret) {
|
||||
this.clientSecret = Optional.of(Objects.requireNonNull(clientSecret, "clientSecret is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final Optional<String> clientSecret) {
|
||||
this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final java.util.List<String> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final Optional<java.util.List<String>> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final java.util.List<String> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final Optional<java.util.List<String>> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final java.util.List<String> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final Optional<java.util.List<String>> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointOAuthAmazon} instance.
|
||||
*
|
||||
* @return a new {@link EndpointOAuthAmazon}
|
||||
*/
|
||||
public EndpointOAuthAmazon build() {
|
||||
return new EndpointOAuthAmazon(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointOAuthAmazon} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("client_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientId;
|
||||
@JsonProperty("client_secret")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientSecret;
|
||||
@JsonProperty("scopes")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> scopes;
|
||||
@JsonProperty("email_addresses")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailAddresses;
|
||||
@JsonProperty("email_domains")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailDomains;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointOAuthAmazon}.
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointOAuthAmazon(
|
||||
@JsonProperty("client_id") final Optional<String> clientId,
|
||||
@JsonProperty("client_secret") final Optional<String> clientSecret,
|
||||
@JsonProperty("scopes") final java.util.List<String> scopes,
|
||||
@JsonProperty("email_addresses") final java.util.List<String> emailAddresses,
|
||||
@JsonProperty("email_domains") final java.util.List<String> emailDomains
|
||||
) {
|
||||
this.clientId = clientId != null ? clientId : Optional.empty();
|
||||
this.clientSecret = clientSecret != null ? clientSecret : Optional.empty();
|
||||
this.scopes = scopes != null ? scopes : java.util.Collections.emptyList();
|
||||
this.emailAddresses = emailAddresses != null ? emailAddresses : java.util.Collections.emptyList();
|
||||
this.emailDomains = emailDomains != null ? emailDomains : java.util.Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientId</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientSecret</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientSecret() {
|
||||
return this.clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>scopes</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getScopes() {
|
||||
return this.scopes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailAddresses</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailAddresses() {
|
||||
return this.emailAddresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailDomains</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailDomains() {
|
||||
return this.emailDomains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointOAuthAmazon other = (EndpointOAuthAmazon) o;
|
||||
return
|
||||
this.clientId.equals(other.clientId)&&
|
||||
this.clientSecret.equals(other.clientSecret)&&
|
||||
this.scopes.equals(other.scopes)&&
|
||||
this.emailAddresses.equals(other.emailAddresses)&&
|
||||
this.emailDomains.equals(other.emailDomains);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointOAuthAmazon{" +
|
||||
"clientId='" + this.clientId.orElse("(null)") +
|
||||
"', clientSecret='" + this.clientSecret.orElse("(null)") +
|
||||
"', scopes='" + this.scopes +
|
||||
"', emailAddresses='" + this.emailAddresses +
|
||||
"', emailDomains='" + this.emailDomains +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -19,11 +19,11 @@ public class EndpointOAuthGitHub {
|
||||
public static class Builder {
|
||||
private Optional<String> clientId = Optional.empty();
|
||||
private Optional<String> clientSecret = Optional.empty();
|
||||
private java.util.List<String> scopes = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailAddresses = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailDomains = java.util.Collections.emptyList();
|
||||
private java.util.List<String> teams = java.util.Collections.emptyList();
|
||||
private java.util.List<String> organizations = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<String>> scopes = Optional.empty();
|
||||
private Optional<java.util.List<String>> emailAddresses = Optional.empty();
|
||||
private Optional<java.util.List<String>> emailDomains = Optional.empty();
|
||||
private Optional<java.util.List<String>> teams = Optional.empty();
|
||||
private Optional<java.util.List<String>> organizations = Optional.empty();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
@@ -95,7 +95,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final java.util.List<String> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required");
|
||||
this.scopes = Optional.of(Objects.requireNonNull(scopes, "scopes is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final Optional<java.util.List<String>> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required").orElse(java.util.Collections.emptyList());
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final java.util.List<String> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required");
|
||||
this.emailAddresses = Optional.of(Objects.requireNonNull(emailAddresses, "emailAddresses is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final Optional<java.util.List<String>> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required").orElse(java.util.Collections.emptyList());
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final java.util.List<String> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required");
|
||||
this.emailDomains = Optional.of(Objects.requireNonNull(emailDomains, "emailDomains is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final Optional<java.util.List<String>> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required").orElse(java.util.Collections.emptyList());
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder teams(final java.util.List<String> teams) {
|
||||
this.teams = Objects.requireNonNull(teams, "teams is required");
|
||||
this.teams = Optional.of(Objects.requireNonNull(teams, "teams is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder teams(final Optional<java.util.List<String>> teams) {
|
||||
this.teams = Objects.requireNonNull(teams, "teams is required").orElse(java.util.Collections.emptyList());
|
||||
this.teams = Objects.requireNonNull(teams, "teams is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder organizations(final java.util.List<String> organizations) {
|
||||
this.organizations = Objects.requireNonNull(organizations, "organizations is required");
|
||||
this.organizations = Optional.of(Objects.requireNonNull(organizations, "organizations is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ public class EndpointOAuthGitHub {
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder organizations(final Optional<java.util.List<String>> organizations) {
|
||||
this.organizations = Objects.requireNonNull(organizations, "organizations is required").orElse(java.util.Collections.emptyList());
|
||||
this.organizations = Objects.requireNonNull(organizations, "organizations is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -252,19 +252,19 @@ public class EndpointOAuthGitHub {
|
||||
private final Optional<String> clientSecret;
|
||||
@JsonProperty("scopes")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> scopes;
|
||||
private final Optional<java.util.List<String>> scopes;
|
||||
@JsonProperty("email_addresses")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailAddresses;
|
||||
private final Optional<java.util.List<String>> emailAddresses;
|
||||
@JsonProperty("email_domains")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailDomains;
|
||||
private final Optional<java.util.List<String>> emailDomains;
|
||||
@JsonProperty("teams")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> teams;
|
||||
private final Optional<java.util.List<String>> teams;
|
||||
@JsonProperty("organizations")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> organizations;
|
||||
private final Optional<java.util.List<String>> organizations;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointOAuthGitHub}.
|
||||
@@ -281,19 +281,19 @@ public class EndpointOAuthGitHub {
|
||||
private EndpointOAuthGitHub(
|
||||
@JsonProperty("client_id") final Optional<String> clientId,
|
||||
@JsonProperty("client_secret") final Optional<String> clientSecret,
|
||||
@JsonProperty("scopes") final java.util.List<String> scopes,
|
||||
@JsonProperty("email_addresses") final java.util.List<String> emailAddresses,
|
||||
@JsonProperty("email_domains") final java.util.List<String> emailDomains,
|
||||
@JsonProperty("teams") final java.util.List<String> teams,
|
||||
@JsonProperty("organizations") final java.util.List<String> organizations
|
||||
@JsonProperty("scopes") final Optional<java.util.List<String>> scopes,
|
||||
@JsonProperty("email_addresses") final Optional<java.util.List<String>> emailAddresses,
|
||||
@JsonProperty("email_domains") final Optional<java.util.List<String>> emailDomains,
|
||||
@JsonProperty("teams") final Optional<java.util.List<String>> teams,
|
||||
@JsonProperty("organizations") final Optional<java.util.List<String>> organizations
|
||||
) {
|
||||
this.clientId = clientId != null ? clientId : Optional.empty();
|
||||
this.clientSecret = clientSecret != null ? clientSecret : Optional.empty();
|
||||
this.scopes = scopes != null ? scopes : java.util.Collections.emptyList();
|
||||
this.emailAddresses = emailAddresses != null ? emailAddresses : java.util.Collections.emptyList();
|
||||
this.emailDomains = emailDomains != null ? emailDomains : java.util.Collections.emptyList();
|
||||
this.teams = teams != null ? teams : java.util.Collections.emptyList();
|
||||
this.organizations = organizations != null ? organizations : java.util.Collections.emptyList();
|
||||
this.scopes = scopes != null ? scopes : Optional.empty();
|
||||
this.emailAddresses = emailAddresses != null ? emailAddresses : Optional.empty();
|
||||
this.emailDomains = emailDomains != null ? emailDomains : Optional.empty();
|
||||
this.teams = teams != null ? teams : Optional.empty();
|
||||
this.organizations = organizations != null ? organizations : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -326,9 +326,9 @@ public class EndpointOAuthGitHub {
|
||||
* oauth app (i.e. you must pass both <code>client_id</code> and
|
||||
* <code>client_secret</code> to set scopes)
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.util.List<String> getScopes() {
|
||||
public Optional<java.util.List<String>> getScopes() {
|
||||
return this.scopes;
|
||||
}
|
||||
|
||||
@@ -336,9 +336,9 @@ public class EndpointOAuthGitHub {
|
||||
* a list of email addresses of users authenticated by identity provider who are
|
||||
* allowed access to the endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.util.List<String> getEmailAddresses() {
|
||||
public Optional<java.util.List<String>> getEmailAddresses() {
|
||||
return this.emailAddresses;
|
||||
}
|
||||
|
||||
@@ -346,9 +346,9 @@ public class EndpointOAuthGitHub {
|
||||
* a list of email domains of users authenticated by identity provider who are
|
||||
* allowed access to the endpoint
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.util.List<String> getEmailDomains() {
|
||||
public Optional<java.util.List<String>> getEmailDomains() {
|
||||
return this.emailDomains;
|
||||
}
|
||||
|
||||
@@ -358,9 +358,9 @@ public class EndpointOAuthGitHub {
|
||||
* 'slug' format qualified with the org name, e.g.
|
||||
* <code>org-name/team-name</code>
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.util.List<String> getTeams() {
|
||||
public Optional<java.util.List<String>> getTeams() {
|
||||
return this.teams;
|
||||
}
|
||||
|
||||
@@ -369,9 +369,9 @@ public class EndpointOAuthGitHub {
|
||||
* organizations will be allowed access. identifiers should be the
|
||||
* organization's 'slug'
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.util.List<String> getOrganizations() {
|
||||
public Optional<java.util.List<String>> getOrganizations() {
|
||||
return this.organizations;
|
||||
}
|
||||
|
||||
@@ -414,11 +414,11 @@ public class EndpointOAuthGitHub {
|
||||
return "EndpointOAuthGitHub{" +
|
||||
"clientId='" + this.clientId.orElse("(null)") +
|
||||
"', clientSecret='" + this.clientSecret.orElse("(null)") +
|
||||
"', scopes='" + this.scopes +
|
||||
"', emailAddresses='" + this.emailAddresses +
|
||||
"', emailDomains='" + this.emailDomains +
|
||||
"', teams='" + this.teams +
|
||||
"', organizations='" + this.organizations +
|
||||
"', scopes='" + this.scopes.map(Object::toString).orElse("(null)") +
|
||||
"', emailAddresses='" + this.emailAddresses.map(Object::toString).orElse("(null)") +
|
||||
"', emailDomains='" + this.emailDomains.map(Object::toString).orElse("(null)") +
|
||||
"', teams='" + this.teams.map(Object::toString).orElse("(null)") +
|
||||
"', organizations='" + this.organizations.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
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 EndpointOAuthGitLab} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointOAuthGitLab {
|
||||
/**
|
||||
* Builder class for {@link EndpointOAuthGitLab}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<String> clientId = Optional.empty();
|
||||
private Optional<String> clientSecret = Optional.empty();
|
||||
private java.util.List<String> scopes = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailAddresses = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailDomains = java.util.Collections.emptyList();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final String clientId) {
|
||||
this.clientId = Optional.of(Objects.requireNonNull(clientId, "clientId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final Optional<String> clientId) {
|
||||
this.clientId = Objects.requireNonNull(clientId, "clientId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final String clientSecret) {
|
||||
this.clientSecret = Optional.of(Objects.requireNonNull(clientSecret, "clientSecret is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final Optional<String> clientSecret) {
|
||||
this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final java.util.List<String> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final Optional<java.util.List<String>> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final java.util.List<String> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final Optional<java.util.List<String>> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final java.util.List<String> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final Optional<java.util.List<String>> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointOAuthGitLab} instance.
|
||||
*
|
||||
* @return a new {@link EndpointOAuthGitLab}
|
||||
*/
|
||||
public EndpointOAuthGitLab build() {
|
||||
return new EndpointOAuthGitLab(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointOAuthGitLab} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("client_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientId;
|
||||
@JsonProperty("client_secret")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientSecret;
|
||||
@JsonProperty("scopes")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> scopes;
|
||||
@JsonProperty("email_addresses")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailAddresses;
|
||||
@JsonProperty("email_domains")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailDomains;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointOAuthGitLab}.
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointOAuthGitLab(
|
||||
@JsonProperty("client_id") final Optional<String> clientId,
|
||||
@JsonProperty("client_secret") final Optional<String> clientSecret,
|
||||
@JsonProperty("scopes") final java.util.List<String> scopes,
|
||||
@JsonProperty("email_addresses") final java.util.List<String> emailAddresses,
|
||||
@JsonProperty("email_domains") final java.util.List<String> emailDomains
|
||||
) {
|
||||
this.clientId = clientId != null ? clientId : Optional.empty();
|
||||
this.clientSecret = clientSecret != null ? clientSecret : Optional.empty();
|
||||
this.scopes = scopes != null ? scopes : java.util.Collections.emptyList();
|
||||
this.emailAddresses = emailAddresses != null ? emailAddresses : java.util.Collections.emptyList();
|
||||
this.emailDomains = emailDomains != null ? emailDomains : java.util.Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientId</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientSecret</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientSecret() {
|
||||
return this.clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>scopes</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getScopes() {
|
||||
return this.scopes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailAddresses</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailAddresses() {
|
||||
return this.emailAddresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailDomains</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailDomains() {
|
||||
return this.emailDomains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointOAuthGitLab other = (EndpointOAuthGitLab) o;
|
||||
return
|
||||
this.clientId.equals(other.clientId)&&
|
||||
this.clientSecret.equals(other.clientSecret)&&
|
||||
this.scopes.equals(other.scopes)&&
|
||||
this.emailAddresses.equals(other.emailAddresses)&&
|
||||
this.emailDomains.equals(other.emailDomains);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointOAuthGitLab{" +
|
||||
"clientId='" + this.clientId.orElse("(null)") +
|
||||
"', clientSecret='" + this.clientSecret.orElse("(null)") +
|
||||
"', scopes='" + this.scopes +
|
||||
"', emailAddresses='" + this.emailAddresses +
|
||||
"', emailDomains='" + this.emailDomains +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
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 EndpointOAuthLinkedIn} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointOAuthLinkedIn {
|
||||
/**
|
||||
* Builder class for {@link EndpointOAuthLinkedIn}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<String> clientId = Optional.empty();
|
||||
private Optional<String> clientSecret = Optional.empty();
|
||||
private java.util.List<String> scopes = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailAddresses = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailDomains = java.util.Collections.emptyList();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final String clientId) {
|
||||
this.clientId = Optional.of(Objects.requireNonNull(clientId, "clientId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final Optional<String> clientId) {
|
||||
this.clientId = Objects.requireNonNull(clientId, "clientId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final String clientSecret) {
|
||||
this.clientSecret = Optional.of(Objects.requireNonNull(clientSecret, "clientSecret is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final Optional<String> clientSecret) {
|
||||
this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final java.util.List<String> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final Optional<java.util.List<String>> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final java.util.List<String> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final Optional<java.util.List<String>> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final java.util.List<String> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final Optional<java.util.List<String>> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointOAuthLinkedIn} instance.
|
||||
*
|
||||
* @return a new {@link EndpointOAuthLinkedIn}
|
||||
*/
|
||||
public EndpointOAuthLinkedIn build() {
|
||||
return new EndpointOAuthLinkedIn(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointOAuthLinkedIn} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("client_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientId;
|
||||
@JsonProperty("client_secret")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientSecret;
|
||||
@JsonProperty("scopes")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> scopes;
|
||||
@JsonProperty("email_addresses")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailAddresses;
|
||||
@JsonProperty("email_domains")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailDomains;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointOAuthLinkedIn}.
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointOAuthLinkedIn(
|
||||
@JsonProperty("client_id") final Optional<String> clientId,
|
||||
@JsonProperty("client_secret") final Optional<String> clientSecret,
|
||||
@JsonProperty("scopes") final java.util.List<String> scopes,
|
||||
@JsonProperty("email_addresses") final java.util.List<String> emailAddresses,
|
||||
@JsonProperty("email_domains") final java.util.List<String> emailDomains
|
||||
) {
|
||||
this.clientId = clientId != null ? clientId : Optional.empty();
|
||||
this.clientSecret = clientSecret != null ? clientSecret : Optional.empty();
|
||||
this.scopes = scopes != null ? scopes : java.util.Collections.emptyList();
|
||||
this.emailAddresses = emailAddresses != null ? emailAddresses : java.util.Collections.emptyList();
|
||||
this.emailDomains = emailDomains != null ? emailDomains : java.util.Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientId</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientSecret</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientSecret() {
|
||||
return this.clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>scopes</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getScopes() {
|
||||
return this.scopes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailAddresses</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailAddresses() {
|
||||
return this.emailAddresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailDomains</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailDomains() {
|
||||
return this.emailDomains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointOAuthLinkedIn other = (EndpointOAuthLinkedIn) o;
|
||||
return
|
||||
this.clientId.equals(other.clientId)&&
|
||||
this.clientSecret.equals(other.clientSecret)&&
|
||||
this.scopes.equals(other.scopes)&&
|
||||
this.emailAddresses.equals(other.emailAddresses)&&
|
||||
this.emailDomains.equals(other.emailDomains);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointOAuthLinkedIn{" +
|
||||
"clientId='" + this.clientId.orElse("(null)") +
|
||||
"', clientSecret='" + this.clientSecret.orElse("(null)") +
|
||||
"', scopes='" + this.scopes +
|
||||
"', emailAddresses='" + this.emailAddresses +
|
||||
"', emailDomains='" + this.emailDomains +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,10 @@ public class EndpointOAuthProvider {
|
||||
private Optional<EndpointOAuthFacebook> facebook = Optional.empty();
|
||||
private Optional<EndpointOAuthMicrosoft> microsoft = Optional.empty();
|
||||
private Optional<EndpointOAuthGoogle> google = Optional.empty();
|
||||
private Optional<EndpointOAuthLinkedIn> linkedin = Optional.empty();
|
||||
private Optional<EndpointOAuthGitLab> gitlab = Optional.empty();
|
||||
private Optional<EndpointOAuthTwitch> twitch = Optional.empty();
|
||||
private Optional<EndpointOAuthAmazon> amazon = Optional.empty();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
@@ -114,6 +118,94 @@ public class EndpointOAuthProvider {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using linkedin as the identity provider
|
||||
*
|
||||
* @param linkedin the value of the <code>linkedin</code> parameter as a {@link EndpointOAuthLinkedIn}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder linkedin(final EndpointOAuthLinkedIn linkedin) {
|
||||
this.linkedin = Optional.of(Objects.requireNonNull(linkedin, "linkedin is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using linkedin as the identity provider
|
||||
*
|
||||
* @param linkedin the value of the <code>linkedin</code> parameter as a {@link EndpointOAuthLinkedIn}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder linkedin(final Optional<EndpointOAuthLinkedIn> linkedin) {
|
||||
this.linkedin = Objects.requireNonNull(linkedin, "linkedin is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using gitlab as the identity provider
|
||||
*
|
||||
* @param gitlab the value of the <code>gitlab</code> parameter as a {@link EndpointOAuthGitLab}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder gitlab(final EndpointOAuthGitLab gitlab) {
|
||||
this.gitlab = Optional.of(Objects.requireNonNull(gitlab, "gitlab is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using gitlab as the identity provider
|
||||
*
|
||||
* @param gitlab the value of the <code>gitlab</code> parameter as a {@link EndpointOAuthGitLab}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder gitlab(final Optional<EndpointOAuthGitLab> gitlab) {
|
||||
this.gitlab = Objects.requireNonNull(gitlab, "gitlab is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using twitch as the identity provider
|
||||
*
|
||||
* @param twitch the value of the <code>twitch</code> parameter as a {@link EndpointOAuthTwitch}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder twitch(final EndpointOAuthTwitch twitch) {
|
||||
this.twitch = Optional.of(Objects.requireNonNull(twitch, "twitch is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using twitch as the identity provider
|
||||
*
|
||||
* @param twitch the value of the <code>twitch</code> parameter as a {@link EndpointOAuthTwitch}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder twitch(final Optional<EndpointOAuthTwitch> twitch) {
|
||||
this.twitch = Objects.requireNonNull(twitch, "twitch is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using amazon as the identity provider
|
||||
*
|
||||
* @param amazon the value of the <code>amazon</code> parameter as a {@link EndpointOAuthAmazon}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder amazon(final EndpointOAuthAmazon amazon) {
|
||||
this.amazon = Optional.of(Objects.requireNonNull(amazon, "amazon is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using amazon as the identity provider
|
||||
*
|
||||
* @param amazon the value of the <code>amazon</code> parameter as a {@link EndpointOAuthAmazon}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder amazon(final Optional<EndpointOAuthAmazon> amazon) {
|
||||
this.amazon = Objects.requireNonNull(amazon, "amazon is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointOAuthProvider} instance.
|
||||
*
|
||||
@@ -124,7 +216,11 @@ public class EndpointOAuthProvider {
|
||||
this.github,
|
||||
this.facebook,
|
||||
this.microsoft,
|
||||
this.google
|
||||
this.google,
|
||||
this.linkedin,
|
||||
this.gitlab,
|
||||
this.twitch,
|
||||
this.amazon
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -152,6 +248,18 @@ public class EndpointOAuthProvider {
|
||||
@JsonProperty("google")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointOAuthGoogle> google;
|
||||
@JsonProperty("linkedin")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointOAuthLinkedIn> linkedin;
|
||||
@JsonProperty("gitlab")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointOAuthGitLab> gitlab;
|
||||
@JsonProperty("twitch")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointOAuthTwitch> twitch;
|
||||
@JsonProperty("amazon")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<EndpointOAuthAmazon> amazon;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointOAuthProvider}.
|
||||
@@ -160,18 +268,30 @@ public class EndpointOAuthProvider {
|
||||
* @param facebook configuration for using facebook as the identity provider
|
||||
* @param microsoft configuration for using microsoft as the identity provider
|
||||
* @param google configuration for using google as the identity provider
|
||||
* @param linkedin configuration for using linkedin as the identity provider
|
||||
* @param gitlab configuration for using gitlab as the identity provider
|
||||
* @param twitch configuration for using twitch as the identity provider
|
||||
* @param amazon configuration for using amazon as the identity provider
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointOAuthProvider(
|
||||
@JsonProperty("github") final Optional<EndpointOAuthGitHub> github,
|
||||
@JsonProperty("facebook") final Optional<EndpointOAuthFacebook> facebook,
|
||||
@JsonProperty("microsoft") final Optional<EndpointOAuthMicrosoft> microsoft,
|
||||
@JsonProperty("google") final Optional<EndpointOAuthGoogle> google
|
||||
@JsonProperty("google") final Optional<EndpointOAuthGoogle> google,
|
||||
@JsonProperty("linkedin") final Optional<EndpointOAuthLinkedIn> linkedin,
|
||||
@JsonProperty("gitlab") final Optional<EndpointOAuthGitLab> gitlab,
|
||||
@JsonProperty("twitch") final Optional<EndpointOAuthTwitch> twitch,
|
||||
@JsonProperty("amazon") final Optional<EndpointOAuthAmazon> amazon
|
||||
) {
|
||||
this.github = github != null ? github : Optional.empty();
|
||||
this.facebook = facebook != null ? facebook : Optional.empty();
|
||||
this.microsoft = microsoft != null ? microsoft : Optional.empty();
|
||||
this.google = google != null ? google : Optional.empty();
|
||||
this.linkedin = linkedin != null ? linkedin : Optional.empty();
|
||||
this.gitlab = gitlab != null ? gitlab : Optional.empty();
|
||||
this.twitch = twitch != null ? twitch : Optional.empty();
|
||||
this.amazon = amazon != null ? amazon : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,6 +330,42 @@ public class EndpointOAuthProvider {
|
||||
return this.google;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using linkedin as the identity provider
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointOAuthLinkedIn} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointOAuthLinkedIn> getLinkedin() {
|
||||
return this.linkedin;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using gitlab as the identity provider
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointOAuthGitLab} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointOAuthGitLab> getGitlab() {
|
||||
return this.gitlab;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using twitch as the identity provider
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointOAuthTwitch} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointOAuthTwitch> getTwitch() {
|
||||
return this.twitch;
|
||||
}
|
||||
|
||||
/**
|
||||
* configuration for using amazon as the identity provider
|
||||
*
|
||||
* @return the value of the property as a {@link EndpointOAuthAmazon} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<EndpointOAuthAmazon> getAmazon() {
|
||||
return this.amazon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -224,7 +380,11 @@ public class EndpointOAuthProvider {
|
||||
this.github.equals(other.github)&&
|
||||
this.facebook.equals(other.facebook)&&
|
||||
this.microsoft.equals(other.microsoft)&&
|
||||
this.google.equals(other.google);
|
||||
this.google.equals(other.google)&&
|
||||
this.linkedin.equals(other.linkedin)&&
|
||||
this.gitlab.equals(other.gitlab)&&
|
||||
this.twitch.equals(other.twitch)&&
|
||||
this.amazon.equals(other.amazon);
|
||||
|
||||
}
|
||||
|
||||
@@ -234,7 +394,11 @@ public class EndpointOAuthProvider {
|
||||
this.github,
|
||||
this.facebook,
|
||||
this.microsoft,
|
||||
this.google
|
||||
this.google,
|
||||
this.linkedin,
|
||||
this.gitlab,
|
||||
this.twitch,
|
||||
this.amazon
|
||||
);
|
||||
}
|
||||
|
||||
@@ -245,6 +409,10 @@ public class EndpointOAuthProvider {
|
||||
"', facebook='" + this.facebook.map(Object::toString).orElse("(null)") +
|
||||
"', microsoft='" + this.microsoft.map(Object::toString).orElse("(null)") +
|
||||
"', google='" + this.google.map(Object::toString).orElse("(null)") +
|
||||
"', linkedin='" + this.linkedin.map(Object::toString).orElse("(null)") +
|
||||
"', gitlab='" + this.gitlab.map(Object::toString).orElse("(null)") +
|
||||
"', twitch='" + this.twitch.map(Object::toString).orElse("(null)") +
|
||||
"', amazon='" + this.amazon.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
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 EndpointOAuthTwitch} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class EndpointOAuthTwitch {
|
||||
/**
|
||||
* Builder class for {@link EndpointOAuthTwitch}.
|
||||
*/
|
||||
public static class Builder {
|
||||
private Optional<String> clientId = Optional.empty();
|
||||
private Optional<String> clientSecret = Optional.empty();
|
||||
private java.util.List<String> scopes = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailAddresses = java.util.Collections.emptyList();
|
||||
private java.util.List<String> emailDomains = java.util.Collections.emptyList();
|
||||
|
||||
private Builder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final String clientId) {
|
||||
this.clientId = Optional.of(Objects.requireNonNull(clientId, "clientId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_id property
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientId(final Optional<String> clientId) {
|
||||
this.clientId = Objects.requireNonNull(clientId, "clientId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final String clientSecret) {
|
||||
this.clientSecret = Optional.of(Objects.requireNonNull(clientSecret, "clientSecret is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client_secret property
|
||||
*
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder clientSecret(final Optional<String> clientSecret) {
|
||||
this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final java.util.List<String> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the scopes property
|
||||
*
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder scopes(final Optional<java.util.List<String>> scopes) {
|
||||
this.scopes = Objects.requireNonNull(scopes, "scopes is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final java.util.List<String> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_addresses property
|
||||
*
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailAddresses(final Optional<java.util.List<String>> emailAddresses) {
|
||||
this.emailAddresses = Objects.requireNonNull(emailAddresses, "emailAddresses is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final java.util.List<String> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email_domains property
|
||||
*
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
*/
|
||||
public Builder emailDomains(final Optional<java.util.List<String>> emailDomains) {
|
||||
this.emailDomains = Objects.requireNonNull(emailDomains, "emailDomains is required").orElse(java.util.Collections.emptyList());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the {@link EndpointOAuthTwitch} instance.
|
||||
*
|
||||
* @return a new {@link EndpointOAuthTwitch}
|
||||
*/
|
||||
public EndpointOAuthTwitch build() {
|
||||
return new EndpointOAuthTwitch(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new builder for the {@link EndpointOAuthTwitch} type.
|
||||
*
|
||||
* @return a new {@link Builder}
|
||||
*/
|
||||
public static Builder newBuilder(
|
||||
) {
|
||||
return new Builder (
|
||||
);
|
||||
}
|
||||
|
||||
@JsonProperty("client_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientId;
|
||||
@JsonProperty("client_secret")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> clientSecret;
|
||||
@JsonProperty("scopes")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> scopes;
|
||||
@JsonProperty("email_addresses")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailAddresses;
|
||||
@JsonProperty("email_domains")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> emailDomains;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link EndpointOAuthTwitch}.
|
||||
*
|
||||
* @param clientId the value of the <code>client_id</code> parameter as a {@link String}
|
||||
* @param clientSecret the value of the <code>client_secret</code> parameter as a {@link String}
|
||||
* @param scopes the value of the <code>scopes</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailAddresses the value of the <code>email_addresses</code> parameter as a {@link java.util.List} of {@link String}
|
||||
* @param emailDomains the value of the <code>email_domains</code> parameter as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
@JsonCreator
|
||||
private EndpointOAuthTwitch(
|
||||
@JsonProperty("client_id") final Optional<String> clientId,
|
||||
@JsonProperty("client_secret") final Optional<String> clientSecret,
|
||||
@JsonProperty("scopes") final java.util.List<String> scopes,
|
||||
@JsonProperty("email_addresses") final java.util.List<String> emailAddresses,
|
||||
@JsonProperty("email_domains") final java.util.List<String> emailDomains
|
||||
) {
|
||||
this.clientId = clientId != null ? clientId : Optional.empty();
|
||||
this.clientSecret = clientSecret != null ? clientSecret : Optional.empty();
|
||||
this.scopes = scopes != null ? scopes : java.util.Collections.emptyList();
|
||||
this.emailAddresses = emailAddresses != null ? emailAddresses : java.util.Collections.emptyList();
|
||||
this.emailDomains = emailDomains != null ? emailDomains : java.util.Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientId</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>clientSecret</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getClientSecret() {
|
||||
return this.clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>scopes</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getScopes() {
|
||||
return this.scopes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailAddresses</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailAddresses() {
|
||||
return this.emailAddresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the value of the <code>emailDomains</code> property.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
public java.util.List<String> getEmailDomains() {
|
||||
return this.emailDomains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final EndpointOAuthTwitch other = (EndpointOAuthTwitch) o;
|
||||
return
|
||||
this.clientId.equals(other.clientId)&&
|
||||
this.clientSecret.equals(other.clientSecret)&&
|
||||
this.scopes.equals(other.scopes)&&
|
||||
this.emailAddresses.equals(other.emailAddresses)&&
|
||||
this.emailDomains.equals(other.emailDomains);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.clientId,
|
||||
this.clientSecret,
|
||||
this.scopes,
|
||||
this.emailAddresses,
|
||||
this.emailDomains
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EndpointOAuthTwitch{" +
|
||||
"clientId='" + this.clientId.orElse("(null)") +
|
||||
"', clientSecret='" + this.clientSecret.orElse("(null)") +
|
||||
"', scopes='" + this.scopes +
|
||||
"', emailAddresses='" + this.emailAddresses +
|
||||
"', emailDomains='" + this.emailDomains +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -51,10 +51,8 @@ public class EndpointWebhookValidation {
|
||||
|
||||
/**
|
||||
* 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>.
|
||||
* endpoint. Value must be one of the supported providers defined at <a
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
*
|
||||
* @param provider the value of the <code>provider</code> parameter as a {@link String}
|
||||
* @return this builder instance
|
||||
@@ -66,10 +64,8 @@ public class EndpointWebhookValidation {
|
||||
|
||||
/**
|
||||
* 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>.
|
||||
* endpoint. Value must be one of the supported providers defined at <a
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
*
|
||||
* @param provider the value of the <code>provider</code> parameter as a {@link String}, wrapped in an {@link Optional}
|
||||
* @return this builder instance
|
||||
@@ -142,7 +138,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>, <code>PAGERDUTY</code>.
|
||||
* @param provider a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers defined at <a href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
* @param secret a string secret used to validate requests from the given provider. All providers except AWS SNS require a secret
|
||||
*/
|
||||
@JsonCreator
|
||||
@@ -168,10 +164,8 @@ public class EndpointWebhookValidation {
|
||||
|
||||
/**
|
||||
* 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>.
|
||||
* endpoint. Value must be one of the supported providers defined at <a
|
||||
* href="https://ngrok.com/docs/cloud-edge/modules/webhook">https://ngrok.com/docs/cloud-edge/modules/webhook</a>
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
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 IdentityProvider} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class IdentityProvider {
|
||||
@JsonProperty("name")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String name;
|
||||
@JsonProperty("url")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String url;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link IdentityProvider}.
|
||||
*
|
||||
* @param name name of the identity provider (e.g. Google)
|
||||
* @param url URL of the identity provider (e.g. <a href="https://accounts.google.com">https://accounts.google.com</a>)
|
||||
*/
|
||||
@JsonCreator
|
||||
public IdentityProvider(
|
||||
@JsonProperty("name") final String name,
|
||||
@JsonProperty("url") final String url
|
||||
) {
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
this.url = Objects.requireNonNull(url, "url is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* name of the identity provider (e.g. Google)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the identity provider (e.g. <a
|
||||
* href="https://accounts.google.com">https://accounts.google.com</a>)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getUrl() {
|
||||
return this.url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final IdentityProvider other = (IdentityProvider) o;
|
||||
return
|
||||
this.name.equals(other.name)&&
|
||||
this.url.equals(other.url);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.name,
|
||||
this.url
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "IdentityProvider{" +
|
||||
"name='" + this.name +
|
||||
"', url='" + this.url +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
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 Location} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class Location {
|
||||
@JsonProperty("country_code")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> countryCode;
|
||||
@JsonProperty("latitude")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Double> latitude;
|
||||
@JsonProperty("longitude")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Double> longitude;
|
||||
@JsonProperty("lat_long_radius_km")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<Long> latLongRadiusKm;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link Location}.
|
||||
*
|
||||
* @param countryCode ISO country code
|
||||
* @param latitude geographical latitude
|
||||
* @param longitude geographical longitude
|
||||
* @param latLongRadiusKm accuracy radius of the geographical coordinates
|
||||
*/
|
||||
@JsonCreator
|
||||
public Location(
|
||||
@JsonProperty("country_code") final Optional<String> countryCode,
|
||||
@JsonProperty("latitude") final Optional<Double> latitude,
|
||||
@JsonProperty("longitude") final Optional<Double> longitude,
|
||||
@JsonProperty("lat_long_radius_km") final Optional<Long> latLongRadiusKm
|
||||
) {
|
||||
this.countryCode = countryCode != null ? countryCode : Optional.empty();
|
||||
this.latitude = latitude != null ? latitude : Optional.empty();
|
||||
this.longitude = longitude != null ? longitude : Optional.empty();
|
||||
this.latLongRadiusKm = latLongRadiusKm != null ? latLongRadiusKm : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO country code
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getCountryCode() {
|
||||
return this.countryCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* geographical latitude
|
||||
*
|
||||
* @return the value of the property as a {@link double} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Double> getLatitude() {
|
||||
return this.latitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* geographical longitude
|
||||
*
|
||||
* @return the value of the property as a {@link double} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Double> getLongitude() {
|
||||
return this.longitude;
|
||||
}
|
||||
|
||||
/**
|
||||
* accuracy radius of the geographical coordinates
|
||||
*
|
||||
* @return the value of the property as a {@link long} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<Long> getLatLongRadiusKm() {
|
||||
return this.latLongRadiusKm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Location other = (Location) o;
|
||||
return
|
||||
this.countryCode.equals(other.countryCode)&&
|
||||
this.latitude.equals(other.latitude)&&
|
||||
this.longitude.equals(other.longitude)&&
|
||||
this.latLongRadiusKm.equals(other.latLongRadiusKm);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.countryCode,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.latLongRadiusKm
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Location{" +
|
||||
"countryCode='" + this.countryCode.orElse("(null)") +
|
||||
"', latitude='" + this.latitude.map(Object::toString).orElse("(null)") +
|
||||
"', longitude='" + this.longitude.map(Object::toString).orElse("(null)") +
|
||||
"', latLongRadiusKm='" + this.latLongRadiusKm.map(Object::toString).orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,9 @@ public class SshCredential {
|
||||
@JsonProperty("acl")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.List<String> acl;
|
||||
@JsonProperty("owner_id")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<String> ownerId;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link SshCredential}.
|
||||
@@ -44,7 +47,8 @@ public class SshCredential {
|
||||
* @param description human-readable description of who or what will use the ssh credential to authenticate. Optional, max 255 bytes.
|
||||
* @param metadata arbitrary user-defined machine-readable data of this ssh credential. Optional, max 4096 bytes.
|
||||
* @param publicKey the PEM-encoded public key of the SSH keypair that will be used to authenticate
|
||||
* @param acl optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the <code>bind</code> rule. The <code>bind</code> rule allows the caller to restrict what domains and addresses the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>, <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of <code>'*'</code> is equivalent to no acl at all and will explicitly permit all actions.
|
||||
* @param acl optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the <code>bind</code> rule. The <code>bind</code> rule allows the caller to restrict what domains, addresses, and labels the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>, <code>y.example.com</code>, <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard key and/or value to match multiple labels. For example, you may specify a rule of <code>bind:*=example</code> which will allow <code>x=example</code>, <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to no acl at all and will explicitly permit all actions.
|
||||
* @param ownerId If supplied at credential creation, ownership will be assigned to the specified User or Bot. Only admins may specify an owner other than themselves. Defaults to the authenticated User or Bot.
|
||||
*/
|
||||
@JsonCreator
|
||||
public SshCredential(
|
||||
@@ -54,7 +58,8 @@ public class SshCredential {
|
||||
@JsonProperty("description") final String description,
|
||||
@JsonProperty("metadata") final String metadata,
|
||||
@JsonProperty("public_key") final String publicKey,
|
||||
@JsonProperty("acl") final java.util.List<String> acl
|
||||
@JsonProperty("acl") final java.util.List<String> acl,
|
||||
@JsonProperty("owner_id") final Optional<String> ownerId
|
||||
) {
|
||||
this.id = Objects.requireNonNull(id, "id is required");
|
||||
this.uri = Objects.requireNonNull(uri, "uri is required");
|
||||
@@ -63,6 +68,7 @@ public class SshCredential {
|
||||
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
|
||||
this.publicKey = Objects.requireNonNull(publicKey, "publicKey is required");
|
||||
this.acl = acl != null ? acl : java.util.Collections.emptyList();
|
||||
this.ownerId = ownerId != null ? ownerId : Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,15 +130,18 @@ public class SshCredential {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @return the value of the property as a {@link java.util.List} of {@link String}
|
||||
*/
|
||||
@@ -140,6 +149,17 @@ public class SshCredential {
|
||||
return this.acl;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public Optional<String> getOwnerId() {
|
||||
return this.ownerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
@@ -157,7 +177,8 @@ public class SshCredential {
|
||||
this.description.equals(other.description)&&
|
||||
this.metadata.equals(other.metadata)&&
|
||||
this.publicKey.equals(other.publicKey)&&
|
||||
this.acl.equals(other.acl);
|
||||
this.acl.equals(other.acl)&&
|
||||
this.ownerId.equals(other.ownerId);
|
||||
|
||||
}
|
||||
|
||||
@@ -170,7 +191,8 @@ public class SshCredential {
|
||||
this.description,
|
||||
this.metadata,
|
||||
this.publicKey,
|
||||
this.acl
|
||||
this.acl,
|
||||
this.ownerId
|
||||
);
|
||||
}
|
||||
|
||||
@@ -184,6 +206,7 @@ public class SshCredential {
|
||||
"', metadata='" + this.metadata +
|
||||
"', publicKey='" + this.publicKey +
|
||||
"', acl='" + this.acl +
|
||||
"', ownerId='" + this.ownerId.orElse("(null)") +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Tunnel {
|
||||
private final Optional<Ref> endpoint;
|
||||
@JsonProperty("labels")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final java.util.Map<String, String> labels;
|
||||
private final Optional<java.util.Map<String, String>> labels;
|
||||
@JsonProperty("backends")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final Optional<java.util.List<Ref>> backends;
|
||||
@@ -72,7 +72,7 @@ public class Tunnel {
|
||||
@JsonProperty("region") final String region,
|
||||
@JsonProperty("tunnel_session") final Ref tunnelSession,
|
||||
@JsonProperty("endpoint") final Optional<Ref> endpoint,
|
||||
@JsonProperty("labels") final java.util.Map<String, String> labels,
|
||||
@JsonProperty("labels") final Optional<java.util.Map<String, String>> labels,
|
||||
@JsonProperty("backends") final Optional<java.util.List<Ref>> backends,
|
||||
@JsonProperty("forwards_to") final String forwardsTo
|
||||
) {
|
||||
@@ -84,7 +84,7 @@ public class Tunnel {
|
||||
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 = labels != null ? labels : java.util.Collections.emptyMap();
|
||||
this.labels = labels != null ? labels : Optional.empty();
|
||||
this.backends = backends != null ? backends : Optional.empty();
|
||||
this.forwardsTo = Objects.requireNonNull(forwardsTo, "forwardsTo is required");
|
||||
}
|
||||
@@ -171,9 +171,9 @@ public class Tunnel {
|
||||
* 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} of {@link String} to {@link String}
|
||||
* @return the value of the property as a {@link java.util.Map} of {@link String} to {@link String} wrapped in an {@link Optional}
|
||||
*/
|
||||
public java.util.Map<String, String> getLabels() {
|
||||
public Optional<java.util.Map<String, String>> getLabels() {
|
||||
return this.labels;
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ public class Tunnel {
|
||||
"', region='" + this.region +
|
||||
"', tunnelSession='" + this.tunnelSession +
|
||||
"', endpoint='" + this.endpoint.map(Object::toString).orElse("(null)") +
|
||||
"', labels='" + this.labels +
|
||||
"', labels='" + this.labels.map(Object::toString).orElse("(null)") +
|
||||
"', backends='" + this.backends.map(Object::toString).orElse("(null)") +
|
||||
"', forwardsTo='" + this.forwardsTo +
|
||||
"'}";
|
||||
|
||||
@@ -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 UserAgent} resource.
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class UserAgent {
|
||||
@JsonProperty("raw")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String raw;
|
||||
@JsonProperty("browser_name")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String browserName;
|
||||
@JsonProperty("browser_version")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String browserVersion;
|
||||
@JsonProperty("device_type")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String deviceType;
|
||||
@JsonProperty("os_name")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String osName;
|
||||
@JsonProperty("os_version")
|
||||
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
|
||||
private final String osVersion;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link UserAgent}.
|
||||
*
|
||||
* @param raw raw User-Agent request header
|
||||
* @param browserName browser name (e.g. Chrome)
|
||||
* @param browserVersion browser version (e.g. 102)
|
||||
* @param deviceType type of device (e.g. Desktop)
|
||||
* @param osName operating system name (e.g. MacOS)
|
||||
* @param osVersion operating system version (e.g. 10.15.7)
|
||||
*/
|
||||
@JsonCreator
|
||||
public UserAgent(
|
||||
@JsonProperty("raw") final String raw,
|
||||
@JsonProperty("browser_name") final String browserName,
|
||||
@JsonProperty("browser_version") final String browserVersion,
|
||||
@JsonProperty("device_type") final String deviceType,
|
||||
@JsonProperty("os_name") final String osName,
|
||||
@JsonProperty("os_version") final String osVersion
|
||||
) {
|
||||
this.raw = Objects.requireNonNull(raw, "raw is required");
|
||||
this.browserName = Objects.requireNonNull(browserName, "browserName is required");
|
||||
this.browserVersion = Objects.requireNonNull(browserVersion, "browserVersion is required");
|
||||
this.deviceType = Objects.requireNonNull(deviceType, "deviceType is required");
|
||||
this.osName = Objects.requireNonNull(osName, "osName is required");
|
||||
this.osVersion = Objects.requireNonNull(osVersion, "osVersion is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* raw User-Agent request header
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getRaw() {
|
||||
return this.raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* browser name (e.g. Chrome)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getBrowserName() {
|
||||
return this.browserName;
|
||||
}
|
||||
|
||||
/**
|
||||
* browser version (e.g. 102)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getBrowserVersion() {
|
||||
return this.browserVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* type of device (e.g. Desktop)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getDeviceType() {
|
||||
return this.deviceType;
|
||||
}
|
||||
|
||||
/**
|
||||
* operating system name (e.g. MacOS)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getOsName() {
|
||||
return this.osName;
|
||||
}
|
||||
|
||||
/**
|
||||
* operating system version (e.g. 10.15.7)
|
||||
*
|
||||
* @return the value of the property as a {@link String}
|
||||
*/
|
||||
public String getOsVersion() {
|
||||
return this.osVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final UserAgent other = (UserAgent) o;
|
||||
return
|
||||
this.raw.equals(other.raw)&&
|
||||
this.browserName.equals(other.browserName)&&
|
||||
this.browserVersion.equals(other.browserVersion)&&
|
||||
this.deviceType.equals(other.deviceType)&&
|
||||
this.osName.equals(other.osName)&&
|
||||
this.osVersion.equals(other.osVersion);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(
|
||||
this.raw,
|
||||
this.browserName,
|
||||
this.browserVersion,
|
||||
this.deviceType,
|
||||
this.osName,
|
||||
this.osVersion
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserAgent{" +
|
||||
"raw='" + this.raw +
|
||||
"', browserName='" + this.browserName +
|
||||
"', browserVersion='" + this.browserVersion +
|
||||
"', deviceType='" + this.deviceType +
|
||||
"', osName='" + this.osName +
|
||||
"', osVersion='" + this.osVersion +
|
||||
"'}";
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class AbuseReports {
|
||||
* A builder object encapsulating state for an unsent Create API call.
|
||||
*/
|
||||
public class CreateCallBuilder {
|
||||
private java.util.List<java.net.URI> urls = java.util.Collections.emptyList();
|
||||
private final java.util.List<java.net.URI> urls;
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ApiKeys {
|
||||
public class CreateCallBuilder {
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> ownerId = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
@@ -92,6 +93,32 @@ public class ApiKeys {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @param ownerId the value of the owner_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ownerId(final String ownerId) {
|
||||
this.ownerId = Optional.of(Objects.requireNonNull(ownerId, "ownerId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @param ownerId the value of the owner_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ownerId(final Optional<String> ownerId) {
|
||||
this.ownerId = Objects.requireNonNull(ownerId, "ownerId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -104,7 +131,8 @@ public class ApiKeys {
|
||||
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<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("owner_id", this.ownerId.map(Function.identity()))
|
||||
),
|
||||
Optional.of(ApiKey.class)
|
||||
);
|
||||
|
||||
@@ -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 ApplicationSessions}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-sessions">https://ngrok.com/docs/api#api-application-sessions</a>.
|
||||
*/
|
||||
public class ApplicationSessions {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for ApplicationSessions.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public ApplicationSessions(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ApplicationSession}
|
||||
*/
|
||||
public CompletionStage<ApplicationSession> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/app/sessions/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(ApplicationSession.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link ApplicationSession}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public ApplicationSession 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 an application session by ID.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-sessions-get">https://ngrok.com/docs/api#api-application-sessions-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,
|
||||
"/app/sessions/" + 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 application session by ID.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-sessions-delete">https://ngrok.com/docs/api#api-application-sessions-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 List API call.
|
||||
*/
|
||||
public class ListCallBuilder {
|
||||
private Optional<String> beforeId = Optional.empty();
|
||||
private Optional<String> limit = Optional.empty();
|
||||
|
||||
private ListCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final String beforeId) {
|
||||
this.beforeId = Optional.of(Objects.requireNonNull(beforeId, "beforeId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final Optional<String> beforeId) {
|
||||
this.beforeId = Objects.requireNonNull(beforeId, "beforeId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final String limit) {
|
||||
this.limit = Optional.of(Objects.requireNonNull(limit, "limit is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final Optional<String> limit) {
|
||||
this.limit = Objects.requireNonNull(limit, "limit is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of a {@link Page} of {@link ApplicationSessionList}
|
||||
*/
|
||||
public CompletionStage<Page<ApplicationSessionList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/app/sessions",
|
||||
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(ApplicationSessionList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link ApplicationSessionList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<ApplicationSessionList> 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 application sessions for this account.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-sessions-list">https://ngrok.com/docs/api#api-application-sessions-list</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ListCallBuilder list(
|
||||
) {
|
||||
return new ListCallBuilder(
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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 ApplicationUsers}.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-users">https://ngrok.com/docs/api#api-application-users</a>.
|
||||
*/
|
||||
public class ApplicationUsers {
|
||||
private final NgrokApiClient apiClient;
|
||||
|
||||
/**
|
||||
* Creates a new sub-client for ApplicationUsers.
|
||||
*
|
||||
* @param apiClient an instance of {@link com.ngrok.NgrokApiClient}
|
||||
*/
|
||||
public ApplicationUsers(final NgrokApiClient apiClient) {
|
||||
this.apiClient = Objects.requireNonNull(apiClient, "apiClient is required");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ApplicationUser}
|
||||
*/
|
||||
public CompletionStage<ApplicationUser> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/app/users/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.of(ApplicationUser.class)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return {@link ApplicationUser}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public ApplicationUser 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 an application user by ID.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-users-get">https://ngrok.com/docs/api#api-application-users-get</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public GetCallBuilder get(
|
||||
final String id
|
||||
) {
|
||||
return new GetCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent 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,
|
||||
"/app/users/" + this.id,
|
||||
Stream.empty(),
|
||||
Stream.empty(),
|
||||
Optional.empty()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public void blockingCall() throws InterruptedException {
|
||||
try {
|
||||
call().toCompletableFuture().get();
|
||||
} catch (final ExecutionException e) {
|
||||
throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause() : new RuntimeException(e.getCause().getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an application user by ID.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-users-delete">https://ngrok.com/docs/api#api-application-users-delete</a>.
|
||||
*
|
||||
* @param id a resource identifier
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public DeleteCallBuilder delete(
|
||||
final String id
|
||||
) {
|
||||
return new DeleteCallBuilder(
|
||||
id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A builder object encapsulating state for an unsent List API call.
|
||||
*/
|
||||
public class ListCallBuilder {
|
||||
private Optional<String> beforeId = Optional.empty();
|
||||
private Optional<String> limit = Optional.empty();
|
||||
|
||||
private ListCallBuilder(
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final String beforeId) {
|
||||
this.beforeId = Optional.of(Objects.requireNonNull(beforeId, "beforeId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>before_id</code> parameter.
|
||||
*
|
||||
* @param beforeId the value of the before_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder beforeId(final Optional<String> beforeId) {
|
||||
this.beforeId = Objects.requireNonNull(beforeId, "beforeId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final String limit) {
|
||||
this.limit = Optional.of(Objects.requireNonNull(limit, "limit is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets (or unsets) the <code>limit</code> parameter.
|
||||
*
|
||||
* @param limit the value of the limit parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public ListCallBuilder limit(final Optional<String> limit) {
|
||||
this.limit = Objects.requireNonNull(limit, "limit is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
* @return a {@link CompletionStage} of a {@link Page} of {@link ApplicationUserList}
|
||||
*/
|
||||
public CompletionStage<Page<ApplicationUserList>> call() {
|
||||
return apiClient.sendRequest(
|
||||
NgrokApiClient.HttpMethod.GET,
|
||||
"/app/users",
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("before_id", this.beforeId.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("limit", this.limit.map(Function.identity()))
|
||||
),
|
||||
Stream.empty(),
|
||||
Optional.of(ApplicationUserList.class)
|
||||
).thenApply(list -> new Page<>(apiClient, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call and blocks until it returns.
|
||||
*
|
||||
* @return a {@link Page} of {@link ApplicationUserList}
|
||||
* @throws InterruptedException if the thread was interrupted during the call
|
||||
*/
|
||||
public Page<ApplicationUserList> 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 application users for this account.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-application-users-list">https://ngrok.com/docs/api#api-application-users-list</a>.
|
||||
*
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public ListCallBuilder list(
|
||||
) {
|
||||
return new ListCallBuilder(
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ public class Credentials {
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> acl = java.util.Collections.emptyList();
|
||||
private Optional<String> ownerId = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
) {
|
||||
@@ -95,15 +96,18 @@ public class Credentials {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as a {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -116,15 +120,18 @@ public class Credentials {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as an {@link Optional} of {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -134,6 +141,32 @@ public class Credentials {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @param ownerId the value of the owner_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ownerId(final String ownerId) {
|
||||
this.ownerId = Optional.of(Objects.requireNonNull(ownerId, "ownerId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @param ownerId the value of the owner_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ownerId(final Optional<String> ownerId) {
|
||||
this.ownerId = Objects.requireNonNull(ownerId, "ownerId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -147,7 +180,8 @@ public class Credentials {
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("acl", Optional.of(this.acl).filter(acl -> !acl.isEmpty()).map(Function.identity()))
|
||||
new AbstractMap.SimpleEntry<>("acl", Optional.of(this.acl).filter(acl -> !acl.isEmpty()).map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("owner_id", this.ownerId.map(Function.identity()))
|
||||
),
|
||||
Optional.of(Credential.class)
|
||||
);
|
||||
@@ -407,7 +441,7 @@ public class Credentials {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> acl = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<String>> acl = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
@@ -466,42 +500,48 @@ public class Credentials {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as a {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder acl(final java.util.List<String> acl) {
|
||||
this.acl = Objects.requireNonNull(acl, "acl is required");
|
||||
this.acl = Optional.of(Objects.requireNonNull(acl, "acl is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as an {@link Optional} of {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder acl(final Optional<java.util.List<String>> acl) {
|
||||
this.acl = Objects.requireNonNull(acl, "acl is required").orElse(java.util.Collections.emptyList());
|
||||
this.acl = Objects.requireNonNull(acl, "acl is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class EdgesHttps {
|
||||
public class CreateCallBuilder {
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> hostports = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTerminationAtEdge> tlsTermination = Optional.empty();
|
||||
|
||||
@@ -97,7 +97,7 @@ public class EdgesHttps {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
this.hostports = Optional.of(Objects.requireNonNull(hostports, "hostports is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class EdgesHttps {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required").orElse(java.util.Collections.emptyList());
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ public class EdgesHttps {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> hostports = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointMutualTlsMutate> mutualTls = Optional.empty();
|
||||
private Optional<EndpointTlsTerminationAtEdge> tlsTermination = Optional.empty();
|
||||
|
||||
@@ -436,7 +436,7 @@ public class EdgesHttps {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
this.hostports = Optional.of(Objects.requireNonNull(hostports, "hostports is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -447,7 +447,7 @@ public class EdgesHttps {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required").orElse(java.util.Collections.emptyList());
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class EdgesTcp {
|
||||
public class CreateCallBuilder {
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> hostports = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
|
||||
@@ -97,7 +97,7 @@ public class EdgesTcp {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
this.hostports = Optional.of(Objects.requireNonNull(hostports, "hostports is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class EdgesTcp {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required").orElse(java.util.Collections.emptyList());
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ public class EdgesTcp {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> hostports = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<String>> hostports = Optional.empty();
|
||||
private Optional<EndpointBackendMutate> backend = Optional.empty();
|
||||
private Optional<EndpointIpPolicyMutate> ipRestriction = Optional.empty();
|
||||
|
||||
@@ -436,7 +436,7 @@ public class EdgesTcp {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
this.hostports = Optional.of(Objects.requireNonNull(hostports, "hostports is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -447,7 +447,7 @@ public class EdgesTcp {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required").orElse(java.util.Collections.emptyList());
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class EdgesTls {
|
||||
public class CreateCallBuilder {
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> hostports = java.util.Collections.emptyList();
|
||||
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();
|
||||
@@ -99,7 +99,7 @@ public class EdgesTls {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
this.hostports = Optional.of(Objects.requireNonNull(hostports, "hostports is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class EdgesTls {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required").orElse(java.util.Collections.emptyList());
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ public class EdgesTls {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> hostports = java.util.Collections.emptyList();
|
||||
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();
|
||||
@@ -486,7 +486,7 @@ public class EdgesTls {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final java.util.List<String> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
this.hostports = Optional.of(Objects.requireNonNull(hostports, "hostports is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ public class EdgesTls {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder hostports(final Optional<java.util.List<String>> hostports) {
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required").orElse(java.util.Collections.emptyList());
|
||||
this.hostports = Objects.requireNonNull(hostports, "hostports is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -176,8 +176,7 @@ public class EventDestinations {
|
||||
|
||||
/**
|
||||
* Create a new Event Destination. It will not apply to anything until it is
|
||||
* associated with an Event Stream, and that Event Stream is associated with an
|
||||
* Endpoint Config.
|
||||
* associated with an Event Subscription.
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-event-destinations-create">https://ngrok.com/docs/api#api-event-destinations-create</a>.
|
||||
*
|
||||
|
||||
@@ -406,8 +406,8 @@ public class EventSubscriptions {
|
||||
private final String id;
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> description = Optional.empty();
|
||||
private java.util.List<EventSourceReplace> sources = java.util.Collections.emptyList();
|
||||
private java.util.List<String> destinationIds = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<EventSourceReplace>> sources = Optional.empty();
|
||||
private Optional<java.util.List<String>> destinationIds = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
@@ -470,7 +470,7 @@ public class EventSubscriptions {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder sources(final java.util.List<EventSourceReplace> sources) {
|
||||
this.sources = Objects.requireNonNull(sources, "sources is required");
|
||||
this.sources = Optional.of(Objects.requireNonNull(sources, "sources is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ public class EventSubscriptions {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder sources(final Optional<java.util.List<EventSourceReplace>> sources) {
|
||||
this.sources = Objects.requireNonNull(sources, "sources is required").orElse(java.util.Collections.emptyList());
|
||||
this.sources = Objects.requireNonNull(sources, "sources is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ public class EventSubscriptions {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder destinationIds(final java.util.List<String> destinationIds) {
|
||||
this.destinationIds = Objects.requireNonNull(destinationIds, "destinationIds is required");
|
||||
this.destinationIds = Optional.of(Objects.requireNonNull(destinationIds, "destinationIds is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ public class EventSubscriptions {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder destinationIds(final Optional<java.util.List<String>> destinationIds) {
|
||||
this.destinationIds = Objects.requireNonNull(destinationIds, "destinationIds is required").orElse(java.util.Collections.emptyList());
|
||||
this.destinationIds = Objects.requireNonNull(destinationIds, "destinationIds is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@ public class HttpResponseBackends {
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<String> body = Optional.empty();
|
||||
private java.util.Map<String, String> headers = java.util.Collections.emptyMap();
|
||||
private Optional<java.util.Map<String, String>> headers = Optional.empty();
|
||||
private Optional<Integer> statusCode = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
@@ -507,7 +507,7 @@ public class HttpResponseBackends {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder headers(final java.util.Map<String, String> headers) {
|
||||
this.headers = Objects.requireNonNull(headers, "headers is required");
|
||||
this.headers = Optional.of(Objects.requireNonNull(headers, "headers is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@ public class HttpResponseBackends {
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder headers(final Optional<java.util.Map<String, String>> headers) {
|
||||
this.headers = Objects.requireNonNull(headers, "headers is required").orElse(java.util.Collections.emptyMap());
|
||||
this.headers = Objects.requireNonNull(headers, "headers is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class IpRestrictions {
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private Optional<Boolean> enforced = Optional.empty();
|
||||
private final String type;
|
||||
private java.util.List<String> ipPolicyIds = java.util.Collections.emptyList();
|
||||
private final java.util.List<String> ipPolicyIds;
|
||||
|
||||
private CreateCallBuilder(
|
||||
final String type,
|
||||
|
||||
@@ -35,7 +35,8 @@ public class ReservedDomains {
|
||||
* A builder object encapsulating state for an unsent Create API call.
|
||||
*/
|
||||
public class CreateCallBuilder {
|
||||
private final String name;
|
||||
private Optional<String> name = Optional.empty();
|
||||
private Optional<String> domain = Optional.empty();
|
||||
private Optional<String> region = Optional.empty();
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
@@ -43,9 +44,55 @@ public class ReservedDomains {
|
||||
private Optional<ReservedDomainCertPolicy> certificateManagementPolicy = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
final String name
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* the domain name to reserve. It may be a full domain name like app.example.com.
|
||||
* If the name does not contain a '.' it will reserve that subdomain on
|
||||
* ngrok.io.
|
||||
*
|
||||
* @param name the value of the name parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder name(final String name) {
|
||||
this.name = Optional.of(Objects.requireNonNull(name, "name is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the domain name to reserve. It may be a full domain name like app.example.com.
|
||||
* If the name does not contain a '.' it will reserve that subdomain on
|
||||
* ngrok.io.
|
||||
*
|
||||
* @param name the value of the name parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder name(final Optional<String> name) {
|
||||
this.name = Objects.requireNonNull(name, "name is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostname of the reserved domain
|
||||
*
|
||||
* @param domain the value of the domain parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder domain(final String domain) {
|
||||
this.domain = Optional.of(Objects.requireNonNull(domain, "domain is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* hostname of the reserved domain
|
||||
*
|
||||
* @param domain the value of the domain parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder domain(final Optional<String> domain) {
|
||||
this.domain = Objects.requireNonNull(domain, "domain is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,7 +228,8 @@ public class ReservedDomains {
|
||||
"/reserved_domains",
|
||||
Stream.empty(),
|
||||
Stream.of(
|
||||
new AbstractMap.SimpleEntry<>("name", Optional.of(this.name)),
|
||||
new AbstractMap.SimpleEntry<>("name", this.name.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("domain", this.domain.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("region", this.region.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
@@ -212,14 +260,11 @@ public class ReservedDomains {
|
||||
*
|
||||
* See also <a href="https://ngrok.com/docs/api#api-reserved-domains-create">https://ngrok.com/docs/api#api-reserved-domains-create</a>.
|
||||
*
|
||||
* @param name the domain name to reserve. It may be a full domain name like app.example.com. If the name does not contain a '.' it will reserve that subdomain on ngrok.io.
|
||||
* @return a call builder for this API call
|
||||
*/
|
||||
public CreateCallBuilder create(
|
||||
final String name
|
||||
) {
|
||||
return new CreateCallBuilder(
|
||||
name
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ public class SshCredentials {
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> acl = java.util.Collections.emptyList();
|
||||
private final String publicKey;
|
||||
private Optional<String> ownerId = Optional.empty();
|
||||
|
||||
private CreateCallBuilder(
|
||||
final String publicKey
|
||||
@@ -95,15 +96,18 @@ public class SshCredentials {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as a {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -116,15 +120,18 @@ public class SshCredentials {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as an {@link Optional} of {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
@@ -134,6 +141,32 @@ public class SshCredentials {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @param ownerId the value of the owner_id parameter as a {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ownerId(final String ownerId) {
|
||||
this.ownerId = Optional.of(Objects.requireNonNull(ownerId, "ownerId is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If supplied at credential creation, ownership will be assigned to the specified
|
||||
* User or Bot. Only admins may specify an owner other than themselves. Defaults to
|
||||
* the authenticated User or Bot.
|
||||
*
|
||||
* @param ownerId the value of the owner_id parameter as an {@link Optional} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public CreateCallBuilder ownerId(final Optional<String> ownerId) {
|
||||
this.ownerId = Objects.requireNonNull(ownerId, "ownerId is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates the API call asynchronously.
|
||||
*
|
||||
@@ -148,7 +181,8 @@ public class SshCredentials {
|
||||
new AbstractMap.SimpleEntry<>("description", this.description.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("metadata", this.metadata.map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("acl", Optional.of(this.acl).filter(acl -> !acl.isEmpty()).map(Function.identity())),
|
||||
new AbstractMap.SimpleEntry<>("public_key", Optional.of(this.publicKey))
|
||||
new AbstractMap.SimpleEntry<>("public_key", Optional.of(this.publicKey)),
|
||||
new AbstractMap.SimpleEntry<>("owner_id", this.ownerId.map(Function.identity()))
|
||||
),
|
||||
Optional.of(SshCredential.class)
|
||||
);
|
||||
@@ -409,7 +443,7 @@ public class SshCredentials {
|
||||
private final String id;
|
||||
private Optional<String> description = Optional.empty();
|
||||
private Optional<String> metadata = Optional.empty();
|
||||
private java.util.List<String> acl = java.util.Collections.emptyList();
|
||||
private Optional<java.util.List<String>> acl = Optional.empty();
|
||||
|
||||
private UpdateCallBuilder(
|
||||
final String id
|
||||
@@ -468,42 +502,48 @@ public class SshCredentials {
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as a {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder acl(final java.util.List<String> acl) {
|
||||
this.acl = Objects.requireNonNull(acl, "acl is required");
|
||||
this.acl = Optional.of(Objects.requireNonNull(acl, "acl is required"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* optional list of ACL rules. If unspecified, the credential will have no
|
||||
* restrictions. The only allowed ACL rule at this time is the <code>bind</code>
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains and
|
||||
* addresses the token is allowed to bind. For example, to allow the token to open
|
||||
* a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules may specify a leading wildcard to
|
||||
* match multiple domains with a common suffix. For example, you may specify a rule
|
||||
* of <code>bind:*.example.com</code> which will allow <code>x.example.com</code>,
|
||||
* <code>y.example.com</code>, <code>*.example.com</code>, etc. A rule of
|
||||
* <code>'*'</code> is equivalent to no acl at all and will explicitly
|
||||
* permit all actions.
|
||||
* rule. The <code>bind</code> rule allows the caller to restrict what domains,
|
||||
* addresses, and labels the token is allowed to bind. For example, to allow the
|
||||
* token to open a tunnel on example.ngrok.io your ACL would include the rule
|
||||
* <code>bind:example.ngrok.io</code>. Bind rules for domains may specify a leading
|
||||
* wildcard to match multiple domains with a common suffix. For example, you may
|
||||
* specify a rule of <code>bind:*.example.com</code> which will allow
|
||||
* <code>x.example.com</code>, <code>y.example.com</code>,
|
||||
* <code>*.example.com</code>, etc. Bind rules for labels may specify a wildcard
|
||||
* key and/or value to match multiple labels. For example, you may specify a rule
|
||||
* of <code>bind:*=example</code> which will allow <code>x=example</code>,
|
||||
* <code>y=example</code>, etc. A rule of <code>'*'</code> is equivalent to
|
||||
* no acl at all and will explicitly permit all actions.
|
||||
*
|
||||
* @param acl the value of the acl parameter as an {@link Optional} of {@link java.util.List} of {@link String}
|
||||
* @return the call builder instance
|
||||
*/
|
||||
public UpdateCallBuilder acl(final Optional<java.util.List<String>> acl) {
|
||||
this.acl = Objects.requireNonNull(acl, "acl is required").orElse(java.util.Collections.emptyList());
|
||||
this.acl = Objects.requireNonNull(acl, "acl is required");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.stream.Stream;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
// Test
|
||||
public abstract class ApiKeyTestBase extends TestBase {
|
||||
public static ApiKey API_KEY = new ApiKey(
|
||||
"abcdef123456",
|
||||
@@ -19,7 +20,8 @@ public abstract class ApiKeyTestBase extends TestBase {
|
||||
"this is a great API key",
|
||||
"this API key is quite meta",
|
||||
OffsetDateTime.parse("2021-06-08T21:09:00-07:00"),
|
||||
Optional.of("qwertyuiop")
|
||||
Optional.of("qwertyuiop"),
|
||||
Optional.of("usr_abcdefghijklmnopqrstuvwxyz0")
|
||||
);
|
||||
|
||||
public static ApiKey API_KEY_NO_TOKEN = new ApiKey(
|
||||
@@ -28,7 +30,8 @@ public abstract class ApiKeyTestBase extends TestBase {
|
||||
API_KEY.getDescription(),
|
||||
API_KEY.getMetadata(),
|
||||
API_KEY.getCreatedAt(),
|
||||
Optional.empty()
|
||||
Optional.empty(),
|
||||
API_KEY.getOwnerId()
|
||||
);
|
||||
|
||||
public static final Map<String, Object> API_KEY_JSON_FIELDS = Stream.of(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
||||
import com.linecorp.armeria.common.HttpHeaderNames;
|
||||
import com.ngrok.ApiKeyTestBase;
|
||||
import com.ngrok.Ngrok;
|
||||
@@ -37,7 +38,8 @@ public class ApiKeysTest extends ApiKeyTestBase {
|
||||
"",
|
||||
"",
|
||||
OffsetDateTime.now(),
|
||||
Optional.of("12345")
|
||||
Optional.of("12345"),
|
||||
Optional.of("usr_abcdefghijklmnopqrstuvwxyz0")
|
||||
);
|
||||
|
||||
private static final ApiKeyList API_KEY_LIST = new ApiKeyList(
|
||||
@@ -52,7 +54,8 @@ public class ApiKeysTest extends ApiKeyTestBase {
|
||||
"this is an UPDATED description",
|
||||
API_KEY.getMetadata(),
|
||||
API_KEY.getCreatedAt(),
|
||||
Optional.empty()
|
||||
Optional.empty(),
|
||||
Optional.of("usr_abcdefghijklmnopqrstuvwxyz0")
|
||||
);
|
||||
|
||||
private static final Map<String, Object> API_KEY_UPDATE = Stream.of(
|
||||
@@ -60,7 +63,7 @@ public class ApiKeysTest extends ApiKeyTestBase {
|
||||
).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
|
||||
@RegisterExtension
|
||||
final WireMockExtension wireMock = new WireMockExtension();
|
||||
final WireMockExtension wireMock = new WireMockExtension(new WireMockConfiguration().dynamicPort().dynamicHttpsPort());
|
||||
|
||||
private Ngrok ngrok() {
|
||||
return TestBase.ngrok(wireMock.getBaseUri());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
||||
import com.linecorp.armeria.common.HttpHeaderNames;
|
||||
import com.ngrok.EventSubscriptionTestBase;
|
||||
import com.ngrok.Ngrok;
|
||||
@@ -26,7 +27,7 @@ import static org.assertj.core.api.Assertions.fail;
|
||||
|
||||
public class EventSubscriptionsTest extends EventSubscriptionTestBase {
|
||||
@RegisterExtension
|
||||
final WireMockExtension wireMock = new WireMockExtension();
|
||||
final WireMockExtension wireMock = new WireMockExtension(new WireMockConfiguration().dynamicPort().dynamicHttpsPort());
|
||||
|
||||
public static final Map<String, Object> EVENT_DESTINATION_CREATE = Stream.of(
|
||||
entry("description", EVENT_DESTINATION.getDescription()),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
||||
import com.linecorp.armeria.common.HttpHeaderNames;
|
||||
import com.ngrok.Ngrok;
|
||||
import com.ngrok.TestBase;
|
||||
@@ -63,7 +64,7 @@ public class HttpsEdgesTest extends TestBase {
|
||||
}
|
||||
|
||||
@RegisterExtension
|
||||
final WireMockExtension wireMock = new WireMockExtension();
|
||||
final WireMockExtension wireMock = new WireMockExtension(new WireMockConfiguration().dynamicPort().dynamicHttpsPort());
|
||||
|
||||
private Ngrok ngrok() {
|
||||
return TestBase.ngrok(wireMock.getBaseUri());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ngrok.services;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
|
||||
import com.linecorp.armeria.common.HttpHeaderNames;
|
||||
import com.ngrok.Ngrok;
|
||||
import com.ngrok.TestBase;
|
||||
@@ -49,7 +50,7 @@ public class IpPolicyRulesTest extends TestBase {
|
||||
).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
|
||||
@RegisterExtension
|
||||
final WireMockExtension wireMock = new WireMockExtension();
|
||||
final WireMockExtension wireMock = new WireMockExtension(new WireMockConfiguration().dynamicPort().dynamicHttpsPort());
|
||||
|
||||
private Ngrok ngrok() {
|
||||
return TestBase.ngrok(wireMock.getBaseUri());
|
||||
|
||||
Reference in New Issue
Block a user