-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from Freja-eID/master
Supported updating issued organisation ids
- Loading branch information
Showing
16 changed files
with
405 additions
and
18 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
56 changes: 56 additions & 0 deletions
56
...t/src/main/java/com/verisec/frejaeid/client/beans/general/UpdateOrganisationIdStatus.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,56 @@ | ||
package com.verisec.frejaeid.client.beans.general; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Objects; | ||
|
||
public class UpdateOrganisationIdStatus { | ||
|
||
private final int added; | ||
private final int updated; | ||
private final int deleted; | ||
|
||
@JsonCreator | ||
public UpdateOrganisationIdStatus(@JsonProperty("added") int added, | ||
@JsonProperty("updated") int updated, | ||
@JsonProperty("deleted") int deleted) { | ||
this.added = added; | ||
this.updated = updated; | ||
this.deleted = deleted; | ||
} | ||
|
||
public int getAdded() { | ||
return added; | ||
} | ||
|
||
public int getUpdated() { | ||
return updated; | ||
} | ||
|
||
public int getDeleted() { | ||
return deleted; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof UpdateOrganisationIdStatus)) return false; | ||
UpdateOrganisationIdStatus that = (UpdateOrganisationIdStatus) o; | ||
return added == that.added && updated == that.updated && deleted == that.deleted; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(added, updated, deleted); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "UpdateOrganisationIdStatus{" + | ||
"added=" + added + | ||
", updated=" + updated + | ||
", deleted=" + deleted + | ||
'}'; | ||
} | ||
} |
82 changes: 82 additions & 0 deletions
82
.../com/verisec/frejaeid/client/beans/organisationid/update/UpdateOrganisationIdRequest.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,82 @@ | ||
package com.verisec.frejaeid.client.beans.organisationid.update; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.verisec.frejaeid.client.beans.common.RelyingPartyRequest; | ||
import com.verisec.frejaeid.client.beans.general.OrganisationIdAttribute; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class UpdateOrganisationIdRequest implements RelyingPartyRequest { | ||
|
||
private final String identifier; | ||
private final List<OrganisationIdAttribute> additionalAttributes; | ||
private final String relyingPartyId; | ||
|
||
public static UpdateOrganisationIdRequest create(String identifier, List<OrganisationIdAttribute> additionalAttributes) { | ||
return new UpdateOrganisationIdRequest(identifier, additionalAttributes, null); | ||
} | ||
|
||
public static UpdateOrganisationIdRequest create(String identifier, List<OrganisationIdAttribute> additionalAttributes, String relyingPartyId) { | ||
return new UpdateOrganisationIdRequest(identifier, additionalAttributes, relyingPartyId); | ||
} | ||
|
||
|
||
/** | ||
* Returns instance of {@linkplain UpdateOrganisationIdRequest} | ||
* | ||
* @param identifier identifier to be updated for the end user. It cannot be | ||
* {@code null} or empty. | ||
* @param additionalAttributes additional attributes related to the identifier. | ||
* It can be {@code null} or empty. | ||
* @param relyingPartyId specifies relying party id for which transaction is | ||
* initiated. It cannot be {@code null} or empty. | ||
* @return request | ||
*/ | ||
@JsonCreator | ||
private UpdateOrganisationIdRequest( | ||
@JsonProperty("identifier") String identifier, | ||
@JsonProperty("additionalAttributes") List<OrganisationIdAttribute> additionalAttributes, | ||
@JsonProperty("relyingPartyId") String relyingPartyId) { | ||
this.identifier = identifier; | ||
this.additionalAttributes = additionalAttributes; | ||
this.relyingPartyId = relyingPartyId; | ||
} | ||
|
||
public String getIdentifier() { | ||
return identifier; | ||
} | ||
|
||
public List<OrganisationIdAttribute> getAdditionalAttributes() { | ||
return additionalAttributes; | ||
} | ||
|
||
public String getRelyingPartyId() { | ||
return relyingPartyId; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof UpdateOrganisationIdRequest)) return false; | ||
UpdateOrganisationIdRequest that = (UpdateOrganisationIdRequest) o; | ||
return Objects.equals(identifier, that.identifier) && | ||
Objects.equals(additionalAttributes, that.additionalAttributes) && | ||
Objects.equals(relyingPartyId, that.relyingPartyId); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(identifier, additionalAttributes, relyingPartyId); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "UpdateOrganisationIdRequest{" + | ||
"identifier='" + identifier + '\'' + | ||
", additionalAttributes=" + additionalAttributes + | ||
", relyingPartyId='" + relyingPartyId + '\'' + | ||
'}'; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...com/verisec/frejaeid/client/beans/organisationid/update/UpdateOrganisationIdResponse.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,43 @@ | ||
package com.verisec.frejaeid.client.beans.organisationid.update; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.verisec.frejaeid.client.beans.common.FrejaHttpResponse; | ||
import com.verisec.frejaeid.client.beans.general.UpdateOrganisationIdStatus; | ||
|
||
import java.util.Objects; | ||
|
||
public class UpdateOrganisationIdResponse implements FrejaHttpResponse { | ||
|
||
private final UpdateOrganisationIdStatus updateOrganisationIdStatus; | ||
|
||
@JsonCreator | ||
public UpdateOrganisationIdResponse( | ||
@JsonProperty("updateOrganisationIdStatus") UpdateOrganisationIdStatus updateOrganisationIdStatus) { | ||
this.updateOrganisationIdStatus = updateOrganisationIdStatus; | ||
} | ||
|
||
public UpdateOrganisationIdStatus getUpdateOrganisationIdStatus() { | ||
return updateOrganisationIdStatus; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof UpdateOrganisationIdResponse)) return false; | ||
UpdateOrganisationIdResponse that = (UpdateOrganisationIdResponse) o; | ||
return Objects.equals(updateOrganisationIdStatus, that.updateOrganisationIdStatus); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(updateOrganisationIdStatus); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "UpdateOrganisationIdResponse{" + | ||
"updateOrganisationIdStatus=" + updateOrganisationIdStatus + | ||
'}'; | ||
} | ||
} |
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
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
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
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
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
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
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
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
Oops, something went wrong.