class Spaceship::ConnectAPI::UserInvitation

Constants

ESSENTIAL_INCLUDES

Attributes

all_apps_visible[RW]
email[RW]
first_name[RW]
last_name[RW]
provisioning_allowed[RW]
roles[RW]
visible_apps[RW]

Public Class Methods

all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, sort: nil) click to toggle source

Managing invitations

# File spaceship/lib/spaceship/connect_api/models/user_invitation.rb, line 53
def self.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, sort: nil)
  client ||= Spaceship::ConnectAPI
  resps = client.get_user_invitations(filter: filter, includes: includes, sort: sort).all_pages
  return resps.flat_map(&:to_models)
end
create(client: nil, email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil, visible_app_ids: []) click to toggle source

Create and post user invitation App Store Connect allows for the following combinations of `all_apps_visible` and `visible_app_ids`:

  • if `all_apps_visible` is `nil`, you don't have to provide values for `visible_app_ids`

  • if `all_apps_visible` is true, you must provide values for `visible_app_ids`.

  • if `all_apps_visible` is false, you must not provide values for `visible_app_ids`.

# File spaceship/lib/spaceship/connect_api/models/user_invitation.rb, line 69
def self.create(client: nil, email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil, visible_app_ids: [])
  client ||= Spaceship::ConnectAPI
  resp = client.post_user_invitation(
    email: email,
    first_name: first_name,
    last_name: last_name,
    roles: roles,
    provisioning_allowed: provisioning_allowed,
    all_apps_visible: all_apps_visible,
    visible_app_ids: visible_app_ids
  )
  return resp.to_models.first
end
find(client: nil, email: nil, includes: ESSENTIAL_INCLUDES) click to toggle source
# File spaceship/lib/spaceship/connect_api/models/user_invitation.rb, line 59
def self.find(client: nil, email: nil, includes: ESSENTIAL_INCLUDES)
  client ||= Spaceship::ConnectAPI
  return all(client: client, filter: { email: email }, includes: includes)
end
type() click to toggle source
# File spaceship/lib/spaceship/connect_api/models/user_invitation.rb, line 45
def self.type
  return "userInvitations"
end

Public Instance Methods

delete!(client: nil) click to toggle source
# File spaceship/lib/spaceship/connect_api/models/user_invitation.rb, line 83
def delete!(client: nil)
  client ||= Spaceship::ConnectAPI
  client.delete_user_invitation(user_invitation_id: id)
end
get_visible_apps(client: nil, limit: nil) click to toggle source

Get visible apps for invited user

# File spaceship/lib/spaceship/connect_api/models/user_invitation.rb, line 89
def get_visible_apps(client: nil, limit: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_user_invitation_visible_apps(user_invitation_id: id, limit: limit)
  return resp.to_models
end