Module: BWAPI::Client::Projects::Tags

Included in:
BWAPI::Client::Projects
Defined in:
lib/bwapi/client/projects/tags.rb

Overview

Tags module for projects/tags endpoints

Instance Method Summary collapse

Instance Method Details

#create_tag(project_id, opts = {}) ⇒ Hash

Create a new tag in project

Parameters:

  • project_id (Integer)

    Id of project

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • id (Integer)

    Id of the tag

  • name (String)

    Name of the tag

Returns:

  • (Hash)

    New tag



32
33
34
# File 'lib/bwapi/client/projects/tags.rb', line 32

def create_tag(project_id, opts = {})
  post "projects/#{project_id}/tags", opts
end

#delete_tag(project_id, tag_id) ⇒ Hash

Delete an existing tag in project

Parameters:

  • project_id (Integer)

    Id of project

  • tag_id (Integer)

    Id of tag

Returns:

  • (Hash)

    Deleted tag



53
54
55
# File 'lib/bwapi/client/projects/tags.rb', line 53

def delete_tag(project_id, tag_id)
  delete "projects/#{project_id}/tags/#{tag_id}"
end

#get_tag(project_id, tag_id) ⇒ Hash

Get a specific tag in project

Parameters:

  • project_id (Integer)

    Id of project

  • tag_id (Integer)

    Id of tag

Returns:

  • (Hash)

    Specific tag



21
22
23
# File 'lib/bwapi/client/projects/tags.rb', line 21

def get_tag(project_id, tag_id)
  get "projects/#{project_id}/tags/#{tag_id}"
end

#tags(project_id, opts = {}) ⇒ Hash

Get all tags in project

Parameters:

  • project_id (Integer)

    Id of project

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • page (Integer)

    Page of projects to retrieve

  • pageSize (Integer)

    Results per page of results

Returns:

  • (Hash)

    All tags in project



12
13
14
# File 'lib/bwapi/client/projects/tags.rb', line 12

def tags(project_id, opts = {})
  get "projects/#{project_id}/tags", opts
end

#update_tag(project_id, tag_id, opts = {}) ⇒ Hash

Update an existing tag in project

Parameters:

  • project_id (Integer)

    Id of project

  • tag_id (Integer)

    Id of tag

  • opts (Hash) (defaults to: {})

    options hash of parameters

Options Hash (opts):

  • id (Integer)

    Id of the tag

  • name (String)

    Name of the tag

Returns:

  • (Hash)

    Updated tag



44
45
46
# File 'lib/bwapi/client/projects/tags.rb', line 44

def update_tag(project_id, tag_id, opts = {})
  put "projects/#{project_id}/tags/#{tag_id}", opts
end