lib/phrase/api/comments_api.rb in phrase-1.0.1 vs lib/phrase/api/comments_api.rb in phrase-1.0.2

- old
+ new

@@ -12,24 +12,24 @@ # @param project_id [String] Project ID # @param key_id [String] Translation Key ID # @param comment_create_parameters [CommentCreateParameters] # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) - # @return [nil] + # @return [Comment] def comment_create(project_id, key_id, comment_create_parameters, opts = {}) - comment_create_with_http_info(project_id, key_id, comment_create_parameters, opts) - nil + data, _status_code, _headers = comment_create_with_http_info(project_id, key_id, comment_create_parameters, opts) + data end # Create a comment # Create a new comment for a key. # @param project_id [String] Project ID # @param key_id [String] Translation Key ID # @param comment_create_parameters [CommentCreateParameters] # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) - # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers + # @return [Array<(Response<(Comment)>, Integer, Hash)>] Response<(Comment)> data, response status code and response headers def comment_create_with_http_info(project_id, key_id, comment_create_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CommentsApi.comment_create ...' end # verify the required parameter 'project_id' is set @@ -50,10 +50,12 @@ # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil? # form parameters @@ -61,11 +63,11 @@ # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(comment_create_parameters) # return_type - return_type = opts[:return_type] + return_type = opts[:return_type] || 'Comment' # auth_names auth_names = opts[:auth_names] || ['Basic', 'Token'] new_options = opts.merge( @@ -93,23 +95,23 @@ # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) # @option opts [String] :branch specify the branch to use # @return [nil] def comment_delete(project_id, key_id, id, opts = {}) - comment_delete_with_http_info(project_id, key_id, id, opts) - nil + data, _status_code, _headers = comment_delete_with_http_info(project_id, key_id, id, opts) + data end # Delete a comment # Delete an existing comment. # @param project_id [String] Project ID # @param key_id [String] Translation Key ID # @param id [String] ID # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) # @option opts [String] :branch specify the branch to use - # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers + # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers def comment_delete_with_http_info(project_id, key_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CommentsApi.comment_delete ...' end # verify the required parameter 'project_id' is set @@ -172,23 +174,23 @@ # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) # @option opts [String] :branch specify the branch to use # @return [nil] def comment_mark_check(project_id, key_id, id, opts = {}) - comment_mark_check_with_http_info(project_id, key_id, id, opts) - nil + data, _status_code, _headers = comment_mark_check_with_http_info(project_id, key_id, id, opts) + data end # Check if comment is read # Check if comment was marked as read. Returns 204 if read, 404 if unread. # @param project_id [String] Project ID # @param key_id [String] Translation Key ID # @param id [String] ID # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) # @option opts [String] :branch specify the branch to use - # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers + # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers def comment_mark_check_with_http_info(project_id, key_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CommentsApi.comment_mark_check ...' end # verify the required parameter 'project_id' is set @@ -251,23 +253,23 @@ # @param comment_mark_read_parameters [CommentMarkReadParameters] # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) # @return [nil] def comment_mark_read(project_id, key_id, id, comment_mark_read_parameters, opts = {}) - comment_mark_read_with_http_info(project_id, key_id, id, comment_mark_read_parameters, opts) - nil + data, _status_code, _headers = comment_mark_read_with_http_info(project_id, key_id, id, comment_mark_read_parameters, opts) + data end # Mark a comment as read # Mark a comment as read. # @param project_id [String] Project ID # @param key_id [String] Translation Key ID # @param id [String] ID # @param comment_mark_read_parameters [CommentMarkReadParameters] # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) - # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers + # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers def comment_mark_read_with_http_info(project_id, key_id, id, comment_mark_read_parameters, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CommentsApi.comment_mark_read ...' end # verify the required parameter 'project_id' is set @@ -335,22 +337,22 @@ # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) # @option opts [String] :branch specify the branch to use # @return [nil] def comment_mark_unread(project_id, key_id, id, opts = {}) - comment_mark_unread_with_http_info(project_id, key_id, id, opts) - nil + data, _status_code, _headers = comment_mark_unread_with_http_info(project_id, key_id, id, opts) + data end # Mark a comment as unread # Mark a comment as unread. # @param project_id [String] Project ID # @param key_id [String] Translation Key ID # @param id [String] ID # @param [Hash] opts the optional parameters # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional) # @option opts [String] :branch specify the branch to use - # @return [Array<(Response<(nil)>, Integer, Hash)>] Response<(nil, response status code and response headers + # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers def comment_mark_unread_with_http_info(project_id, key_id, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CommentsApi.comment_mark_unread ...' end # verify the required parameter 'project_id' is set