Module: BWAPI::Client::Projects::Sharing

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

Overview

Sharing module for projects/sharing endpoints

Instance Method Summary collapse

Instance Method Details

#default_project_sharingHash

Default shares of a project

Returns:

  • (Hash)

    Default project shares information



9
10
11
# File 'lib/bwapi/client/projects/sharing.rb', line 9

def default_project_sharing
  get 'projects/sharing'
end

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

Shares of a project

Parameters:

  • project_id (Integer)

    Id of project

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

    options hash of parameters

Returns:

  • (Hash)

    Specific project shares



19
20
21
# File 'lib/bwapi/client/projects/sharing.rb', line 19

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

#project_sharing_user(project_id, user_id) ⇒ Hash

User share of a project

Parameters:

  • project_id (Integer)

    Id of project

  • user_id (Integer)

    Id of user

Returns:

  • (Hash)

    Share of project for user



38
39
40
# File 'lib/bwapi/client/projects/sharing.rb', line 38

def project_sharing_user(project_id, user_id)
  get "projects/#{project_id}/sharing/#{user_id}"
end

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

Update shares of a project

Parameters:

  • project_id (Integer)

    Id of project

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

    options hash of parameters

Returns:

  • (Hash)

    Updated project shares



29
30
31
# File 'lib/bwapi/client/projects/sharing.rb', line 29

def update_project_sharing(project_id, opts = {})
  put "projects/#{project_id}/sharing", opts
end

#update_project_sharing_user(project_id, user_id, opts = {}) ⇒ Hash

Edit user share of a project

Parameters:

  • project_id (Integer)

    Id of project

  • user_id (Integer)

    Id of user

Returns:

  • (Hash)

    Updated share of project for user



48
49
50
# File 'lib/bwapi/client/projects/sharing.rb', line 48

def update_project_sharing_user(project_id, user_id, opts = {})
  put "projects/#{project_id}/sharing/#{user_id}", opts
end