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

Instance Method Details

#add_app_members(owner:, platform:, app_id:, users:, role: nil) ⇒ Deploygate::Client::Response

Invite users to the app.

Parameters:

  • owner (String)

    User or organization name

  • platform (String)

    Application platform(ios/android)

  • app_id (String)

    Application package name

  • users (String)

    User name or email (You can specify multiple values separated by commas)

  • role[String] (Hash)

    a customizable set of options

Returns:

See Also:



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,

Parameters:

  • org_name (String)

    Organization name

  • platform (String)

    Application platform(ios/android)

  • app_id (String)

    Application package name

  • team (String)

    Team name

Returns:

See Also:



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.

Parameters:

  • owner (String)

    User or organization name

  • platform (String)

    Application platform(ios/android)

  • app_id (String)

    Application package name

Returns:

See Also:



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.

Parameters:

  • org_name (String)

    Organization name

  • platform (String)

    Application platform(ios/android)

  • app_id (String)

    Application package name

Returns:

See Also:



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.

Parameters:

  • owner (String)

    User or organization name

  • platform (String)

    Application platform(ios/android)

  • app_id (String)

    Application package name

  • dist_name (String)

    Distribution page name

Returns:

See Also:



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.

Parameters:

  • owner (String)

    User or organization name

  • platform (String)

    Application platform (ios/android)

  • app_id (String)

    Application package name

  • users (String)

    User name or email (You can specify multiple values separated by commas)

Returns:

See Also:



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.

Parameters:

  • org_name (String)

    Organization name

  • platform (String)

    Application platform(ios/android)

  • app_id (String)

    Application package name

  • team (String)

    Team name

Returns:

See Also:



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.

Parameters:

  • owner (String)

    User or organization name

  • file_path (String)

    Application binary file(ipa/apk)

  • message (Hash) (defaults to: nil)

    a customizable set of options

  • dist_key (Hash) (defaults to: nil)

    a customizable set of options

  • dist_name (Hash) (defaults to: nil)

    a customizable set of options

  • release_note (Hash) (defaults to: nil)

    a customizable set of options

  • disable_notify (Hash) (defaults to: nil)

    a customizable set of options

  • visibility (Hash) (defaults to: nil)

    a customizable set of options

Options Hash (message:):

  • Description (String)

    of the file

Options Hash (dist_key:):

  • Distribution (String)

    page hash

Options Hash (dist_name:):

  • Distribution (String)

    page name

Options Hash (release_note:):

  • Message (String)

    for distribution page

Options Hash (disable_notify:):

  • Email (Boolean)

    notification for push(only ios)

Options Hash (visibility:):

  • Application (String)

    privacy(private/public)

Returns:

See Also:



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: message,
      distribution_key: dist_key,
      distribution_name: dist_name,
      release_note: release_note,
      disable_notify: disable_notify,
      visibility: visibility
    }
  end
  Response.new(res)
end