Module: Spaceship::ConnectAPI::TestFlight

Included in:
Spaceship::ConnectAPI
Defined in:
spaceship/lib/spaceship/connect_api/testflight/client.rb,
spaceship/lib/spaceship/connect_api/testflight/testflight.rb

Defined Under Namespace

Classes: Client

Instance Method Summary collapse

Instance Method Details

#add_beta_groups_to_build(build_id: nil, beta_group_ids: []) ⇒ Object


171
172
173
174
175
176
177
178
179
180
181
182
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 171

def add_beta_groups_to_build(build_id: nil, beta_group_ids: [])
  body = {
    data: beta_group_ids.map do |id|
      {
        type: "betaGroups",
        id: id
      }
    end
  }

  Client.instance.post("builds/#{build_id}/relationships/betaGroups", body)
end

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


184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 184

def create_beta_group(app_id: nil, group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
  body = {
    data: {
      attributes: {
        name: group_name,
        publicLinkEnabled: public_link_enabled,
        publicLinkLimit: public_link_limit,
        publicLinkLimitEnabled: public_link_limit_enabled
      },
      relationships: {
        app: {
          data: {
            id: app_id,
            type: "apps"
          }
        }
      },
      type: "betaGroups"
    }
  }
  Client.instance.post("betaGroups", body)
end

#delete_beta_app_review_submission(beta_app_review_submission_id: nil) ⇒ Object


108
109
110
111
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 108

def delete_beta_app_review_submission(beta_app_review_submission_id: nil)
  params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil, cursor: nil)
  Client.instance.delete("betaAppReviewSubmissions/#{beta_app_review_submission_id}", params)
end

#delete_beta_feedback(feedback_id: nil) ⇒ Object


353
354
355
356
357
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 353

def delete_beta_feedback(feedback_id: nil)
  raise "Feedback id is nil" if feedback_id.nil?

  Client.instance.delete("betaFeedbacks/#{feedback_id}")
end

#delete_beta_tester_from_apps(beta_tester_id: nil, app_ids: []) ⇒ Object


244
245
246
247
248
249
250
251
252
253
254
255
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 244

def delete_beta_tester_from_apps(beta_tester_id: nil, app_ids: [])
  body = {
    data: app_ids.map do |id|
      {
        type: "apps",
        id: id
      }
    end
  }

  Client.instance.delete("betaTesters/#{beta_tester_id}/relationships/apps", nil, body)
end

#delete_beta_tester_from_beta_groups(beta_tester_id: nil, beta_group_ids: []) ⇒ Object


257
258
259
260
261
262
263
264
265
266
267
268
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 257

def delete_beta_tester_from_beta_groups(beta_tester_id: nil, beta_group_ids: [])
  body = {
    data: beta_group_ids.map do |id|
      {
        type: "betaGroups",
        id: id
      }
    end
  }

  Client.instance.delete("betaTesters/#{beta_tester_id}/relationships/betaGroups", nil, body)
end

#get_app(app_id: nil, includes: nil) ⇒ Object


15
16
17
18
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 15

def get_app(app_id: nil, includes: nil)
  params = Client.instance.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
  Client.instance.get("apps/#{app_id}", params)
end

#get_apps(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

apps


10
11
12
13
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 10

