Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Nov 16, 2023
2 parents 84edd47 + 9cc6d2d commit c6108d8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Release.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

public class Release {

private String name;
Expand All @@ -20,6 +24,8 @@ public class Release {
private String tagPath;
private String evidenceSha;
private Assets assets;
@JsonProperty("_links")
private Map<String, String> links;

public String getName() {
return name;
Expand Down Expand Up @@ -125,6 +131,23 @@ public void setAssets(Assets assets) {
this.assets = assets;
}

public Map<String, String> getLinks() {
return links;
}

public void setLinks(Map<String, String> links) {
this.links = links;
}

@JsonIgnore
public String getLinkByName(String name) {
if (links == null || links.isEmpty()) {
return (null);
}

return (links.get(name));
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
Expand Down
18 changes: 18 additions & 0 deletions src/test/resources/org/gitlab4j/api/releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@
}
],
"evidence_file_path":"https://gitlab.example.com/root/awesome-app/-/releases/v0.2/evidence.json"
},
"_links": {
"closed_issues_url": "https://gitlab.example.com/root/awesome-app/-/issues?release_tag=v0.2&scope=all&state=closed",
"closed_merge_requests_url": "https://gitlab.example.com/root/awesome-app/-/merge_requests?release_tag=v0.2&scope=all&state=closed",
"edit_url": "https://gitlab.example.com/root/awesome-app/-/releases/v0.2/edit",
"merged_merge_requests_url": "https://gitlab.example.com/root/awesome-app/-/merge_requests?release_tag=v0.2&scope=all&state=merged",
"opened_issues_url": "https://gitlab.example.com/root/awesome-app/-/issues?release_tag=v0.2&scope=all&state=opened",
"opened_merge_requests_url": "https://gitlab.example.com/root/awesome-app/-/merge_requests?release_tag=v0.2&scope=all&state=opened",
"self": "https://gitlab.example.com/root/awesome-app/-/releases/v0.2"
}
},
{
Expand Down Expand Up @@ -152,6 +161,15 @@

],
"evidence_file_path":"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
},
"_links": {
"closed_issues_url": "https://gitlab.example.com/root/awesome-app/-/issues?release_tag=v0.1&scope=all&state=closed",
"closed_merge_requests_url": "https://gitlab.example.com/root/awesome-app/-/merge_requests?release_tag=v0.1&scope=all&state=closed",
"edit_url": "https://gitlab.example.com/root/awesome-app/-/releases/v0.1/edit",
"merged_merge_requests_url": "https://gitlab.example.com/root/awesome-app/-/merge_requests?release_tag=v0.1&scope=all&state=merged",
"opened_issues_url": "https://gitlab.example.com/root/awesome-app/-/issues?release_tag=v0.1&scope=all&state=opened",
"opened_merge_requests_url": "https://gitlab.example.com/root/awesome-app/-/merge_requests?release_tag=v0.1&scope=all&state=opened",
"self": "https://gitlab.example.com/root/awesome-app/-/releases/v0.1"
}
}
]

0 comments on commit c6108d8

Please sign in to comment.