Skip to content

Commit 1377e5a

Browse files
committed
added management API changes
1 parent 76fba90 commit 1377e5a

13 files changed

Lines changed: 405 additions & 14 deletions

File tree

src/main/java/com/auth0/net/TokenQuota.java renamed to src/main/java/com/auth0/json/auth/TokenQuotaLimit.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package com.auth0.net;
1+
package com.auth0.json.auth;
22

3-
public class TokenQuota {
3+
public class TokenQuotaLimit {
44
private int quota;
55
private int remaining;
66
private int time;
77

8-
public TokenQuota(int quota, int remaining, int time) {
8+
public TokenQuotaLimit(int quota, int remaining, int time) {
99
this.quota = quota;
1010
this.remaining = remaining;
1111
this.time = time;

src/main/java/com/auth0/json/mgmt/client/Client.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.auth0.json.mgmt.client;
22

3+
import com.auth0.json.mgmt.tokenquota.TokenQuota;
34
import com.fasterxml.jackson.annotation.JsonCreator;
45
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
56
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -104,6 +105,8 @@ public class Client {
104105
private Boolean requireProofOfPossession;
105106
@JsonProperty("default_organization")
106107
private ClientDefaultOrganization defaultOrganization;
108+
@JsonProperty("token_quota")
109+
private TokenQuota tokenQuota;
107110

108111
/**
109112
* Getter for the name of the tenant this client belongs to.
@@ -907,5 +910,21 @@ public ClientDefaultOrganization getDefaultOrganization() {
907910
public void setDefaultOrganization(ClientDefaultOrganization defaultOrganization) {
908911
this.defaultOrganization = defaultOrganization;
909912
}
913+
914+
/**
915+
* Getter for the token quota configuration.
916+
* @return the token quota configuration.
917+
*/
918+
public TokenQuota getTokenQuota() {
919+
return tokenQuota;
920+
}
921+
922+
/**
923+
* Setter for the token quota configuration.
924+
* @param tokenQuota the token quota configuration to set.
925+
*/
926+
public void setTokenQuota(TokenQuota tokenQuota) {
927+
this.tokenQuota = tokenQuota;
928+
}
910929
}
911930

src/main/java/com/auth0/json/mgmt/organizations/Organization.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.auth0.json.mgmt.organizations;
22

33
import com.auth0.client.mgmt.filter.PageFilter;
4+
import com.auth0.json.mgmt.tokenquota.TokenQuota;
45
import com.fasterxml.jackson.annotation.JsonCreator;
56
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
67
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -29,6 +30,8 @@ public class Organization {
2930
private Branding branding;
3031
@JsonProperty("enabled_connections")
3132
private List<EnabledConnection> enabledConnections;
33+
@JsonProperty("token_quota")
34+
private TokenQuota tokenQuota;
3235

3336
public Organization() {}
3437

@@ -132,4 +135,20 @@ public List<EnabledConnection> getEnabledConnections() {
132135
public void setEnabledConnections(List<EnabledConnection> enabledConnections) {
133136
this.enabledConnections = enabledConnections;
134137
}
138+
139+
/**
140+
* @return the token quota of this Organization.
141+
*/
142+
public TokenQuota getTokenQuota() {
143+
return tokenQuota;
144+
}
145+
146+
/**
147+
* Sets the token quota of this Organization.
148+
*
149+
* @param tokenQuota the token quota of this Organization.
150+
*/
151+
public void setTokenQuota(TokenQuota tokenQuota) {
152+
this.tokenQuota = tokenQuota;
153+
}
135154
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.auth0.json.mgmt.tenants;
2+
3+
import com.auth0.json.mgmt.tokenquota.ClientCredentials;
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5+
import com.fasterxml.jackson.annotation.JsonInclude;
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
8+
@JsonIgnoreProperties(ignoreUnknown = true)
9+
@JsonInclude(JsonInclude.Include.NON_NULL)
10+
public class Clients {
11+
@JsonProperty("client_credentials")
12+
private ClientCredentials clientCredentials;
13+
14+
/**
15+
* Default constructor for Clients.
16+
*/
17+
public Clients() {
18+
}
19+
20+
/**
21+
* Constructor for Clients.
22+
*
23+
* @param clientCredentials the client credentials
24+
*/
25+
public Clients(ClientCredentials clientCredentials) {
26+
this.clientCredentials = clientCredentials;
27+
}
28+
29+
/**
30+
* @return the client credentials
31+
*/
32+
public ClientCredentials getClientCredentials() {
33+
return clientCredentials;
34+
}
35+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package com.auth0.json.mgmt.tenants;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
7+
@JsonIgnoreProperties(ignoreUnknown = true)
8+
@JsonInclude(JsonInclude.Include.NON_NULL)
9+
public class DefaultTokenQuota {
10+
@JsonProperty("clients")
11+
private Clients client;
12+
13+
@JsonProperty("organizations")
14+
private Organizations organizations;
15+
16+
/**
17+
* Default constructor for DefaultTokenQuota.
18+
*/
19+
public DefaultTokenQuota() {}
20+
21+
/**
22+
* Constructor for DefaultTokenQuota.
23+
*
24+
* @param client the clients
25+
* @param organizations the organizations
26+
*/
27+
public DefaultTokenQuota(Clients client, Organizations organizations) {
28+
this.client = client;
29+
this.organizations = organizations;
30+
}
31+
32+
/**
33+
* @return the clients
34+
*/
35+
public Clients getClient() {
36+
return client;
37+
}
38+
39+
/**
40+
* @param client the clients to set
41+
*/
42+
public void setClient(Clients client) {
43+
this.client = client;
44+
}
45+
46+
/**
47+
* @return the organizations
48+
*/
49+
public Organizations getOrganizations() {
50+
return organizations;
51+
}
52+
53+
/**
54+
* @param organizations the organizations to set
55+
*/
56+
public void setOrganizations(Organizations organizations) {
57+
this.organizations = organizations;
58+
}
59+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.auth0.json.mgmt.tenants;
2+
3+
import com.auth0.json.mgmt.tokenquota.ClientCredentials;
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5+
import com.fasterxml.jackson.annotation.JsonInclude;
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
8+
@JsonIgnoreProperties(ignoreUnknown = true)
9+
@JsonInclude(JsonInclude.Include.NON_NULL)
10+
public class Organizations {
11+
@JsonProperty("client_credentials")
12+
private ClientCredentials clientCredentials;
13+
14+
/**
15+
* Default constructor for Organizations.
16+
*/
17+
public Organizations() {}
18+
19+
/**
20+
* Constructor for Organizations.
21+
*
22+
* @param clientCredentials the client credentials
23+
*/
24+
public Organizations(ClientCredentials clientCredentials) {
25+
this.clientCredentials = clientCredentials;
26+
}
27+
28+
/**
29+
* @return the client credentials
30+
*/
31+
public ClientCredentials getClientCredentials() {
32+
return clientCredentials;
33+
}
34+
}

src/main/java/com/auth0/json/mgmt/tenants/Tenant.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ public class Tenant {
5858
@JsonProperty("mtls")
5959
private Mtls mtls;
6060

61+
@JsonProperty("authorization_response_iss_parameter_supported")
62+
private boolean authorizationResponseIssParameterSupported;
63+
64+
@JsonProperty("default_token_quota")
65+
private DefaultTokenQuota defaultTokenQuota;
6166

6267
/**
6368
* Getter for the change password page customization.
@@ -397,4 +402,36 @@ public Mtls getMtls() {
397402
public void setMtls(Mtls mtls) {
398403
this.mtls = mtls;
399404
}
405+
406+
/**
407+
* @return the value of the {@code authorization_response_iss_parameter_supported} field
408+
*/
409+
public boolean isAuthorizationResponseIssParameterSupported() {
410+
return authorizationResponseIssParameterSupported;
411+
}
412+
413+
/**
414+
* Sets the value of the {@code authorization_response_iss_parameter_supported} field
415+
*
416+
* @param authorizationResponseIssParameterSupported the value of the {@code authorization_response_iss_parameter_supported} field
417+
*/
418+
public void setAuthorizationResponseIssParameterSupported(boolean authorizationResponseIssParameterSupported) {
419+
this.authorizationResponseIssParameterSupported = authorizationResponseIssParameterSupported;
420+
}
421+
422+
/**
423+
* @return the value of the {@code default_token_quota} field
424+
*/
425+
public DefaultTokenQuota getDefaultTokenQuota() {
426+
return defaultTokenQuota;
427+
}
428+
429+
/**
430+
* Sets the value of the {@code default_token_quota} field
431+
*
432+
* @param defaultTokenQuota the value of the {@code default_token_quota} field
433+
*/
434+
public void setDefaultTokenQuota(DefaultTokenQuota defaultTokenQuota) {
435+
this.defaultTokenQuota = defaultTokenQuota;
436+
}
400437
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package com.auth0.json.mgmt.tokenquota;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
5+
public class ClientCredentials {
6+
@JsonProperty("per_day")
7+
private int perDay;
8+
@JsonProperty("per_hour")
9+
private int perHour;
10+
@JsonProperty("enforce")
11+
private boolean enforce;
12+
13+
/**
14+
* @return the number of client credentials allowed per day
15+
*/
16+
public int getPerDay() {
17+
return perDay;
18+
}
19+
20+
/**
21+
* Sets the number of client credentials allowed per day.
22+
*
23+
* @param perDay the number of client credentials allowed per day
24+
*/
25+
public void setPerDay(int perDay) {
26+
this.perDay = perDay;
27+
}
28+
29+
/**
30+
* @return the number of client credentials allowed per hour
31+
*/
32+
public int getPerHour() {
33+
return perHour;
34+
}
35+
36+
/**
37+
* Sets the number of client credentials allowed per hour.
38+
*
39+
* @param perHour the number of client credentials allowed per hour
40+
*/
41+
public void setPerHour(int perHour) {
42+
this.perHour = perHour;
43+
}
44+
45+
/**
46+
* @return true if the quota is enforced, false otherwise
47+
*/
48+
public boolean isEnforce() {
49+
return enforce;
50+
}
51+
52+
/**
53+
* Sets whether the quota is enforced.
54+
*
55+
* @param enforce true to enforce the quota, false otherwise
56+
*/
57+
public void setEnforce(boolean enforce) {
58+
this.enforce = enforce;
59+
}
60+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.auth0.json.mgmt.tokenquota;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
7+
@JsonIgnoreProperties(ignoreUnknown = true)
8+
@JsonInclude(JsonInclude.Include.NON_NULL)
9+
public class TokenQuota {
10+
@JsonProperty("client_credentials")
11+
private ClientCredentials clientCredentials;
12+
13+
/**
14+
* Default constructor for Clients.
15+
*/
16+
public TokenQuota() {}
17+
/**
18+
* Constructor for Clients.
19+
*
20+
* @param clientCredentials the client credentials
21+
*/
22+
public TokenQuota(ClientCredentials clientCredentials) {
23+
this.clientCredentials = clientCredentials;
24+
}
25+
26+
/**
27+
* @return the client credentials
28+
*/
29+
public ClientCredentials getClientCredentials() {
30+
return clientCredentials;
31+
}
32+
}

src/main/java/com/auth0/net/ResponseImpl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.auth0.net;
22

3+
import com.auth0.json.auth.TokenQuotaLimit;
4+
35
import java.util.Collections;
46
import java.util.Map;
57

@@ -50,8 +52,8 @@ public TokenQuotaBucket getOrganizationQuotaLimit() {
5052

5153
public static TokenQuotaBucket parseQuota(String tokenQuota) {
5254

53-
TokenQuota perHour = null;
54-
TokenQuota perDay = null;
55+
TokenQuotaLimit perHour = null;
56+
TokenQuotaLimit perDay = null;
5557

5658
String[] parts = tokenQuota.split(",");
5759
for (String part : parts) {
@@ -79,9 +81,9 @@ public static TokenQuotaBucket parseQuota(String tokenQuota) {
7981
}
8082

8183
if (attributes[0].contains("per_hour")) {
82-
perHour = new TokenQuota(quota, remaining, time);
84+
perHour = new TokenQuotaLimit(quota, remaining, time);
8385
} else if (attributes[0].contains("per_day")) {
84-
perDay = new TokenQuota(quota, remaining, time);
86+
perDay = new TokenQuotaLimit(quota, remaining, time);
8587
}
8688
}
8789

0 commit comments

Comments
 (0)