def get_apps(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("apps", params)
end

#get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaAppLocalizations


24
25
26
27
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 24

def get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaAppLocalizations", params)
end

#get_beta_app_review_detail(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaAppReviewDetails


64
65
66
67
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 64

def get_beta_app_review_detail(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaAppReviewDetails", params)
end

#get_beta_app_review_submissions(filter: {}, includes: nil, limit: nil, sort: nil, cursor: nil) ⇒ Object

betaAppReviewSubmissions


85
86
87
88
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 85

def get_beta_app_review_submissions(filter: {}, includes: nil, limit: nil, sort: nil, cursor: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort, cursor: cursor)
  Client.instance.get("betaAppReviewSubmissions", params)
end

#get_beta_build_localizations(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaBuildLocalizations


117
118
119
120
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 117

def get_beta_build_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaBuildLocalizations", params)
end

#get_beta_build_metrics(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaBuildMetrics


157
158
159
160
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 157

def get_beta_build_metrics(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaBuildMetrics", params)
end

#get_beta_feedback(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaFeedbacks (private API as of end 2019)


348
349
350
351
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 348

def get_beta_feedback(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaFeedbacks", params)
end

#get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaGroups


166
167
168
169
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 166

def get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaGroups", params)
end

#get_beta_tester_metrics(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaTesterMetrics


274
275
276
277
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 274

def get_beta_tester_metrics(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaTesterMetrics", params)
end

#get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

betaTesters


211
212
213
214
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 211

def get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("betaTesters", params)
end

#get_build(build_id: nil, includes: nil) ⇒ Object


288
289
290
291
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 288

def get_build(build_id: nil, includes: nil)
  params = Client.instance.build_params(filter: nil, includes: includes, limit: nil, sort: nil, cursor: nil)
  Client.instance.get("builds/#{build_id}", params)
end

#get_build_beta_details(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

buildBetaDetails


309
310
311
312
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 309

def get_build_beta_details(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("buildBetaDetails", params)
end

#get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

buildDeliveries


330
331
332
333
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 330

def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("buildDeliveries", params)
end

#get_builds(filter: {}, includes: "buildBetaDetail,betaBuildMetrics", limit: 10, sort: "uploadedDate", cursor: nil) ⇒ Object

builds


283
284
285
286
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 283

def get_builds(filter: {}, includes: "buildBetaDetail,betaBuildMetrics", limit: 10, sort: "uploadedDate", cursor: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort, cursor: cursor)
  Client.instance.get("builds", params)
end

#get_pre_release_versions(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

preReleaseVersions


339
340
341
342
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 339

def get_pre_release_versions(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("preReleaseVersions", params)
end

#patch_beta_app_localizations(localization_id: nil, attributes: {}) ⇒ Object


48
49
50
51
52
53
54
55
56
57
58
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 48

def patch_beta_app_localizations(localization_id: nil, attributes: {})
  body = {
    data: {
      attributes: attributes,
      id: localization_id,
      type: "betaAppLocalizations"
    }
  }

  Client.instance.patch("betaAppLocalizations/#{localization_id}", body)
end

#patch_beta_app_review_detail(app_id: nil, attributes: {}) ⇒ Object


69
70
71
72
73
74
75
76
77
78
79
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 69

def patch_beta_app_review_detail(app_id: nil, attributes: {})
  body = {
    data: {
      attributes: attributes,
      id: app_id,
      type: "betaAppReviewDetails"
    }
  }

  Client.instance.patch("betaAppReviewDetails/#{app_id}", body)
end

#patch_beta_build_localizations(localization_id: nil, feedbackEmail: nil, attributes: {}) ⇒ Object


141
142
143
144
145
146
147
148
149
150
151
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 141

def patch_beta_build_localizations(localization_id: nil, feedbackEmail: nil, attributes: {})
  body = {
    data: {
      attributes: attributes,
      id: localization_id,
      type: "betaBuildLocalizations"
    }
  }

  Client.instance.patch("betaBuildLocalizations/#{localization_id}", body)
end

#patch_build_beta_details(build_beta_details_id: nil, attributes: {}) ⇒ Object


314
315
316
317
318
319
320
321
322
323
324
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 314

def patch_build_beta_details(build_beta_details_id: nil, attributes: {})
  body = {
    data: {
      attributes: attributes,
      id: build_beta_details_id,
      type: "buildBetaDetails"
    }
  }

  Client.instance.patch("buildBetaDetails/#{build_beta_details_id}", body)
end

#patch_builds(build_id: nil, attributes: {}) ⇒ Object


293
294
295
296
297
298
299
300
301
302
303
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 293

def patch_builds(build_id: nil, attributes: {})
  body = {
    data: {
      attributes: attributes,
      id: build_id,
      type: "builds"
    }
  }

  Client.instance.patch("builds/#{build_id}", body)
end

#post_beta_app_localizations(app_id: nil, attributes: {}) ⇒ Object


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 29

def post_beta_app_localizations(app_id: nil, attributes: {})
  body = {
    data: {
      attributes: attributes,
      type: "betaAppLocalizations",
      relationships: {
        app: {
          data: {
            type: "apps",
            id: app_id
          }
        }
      }
    }
  }

  Client.instance.post("betaAppLocalizations", body)
end

#post_beta_app_review_submissions(build_id: nil) ⇒ Object


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 90

def post_beta_app_review_submissions(build_id: nil)
  body = {
    data: {
      type: "betaAppReviewSubmissions",
      relationships: {
        build: {
          data: {
            type: "builds",
            id: build_id
          }
        }
      }
    }
  }

  Client.instance.post("betaAppReviewSubmissions", body)
end

#post_beta_build_localizations(build_id: nil, attributes: {}) ⇒ Object


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 122

def post_beta_build_localizations(build_id: nil, attributes: {})
  body = {
    data: {
      attributes: attributes,
      type: "betaBuildLocalizations",
      relationships: {
        build: {
          data: {
            type: "builds",
            id: build_id
          }
        }
      }
    }
  }

  Client.instance.post("betaBuildLocalizations", body)
end

#post_bulk_beta_tester_assignments(beta_group_id: nil, beta_testers: nil) ⇒ Object

beta_testers - [“”, firstName: “”, lastName: “”]


217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 217

def post_bulk_beta_tester_assignments(beta_group_id: nil, beta_testers: nil)
  beta_testers || []

  beta_testers.map do |tester|
    tester[:errors] = []
  end

  body = {
    data: {
      attributes: {
        betaTesters: beta_testers
      },
      relationships: {
        betaGroup: {
          data: {
            type: "betaGroups",
            id: beta_group_id
          }
        }
      },
      type: "bulkBetaTesterAssignments"
    }
  }

  Client.instance.post("bulkBetaTesterAssignments", body)
end