Module: Deploygate::Client::Apps
- Included in:
- Deploygate::Client
- Defined in:
- lib/deploygate/client/apps.rb
Overview
Request to application endpoints
Constant Summary collapse
- PLATFORM_ANDROID =
'android'
- PLATFORM_IOS =
'ios'
- ROLE_DEVELOPER =
1
- ROLE_TESTER =
2
Instance Method Summary collapse
-
#add_app_members(owner:, platform:, app_id:, users:, role: nil) ⇒ Deploygate::Client::Response
Invite users to the app.
-
#add_app_team(org_name:, platform:, app_id:, team_name:) ⇒ Deploygate::Client::Response
Add teams to the app,.
-
#app_members(owner:, platform:, app_id:) ⇒ Deploygate::Client::Response
Get a list of members participating in the app.
-
#app_teams(org_name:, platform:, app_id:) ⇒ Deploygate::Client::Response
Get a list of teams participating in the app.
-
#delete_app_distribution(owner:, platform:, app_id:, dist_name:) ⇒ Deploygate::Client::Response
Delete distribution page.
-
#delete_app_members(owner:, platform:, app_id:, users:) ⇒ Deploygate::Client::Response
Delete members from the app.
-
#delete_app_team(org_name:, platform:, app_id:, team_name:) ⇒ Deploygate::Client::Response
Delete team from the app.
-
#upload_app(owner:, file_path:, message: nil, dist_key: nil, dist_name: nil, release_note: nil, disable_notify: nil, visibility: nil) ⇒ Deploygate::Client::Response
Upload an application binary file.
Instance Method Details
#add_app_members(owner:, platform:, app_id:, users:, role: nil) ⇒ Deploygate::Client::Response
Invite users to the app.
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/deploygate/client/apps.rb', line 61 def add_app_members(owner:, platform:, app_id:, users:, role: nil) endpoint = "/api/users/#{owner}/platforms/#{platform}/apps/#{app_id}/members" res = api.post endpoint do |request| request.headers['Content-Type'] = 'application/x-www-form-urlencoded' request.body = URI.encode_www_form( users: users, role: role ) end Response.new(res) end |
#add_app_team(org_name:, platform:, app_id:, team_name:) ⇒ Deploygate::Client::Response
Add teams to the app,
128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/deploygate/client/apps.rb', line 128 def add_app_team(org_name:, platform:, app_id:, team_name:) endpoint = "/api/organizations/#{org_name}/platforms/#{platform}"\ "/apps/#{app_id}/teams" res = api.post endpoint do |request| request.headers['Content-Type'] = 'application/x-www-form-urlencoded' request.body = URI.encode_www_form( team: team_name ) end Response.new(res) end |
#app_members(owner:, platform:, app_id:) ⇒ Deploygate::Client::Response
Get a list of members participating in the app.
80 81 82 83 84 |
# File 'lib/deploygate/client/apps.rb', line 80 def app_members(owner:, platform:, app_id:) endpoint = "/api/users/#{owner}/platforms/#{platform}/apps/#{app_id}/members" res = api.get endpoint Response.new(res) end |
#app_teams(org_name:, platform:, app_id:) ⇒ Deploygate::Client::Response
Get a list of teams participating in the app.
113 114 115 116 117 118 |
# File 'lib/deploygate/client/apps.rb', line 113 def app_teams(org_name:, platform:, app_id:) endpoint = "/api/organizations/#{org_name}/platforms/#{platform}"\ "/apps/#{app_id}/teams" res = api.get endpoint Response.new(res) end |
#delete_app_distribution(owner:, platform:, app_id:, dist_name:) ⇒ Deploygate::Client::Response
Delete distribution page.
163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/deploygate/client/apps.rb', line 163 def delete_app_distribution(owner:, platform:, app_id:, dist_name:) endpoint = "/api/users/#{owner}/platforms/#{platform}"\ "/apps/#{app_id}/distributions" res = api.delete endpoint do |request| request.headers['Content-Type'] = 'application/x-www-form-urlencoded' request.body = URI.encode_www_form( distribution_name: dist_name ) end Response.new(res) end |
#delete_app_members(owner:, platform:, app_id:, users:) ⇒ Deploygate::Client::Response
Delete members from the app.
95 96 97 98 99 100 101 102 103 104 |
# File 'lib/deploygate/client/apps.rb', line 95 def delete_app_members(owner:, platform:, app_id:, users:) endpoint = "/api/users/#{owner}/platforms/#{platform}/apps/#{app_id}/members" res = api.delete endpoint do |request| request.headers['Content-Type'] = 'application/x-www-form-urlencoded' request.body = URI.encode_www_form( users: users ) end Response.new(res) end |
#delete_app_team(org_name:, platform:, app_id:, team_name:) ⇒ Deploygate::Client::Response
Delete team from the app.
148 149 150 151 152 153 |
# File 'lib/deploygate/client/apps.rb', line 148 def delete_app_team(org_name:, platform:, app_id:, team_name:) endpoint = "/api/organizations/#{org_name}/platforms/#{platform}"\ "/apps/#{app_id}/teams/#{team_name}" res = api.delete endpoint Response.new(res) end |
#upload_app(owner:, file_path:, message: nil, dist_key: nil, dist_name: nil, release_note: nil, disable_notify: nil, visibility: nil) ⇒ Deploygate::Client::Response
Upload an application binary file.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/deploygate/client/apps.rb', line 26 def upload_app( owner:, file_path:, message: nil, dist_key: nil, dist_name: nil, release_note: nil, disable_notify: nil, visibility: nil ) endpoint = "/api/users/#{owner}/apps" res = api.post endpoint do |request| request.body = { file: Faraday::UploadIO.new(file_path, 'octet/stream'), message: , distribution_key: dist_key, distribution_name: dist_name, release_note: release_note, disable_notify: disable_notify, visibility: visibility } end Response.new(res) end |