module BWAPI::Client::Projects::Sharing

Sharing module for projects/sharing endpoints

Public Instance Methods

default_project_sharing() click to toggle source

Default shares of a project

@return [Hash] Default project shares information

# File lib/bwapi/client/projects/sharing.rb, line 9
def default_project_sharing
  get 'projects/sharing'
end
project_sharing(project_id, opts = {}) click to toggle source

Shares of a project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @options opts [Boolean] sharedOnly Boolean flag to return only shared shares (default: false) @return [Hash] Specific project shares

# 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) click to toggle source

User share of a project

@param project_id [Integer] Id of project @param user_id [Integer] Id of user @return [Hash] Share of project for user

# 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 = {}) click to toggle source

Update shares of a project

@param project_id [Integer] Id of project @param opts [Hash] options hash of parameters @options opts [Array] ProjectShareDTO Shares to be edited @return [Hash] Updated project shares

# 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 = {}) click to toggle source

Edit user share of a project

@param project_id [Integer] Id of project @param user_id [Integer] Id of user @options opts [Hash] User share to be edited @return [Hash] Updated share of project for user

# 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