module Gitlab::Client::UserSnippets

def create_user_snippet(options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Information about created snippet.

Options Hash: (**options)
  • :visibility (String) -- visibility of a snippet.
  • :description (String) -- Description of a snippet.
  • :content (String) -- Content of a snippet.
  • :file_name (String) -- Name of a snippet file.
  • :title (String) -- Title of a snippet.

Parameters:
  • options (Hash) -- A customizable set of options.
def create_user_snippet(options = {})
  post('/snippets', body: options)
end

def delete_user_snippet(id)

Returns:
  • (void) - This API call returns an empty response body.

Parameters:
  • id (Integer) -- ID of snippet to delete.
def delete_user_snippet(id)
  delete("/snippets/#{id}")
end

def edit_user_snippet(id, options = {})

Returns:
  • (Gitlab::ObjectifiedHash) - Information about updated snippet.

Options Hash: (**options)
  • :visibility (String) -- visibility of a snippet.
  • :description (String) -- Description of a snippet.
  • :content (String) -- Content of a snippet.
  • :file_name (String) -- Name of a snippet file.
  • :title (String) -- Title of a snippet.

Parameters:
  • options (Hash) -- A customizable set of options.
  • id (Integer) -- ID of snippet to update.
def edit_user_snippet(id, options = {})
  put("/snippets/#{id}", body: options)
end

def public_snippets(options = {})

Returns:
  • (Array) - List of all public snippets

Options Hash: (**options)
  • :page (String) -- Page to retrieve.
  • :per_page (String) -- Number of snippets to return per page.

Parameters:
  • options (Hash) -- A customizable set of options.
def public_snippets(options = {})
  get('/snippets/public', query: options)
end

def snippet_user_agent_details(id)

Returns:
  • (Array) - Details of the user agent

Parameters:
  • id (Integer) -- ID of snippet to delete.
def snippet_user_agent_details(id)
  get("/snippets/#{id}/user_agent_detail")
end

def user_snippet(id)

Returns:
  • (Gitlab::ObjectifiedHash) - Information about the user snippet

Parameters:
  • id (Integer) -- ID of snippet to retrieve.
def user_snippet(id)
  get("/snippets/#{id}")
end

def user_snippet_raw(id)

Returns:
  • (String) - User snippet text

Parameters:
  • id (Integer) -- ID of snippet to retrieve.
def user_snippet_raw(id)
  get("/snippets/#{id}/raw",
      format: nil,
      headers: { Accept: 'text/plain' },
      parser: ::Gitlab::Request::Parser)
end

def user_snippets

Returns:
  • (Array) - List of snippets of current user
def user_snippets
  get('/snippets')
end