Class: Spaceship::ConnectAPI::UserInvitation
- Inherits:
-
Object
- Object
- Spaceship::ConnectAPI::UserInvitation
- Includes:
- Model
- Defined in:
- spaceship/lib/spaceship/connect_api/models/user_invitation.rb
Constant Summary collapse
- ESSENTIAL_INCLUDES =
[ "visibleApps" ].join(",")
- UserRole =
Spaceship::ConnectAPI::User::UserRole
Instance Attribute Summary collapse
-
#all_apps_visible ⇒ Object
Returns the value of attribute all_apps_visible.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#provisioning_allowed ⇒ Object
Returns the value of attribute provisioning_allowed.
-
#roles ⇒ Object
Returns the value of attribute roles.
-
#visible_apps ⇒ Object
Returns the value of attribute visible_apps.
Attributes included from Model
Class Method Summary collapse
-
.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, sort: nil) ⇒ Object
Managing invitations.
-
.create(client: nil, email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil, visible_app_ids: []) ⇒ Object
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 false, you must provide values for `visible_app_ids`.
- .find(client: nil, email: nil, includes: ESSENTIAL_INCLUDES) ⇒ Object
- .type ⇒ Object
Instance Method Summary collapse
- #delete!(client: nil) ⇒ Object
-
#get_visible_apps(client: nil, limit: nil) ⇒ Object
Get visible apps for invited user.
Methods included from Model
#attr_mapping, included, #initialize, #reverse_attr_mapping, #to_json, #update_attributes
Instance Attribute Details
#all_apps_visible ⇒ Object
Returns the value of attribute all_apps_visible.
13 14 15 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 13 def all_apps_visible @all_apps_visible end |
#email ⇒ Object
Returns the value of attribute email.
11 12 13 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 11 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
9 10 11 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 9 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
10 11 12 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 10 def last_name @last_name end |
#provisioning_allowed ⇒ Object
Returns the value of attribute provisioning_allowed.
14 15 16 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 14 def provisioning_allowed @provisioning_allowed end |
#roles ⇒ Object
Returns the value of attribute roles.
12 13 14 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 12 def roles @roles end |
#visible_apps ⇒ Object
Returns the value of attribute visible_apps.
16 17 18 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 16 def visible_apps @visible_apps end |
Class Method Details
.all(client: nil, filter: {}, includes: ESSENTIAL_INCLUDES, sort: nil) ⇒ Object
Managing invitations
43 44 45 46 47 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 43 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: []) ⇒ Object
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 false, you must provide values for `visible_app_ids`.
-
if ‘all_apps_visible` is true, you must not provide values for `visible_app_ids`.
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 59 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) ⇒ Object
49 50 51 52 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 49 def self.find(client: nil, email: nil, includes: ESSENTIAL_INCLUDES) client ||= Spaceship::ConnectAPI return all(client: client, filter: { email: email }, includes: includes) end |
.type ⇒ Object
35 36 37 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 35 def self.type return "userInvitations" end |
Instance Method Details
#delete!(client: nil) ⇒ Object
73 74 75 76 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 73 def delete!(client: nil) client ||= Spaceship::ConnectAPI client.delete_user_invitation(user_invitation_id: id) end |
#get_visible_apps(client: nil, limit: nil) ⇒ Object
Get visible apps for invited user
79 80 81 82 83 |
# File 'spaceship/lib/spaceship/connect_api/models/user_invitation.rb', line 79 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 |