Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/main/java/com/auth0/json/auth/TokenQuotaLimit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.auth0.json.auth;

public class TokenQuotaLimit {
private int quota;
private int remaining;
private int time;

public TokenQuotaLimit(int quota, int remaining, int time) {
this.quota = quota;
this.remaining = remaining;
this.time = time;
}

public int getQuota() {
return quota;
}

public int getRemaining() {
return remaining;
}

public int getTime() {
return time;
}
}
19 changes: 19 additions & 0 deletions src/main/java/com/auth0/json/mgmt/client/Client.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.auth0.json.mgmt.client;

import com.auth0.json.mgmt.tokenquota.TokenQuota;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down Expand Up @@ -104,6 +105,8 @@ public class Client {
private Boolean requireProofOfPossession;
@JsonProperty("default_organization")
private ClientDefaultOrganization defaultOrganization;
@JsonProperty("token_quota")
private TokenQuota tokenQuota;

/**
* Getter for the name of the tenant this client belongs to.
Expand Down Expand Up @@ -907,5 +910,21 @@ public ClientDefaultOrganization getDefaultOrganization() {
public void setDefaultOrganization(ClientDefaultOrganization defaultOrganization) {
this.defaultOrganization = defaultOrganization;
}

/**
* Getter for the token quota configuration.
* @return the token quota configuration.
*/
public TokenQuota getTokenQuota() {
return tokenQuota;
}

/**
* Setter for the token quota configuration.
* @param tokenQuota the token quota configuration to set.
*/
public void setTokenQuota(TokenQuota tokenQuota) {
this.tokenQuota = tokenQuota;
}
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.auth0.json.mgmt.organizations;

import com.auth0.client.mgmt.filter.PageFilter;
import com.auth0.json.mgmt.tokenquota.TokenQuota;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down Expand Up @@ -29,6 +30,8 @@ public class Organization {
private Branding branding;
@JsonProperty("enabled_connections")
private List<EnabledConnection> enabledConnections;
@JsonProperty("token_quota")
private TokenQuota tokenQuota;

public Organization() {}

Expand Down Expand Up @@ -132,4 +135,20 @@ public List<EnabledConnection> getEnabledConnections() {
public void setEnabledConnections(List<EnabledConnection> enabledConnections) {
this.enabledConnections = enabledConnections;
}

/**
* @return the token quota of this Organization.
*/
public TokenQuota getTokenQuota() {
return tokenQuota;
}

/**
* Sets the token quota of this Organization.
*
* @param tokenQuota the token quota of this Organization.
*/
public void setTokenQuota(TokenQuota tokenQuota) {
this.tokenQuota = tokenQuota;
}
}
35 changes: 35 additions & 0 deletions src/main/java/com/auth0/json/mgmt/tenants/Clients.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.auth0.json.mgmt.tenants;

import com.auth0.json.mgmt.tokenquota.ClientCredentials;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Clients {
@JsonProperty("client_credentials")
private ClientCredentials clientCredentials;

/**
* Default constructor for Clients.
*/
public Clients() {
}

/**
* Constructor for Clients.
*
* @param clientCredentials the client credentials
*/
public Clients(ClientCredentials clientCredentials) {
this.clientCredentials = clientCredentials;
}

/**
* @return the client credentials
*/
public ClientCredentials getClientCredentials() {
return clientCredentials;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.auth0.json.mgmt.tenants;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DefaultTokenQuota {
@JsonProperty("clients")
private Clients client;

@JsonProperty("organizations")
private Organizations organizations;

/**
* Default constructor for DefaultTokenQuota.
*/
public DefaultTokenQuota() {}

/**
* Constructor for DefaultTokenQuota.
*
* @param client the clients
* @param organizations the organizations
*/
public DefaultTokenQuota(Clients client, Organizations organizations) {
this.client = client;
this.organizations = organizations;
}

/**
* @return the clients
*/
public Clients getClient() {
return client;
}

/**
* @param client the clients to set
*/
public void setClient(Clients client) {
this.client = client;
}

/**
* @return the organizations
*/
public Organizations getOrganizations() {
return organizations;
}

/**
* @param organizations the organizations to set
*/
public void setOrganizations(Organizations organizations) {
this.organizations = organizations;
}
}
34 changes: 34 additions & 0 deletions src/main/java/com/auth0/json/mgmt/tenants/Organizations.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.auth0.json.mgmt.tenants;

import com.auth0.json.mgmt.tokenquota.ClientCredentials;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Organizations {
@JsonProperty("client_credentials")
private ClientCredentials clientCredentials;

/**
* Default constructor for Organizations.
*/
public Organizations() {}

/**
* Constructor for Organizations.
*
* @param clientCredentials the client credentials
*/
public Organizations(ClientCredentials clientCredentials) {
this.clientCredentials = clientCredentials;
}

/**
* @return the client credentials
*/
public ClientCredentials getClientCredentials() {
return clientCredentials;
}
}
37 changes: 37 additions & 0 deletions src/main/java/com/auth0/json/mgmt/tenants/Tenant.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public class Tenant {
@JsonProperty("mtls")
private Mtls mtls;

@JsonProperty("authorization_response_iss_parameter_supported")
private boolean authorizationResponseIssParameterSupported;

@JsonProperty("default_token_quota")
private DefaultTokenQuota defaultTokenQuota;

/**
* Getter for the change password page customization.
Expand Down Expand Up @@ -397,4 +402,36 @@ public Mtls getMtls() {
public void setMtls(Mtls mtls) {
this.mtls = mtls;
}

/**
* @return the value of the {@code authorization_response_iss_parameter_supported} field
*/
public boolean isAuthorizationResponseIssParameterSupported() {
return authorizationResponseIssParameterSupported;
}

/**
* Sets the value of the {@code authorization_response_iss_parameter_supported} field
*
* @param authorizationResponseIssParameterSupported the value of the {@code authorization_response_iss_parameter_supported} field
*/
public void setAuthorizationResponseIssParameterSupported(boolean authorizationResponseIssParameterSupported) {
this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported;
}

/**
* @return the value of the {@code default_token_quota} field
*/
public DefaultTokenQuota getDefaultTokenQuota() {
return defaultTokenQuota;
}

/**
* Sets the value of the {@code default_token_quota} field
*
* @param defaultTokenQuota the value of the {@code default_token_quota} field
*/
public void setDefaultTokenQuota(DefaultTokenQuota defaultTokenQuota) {
this.defaultTokenQuota = defaultTokenQuota;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.auth0.json.mgmt.tokenquota;

import com.fasterxml.jackson.annotation.JsonProperty;

public class ClientCredentials {
@JsonProperty("per_day")
private int perDay;
@JsonProperty("per_hour")
private int perHour;
@JsonProperty("enforce")
private boolean enforce;

/**
* @return the number of client credentials allowed per day
*/
public int getPerDay() {
return perDay;
}

/**
* Sets the number of client credentials allowed per day.
*
* @param perDay the number of client credentials allowed per day
*/
public void setPerDay(int perDay) {
this.perDay = perDay;
}

/**
* @return the number of client credentials allowed per hour
*/
public int getPerHour() {
return perHour;
}

/**
* Sets the number of client credentials allowed per hour.
*
* @param perHour the number of client credentials allowed per hour
*/
public void setPerHour(int perHour) {
this.perHour = perHour;
}

/**
* @return true if the quota is enforced, false otherwise
*/
public boolean isEnforce() {
return enforce;
}

/**
* Sets whether the quota is enforced.
*
* @param enforce true to enforce the quota, false otherwise
*/
public void setEnforce(boolean enforce) {
this.enforce = enforce;
}
}
32 changes: 32 additions & 0 deletions src/main/java/com/auth0/json/mgmt/tokenquota/TokenQuota.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.auth0.json.mgmt.tokenquota;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TokenQuota {
@JsonProperty("client_credentials")
private ClientCredentials clientCredentials;

/**
* Default constructor for Clients.
*/
public TokenQuota() {}
/**
* Constructor for Clients.
*
* @param clientCredentials the client credentials
*/
public TokenQuota(ClientCredentials clientCredentials) {
this.clientCredentials = clientCredentials;
}

/**
* @return the client credentials
*/
public ClientCredentials getClientCredentials() {
return clientCredentials;
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/auth0/net/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ public interface Response<T> {
* @return the HTTP status code.
*/
int getStatusCode();

TokenQuotaBucket getClientQuotaLimit();

TokenQuotaBucket getOrganizationQuotaLimit();
}
Loading
Loading