| Module | Gitlab::Client::Snippets |
| In: |
lib/gitlab/client/snippets.rb
|
Defines methods related to snippets. @see github.com/gitlabhq/gitlabhq/blob/master/doc/api/project_snippets.md
Creates a new snippet.
@example
Gitlab.create_snippet(42, { title: 'REST', file_name: 'api.rb', code: 'some code' })
@param [Integer] project The ID of a project. @param [Hash] options A customizable set of options. @option options [String] :title (required) The title of a snippet. @option options [String] :file_name (required) The name of a snippet file. @option options [String] :code (required) The content of a snippet. @option options [String] :lifetime (optional) The expiration date of a snippet. @return [Gitlab::ObjectifiedHash] Information about created snippet.
Deletes a snippet.
@example
Gitlab.delete_snippet(2, 14)
@param [Integer] project The ID of a project. @param [Integer] id The ID of a snippet. @return [Gitlab::ObjectifiedHash] Information about deleted snippet.
Updates a snippet.
@example
Gitlab.edit_snippet(42, 34, { file_name: 'README.txt' })
@param [Integer] project The ID of a project. @param [Integer] id The ID of a snippet. @param [Hash] options A customizable set of options. @option options [String] :title The title of a snippet. @option options [String] :file_name The name of a snippet file. @option options [String] :code The content of a snippet. @option options [String] :lifetime The expiration date of a snippet. @return [Gitlab::ObjectifiedHash] Information about updated snippet.
Gets information about a snippet.
@example
Gitlab.snippet(2, 14)
@param [Integer] project The ID of a project. @param [Integer] id The ID of a snippet. @return [Gitlab::ObjectifiedHash]
Returns raw project snippet content as plain text.
@example
Gitlab.snippet_content(2, 14)
@param [Integer] project The ID of a project. @param [Integer] id The ID of a snippet. @return [Gitlab::ObjectifiedHash] Information about deleted snippet.
Gets a list of project‘s snippets.
@example
Gitlab.snippets(42)
@param [Integer] project The ID of a project. @param [Hash] options A customizable set of options. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Gitlab::ObjectifiedHash]