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

#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_tester_from_apps(beta_tester_id: nil, app_ids: []) ⇒ Object


221
222
223
224
225
226
227
228
229
230
231
232
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 221

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


234
235
236
237
238
239
240
241
242
243
244
245
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 234

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_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


251
252
253
254
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 251

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


188
189
190
191
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 188

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


265
266
267
268
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 265

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


286
287
288
289
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 286

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


307
308
309
310
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 307

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


260
261
262
263
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 260

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


316
317
318
319
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 316

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


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

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


270
271
272
273
274
275
276
277
278
279
280
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 270

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: “”]


194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'spaceship/lib/spaceship/connect_api/testflight/testflight.rb', line 194

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