-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
809 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/auth0/client/mgmt/filter/EncryptionKeyFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.auth0.client.mgmt.filter; | ||
|
||
public class EncryptionKeyFilter extends BaseFilter { | ||
|
||
/** | ||
* Filter by page | ||
* | ||
* @param pageNumber the page number to retrieve. | ||
* @param amountPerPage the amount of items per page to retrieve. | ||
* @return this filter instance | ||
*/ | ||
public EncryptionKeyFilter withPage(int pageNumber, int amountPerPage) { | ||
parameters.put("page", pageNumber); | ||
parameters.put("per_page", amountPerPage); | ||
return this; | ||
} | ||
|
||
/** | ||
* Include the query summary | ||
* | ||
* @param includeTotals whether to include or not the query summary. | ||
* @return this filter instance | ||
*/ | ||
public EncryptionKeyFilter withTotals(boolean includeTotals) { | ||
parameters.put("include_totals", includeTotals); | ||
return this; | ||
} | ||
|
||
} |
136 changes: 136 additions & 0 deletions
136
src/main/java/com/auth0/json/mgmt/keys/EncryptionKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
package com.auth0.json.mgmt.keys; | ||
|
||
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 EncryptionKey { | ||
@JsonProperty("kid") | ||
private String kid; | ||
@JsonProperty("type") | ||
private String type; | ||
@JsonProperty("state") | ||
private String state; | ||
@JsonProperty("created_at") | ||
private String createdAt; | ||
@JsonProperty("updated_at") | ||
private String updatedAt; | ||
@JsonProperty("parent_kid") | ||
private String parentKid; | ||
@JsonProperty("public_key") | ||
private String publicKey; | ||
|
||
/** | ||
* Getter for the key id. | ||
* @return | ||
*/ | ||
public String getKid() { | ||
return kid; | ||
} | ||
|
||
/** | ||
* Setter for the key id. | ||
* @param kid | ||
*/ | ||
public void setKid(String kid) { | ||
this.kid = kid; | ||
} | ||
|
||
/** | ||
* Getter for the key type. | ||
* @return | ||
*/ | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* Setter for the key type. | ||
* @param type | ||
*/ | ||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
/** | ||
* Getter for the key state. | ||
* @return | ||
*/ | ||
public String getState() { | ||
return state; | ||
} | ||
|
||
/** | ||
* Setter for the key state. | ||
* @param state | ||
*/ | ||
public void setState(String state) { | ||
this.state = state; | ||
} | ||
|
||
/** | ||
* Getter for the key creation date. | ||
* @return | ||
*/ | ||
public String getCreatedAt() { | ||
return createdAt; | ||
} | ||
|
||
/** | ||
* Setter for the key creation date. | ||
* @param createdAt | ||
*/ | ||
public void setCreatedAt(String createdAt) { | ||
this.createdAt = createdAt; | ||
} | ||
|
||
/** | ||
* Getter for the key update date. | ||
* @return | ||
*/ | ||
public String getUpdatedAt() { | ||
return updatedAt; | ||
} | ||
|
||
/** | ||
* Setter for the key update date. | ||
* @param updatedAt | ||
*/ | ||
public void setUpdatedAt(String updatedAt) { | ||
this.updatedAt = updatedAt; | ||
} | ||
|
||
/** | ||
* Getter for the parent key id. | ||
* @return | ||
*/ | ||
public String getParentKid() { | ||
return parentKid; | ||
} | ||
|
||
/** | ||
* Setter for the parent key id. | ||
* @param parentKid | ||
*/ | ||
public void setParentKid(String parentKid) { | ||
this.parentKid = parentKid; | ||
} | ||
|
||
/** | ||
* Getter for the public key. | ||
* @return | ||
*/ | ||
public String getPublicKey() { | ||
return publicKey; | ||
} | ||
|
||
/** | ||
* Setter for the public key. | ||
* @param publicKey | ||
*/ | ||
public void setPublicKey(String publicKey) { | ||
this.publicKey = publicKey; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.auth0.json.mgmt.keys; | ||
|
||
import com.auth0.json.mgmt.Page; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
|
||
import java.util.List; | ||
|
||
@SuppressWarnings({"unused", "WeakerAccess"}) | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@JsonDeserialize(using = EncryptionKeysPageDeserializer.class) | ||
public class EncryptionKeysPage extends Page<EncryptionKey> { | ||
|
||
public EncryptionKeysPage(List<EncryptionKey> items) { | ||
super(items); | ||
} | ||
|
||
public EncryptionKeysPage(Integer start, Integer length, Integer total, Integer limit, List<EncryptionKey> items) { | ||
super(start, length, total, limit, items); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/auth0/json/mgmt/keys/EncryptionKeysPageDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.auth0.json.mgmt.keys; | ||
|
||
import com.auth0.json.mgmt.PageDeserializer; | ||
|
||
import java.util.List; | ||
|
||
public class EncryptionKeysPageDeserializer extends PageDeserializer<EncryptionKeysPage, EncryptionKey> { | ||
|
||
protected EncryptionKeysPageDeserializer() { | ||
super(EncryptionKey.class, "keys"); | ||
} | ||
|
||
@Override | ||
protected EncryptionKeysPage createPage(List<EncryptionKey> items) { | ||
return new EncryptionKeysPage(items); | ||
} | ||
|
||
@Override | ||
protected EncryptionKeysPage createPage(Integer start, Integer length, Integer total, Integer limit, List<EncryptionKey> items) { | ||
return new EncryptionKeysPage(start, length, total, limit, items); | ||
} | ||
|
||
} |
Oops, something went wrong.