Method: Spaceship::ConnectAPI::TestFlight::API#create_beta_group

Defined in:
spaceship/lib/spaceship/connect_api/testflight/testflight.rb

#create_beta_group(app_id: nil, group_name: nil, is_internal_group: false, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false) ⇒ Object



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 207

def create_beta_group(app_id: nil, group_name: nil, is_internal_group: false, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
  body = {
    data: {
      attributes: {
        name: group_name,
        isInternalGroup: is_internal_group,
        hasAccessToAllBuilds: is_internal_group ? true : false, # Undocumented of 2021-08-02 in ASC API docs and ASC Open API spec. This is the default behavior on App Store Connect and does work with both Apple ID and API Token
        publicLinkEnabled: public_link_enabled,
        publicLinkLimit: public_link_limit,
        publicLinkLimitEnabled: public_link_limit_enabled
      },
      relationships: {
        app: {
          data: {
            id: app_id,
            type: "apps"
          },
        },
      },
      type: "betaGroups",
    },
  }
  test_flight_request_client.post("betaGroups", body)
end