Class: AlfrescoAPI::CommentsApi
- Inherits:
-
Object
- Object
- AlfrescoAPI::CommentsApi
- Defined in:
- lib/alfresco_api/api/comments_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_comment(node_id, comment_body_create, opts = {}) ⇒ CommentEntry
Create a comment Creates a comment on node nodeId.
-
#create_comment_with_http_info(node_id, comment_body_create, opts = {}) ⇒ Array<(CommentEntry, Fixnum, Hash)>
Create a comment Creates a comment on node nodeId.
-
#delete_comment(node_id, comment_id, opts = {}) ⇒ nil
Delete a comment Deletes the comment commentId from node nodeId.
-
#delete_comment_with_http_info(node_id, comment_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a comment Deletes the comment commentId from node nodeId.
-
#initialize(api_client = ApiClient.default) ⇒ CommentsApi
constructor
A new instance of CommentsApi.
-
#list_comments(node_id, opts = {}) ⇒ CommentPaging
List comments Gets a list of comments for the node nodeId, sorted chronologically with the newest comment first.
-
#list_comments_with_http_info(node_id, opts = {}) ⇒ Array<(CommentPaging, Fixnum, Hash)>
List comments Gets a list of comments for the node nodeId, sorted chronologically with the newest comment first.
-
#update_comment(node_id, comment_id, comment_body_update, opts = {}) ⇒ CommentEntry
Update a comment Updates an existing comment commentId on node nodeId.
-
#update_comment_with_http_info(node_id, comment_id, comment_body_update, opts = {}) ⇒ Array<(CommentEntry, Fixnum, Hash)>
Update a comment Updates an existing comment commentId on node nodeId.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CommentsApi
Returns a new instance of CommentsApi.
19 20 21 |
# File 'lib/alfresco_api/api/comments_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/alfresco_api/api/comments_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_comment(node_id, comment_body_create, opts = {}) ⇒ CommentEntry
Create a comment Creates a comment on node nodeId. You specify the comment in a JSON body like this: “‘JSON { "content": "This is a comment" } “` Note: You can create more than one comment by specifying a list of comments in the JSON body like this: “`JSON [ { "content": "This is a comment" }, { "content": "This is another comment" } ] “` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: “`JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } “`
30 31 32 33 |
# File 'lib/alfresco_api/api/comments_api.rb', line 30 def create_comment(node_id, comment_body_create, opts = {}) data, _status_code, _headers = create_comment_with_http_info(node_id, comment_body_create, opts) return data end |
#create_comment_with_http_info(node_id, comment_body_create, opts = {}) ⇒ Array<(CommentEntry, Fixnum, Hash)>
Create a comment Creates a comment on node nodeId. You specify the comment in a JSON body like this: ```JSON { "content": "This is a comment" } ``` Note: You can create more than one comment by specifying a list of comments in the JSON body like this: ```JSON [ { "content": "This is a comment" }, { "content": "This is another comment" } ] ``` If you specify a list as input, then a paginated list rather than an entry is returned in the response body. For example: ```JSON { "list": { "pagination": { "count": 2, "hasMoreItems": false, "totalItems": 2, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { … } }, { "entry": { … } } ] } } ```
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/alfresco_api/api/comments_api.rb', line 42 def create_comment_with_http_info(node_id, comment_body_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CommentsApi.create_comment ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling CommentsApi.create_comment" end # verify the required parameter 'comment_body_create' is set if @api_client.config.client_side_validation && comment_body_create.nil? fail ArgumentError, "Missing the required parameter 'comment_body_create' when calling CommentsApi.create_comment" end # resource path local_var_path = "/nodes/{nodeId}/comments".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(comment_body_create) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommentEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: CommentsApi#create_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_comment(node_id, comment_id, opts = {}) ⇒ nil
Delete a comment Deletes the comment commentId from node nodeId.
93 94 95 96 |
# File 'lib/alfresco_api/api/comments_api.rb', line 93 def delete_comment(node_id, comment_id, opts = {}) delete_comment_with_http_info(node_id, comment_id, opts) return nil end |
#delete_comment_with_http_info(node_id, comment_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete a comment Deletes the comment commentId from node nodeId.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/alfresco_api/api/comments_api.rb', line 104 def delete_comment_with_http_info(node_id, comment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CommentsApi.delete_comment ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling CommentsApi.delete_comment" end # verify the required parameter 'comment_id' is set if @api_client.config.client_side_validation && comment_id.nil? fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.delete_comment" end # resource path local_var_path = "/nodes/{nodeId}/comments/{commentId}".sub('{' + 'nodeId' + '}', node_id.to_s).sub('{' + 'commentId' + '}', comment_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: CommentsApi#delete_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_comments(node_id, opts = {}) ⇒ CommentPaging
List comments Gets a list of comments for the node nodeId, sorted chronologically with the newest comment first.
155 156 157 158 |
# File 'lib/alfresco_api/api/comments_api.rb', line 155 def list_comments(node_id, opts = {}) data, _status_code, _headers = list_comments_with_http_info(node_id, opts) return data end |
#list_comments_with_http_info(node_id, opts = {}) ⇒ Array<(CommentPaging, Fixnum, Hash)>
List comments Gets a list of comments for the node nodeId, sorted chronologically with the newest comment first.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/alfresco_api/api/comments_api.rb', line 168 def list_comments_with_http_info(node_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CommentsApi.list_comments ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling CommentsApi.list_comments" end if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0 fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling CommentsApi.list_comments, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1 fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling CommentsApi.list_comments, must be greater than or equal to 1.' end # resource path local_var_path = "/nodes/{nodeId}/comments".sub('{' + 'nodeId' + '}', node_id.to_s) # query parameters query_params = {} query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil? query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil? query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommentPaging') if @api_client.config.debugging @api_client.config.logger.debug "API called: CommentsApi#list_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_comment(node_id, comment_id, comment_body_update, opts = {}) ⇒ CommentEntry
Update a comment Updates an existing comment commentId on node nodeId.
227 228 229 230 |
# File 'lib/alfresco_api/api/comments_api.rb', line 227 def update_comment(node_id, comment_id, comment_body_update, opts = {}) data, _status_code, _headers = update_comment_with_http_info(node_id, comment_id, comment_body_update, opts) return data end |
#update_comment_with_http_info(node_id, comment_id, comment_body_update, opts = {}) ⇒ Array<(CommentEntry, Fixnum, Hash)>
Update a comment Updates an existing comment commentId on node nodeId.
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/alfresco_api/api/comments_api.rb', line 240 def update_comment_with_http_info(node_id, comment_id, comment_body_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CommentsApi.update_comment ..." end # verify the required parameter 'node_id' is set if @api_client.config.client_side_validation && node_id.nil? fail ArgumentError, "Missing the required parameter 'node_id' when calling CommentsApi.update_comment" end # verify the required parameter 'comment_id' is set if @api_client.config.client_side_validation && comment_id.nil? fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.update_comment" end # verify the required parameter 'comment_body_update' is set if @api_client.config.client_side_validation && comment_body_update.nil? fail ArgumentError, "Missing the required parameter 'comment_body_update' when calling CommentsApi.update_comment" end # resource path local_var_path = "/nodes/{nodeId}/comments/{commentId}".sub('{' + 'nodeId' + '}', node_id.to_s).sub('{' + 'commentId' + '}', comment_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(comment_body_update) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommentEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: CommentsApi#update_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |