spaceship/lib/spaceship/connect_api/users/users.rb in fastlane-2.189.0 vs spaceship/lib/spaceship/connect_api/users/users.rb in fastlane-2.190.0

- old
+ new

@@ -40,40 +40,62 @@ } users_request_client.post("users/#{user_id}/relationships/visibleApps", body) end + # Get app permissions for user + def get_user_visible_apps(user_id: id, limit: nil) + params = users_request_client.build_params(filter: {}, includes: nil, limit: limit, sort: nil) + users_request_client.get("users/#{user_id}/visibleApps", params) + end + # # invitations (invited users) # - # Get all invited users (not yet accepted) + # Get all invited users def get_user_invitations(filter: {}, includes: nil, limit: nil, sort: nil) params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort) users_request_client.get("userInvitations", params) end # Invite new users to App Store Connect - def post_user_invitation(email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil) + def post_user_invitation(email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil, visible_app_ids: []) body = { data: { type: "userInvitations", attributes: { email: email, firstName: first_name, lastName: last_name, roles: roles, provisioningAllowed: provisioning_allowed, allAppsVisible: all_apps_visible + }, + relationships: { + visibleApps: { + data: visible_app_ids.map do |id| + { + id: id, + type: "apps" + } + end + } } } } users_request_client.post("userInvitations", body) end # Remove invited user from team (not yet accepted) def delete_user_invitation(user_invitation_id: nil) users_request_client.delete("userInvitations/#{user_invitation_id}") + end + + # Get all app permissions for invited user + def get_user_invitation_visible_apps(user_invitation_id: id, limit: nil) + params = users_request_client.build_params(filter: {}, includes: nil, limit: limit, sort: nil) + users_request_client.get("userInvitations/#{user_invitation_id}/visibleApps", params) end end end end end