Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
fac578c8
Unverified
Commit
fac578c8
authored
1 year ago
by
Hannes Erven
Committed by
GitHub
1 year ago
Browse files
Options
Download
Email Patches
Plain Diff
Add the "internal" flag to NotesApi (#1029)
parent
55d3f927
main
6.x
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/org/gitlab4j/api/NotesApi.java
+18
-2
src/main/java/org/gitlab4j/api/NotesApi.java
src/main/java/org/gitlab4j/api/models/Note.java
+10
-1
src/main/java/org/gitlab4j/api/models/Note.java
src/test/resources/org/gitlab4j/api/note.json
+1
-0
src/test/resources/org/gitlab4j/api/note.json
with
29 additions
and
3 deletions
+29
-3
src/main/java/org/gitlab4j/api/NotesApi.java
+
18
-
2
View file @
fac578c8
...
...
@@ -152,7 +152,7 @@ public class NotesApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
*/
public
Note
createIssueNote
(
Object
projectIdOrPath
,
Long
issueIid
,
String
body
)
throws
GitLabApiException
{
return
(
createIssueNote
(
projectIdOrPath
,
issueIid
,
body
,
null
));
return
(
createIssueNote
(
projectIdOrPath
,
issueIid
,
body
,
null
,
null
));
}
/**
...
...
@@ -166,10 +166,26 @@ public class NotesApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
*/
public
Note
createIssueNote
(
Object
projectIdOrPath
,
Long
issueIid
,
String
body
,
Date
createdAt
)
throws
GitLabApiException
{
return
(
createIssueNote
(
projectIdOrPath
,
issueIid
,
body
,
null
,
null
));
}
/**
* Create a issues's note.
*
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
* @param issueIid the issue IID to create the notes for
* @param body the content of note
* @param createdAt the created time of note
* @param internal whether the note shall be marked 'internal'
* @return the created Note instance
* @throws GitLabApiException if any exception occurs
*/
public
Note
createIssueNote
(
Object
projectIdOrPath
,
Long
issueIid
,
String
body
,
Date
createdAt
,
Boolean
internal
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
()
.
withParam
(
"body"
,
body
,
true
)
.
withParam
(
"created_at"
,
createdAt
);
.
withParam
(
"created_at"
,
createdAt
)
.
withParam
(
"internal"
,
internal
);
;
Response
response
=
post
(
Response
.
Status
.
CREATED
,
formData
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"issues"
,
issueIid
,
"notes"
);
return
(
response
.
readEntity
(
Note
.
class
));
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/gitlab4j/api/models/Note.java
+
10
-
1
View file @
fac578c8
...
...
@@ -98,6 +98,7 @@ public class Note {
private
Boolean
resolvable
;
private
Participant
resolvedBy
;
private
Date
resolvedAt
;
private
Boolean
internal
;
private
Type
type
;
private
Position
position
;
...
...
@@ -270,7 +271,15 @@ public class Note {
this
.
position
=
position
;
}
@Override
public
Boolean
getInternal
()
{
return
internal
;
}
public
void
setInternal
(
Boolean
internal
)
{
this
.
internal
=
internal
;
}
@Override
public
String
toString
()
{
return
(
JacksonJson
.
toJsonString
(
this
));
}
...
...
This diff is collapsed.
Click to expand it.
src/test/resources/org/gitlab4j/api/note.json
+
1
-
0
View file @
fac578c8
...
...
@@ -16,6 +16,7 @@
"resolvable"
:
true
,
"resolved"
:
true
,
"resolved_at"
:
"2021-09-14T09:03:50.221Z"
,
"internal"
:
false
,
"system"
:
false
,
"noteable_id"
:
52
,
"noteable_type"
:
"Snippet"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets