Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaspons committed Dec 30, 2023
1 parent 700766e commit 7119385
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
11 changes: 9 additions & 2 deletions R/osmapi_changeset_discussion.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' @param changeset_id The id of the changeset to comment represented by a numeric or a character value.
#' @param comment The text of the comment to post.
#'
#' @return Returns the changeset information invisibly as a `xml_document`.
#' @return Returns the changeset information.
#' @family changeset discussion's functions
#' @export
#'
Expand Down Expand Up @@ -71,11 +71,16 @@ osm_comment_changeset_discussion <- function(changeset_id, comment) { # TODO: ,
#'
#' @param changeset_id The id of the changeset represented by a numeric or a character value.
#'
#' @return Returns the changeset information invisibly as a `xml_document`.
#' @return Returns the changeset information.
#' @family changeset discussion's functions
#' @export
#'
#' @examples
#' \dontrun{
#' # set_osmapi_connection(server = "openstreetmap.org")
#' osm_subscribe_changeset_discussion(137595351)
#' osm_unsubscribe_changeset_discussion("137595351")
#' }
osm_subscribe_changeset_discussion <- function(changeset_id) { # TODO: , format = c("R", "xml", "json")
req <- osmapi_request(authenticate = TRUE)
req <- httr2::req_method(req, "POST")
Expand Down Expand Up @@ -159,6 +164,7 @@ osm_hide_comment_changeset_discussion <- function(comment_id) { # TODO: , format
obj_xml <- httr2::resp_body_xml(resp)

out <- changeset_xml2DF(obj_xml)
# TODO: parse unknown xml response (only available for moderators)

return(out)
}
Expand Down Expand Up @@ -192,6 +198,7 @@ osm_unhide_comment_changeset_discussion <- function(comment_id) { # TODO: , form
obj_xml <- httr2::resp_body_xml(resp)

out <- changeset_xml2DF(obj_xml)
# TODO: parse unknown xml response (only available for moderators)

return(out)
}
2 changes: 1 addition & 1 deletion R/osmapi_changesets.R
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ osm_update_changeset <- function(changeset_id, comment, ...,
# : If the changeset in question has already been closed (either by the user itself or as a result of the auto-closing feature). A message with the format "`The changeset #id was closed at #closed_at.`" is returned
# : Or if the user trying to update the changeset is not the same as the one that created it

#' @describeIn osm_create_changeset Closes a changeset. A changeset may already have been closed without the owner
#' @describeIn osm_create_changeset Close a changeset. A changeset may already have been closed without the owner
#' issuing this API call. In this case an error code is returned.
#'
#' @return Nothing is returned upon successful closing of a changeset.
Expand Down
7 changes: 4 additions & 3 deletions R/osmapi_elements.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#'
#' Creates a new element in an open changeset as specified.
#'
#' @param x The new object data. Can be the path of an xml file, a `xml_document` or a data.frame inheriting
#' @param x The new object data. Can be the path to an xml file, a `xml_document` or a data.frame inheriting
#' or following the structure of an `osmapi_objects` object.
#' @param changeset_id The ID of an open changeset where to create the object. If missing, `x` should define the
#' changeset ID, otherwise it will be overwritten with `changeset_id`. Ignored if `x` is a path.
Expand Down Expand Up @@ -995,7 +995,8 @@ osm_redaction_object <- function(osm_type = c("node", "way", "relation"), osm_id
req <- httr2::req_url_query(redaction = redaction_id)
}

httr2::req_perform(req)
resp <- httr2::req_perform(req)
# TODO: parse unknown response (only available for moderators)

invisible()
return(resp)
}
2 changes: 1 addition & 1 deletion man/osm_comment_changeset_discussion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/osm_create_changeset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/osm_create_object.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion man/osm_subscribe_changeset_discussion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7119385

Please sign in to comment.