Update generated files

This commit is contained in:
ngrok release bot
2023-09-01 13:47:05 +00:00
parent 52efbb1fc4
commit de2159e74f
179 changed files with 4975 additions and 625 deletions
+2
View File
@@ -1,3 +1,5 @@
# Code generated for API Clients. DO NOT EDIT.
target/
.classpath
.project
+9
View File
@@ -0,0 +1,9 @@
<!-- Code generated for API Clients. DO NOT EDIT. -->
## 0.8.0
ENHANCEMENTS:
* Added `owner_id` field to the `api_key`, `credential`, and `ssh_credential` resources. 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.
* Added `failover_backend`, `http_response_backend`, and `tunnel_group_backend` resources. A Failover backend defines failover behavior within a list of referenced backends. Traffic is sent to the first backend in the list. If that backend is offline or no connection can be established, ngrok attempts to connect to the next backend in the list until one is successful.
+6
View File
@@ -1,3 +1,5 @@
<!-- Code generated for API Clients. DO NOT EDIT. -->
# Unstable
This library is currently unstable. We know of rough edges
@@ -29,6 +31,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
+3 -1
View File
@@ -1,5 +1,7 @@
<?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">
<!-- Code generated for API Clients. DO NOT EDIT. -->
<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>
+2
View File
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
# Code generated for API Clients. DO NOT EDIT.
set -e
rm -rf docs/
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok;
/**
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok;
import com.fasterxml.jackson.databind.JsonNode;
+37 -13
View File
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok;
import com.ngrok.services.*;
@@ -82,6 +84,41 @@ 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);
}
/**
* Tunnel Sessions represent instances of ngrok agents or SSH reverse tunnel
* sessions that are running and connected to the ngrok service. Each tunnel
* session can include one or more Tunnels.
*
* See also <a href="https://ngrok.com/docs/api#api-tunnel-sessions">https://ngrok.com/docs/api#api-tunnel-sessions</a>.
*
* @return a service client
*/
public TunnelSessions tunnelSessions() {
return new TunnelSessions(this.apiClient);
}
/**
* Certificate Authorities are x509 certificates that are used to sign other
* x509 certificates. Attach a Certificate Authority to the Mutual TLS module
@@ -293,19 +330,6 @@ public class Ngrok {
return new TlsCertificates(this.apiClient);
}
/**
* Tunnel Sessions represent instances of ngrok agents or SSH reverse tunnel
* sessions that are running and connected to the ngrok service. Each tunnel
* session can include one or more Tunnels.
*
* See also <a href="https://ngrok.com/docs/api#api-tunnel-sessions">https://ngrok.com/docs/api#api-tunnel-sessions</a>.
*
* @return a service client
*/
public TunnelSessions tunnelSessions() {
return new TunnelSessions(this.apiClient);
}
/**
* Tunnels provide endpoints to access services exposed by a running ngrok
* agent tunnel session or an SSH reverse tunnel session.
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok;
import java.net.URI;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -27,7 +29,7 @@ public class AbuseReport {
private final java.util.List<java.net.URI> urls;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("status")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String status;
@@ -52,7 +54,7 @@ public class AbuseReport {
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("urls") final java.util.List<java.net.URI> urls,
@JsonProperty("metadata") final String metadata,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("status") final String status,
@JsonProperty("hostnames") final java.util.List<AbuseReportHostname> hostnames
) {
@@ -60,7 +62,7 @@ public class AbuseReport {
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.urls = urls != null ? urls : java.util.Collections.emptyList();
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.metadata = metadata != null ? metadata : Optional.empty();
this.status = Objects.requireNonNull(status, "status is required");
this.hostnames = hostnames != null ? hostnames : java.util.Collections.emptyList();
}
@@ -104,9 +106,9 @@ public class AbuseReport {
/**
* arbitrary user-defined data about this abuse report. Optional, max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -171,7 +173,7 @@ public class AbuseReport {
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', urls='" + this.urls +
"', metadata='" + this.metadata +
"', metadata='" + this.metadata.orElse("(null)") +
"', status='" + this.status +
"', hostnames='" + this.hostnames +
"'}";
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -21,10 +23,10 @@ public class AgentIngress {
private final java.net.URI uri;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("domain")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String domain;
@@ -37,6 +39,12 @@ public class AgentIngress {
@JsonProperty("created_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.time.OffsetDateTime createdAt;
@JsonProperty("certificate_management_policy")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<AgentIngressCertPolicy> certificateManagementPolicy;
@JsonProperty("certificate_management_status")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<AgentIngressCertStatus> certificateManagementStatus;
/**
* Creates a new instance of {@link AgentIngress}.
@@ -49,26 +57,32 @@ public class AgentIngress {
* @param nsTargets a list of target values to use as the values of NS records for the domain property these values will delegate control over the domain to ngrok
* @param regionDomains a list of regional agent ingress domains that are subdomains of the value of domain this value may increase over time as ngrok adds more regions
* @param createdAt timestamp when the Agent Ingress was created, RFC 3339 format
* @param certificateManagementPolicy configuration for automatic management of TLS certificates for this domain, or null if automatic management is disabled
* @param certificateManagementStatus status of the automatic certificate management for this domain, or null if automatic management is disabled
*/
@JsonCreator
public AgentIngress(
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("domain") final String domain,
@JsonProperty("ns_targets") final java.util.List<String> nsTargets,
@JsonProperty("region_domains") final java.util.List<String> regionDomains,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("certificate_management_policy") final Optional<AgentIngressCertPolicy> certificateManagementPolicy,
@JsonProperty("certificate_management_status") final Optional<AgentIngressCertStatus> certificateManagementStatus
) {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.domain = Objects.requireNonNull(domain, "domain is required");
this.nsTargets = nsTargets != null ? nsTargets : java.util.Collections.emptyList();
this.regionDomains = regionDomains != null ? regionDomains : java.util.Collections.emptyList();
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.certificateManagementPolicy = certificateManagementPolicy != null ? certificateManagementPolicy : Optional.empty();
this.certificateManagementStatus = certificateManagementStatus != null ? certificateManagementStatus : Optional.empty();
}
/**
@@ -93,9 +107,9 @@ public class AgentIngress {
* human-readable description of the use of this Agent Ingress. optional, max 255
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -103,9 +117,9 @@ public class AgentIngress {
* arbitrary user-defined machine-readable data of this Agent Ingress. optional,
* max 4096 bytes
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -148,6 +162,26 @@ public class AgentIngress {
return this.createdAt;
}
/**
* configuration for automatic management of TLS certificates for this domain, or
* null if automatic management is disabled
*
* @return the value of the property as a {@link AgentIngressCertPolicy} wrapped in an {@link Optional}
*/
public Optional<AgentIngressCertPolicy> getCertificateManagementPolicy() {
return this.certificateManagementPolicy;
}
/**
* status of the automatic certificate management for this domain, or null if
* automatic management is disabled
*
* @return the value of the property as a {@link AgentIngressCertStatus} wrapped in an {@link Optional}
*/
public Optional<AgentIngressCertStatus> getCertificateManagementStatus() {
return this.certificateManagementStatus;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
@@ -166,7 +200,9 @@ public class AgentIngress {
this.domain.equals(other.domain)&&
this.nsTargets.equals(other.nsTargets)&&
this.regionDomains.equals(other.regionDomains)&&
this.createdAt.equals(other.createdAt);
this.createdAt.equals(other.createdAt)&&
this.certificateManagementPolicy.equals(other.certificateManagementPolicy)&&
this.certificateManagementStatus.equals(other.certificateManagementStatus);
}
@@ -180,7 +216,9 @@ public class AgentIngress {
this.domain,
this.nsTargets,
this.regionDomains,
this.createdAt
this.createdAt,
this.certificateManagementPolicy,
this.certificateManagementStatus
);
}
@@ -189,12 +227,14 @@ public class AgentIngress {
return "AgentIngress{" +
"id='" + this.id +
"', uri='" + this.uri +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', domain='" + this.domain +
"', nsTargets='" + this.nsTargets +
"', regionDomains='" + this.regionDomains +
"', createdAt='" + this.createdAt +
"', certificateManagementPolicy='" + this.certificateManagementPolicy.map(Object::toString).orElse("(null)") +
"', certificateManagementStatus='" + this.certificateManagementStatus.map(Object::toString).orElse("(null)") +
"'}";
}
}
@@ -0,0 +1,127 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link AgentIngressCertJob} resource.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class AgentIngressCertJob {
@JsonProperty("error_code")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> errorCode;
@JsonProperty("msg")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String msg;
@JsonProperty("started_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.time.OffsetDateTime startedAt;
@JsonProperty("retries_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<java.time.OffsetDateTime> retriesAt;
/**
* Creates a new instance of {@link AgentIngressCertJob}.
*
* @param errorCode if present, an error code indicating why provisioning is failing. It may be either a temporary condition (INTERNAL_ERROR), or a permanent one the user must correct (DNS_ERROR).
* @param msg a message describing the current status or error
* @param startedAt timestamp when the provisioning job started, RFC 3339 format
* @param retriesAt timestamp when the provisioning job will be retried
*/
@JsonCreator
public AgentIngressCertJob(
@JsonProperty("error_code") final Optional<String> errorCode,
@JsonProperty("msg") final String msg,
@JsonProperty("started_at") final java.time.OffsetDateTime startedAt,
@JsonProperty("retries_at") final Optional<java.time.OffsetDateTime> retriesAt
) {
this.errorCode = errorCode != null ? errorCode : Optional.empty();
this.msg = Objects.requireNonNull(msg, "msg is required");
this.startedAt = Objects.requireNonNull(startedAt, "startedAt is required");
this.retriesAt = retriesAt != null ? retriesAt : Optional.empty();
}
/**
* if present, an error code indicating why provisioning is failing. It may be
* either a temporary condition (INTERNAL_ERROR), or a permanent one the user must
* correct (DNS_ERROR).
*
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public Optional<String> getErrorCode() {
return this.errorCode;
}
/**
* a message describing the current status or error
*
* @return the value of the property as a {@link String}
*/
public String getMsg() {
return this.msg;
}
/**
* timestamp when the provisioning job started, RFC 3339 format
*
* @return the value of the property as a {@link java.time.OffsetDateTime}
*/
public java.time.OffsetDateTime getStartedAt() {
return this.startedAt;
}
/**
* timestamp when the provisioning job will be retried
*
* @return the value of the property as a {@link java.time.OffsetDateTime} wrapped in an {@link Optional}
*/
public Optional<java.time.OffsetDateTime> getRetriesAt() {
return this.retriesAt;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final AgentIngressCertJob other = (AgentIngressCertJob) o;
return
this.errorCode.equals(other.errorCode)&&
this.msg.equals(other.msg)&&
this.startedAt.equals(other.startedAt)&&
this.retriesAt.equals(other.retriesAt);
}
@Override
public int hashCode() {
return Objects.hash(
this.errorCode,
this.msg,
this.startedAt,
this.retriesAt
);
}
@Override
public String toString() {
return "AgentIngressCertJob{" +
"errorCode='" + this.errorCode.orElse("(null)") +
"', msg='" + this.msg +
"', startedAt='" + this.startedAt +
"', retriesAt='" + this.retriesAt.map(Object::toString).orElse("(null)") +
"'}";
}
}
@@ -0,0 +1,174 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link AgentIngressCertPolicy} resource.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class AgentIngressCertPolicy {
/**
* Builder class for {@link AgentIngressCertPolicy}.
*/
public static class Builder {
private Optional<String> authority = Optional.empty();
private Optional<String> privateKeyType = Optional.empty();
private Builder(
) {
}
/**
* certificate authority to request certificates from. The only supported value is
* letsencrypt.
*
* @param authority the value of the <code>authority</code> parameter as a {@link String}
* @return this builder instance
*/
public Builder authority(final String authority) {
this.authority = Optional.of(Objects.requireNonNull(authority, "authority is required"));
return this;
}
/**
* certificate authority to request certificates from. The only supported value is
* letsencrypt.
*
* @param authority the value of the <code>authority</code> parameter as a {@link String}, wrapped in an {@link Optional}
* @return this builder instance
*/
public Builder authority(final Optional<String> authority) {
this.authority = Objects.requireNonNull(authority, "authority is required");
return this;
}
/**
* type of private key to use when requesting certificates. Defaults to rsa, can be
* either rsa or ecdsa.
*
* @param privateKeyType the value of the <code>private_key_type</code> parameter as a {@link String}
* @return this builder instance
*/
public Builder privateKeyType(final String privateKeyType) {
this.privateKeyType = Optional.of(Objects.requireNonNull(privateKeyType, "privateKeyType is required"));
return this;
}
/**
* type of private key to use when requesting certificates. Defaults to rsa, can be
* either rsa or ecdsa.
*
* @param privateKeyType the value of the <code>private_key_type</code> parameter as a {@link String}, wrapped in an {@link Optional}
* @return this builder instance
*/
public Builder privateKeyType(final Optional<String> privateKeyType) {
this.privateKeyType = Objects.requireNonNull(privateKeyType, "privateKeyType is required");
return this;
}
/**
* Constructs the {@link AgentIngressCertPolicy} instance.
*
* @return a new {@link AgentIngressCertPolicy}
*/
public AgentIngressCertPolicy build() {
return new AgentIngressCertPolicy(
this.authority.orElse(""),
this.privateKeyType.orElse("")
);
}
}
/**
* Creates a new builder for the {@link AgentIngressCertPolicy} type.
*
* @return a new {@link Builder}
*/
public static Builder newBuilder(
) {
return new Builder (
);
}
@JsonProperty("authority")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String authority;
@JsonProperty("private_key_type")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String privateKeyType;
/**
* Creates a new instance of {@link AgentIngressCertPolicy}.
*
* @param authority certificate authority to request certificates from. The only supported value is letsencrypt.
* @param privateKeyType type of private key to use when requesting certificates. Defaults to rsa, can be either rsa or ecdsa.
*/
@JsonCreator
private AgentIngressCertPolicy(
@JsonProperty("authority") final String authority,
@JsonProperty("private_key_type") final String privateKeyType
) {
this.authority = Objects.requireNonNull(authority, "authority is required");
this.privateKeyType = Objects.requireNonNull(privateKeyType, "privateKeyType is required");
}
/**
* certificate authority to request certificates from. The only supported value is
* letsencrypt.
*
* @return the value of the property as a {@link String}
*/
public String getAuthority() {
return this.authority;
}
/**
* type of private key to use when requesting certificates. Defaults to rsa, can be
* either rsa or ecdsa.
*
* @return the value of the property as a {@link String}
*/
public String getPrivateKeyType() {
return this.privateKeyType;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final AgentIngressCertPolicy other = (AgentIngressCertPolicy) o;
return
this.authority.equals(other.authority)&&
this.privateKeyType.equals(other.privateKeyType);
}
@Override
public int hashCode() {
return Objects.hash(
this.authority,
this.privateKeyType
);
}
@Override
public String toString() {
return "AgentIngressCertPolicy{" +
"authority='" + this.authority +
"', privateKeyType='" + this.privateKeyType +
"'}";
}
}
@@ -0,0 +1,90 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link AgentIngressCertStatus} resource.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class AgentIngressCertStatus {
@JsonProperty("renews_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<java.time.OffsetDateTime> renewsAt;
@JsonProperty("provisioning_job")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<AgentIngressCertJob> provisioningJob;
/**
* Creates a new instance of {@link AgentIngressCertStatus}.
*
* @param renewsAt timestamp when the next renewal will be requested, RFC 3339 format
* @param provisioningJob status of the certificate provisioning job, or null if the certificiate isn&#39;t being provisioned or renewed
*/
@JsonCreator
public AgentIngressCertStatus(
@JsonProperty("renews_at") final Optional<java.time.OffsetDateTime> renewsAt,
@JsonProperty("provisioning_job") final Optional<AgentIngressCertJob> provisioningJob
) {
this.renewsAt = renewsAt != null ? renewsAt : Optional.empty();
this.provisioningJob = provisioningJob != null ? provisioningJob : Optional.empty();
}
/**
* timestamp when the next renewal will be requested, RFC 3339 format
*
* @return the value of the property as a {@link java.time.OffsetDateTime} wrapped in an {@link Optional}
*/
public Optional<java.time.OffsetDateTime> getRenewsAt() {
return this.renewsAt;
}
/**
* status of the certificate provisioning job, or null if the certificiate
* isn&#39;t being provisioned or renewed
*
* @return the value of the property as a {@link AgentIngressCertJob} wrapped in an {@link Optional}
*/
public Optional<AgentIngressCertJob> getProvisioningJob() {
return this.provisioningJob;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final AgentIngressCertStatus other = (AgentIngressCertStatus) o;
return
this.renewsAt.equals(other.renewsAt)&&
this.provisioningJob.equals(other.provisioningJob);
}
@Override
public int hashCode() {
return Objects.hash(
this.renewsAt,
this.provisioningJob
);
}
@Override
public String toString() {
return "AgentIngressCertStatus{" +
"renewsAt='" + this.renewsAt.map(Object::toString).orElse("(null)") +
"', provisioningJob='" + this.provisioningJob.map(Object::toString).orElse("(null)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
+37 -15
View File
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -21,16 +23,19 @@ public class ApiKey {
private final java.net.URI uri;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("created_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.time.OffsetDateTime createdAt;
@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,22 +46,25 @@ 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(
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<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");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.token = token != null ? token : Optional.empty();
this.ownerId = ownerId != null ? ownerId : Optional.empty();
}
/**
@@ -81,18 +89,18 @@ public class ApiKey {
* human-readable description of what uses the API key to authenticate. optional,
* max 255 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
/**
* arbitrary user-defined data of this API key. optional, max 4096 bytes
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -116,6 +124,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 +151,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 +164,8 @@ public class ApiKey {
this.description,
this.metadata,
this.createdAt,
this.token
this.token,
this.ownerId
);
}
@@ -153,10 +174,11 @@ public class ApiKey {
return "ApiKey{" +
"id='" + this.id +
"', uri='" + this.uri +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', createdAt='" + this.createdAt +
"', token='" + this.token.orElse("(null)") +
"', ownerId='" + this.ownerId.orElse("(null)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -0,0 +1,251 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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 Optional<java.time.OffsetDateTime> createdAt;
@JsonProperty("last_active")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<java.time.OffsetDateTime> lastActive;
@JsonProperty("expires_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<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 Optional<java.time.OffsetDateTime> createdAt,
@JsonProperty("last_active") final Optional<java.time.OffsetDateTime> lastActive,
@JsonProperty("expires_at") final Optional<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 = createdAt != null ? createdAt : Optional.empty();
this.lastActive = lastActive != null ? lastActive : Optional.empty();
this.expiresAt = expiresAt != null ? expiresAt : Optional.empty();
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} wrapped in an {@link Optional}
*/
public Optional<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} wrapped in an {@link Optional}
*/
public Optional<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} wrapped in an {@link Optional}
*/
public Optional<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.map(Object::toString).orElse("(null)") +
"', lastActive='" + this.lastActive.map(Object::toString).orElse("(null)") +
"', expiresAt='" + this.expiresAt.map(Object::toString).orElse("(null)") +
"', 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,107 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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,233 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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 Optional<String> username;
@JsonProperty("email")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> email;
@JsonProperty("name")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> name;
@JsonProperty("created_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<java.time.OffsetDateTime> createdAt;
@JsonProperty("last_active")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<java.time.OffsetDateTime> lastActive;
@JsonProperty("last_login")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<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 Optional<String> username,
@JsonProperty("email") final Optional<String> email,
@JsonProperty("name") final Optional<String> name,
@JsonProperty("created_at") final Optional<java.time.OffsetDateTime> createdAt,
@JsonProperty("last_active") final Optional<java.time.OffsetDateTime> lastActive,
@JsonProperty("last_login") final Optional<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 = username != null ? username : Optional.empty();
this.email = email != null ? email : Optional.empty();
this.name = name != null ? name : Optional.empty();
this.createdAt = createdAt != null ? createdAt : Optional.empty();
this.lastActive = lastActive != null ? lastActive : Optional.empty();
this.lastLogin = lastLogin != null ? lastLogin : Optional.empty();
}
/**
* 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} wrapped in an {@link Optional}
*/
public Optional<String> getUsername() {
return this.username;
}
/**
* user email
*
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public Optional<String> getEmail() {
return this.email;
}
/**
* user common name
*
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public Optional<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} wrapped in an {@link Optional}
*/
public Optional<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} wrapped in an {@link Optional}
*/
public Optional<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} wrapped in an {@link Optional}
*/
public Optional<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.orElse("(null)") +
"', email='" + this.email.orElse("(null)") +
"', name='" + this.name.orElse("(null)") +
"', createdAt='" + this.createdAt.map(Object::toString).orElse("(null)") +
"', lastActive='" + this.lastActive.map(Object::toString).orElse("(null)") +
"', lastLogin='" + this.lastLogin.map(Object::toString).orElse("(null)") +
"'}";
}
}
@@ -0,0 +1,107 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -0,0 +1,107 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class CertificateAuthority {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("ca_pem")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String caPem;
@@ -67,8 +69,8 @@ public class CertificateAuthority {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("ca_pem") final String caPem,
@JsonProperty("subject_common_name") final String subjectCommonName,
@JsonProperty("not_before") final java.time.OffsetDateTime notBefore,
@@ -79,8 +81,8 @@ public class CertificateAuthority {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.caPem = Objects.requireNonNull(caPem, "caPem is required");
this.subjectCommonName = Objects.requireNonNull(subjectCommonName, "subjectCommonName is required");
this.notBefore = Objects.requireNonNull(notBefore, "notBefore is required");
@@ -120,9 +122,9 @@ public class CertificateAuthority {
* human-readable description of this Certificate Authority. optional, max 255
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -130,9 +132,9 @@ public class CertificateAuthority {
* arbitrary user-defined machine-readable data of this Certificate Authority.
* optional, max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -239,8 +241,8 @@ public class CertificateAuthority {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', caPem='" + this.caPem +
"', subjectCommonName='" + this.subjectCommonName +
"', notBefore='" + this.notBefore +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,16 +26,19 @@ public class Credential {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("token")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> token;
@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,25 +49,28 @@ 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&#39;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>&#39;*&#39;</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>&#39;*&#39;</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(
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<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");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.token = token != null ? token : Optional.empty();
this.acl = acl != null ? acl : java.util.Collections.emptyList();
this.ownerId = ownerId != null ? ownerId : Optional.empty();
}
/**
@@ -96,9 +104,9 @@ public class Credential {
* human-readable description of who or what will use the credential to
* authenticate. Optional, max 255 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -106,9 +114,9 @@ public class Credential {
* arbitrary user-defined machine-readable data of this credential. Optional, max
* 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -126,15 +134,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>&#39;*&#39;</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>&#39;*&#39;</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 +153,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 +181,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 +195,8 @@ public class Credential {
this.description,
this.metadata,
this.token,
this.acl
this.acl,
this.ownerId
);
}
@@ -182,10 +206,11 @@ public class Credential {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', token='" + this.token.orElse("(null)") +
"', acl='" + this.acl +
"', ownerId='" + this.ownerId.orElse("(null)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -18,13 +20,13 @@ public class Endpoint {
private final String id;
@JsonProperty("region")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String region;
private final Optional<String> region;
@JsonProperty("created_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.time.OffsetDateTime createdAt;
private final Optional<java.time.OffsetDateTime> createdAt;
@JsonProperty("updated_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.time.OffsetDateTime updatedAt;
private final Optional<java.time.OffsetDateTime> updatedAt;
@JsonProperty("public_url")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.net.URI publicUrl;
@@ -39,7 +41,7 @@ public class Endpoint {
private final String type;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("domain")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<Ref> domain;
@@ -73,28 +75,28 @@ public class Endpoint {
@JsonCreator
public Endpoint(
@JsonProperty("id") final String id,
@JsonProperty("region") final String region,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("updated_at") final java.time.OffsetDateTime updatedAt,
@JsonProperty("region") final Optional<String> region,
@JsonProperty("created_at") final Optional<java.time.OffsetDateTime> createdAt,
@JsonProperty("updated_at") final Optional<java.time.OffsetDateTime> updatedAt,
@JsonProperty("public_url") final java.net.URI publicUrl,
@JsonProperty("proto") final String proto,
@JsonProperty("hostport") final String hostport,
@JsonProperty("type") final String type,
@JsonProperty("metadata") final String metadata,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("domain") final Optional<Ref> domain,
@JsonProperty("tcp_addr") final Optional<Ref> tcpAddr,
@JsonProperty("tunnel") final Optional<Ref> tunnel,
@JsonProperty("edge") final Optional<Ref> edge
) {
this.id = Objects.requireNonNull(id, "id is required");
this.region = Objects.requireNonNull(region, "region is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt is required");
this.region = region != null ? region : Optional.empty();
this.createdAt = createdAt != null ? createdAt : Optional.empty();
this.updatedAt = updatedAt != null ? updatedAt : Optional.empty();
this.publicUrl = Objects.requireNonNull(publicUrl, "publicUrl is required");
this.proto = Objects.requireNonNull(proto, "proto is required");
this.hostport = Objects.requireNonNull(hostport, "hostport is required");
this.type = Objects.requireNonNull(type, "type is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.metadata = metadata != null ? metadata : Optional.empty();
this.domain = domain != null ? domain : Optional.empty();
this.tcpAddr = tcpAddr != null ? tcpAddr : Optional.empty();
this.tunnel = tunnel != null ? tunnel : Optional.empty();
@@ -113,27 +115,27 @@ public class Endpoint {
/**
* identifier of the region this endpoint belongs to
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getRegion() {
public Optional<String> getRegion() {
return this.region;
}
/**
* timestamp when the endpoint was created in RFC 3339 format
*
* @return the value of the property as a {@link java.time.OffsetDateTime}
* @return the value of the property as a {@link java.time.OffsetDateTime} wrapped in an {@link Optional}
*/
public java.time.OffsetDateTime getCreatedAt() {
public Optional<java.time.OffsetDateTime> getCreatedAt() {
return this.createdAt;
}
/**
* timestamp when the endpoint was updated in RFC 3339 format
*
* @return the value of the property as a {@link java.time.OffsetDateTime}
* @return the value of the property as a {@link java.time.OffsetDateTime} wrapped in an {@link Optional}
*/
public java.time.OffsetDateTime getUpdatedAt() {
public Optional<java.time.OffsetDateTime> getUpdatedAt() {
return this.updatedAt;
}
@@ -178,9 +180,9 @@ public class Endpoint {
/**
* user-supplied metadata of the associated tunnel or edge object
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -270,14 +272,14 @@ public class Endpoint {
public String toString() {
return "Endpoint{" +
"id='" + this.id +
"', region='" + this.region +
"', createdAt='" + this.createdAt +
"', updatedAt='" + this.updatedAt +
"', region='" + this.region.orElse("(null)") +
"', createdAt='" + this.createdAt.map(Object::toString).orElse("(null)") +
"', updatedAt='" + this.updatedAt.map(Object::toString).orElse("(null)") +
"', publicUrl='" + this.publicUrl +
"', proto='" + this.proto +
"', hostport='" + this.hostport +
"', type='" + this.type +
"', metadata='" + this.metadata +
"', metadata='" + this.metadata.orElse("(null)") +
"', domain='" + this.domain.map(Object::toString).orElse("(null)") +
"', tcpAddr='" + this.tcpAddr.map(Object::toString).orElse("(null)") +
"', tunnel='" + this.tunnel.map(Object::toString).orElse("(null)") +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,7 +26,7 @@ public class EndpointIpPolicy {
* Creates a new instance of {@link EndpointIpPolicy}.
*
* @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 ipPolicies the value of the <code>ip_policies</code> parameter as a {@link java.util.List} of {@link Ref}
* @param ipPolicies list of all IP policies that will be used to check if a source IP is allowed access to the endpoint
*/
@JsonCreator
public EndpointIpPolicy(
@@ -46,7 +48,8 @@ public class EndpointIpPolicy {
}
/**
* Fetches the value of the <code>ipPolicies</code> property.
* list of all IP policies that will be used to check if a source IP is allowed
* access to the endpoint
*
* @return the value of the property as a {@link java.util.List} of {@link Ref}
*/
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -0,0 +1,294 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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 +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -19,11 +21,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 +97,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 +111,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 +123,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 +135,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 +147,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 +159,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 +173,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 +187,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 +200,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 +213,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 +254,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 +283,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 +328,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 +338,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 +348,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 +360,9 @@ public class EndpointOAuthGitHub {
* &#39;slug&#39; 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 +371,9 @@ public class EndpointOAuthGitHub {
* organizations will be allowed access. identifiers should be the
* organization&#39;s &#39;slug&#39;
*
* @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 +416,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,294 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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 +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -0,0 +1,294 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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 +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -21,6 +23,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 +120,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 +218,11 @@ public class EndpointOAuthProvider {
this.github,
this.facebook,
this.microsoft,
this.google
this.google,
this.linkedin,
this.gitlab,
this.twitch,
this.amazon
);
}
}
@@ -152,6 +250,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 +270,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 +332,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 +382,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 +396,11 @@ public class EndpointOAuthProvider {
this.github,
this.facebook,
this.microsoft,
this.google
this.google,
this.linkedin,
this.gitlab,
this.twitch,
this.amazon
);
}
@@ -245,6 +411,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,294 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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 +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -51,10 +53,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 +66,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 +140,7 @@ public class EndpointWebhookValidation {
* Creates a new instance of {@link EndpointWebhookValidation}.
*
* @param enabled <code>true</code> if the module will be applied to traffic, <code>false</code> to disable. default <code>true</code> if unspecified
* @param provider a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers: <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 +166,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}
*/
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -18,13 +20,13 @@ public class EventDestination {
private final String id;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("created_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("format")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String format;
@@ -49,17 +51,17 @@ public class EventDestination {
@JsonCreator
public EventDestination(
@JsonProperty("id") final String id,
@JsonProperty("metadata") final String metadata,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("format") final String format,
@JsonProperty("target") final EventTarget target,
@JsonProperty("uri") final java.net.URI uri
) {
this.id = Objects.requireNonNull(id, "id is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.metadata = metadata != null ? metadata : Optional.empty();
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.description = description != null ? description : Optional.empty();
this.format = Objects.requireNonNull(format, "format is required");
this.target = Objects.requireNonNull(target, "target is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
@@ -78,9 +80,9 @@ public class EventDestination {
* Arbitrary user-defined machine-readable data of this Event Destination.
* Optional, max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -96,9 +98,9 @@ public class EventDestination {
/**
* Human-readable description of the Event Destination. Optional, max 255 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -171,9 +173,9 @@ public class EventDestination {
public String toString() {
return "EventDestination{" +
"id='" + this.id +
"', metadata='" + this.metadata +
"', metadata='" + this.metadata.orElse("(null)") +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', description='" + this.description.orElse("(null)") +
"', format='" + this.format +
"', target='" + this.target +
"', uri='" + this.uri +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class EventSubscription {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("sources")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.util.List<EventSource> sources;
@@ -51,16 +53,16 @@ public class EventSubscription {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("sources") final java.util.List<EventSource> sources,
@JsonProperty("destinations") final java.util.List<Ref> destinations
) {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = metadata != null ? metadata : Optional.empty();
this.description = description != null ? description : Optional.empty();
this.sources = sources != null ? sources : java.util.Collections.emptyList();
this.destinations = destinations != null ? destinations : java.util.Collections.emptyList();
}
@@ -96,9 +98,9 @@ public class EventSubscription {
* Arbitrary customer supplied information intended to be machine readable.
* Optional, max 4096 chars.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -106,9 +108,9 @@ public class EventSubscription {
* Arbitrary customer supplied information intended to be human readable. Optional,
* max 255 chars.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -170,8 +172,8 @@ public class EventSubscription {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', metadata='" + this.metadata +
"', description='" + this.description +
"', metadata='" + this.metadata.orElse("(null)") +
"', description='" + this.description.orElse("(null)") +
"', sources='" + this.sources +
"', destinations='" + this.destinations +
"'}";
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -20,6 +22,7 @@ public class EventTarget {
private Optional<EventTargetFirehose> firehose = Optional.empty();
private Optional<EventTargetKinesis> kinesis = Optional.empty();
private Optional<EventTargetCloudwatchLogs> cloudwatchLogs = Optional.empty();
private Optional<EventTargetDatadog> datadog = Optional.empty();
private Builder(
) {
@@ -91,6 +94,28 @@ public class EventTarget {
return this;
}
/**
* Configuration used to send events to Datadog.
*
* @param datadog the value of the <code>datadog</code> parameter as a {@link EventTargetDatadog}
* @return this builder instance
*/
public Builder datadog(final EventTargetDatadog datadog) {
this.datadog = Optional.of(Objects.requireNonNull(datadog, "datadog is required"));
return this;
}
/**
* Configuration used to send events to Datadog.
*
* @param datadog the value of the <code>datadog</code> parameter as a {@link EventTargetDatadog}, wrapped in an {@link Optional}
* @return this builder instance
*/
public Builder datadog(final Optional<EventTargetDatadog> datadog) {
this.datadog = Objects.requireNonNull(datadog, "datadog is required");
return this;
}
/**
* Constructs the {@link EventTarget} instance.
*
@@ -100,7 +125,8 @@ public class EventTarget {
return new EventTarget(
this.firehose,
this.kinesis,
this.cloudwatchLogs
this.cloudwatchLogs,
this.datadog
);
}
}
@@ -125,6 +151,9 @@ public class EventTarget {
@JsonProperty("cloudwatch_logs")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<EventTargetCloudwatchLogs> cloudwatchLogs;
@JsonProperty("datadog")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<EventTargetDatadog> datadog;
/**
* Creates a new instance of {@link EventTarget}.
@@ -132,16 +161,19 @@ public class EventTarget {
* @param firehose Configuration used to send events to Amazon Kinesis Data Firehose.
* @param kinesis Configuration used to send events to Amazon Kinesis.
* @param cloudwatchLogs Configuration used to send events to Amazon CloudWatch Logs.
* @param datadog Configuration used to send events to Datadog.
*/
@JsonCreator
private EventTarget(
@JsonProperty("firehose") final Optional<EventTargetFirehose> firehose,
@JsonProperty("kinesis") final Optional<EventTargetKinesis> kinesis,
@JsonProperty("cloudwatch_logs") final Optional<EventTargetCloudwatchLogs> cloudwatchLogs
@JsonProperty("cloudwatch_logs") final Optional<EventTargetCloudwatchLogs> cloudwatchLogs,
@JsonProperty("datadog") final Optional<EventTargetDatadog> datadog
) {
this.firehose = firehose != null ? firehose : Optional.empty();
this.kinesis = kinesis != null ? kinesis : Optional.empty();
this.cloudwatchLogs = cloudwatchLogs != null ? cloudwatchLogs : Optional.empty();
this.datadog = datadog != null ? datadog : Optional.empty();
}
/**
@@ -171,6 +203,15 @@ public class EventTarget {
return this.cloudwatchLogs;
}
/**
* Configuration used to send events to Datadog.
*
* @return the value of the property as a {@link EventTargetDatadog} wrapped in an {@link Optional}
*/
public Optional<EventTargetDatadog> getDatadog() {
return this.datadog;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
@@ -184,7 +225,8 @@ public class EventTarget {
return
this.firehose.equals(other.firehose)&&
this.kinesis.equals(other.kinesis)&&
this.cloudwatchLogs.equals(other.cloudwatchLogs);
this.cloudwatchLogs.equals(other.cloudwatchLogs)&&
this.datadog.equals(other.datadog);
}
@@ -193,7 +235,8 @@ public class EventTarget {
return Objects.hash(
this.firehose,
this.kinesis,
this.cloudwatchLogs
this.cloudwatchLogs,
this.datadog
);
}
@@ -203,6 +246,7 @@ public class EventTarget {
"firehose='" + this.firehose.map(Object::toString).orElse("(null)") +
"', kinesis='" + this.kinesis.map(Object::toString).orElse("(null)") +
"', cloudwatchLogs='" + this.cloudwatchLogs.map(Object::toString).orElse("(null)") +
"', datadog='" + this.datadog.map(Object::toString).orElse("(null)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -0,0 +1,252 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link EventTargetDatadog} resource.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class EventTargetDatadog {
/**
* Builder class for {@link EventTargetDatadog}.
*/
public static class Builder {
private Optional<String> apiKey = Optional.empty();
private Optional<String> ddtags = Optional.empty();
private Optional<String> service = Optional.empty();
private Optional<String> ddsite = Optional.empty();
private Builder(
) {
}
/**
* Datadog API key to use.
*
* @param apiKey the value of the <code>api_key</code> parameter as a {@link String}
* @return this builder instance
*/
public Builder apiKey(final String apiKey) {
this.apiKey = Optional.of(Objects.requireNonNull(apiKey, "apiKey is required"));
return this;
}
/**
* Datadog API key to use.
*
* @param apiKey the value of the <code>api_key</code> parameter as a {@link String}, wrapped in an {@link Optional}
* @return this builder instance
*/
public Builder apiKey(final Optional<String> apiKey) {
this.apiKey = Objects.requireNonNull(apiKey, "apiKey is required");
return this;
}
/**
* Tags to send with the event.
*
* @param ddtags the value of the <code>ddtags</code> parameter as a {@link String}
* @return this builder instance
*/
public Builder ddtags(final String ddtags) {
this.ddtags = Optional.of(Objects.requireNonNull(ddtags, "ddtags is required"));
return this;
}
/**
* Tags to send with the event.
*
* @param ddtags the value of the <code>ddtags</code> parameter as a {@link String}, wrapped in an {@link Optional}
* @return this builder instance
*/
public Builder ddtags(final Optional<String> ddtags) {
this.ddtags = Objects.requireNonNull(ddtags, "ddtags is required");
return this;
}
/**
* Service name to send with the event.
*
* @param service the value of the <code>service</code> parameter as a {@link String}
* @return this builder instance
*/
public Builder service(final String service) {
this.service = Optional.of(Objects.requireNonNull(service, "service is required"));
return this;
}
/**
* Service name to send with the event.
*
* @param service the value of the <code>service</code> parameter as a {@link String}, wrapped in an {@link Optional}
* @return this builder instance
*/
public Builder service(final Optional<String> service) {
this.service = Objects.requireNonNull(service, "service is required");
return this;
}
/**
* Datadog site to send event to.
*
* @param ddsite the value of the <code>ddsite</code> parameter as a {@link String}
* @return this builder instance
*/
public Builder ddsite(final String ddsite) {
this.ddsite = Optional.of(Objects.requireNonNull(ddsite, "ddsite is required"));
return this;
}
/**
* Datadog site to send event to.
*
* @param ddsite the value of the <code>ddsite</code> parameter as a {@link String}, wrapped in an {@link Optional}
* @return this builder instance
*/
public Builder ddsite(final Optional<String> ddsite) {
this.ddsite = Objects.requireNonNull(ddsite, "ddsite is required");
return this;
}
/**
* Constructs the {@link EventTargetDatadog} instance.
*
* @return a new {@link EventTargetDatadog}
*/
public EventTargetDatadog build() {
return new EventTargetDatadog(
this.apiKey,
this.ddtags,
this.service,
this.ddsite
);
}
}
/**
* Creates a new builder for the {@link EventTargetDatadog} type.
*
* @return a new {@link Builder}
*/
public static Builder newBuilder(
) {
return new Builder (
);
}
@JsonProperty("api_key")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> apiKey;
@JsonProperty("ddtags")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> ddtags;
@JsonProperty("service")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> service;
@JsonProperty("ddsite")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<String> ddsite;
/**
* Creates a new instance of {@link EventTargetDatadog}.
*
* @param apiKey Datadog API key to use.
* @param ddtags Tags to send with the event.
* @param service Service name to send with the event.
* @param ddsite Datadog site to send event to.
*/
@JsonCreator
private EventTargetDatadog(
@JsonProperty("api_key") final Optional<String> apiKey,
@JsonProperty("ddtags") final Optional<String> ddtags,
@JsonProperty("service") final Optional<String> service,
@JsonProperty("ddsite") final Optional<String> ddsite
) {
this.apiKey = apiKey != null ? apiKey : Optional.empty();
this.ddtags = ddtags != null ? ddtags : Optional.empty();
this.service = service != null ? service : Optional.empty();
this.ddsite = ddsite != null ? ddsite : Optional.empty();
}
/**
* Datadog API key to use.
*
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public Optional<String> getApiKey() {
return this.apiKey;
}
/**
* Tags to send with the event.
*
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public Optional<String> getDdtags() {
return this.ddtags;
}
/**
* Service name to send with the event.
*
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public Optional<String> getService() {
return this.service;
}
/**
* Datadog site to send event to.
*
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public Optional<String> getDdsite() {
return this.ddsite;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final EventTargetDatadog other = (EventTargetDatadog) o;
return
this.apiKey.equals(other.apiKey)&&
this.ddtags.equals(other.ddtags)&&
this.service.equals(other.service)&&
this.ddsite.equals(other.ddsite);
}
@Override
public int hashCode() {
return Objects.hash(
this.apiKey,
this.ddtags,
this.service,
this.ddsite
);
}
@Override
public String toString() {
return "EventTargetDatadog{" +
"apiKey='" + this.apiKey.orElse("(null)") +
"', ddtags='" + this.ddtags.orElse("(null)") +
"', service='" + this.service.orElse("(null)") +
"', ddsite='" + this.ddsite.orElse("(null)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class FailoverBackend {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("backends")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.util.List<String> backends;
@@ -47,15 +49,15 @@ public class FailoverBackend {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("backends") final java.util.List<String> backends
) {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.backends = backends != null ? backends : java.util.Collections.emptyList();
}
@@ -89,18 +91,18 @@ public class FailoverBackend {
/**
* human-readable description of this backend. Optional
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
/**
* arbitrary user-defined machine-readable data of this backend. Optional
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -151,8 +153,8 @@ public class FailoverBackend {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', backends='" + this.backends +
"'}";
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class HttpResponseBackend {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("body")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String body;
@@ -55,8 +57,8 @@ public class HttpResponseBackend {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("body") final String body,
@JsonProperty("headers") final java.util.Map<String, String> headers,
@JsonProperty("status_code") final Integer statusCode
@@ -64,8 +66,8 @@ public class HttpResponseBackend {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.body = Objects.requireNonNull(body, "body is required");
this.headers = headers != null ? headers : java.util.Collections.emptyMap();
this.statusCode = Objects.requireNonNull(statusCode, "statusCode is required");
@@ -101,18 +103,18 @@ public class HttpResponseBackend {
/**
* human-readable description of this backend. Optional
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
/**
* arbitrary user-defined machine-readable data of this backend. Optional
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -185,8 +187,8 @@ public class HttpResponseBackend {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', body='" + this.body +
"', headers='" + this.headers +
"', statusCode='" + this.statusCode +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -18,10 +20,10 @@ public class HttpsEdge {
private final String id;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("created_at")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final java.time.OffsetDateTime createdAt;
@@ -57,8 +59,8 @@ public class HttpsEdge {
@JsonCreator
public HttpsEdge(
@JsonProperty("id") final String id,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("hostports") final Optional<java.util.List<String>> hostports,
@@ -67,8 +69,8 @@ public class HttpsEdge {
@JsonProperty("routes") final java.util.List<HttpsEdgeRoute> routes
) {
this.id = Objects.requireNonNull(id, "id is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.hostports = hostports != null ? hostports : Optional.empty();
@@ -90,9 +92,9 @@ public class HttpsEdge {
* human-readable description of what this edge will be used for; optional, max 255
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -100,9 +102,9 @@ public class HttpsEdge {
* arbitrary user-defined machine-readable data of this edge; optional, max 4096
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -202,8 +204,8 @@ public class HttpsEdge {
public String toString() {
return "HttpsEdge{" +
"id='" + this.id +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', createdAt='" + this.createdAt +
"', uri='" + this.uri +
"', hostports='" + this.hostports.map(Object::toString).orElse("(null)") +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -33,10 +35,10 @@ public class HttpsEdgeRoute {
private final java.net.URI uri;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("backend")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final Optional<EndpointBackend> backend;
@@ -102,8 +104,8 @@ public class HttpsEdgeRoute {
@JsonProperty("match_type") final String matchType,
@JsonProperty("match") final String match,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("backend") final Optional<EndpointBackend> backend,
@JsonProperty("ip_restriction") final Optional<EndpointIpPolicy> ipRestriction,
@JsonProperty("circuit_breaker") final Optional<EndpointCircuitBreaker> circuitBreaker,
@@ -122,8 +124,8 @@ public class HttpsEdgeRoute {
this.matchType = Objects.requireNonNull(matchType, "matchType is required");
this.match = Objects.requireNonNull(match, "match is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.backend = backend != null ? backend : Optional.empty();
this.ipRestriction = ipRestriction != null ? ipRestriction : Optional.empty();
this.circuitBreaker = circuitBreaker != null ? circuitBreaker : Optional.empty();
@@ -197,9 +199,9 @@ public class HttpsEdgeRoute {
* human-readable description of what this edge will be used for; optional, max 255
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -207,9 +209,9 @@ public class HttpsEdgeRoute {
* arbitrary user-defined machine-readable data of this edge. Optional, max 4096
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -379,8 +381,8 @@ public class HttpsEdgeRoute {
"', matchType='" + this.matchType +
"', match='" + this.match +
"', uri='" + this.uri +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', backend='" + this.backend.map(Object::toString).orElse("(null)") +
"', ipRestriction='" + this.ipRestriction.map(Object::toString).orElse("(null)") +
"', circuitBreaker='" + this.circuitBreaker.map(Object::toString).orElse("(null)") +
@@ -0,0 +1,90 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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 +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class IpPolicy {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
/**
* Creates a new instance of {@link IpPolicy}.
@@ -43,14 +45,14 @@ public class IpPolicy {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata
) {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
}
/**
@@ -84,9 +86,9 @@ public class IpPolicy {
* human-readable description of the source IPs of this IP policy. optional, max
* 255 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -94,9 +96,9 @@ public class IpPolicy {
* arbitrary user-defined machine-readable data of this IP policy. optional, max
* 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -136,8 +138,8 @@ public class IpPolicy {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class IpPolicyRule {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("cidr")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String cidr;
@@ -55,8 +57,8 @@ public class IpPolicyRule {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("cidr") final String cidr,
@JsonProperty("ip_policy") final Ref ipPolicy,
@JsonProperty("action") final String action
@@ -64,8 +66,8 @@ public class IpPolicyRule {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.cidr = Objects.requireNonNull(cidr, "cidr is required");
this.ipPolicy = Objects.requireNonNull(ipPolicy, "ipPolicy is required");
this.action = Objects.requireNonNull(action, "action is required");
@@ -102,9 +104,9 @@ public class IpPolicyRule {
* human-readable description of the source IPs of this IP rule. optional, max 255
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -112,9 +114,9 @@ public class IpPolicyRule {
* arbitrary user-defined machine-readable data of this IP policy rule. optional,
* max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -188,8 +190,8 @@ public class IpPolicyRule {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', cidr='" + this.cidr +
"', ipPolicy='" + this.ipPolicy +
"', action='" + this.action +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class IpRestriction {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("enforced")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final boolean enforced;
@@ -55,8 +57,8 @@ public class IpRestriction {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("enforced") final Boolean enforced,
@JsonProperty("type") final String type,
@JsonProperty("ip_policies") final java.util.List<Ref> ipPolicies
@@ -64,8 +66,8 @@ public class IpRestriction {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.enforced = Objects.requireNonNull(enforced, "enforced is required");
this.type = Objects.requireNonNull(type, "type is required");
this.ipPolicies = ipPolicies != null ? ipPolicies : java.util.Collections.emptyList();
@@ -101,9 +103,9 @@ public class IpRestriction {
/**
* human-readable description of this IP restriction. optional, max 255 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -111,9 +113,9 @@ public class IpRestriction {
* arbitrary user-defined machine-readable data of this IP restriction. optional,
* max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -190,8 +192,8 @@ public class IpRestriction {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', enforced='" + this.enforced +
"', type='" + this.type +
"', ipPolicies='" + this.ipPolicies +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -0,0 +1,125 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.Optional;
/**
* A class encapsulating the {@link 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)") +
"'}";
}
}
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.ngrok.NgrokApiClient;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import java.net.URI;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class ReservedAddr {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("addr")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String addr;
@@ -51,16 +53,16 @@ public class ReservedAddr {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("addr") final String addr,
@JsonProperty("region") final String region
) {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.addr = Objects.requireNonNull(addr, "addr is required");
this.region = Objects.requireNonNull(region, "region is required");
}
@@ -95,9 +97,9 @@ public class ReservedAddr {
/**
* human-readable description of what this reserved address will be used for
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -105,9 +107,9 @@ public class ReservedAddr {
* arbitrary user-defined machine-readable data of this reserved address. Optional,
* max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -170,8 +172,8 @@ public class ReservedAddr {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', addr='" + this.addr +
"', region='" + this.region +
"'}";
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class ReservedDomain {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("domain")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String domain;
@@ -71,8 +73,8 @@ public class ReservedDomain {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("domain") final String domain,
@JsonProperty("region") final String region,
@JsonProperty("cname_target") final Optional<String> cnameTarget,
@@ -84,8 +86,8 @@ public class ReservedDomain {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.domain = Objects.requireNonNull(domain, "domain is required");
this.region = Objects.requireNonNull(region, "region is required");
this.cnameTarget = cnameTarget != null ? cnameTarget : Optional.empty();
@@ -125,9 +127,9 @@ public class ReservedDomain {
/**
* human-readable description of what this reserved domain will be used for
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -135,9 +137,9 @@ public class ReservedDomain {
* arbitrary user-defined machine-readable data of this reserved domain. Optional,
* max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -263,8 +265,8 @@ public class ReservedDomain {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', domain='" + this.domain +
"', region='" + this.region +
"', cnameTarget='" + this.cnameTarget.orElse("(null)") +
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,10 +26,10 @@ public class SshCertificateAuthority {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("public_key")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String publicKey;
@@ -51,16 +53,16 @@ public class SshCertificateAuthority {
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<String> metadata,
@JsonProperty("public_key") final String publicKey,
@JsonProperty("key_type") final String keyType
) {
this.id = Objects.requireNonNull(id, "id is required");
this.uri = Objects.requireNonNull(uri, "uri is required");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.publicKey = Objects.requireNonNull(publicKey, "publicKey is required");
this.keyType = Objects.requireNonNull(keyType, "keyType is required");
}
@@ -97,9 +99,9 @@ public class SshCertificateAuthority {
* human-readable description of this SSH Certificate Authority. optional, max 255
* bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -107,9 +109,9 @@ public class SshCertificateAuthority {
* arbitrary user-defined machine-readable data of this SSH Certificate Authority.
* optional, max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -171,8 +173,8 @@ public class SshCertificateAuthority {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', publicKey='" + this.publicKey +
"', keyType='" + this.keyType +
"'}";
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -1,3 +1,5 @@
/* Code generated for API Clients. DO NOT EDIT. */
package com.ngrok.definitions;
import com.fasterxml.jackson.annotation.JsonCreator;
@@ -24,16 +26,19 @@ public class SshCredential {
private final java.time.OffsetDateTime createdAt;
@JsonProperty("description")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String description;
private final Optional<String> description;
@JsonProperty("metadata")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String metadata;
private final Optional<String> metadata;
@JsonProperty("public_key")
@JsonInclude(value = JsonInclude.Include.NON_ABSENT)
private final String publicKey;
@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,25 +49,28 @@ 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>&#39;*&#39;</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>&#39;*&#39;</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(
@JsonProperty("id") final String id,
@JsonProperty("uri") final java.net.URI uri,
@JsonProperty("created_at") final java.time.OffsetDateTime createdAt,
@JsonProperty("description") final String description,
@JsonProperty("metadata") final String metadata,
@JsonProperty("description") final Optional<String> description,
@JsonProperty("metadata") final Optional<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");
this.createdAt = Objects.requireNonNull(createdAt, "createdAt is required");
this.description = Objects.requireNonNull(description, "description is required");
this.metadata = Objects.requireNonNull(metadata, "metadata is required");
this.description = description != null ? description : Optional.empty();
this.metadata = metadata != null ? metadata : Optional.empty();
this.publicKey = Objects.requireNonNull(publicKey, "publicKey is required");
this.acl = acl != null ? acl : java.util.Collections.emptyList();
this.ownerId = ownerId != null ? ownerId : Optional.empty();
}
/**
@@ -96,9 +104,9 @@ public class SshCredential {
* human-readable description of who or what will use the ssh credential to
* authenticate. Optional, max 255 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getDescription() {
public Optional<String> getDescription() {
return this.description;
}
@@ -106,9 +114,9 @@ public class SshCredential {
* arbitrary user-defined machine-readable data of this ssh credential. Optional,
* max 4096 bytes.
*
* @return the value of the property as a {@link String}
* @return the value of the property as a {@link String} wrapped in an {@link Optional}
*/
public String getMetadata() {
public Optional<String> getMetadata() {
return this.metadata;
}
@@ -124,15 +132,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>&#39;*&#39;</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>&#39;*&#39;</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 +151,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 +179,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 +193,8 @@ public class SshCredential {
this.description,
this.metadata,
this.publicKey,
this.acl
this.acl,
this.ownerId
);
}
@@ -180,10 +204,11 @@ public class SshCredential {
"id='" + this.id +
"', uri='" + this.uri +
"', createdAt='" + this.createdAt +
"', description='" + this.description +
"', metadata='" + this.metadata +
"', description='" + this.description.orElse("(null)") +
"', metadata='" + this.metadata.orElse("(null)") +
"', publicKey='" + this.publicKey +
"', acl='" + this.acl +
"', ownerId='" + this.ownerId.orElse("(null)") +
"'}";
}
}

Some files were not shown because too many files have changed in this diff Show More