Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/invitations.rb')
-rw-r--r--lib/api/invitations.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/api/invitations.rb b/lib/api/invitations.rb
index 6fb3eca0ba8..6aefdf146cf 100644
--- a/lib/api/invitations.rb
+++ b/lib/api/invitations.rb
@@ -18,11 +18,12 @@ module API
desc 'Invite non-members by email address to a group or project.' do
detail 'This feature was introduced in GitLab 13.6'
success Entities::Invitation
+ tags %w[invitations]
end
params do
requires :access_level, type: Integer, values: Gitlab::Access.all_values, desc: 'A valid access level (defaults: `30`, developer access level)'
- optional :email, types: [String, Array[String]], email_or_email_list: true, desc: 'The email address to invite, or multiple emails separated by comma'
- optional :user_id, types: [Integer, String], desc: 'The user ID of the new member or multiple IDs separated by commas.'
+ optional :email, type: Array[String], email_or_email_list: true, coerce_with: ::API::Validations::Types::CommaSeparatedToArray.coerce, desc: 'The email address to invite, or multiple emails separated by comma'
+ optional :user_id, type: Array[String], coerce_with: ::API::Validations::Types::CommaSeparatedToArray.coerce, desc: 'The user ID of the new member or multiple IDs separated by commas.'
optional :expires_at, type: DateTime, desc: 'Date string in the format YEAR-MONTH-DAY'
optional :invite_source, type: String, desc: 'Source that triggered the member creation process', default: 'invitations-api'
optional :tasks_to_be_done, type: Array[String], coerce_with: Validations::Types::CommaSeparatedToArray.coerce, desc: 'Tasks the inviter wants the member to do'
@@ -44,8 +45,12 @@ module API
desc 'Get a list of group or project invitations viewable by the authenticated user' do
detail 'This feature was introduced in GitLab 13.6'
success Entities::Invitation
+ is_array true
+ tags %w[invitations]
end
params do
+ optional :page, type: Integer, desc: 'Page to retrieve'
+ optional :per_page, type: Integer, desc: 'Number of member invitations to return per page'
optional :query, type: String, desc: 'A query string to search for members'
use :pagination
end
@@ -62,6 +67,7 @@ module API
desc 'Updates a group or project invitation.' do
success Entities::Member
+ tags %w[invitations]
end
params do
requires :email, type: String, desc: 'The email address of the invitation'
@@ -93,7 +99,15 @@ module API
end
end
- desc 'Removes an invitation from a group or project.'
+ desc 'Removes an invitation from a group or project.' do
+ success code: 204
+ failure [
+ { code: 403, message: 'Forbidden' },
+ { code: 404, message: 'Not found' },
+ { code: 409, message: 'Could not delete invitation' }
+ ]
+ tags %w[invitations]
+ end
params do
requires :email, type: String, desc: 'The email address of the invitation'
end