Module: Spaceship::ConnectAPI::Tunes::API

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

Instance Method Summary collapse

Instance Method Details

#delete_app_info(app_info_id: nil) ⇒ Object



563
564
565
566
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 563

def delete_app_info(app_info_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("appInfos/#{app_info_id}", params)
end

#delete_app_preview(app_preview_id: nil) ⇒ Object



243
244
245
246
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 243

def delete_app_preview(app_preview_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("appPreviews/#{app_preview_id}", params)
end

#delete_app_screenshot(app_screenshot_id: nil) ⇒ Object



455
456
457
458
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 455

def delete_app_screenshot(app_screenshot_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("appScreenshots/#{app_screenshot_id}", params)
end

#delete_app_store_review_attachment(app_store_review_attachment_id: nil) ⇒ Object



362
363
364
365
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 362

def delete_app_store_review_attachment(app_store_review_attachment_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("appStoreReviewAttachments/#{app_store_review_attachment_id}", params)
end

#delete_app_store_version_localization(app_store_version_localization_id: nil) ⇒ Object



688
689
690
691
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 688

def delete_app_store_version_localization(app_store_version_localization_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("appStoreVersionLocalizations/#{app_store_version_localization_id}", params)
end

#delete_app_store_version_phased_release(app_store_version_phased_release_id: nil) ⇒ Object



733
734
735
736
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 733

def delete_app_store_version_phased_release(app_store_version_phased_release_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("appStoreVersionPhasedReleases/#{app_store_version_phased_release_id}", params)
end

#delete_app_store_version_submission(app_store_version_submission_id: nil) ⇒ Object



866
867
868
869
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 866

def delete_app_store_version_submission(app_store_version_submission_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("appStoreVersionSubmissions/#{app_store_version_submission_id}", params)
end

#delete_custom_app_organization(custom_app_organization_id: nil) ⇒ Object



959
960
961
962
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 959

def delete_custom_app_organization(custom_app_organization_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("customAppOrganizations/#{custom_app_organization_id}", params)
end

#delete_custom_app_user(custom_app_user_id: nil) ⇒ Object



923
924
925
926
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 923

def delete_custom_app_user(custom_app_user_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("customAppUsers/#{custom_app_user_id}", params)
end

#delete_idfa_declaration(idfa_declaration_id: nil) ⇒ Object



1004
1005
1006
1007
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 1004

def delete_idfa_declaration(idfa_declaration_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("idfaDeclarations/#{idfa_declaration_id}", params)
end

#delete_reset_ratings_request(reset_ratings_request_id: nil) ⇒ Object



834
835
836
837
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 834

def delete_reset_ratings_request(reset_ratings_request_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("resetRatingsRequests/#{reset_ratings_request_id}", params)
end

#delete_sandbox_tester(sandbox_tester_id: nil) ⇒ Object



1029
1030
1031
1032
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 1029

def delete_sandbox_tester(sandbox_tester_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.delete("sandboxTesters/#{sandbox_tester_id}", params)
end

#get_age_rating_declaration(app_store_version_id: nil) ⇒ Object

ageRatingDeclarations



20
21
22
23
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 20

def get_age_rating_declaration(app_store_version_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}/ageRatingDeclaration", params)
end

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

appInfoLocalizations



572
573
574
575
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 572

def get_app_info_localizations(app_info_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appInfos/#{app_info_id}/appInfoLocalizations", params)
end

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

appInfos



464
465
466
467
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 464

def get_app_infos(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("apps/#{app_id}/appInfos", params)
end

#get_app_preview(app_preview_id: nil) ⇒ Object

appPreview



207
208
209
210
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 207

def get_app_preview(app_preview_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("appPreviews/#{app_preview_id}", params)
end

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



257
258
259
260
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 257

def get_app_preview_set(app_preview_set_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appPreviewSets/#{app_preview_set_id}", params)
end

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

appPreviewSets



252
253
254
255
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 252

def get_app_preview_sets(filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appPreviewSets", params)
end

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



314
315
316
317
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 314

def get_app_price(app_price_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appPrices/#{app_price_id}", params)
end

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

appPricePoints



322
323
324
325
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 322

def get_app_price_points(filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appPricePoints", params)
end

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

appPrices



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

def get_app_prices(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appPrices", params)
end

#get_app_screenshot(app_screenshot_id: nil) ⇒ Object

appScreenshots



419
420
421
422
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 419

def get_app_screenshot(app_screenshot_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("appScreenshots/#{app_screenshot_id}", params)
end

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



376
377
378
379
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 376

def get_app_screenshot_set(app_screenshot_set_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appScreenshotSets/#{app_screenshot_set_id}", params)
end

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

appScreenshotSets



371
372
373
374
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 371

def get_app_screenshot_sets(app_store_version_localization_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appStoreVersionLocalizations/#{app_store_version_localization_id}/appScreenshotSets", params)
end

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

appStoreReviewDetails



612
613
614
615
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 612

def get_app_store_review_detail(app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreReviewDetail", params)
end

#get_app_store_version(app_store_version_id: nil, includes: nil) ⇒ Object



747
748
749
750
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 747

def get_app_store_version(app_store_version_id: nil, includes: nil)
  params = tunes_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}", params)
end

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

appStoreVersionLocalizations



652
653
654
655
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 652

def get_app_store_version_localizations(app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionLocalizations", params)
end

#get_app_store_version_phased_release(app_store_version_id: nil) ⇒ Object

appStoreVersionPhasedReleases



697
698
699
700
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 697

def get_app_store_version_phased_release(app_store_version_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionPhasedRelease", params)
end

#get_app_store_version_submission(app_store_version_id: nil) ⇒ Object

appStoreVersionSubmissions



843
844
845
846
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 843

def get_app_store_version_submission(app_store_version_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionSubmission", params)
end

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

appStoreVersions



742
743
744
745
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 742

def get_app_store_versions(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("apps/#{app_id}/appStoreVersions", params)
end

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

availableTerritories



300
301
302
303
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 300

def get_available_territories(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("apps/#{app_id}/availableTerritories", params)
end

#get_custom_app_organization(app_id: nil, filter: nil, includes: nil, limit: nil, sort: nil) ⇒ Object

customOrganizationUsers



932
933
934
935
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 932

def get_custom_app_organization(app_id: nil, filter: nil, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("apps/#{app_id}/customAppOrganizations", params)
end

#get_custom_app_users(app_id: nil, filter: nil, includes: nil, limit: nil, sort: nil) ⇒ Object

customAppUsers



897
898
899
900
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 897

def get_custom_app_users(app_id: nil, filter: nil, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("apps/#{app_id}/customAppUsers", params)
end

#get_idfa_declaration(app_store_version_id: nil) ⇒ Object

idfaDeclarations



968
969
970
971
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 968

def get_idfa_declaration(app_store_version_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}/idfaDeclaration", params)
end

#get_reset_ratings_request(app_store_version_id: nil) ⇒ Object

appStoreVersionPhasedReleases



811
812
813
814
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 811

def get_reset_ratings_request(app_store_version_id: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("appStoreVersions/#{app_store_version_id}/resetRatingsRequest", params)
end

#get_sandbox_testers(filter: nil, includes: nil, limit: nil, sort: nil) ⇒ Object

sandboxTesters



1013
1014
1015
1016
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 1013

def get_sandbox_testers(filter: nil, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  tunes_request_client.get("sandboxTesters", params)
end

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

territories



1038
1039
1040
1041
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 1038

def get_territories(filter: {}, includes: nil, limit: nil, sort: nil)
  params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
  tunes_request_client.get("territories", params)
end

#patch_age_rating_declaration(age_rating_declaration_id: nil, attributes: nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 25

def patch_age_rating_declaration(age_rating_declaration_id: nil, attributes: nil)
  body = {
    data: {
      type: "ageRatingDeclarations",
      id: age_rating_declaration_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("ageRatingDeclarations/#{age_rating_declaration_id}", body)
end

#patch_app(app_id: nil, attributes: {}, app_price_tier_id: nil, territory_ids: nil) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 135

def patch_app(app_id: nil, attributes: {}, app_price_tier_id: nil, territory_ids: nil)
  relationships = {}
  included = []

  # Price tier
  unless app_price_tier_id.nil?
    relationships[:prices] = {
      data: [
        {
          type: "appPrices",
          id: "${price1}"
        }
      ]
    }

    included << {
      type: "appPrices",
      id: "${price1}",
      attributes: {
        startDate: nil
      },
      relationships: {
        app: {
          data: {
            type: "apps",
            id: app_id
          }
        },
        priceTier: {
          data: {
            type: "appPriceTiers",
            id: app_price_tier_id.to_s
          }
        }
      }
    }
  end

  # Territories
  territories_data = (territory_ids || []).map do |id|
    { type: "territories", id: id }
  end
  unless territories_data.empty?
    relationships[:availableTerritories] = {
      data: territories_data
    }
  end

  # Data
  data = {
    type: "apps",
    id: app_id
  }
  data[:relationships] = relationships unless relationships.empty?

  if !attributes.nil? && !attributes.empty?
    data[:attributes] = attributes
  end

  # Body
  body = {
    data: data
  }
  body[:included] = included unless included.empty?

  tunes_request_client.patch("apps/#{app_id}", body)
end

#patch_app_info(app_info_id: nil, attributes: {}) ⇒ Object



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 469

def patch_app_info(app_info_id: nil, attributes: {})
  attributes ||= {}

  data = {
    type: "appInfos",
    id: app_info_id
  }
  data[:attributes] = attributes unless attributes.empty?

  body = {
    data: data
  }

  tunes_request_client.patch("appInfos/#{app_info_id}", body)
end

#patch_app_info_categories(app_info_id: nil, category_id_map: nil) ⇒ Object

Adding the key will create/update (if value) or delete if nil Not including a key will leave as is category_id_map:

primary_category_id: "GAMES",
primary_subcategory_one_id: "PUZZLE",
primary_subcategory_two_id: "STRATEGY",
secondary_category_id: nil,
secondary_subcategory_one_id: nil,
secondary_subcategory_two_id: nil



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 497

def patch_app_info_categories(app_info_id: nil, category_id_map: nil)
  category_id_map ||= {}
  primary_category_id = category_id_map[:primary_category_id]
  primary_subcategory_one_id = category_id_map[:primary_subcategory_one_id]
  primary_subcategory_two_id = category_id_map[:primary_subcategory_two_id]
  secondary_category_id = category_id_map[:secondary_category_id]
  secondary_subcategory_one_id = category_id_map[:secondary_subcategory_one_id]
  secondary_subcategory_two_id = category_id_map[:secondary_subcategory_two_id]

  relationships = {}

  # Only update if key is included (otherwise category will be removed)
  if category_id_map.include?(:primary_category_id)
    relationships[:primaryCategory] = {
      data: primary_category_id ? { type: "appCategories", id: primary_category_id } : nil
    }
  end

  # Only update if key is included (otherwise category will be removed)
  if category_id_map.include?(:primary_subcategory_one_id)
    relationships[:primarySubcategoryOne] = {
      data: primary_subcategory_one_id ? { type: "appCategories", id: primary_subcategory_one_id } : nil
    }
  end

  # Only update if key is included (otherwise category will be removed)
  if category_id_map.include?(:primary_subcategory_two_id)
    relationships[:primarySubcategoryTwo] = {
      data: primary_subcategory_two_id ? { type: "appCategories", id: primary_subcategory_two_id } : nil
    }
  end

  # Only update if key is included (otherwise category will be removed)
  if category_id_map.include?(:secondary_category_id)
    relationships[:secondaryCategory] = {
      data: secondary_category_id ? { type: "appCategories", id: secondary_category_id } : nil
    }
  end

  # Only update if key is included (otherwise category will be removed)
  if category_id_map.include?(:secondary_subcategory_one_id)
    relationships[:secondarySubcategoryOne] = {
      data: secondary_subcategory_one_id ? { type: "appCategories", id: secondary_subcategory_one_id } : nil
    }
  end

  # Only update if key is included (otherwise category will be removed)
  if category_id_map.include?(:secondary_subcategory_two_id)
    relationships[:secondarySubcategoryTwo] = {
      data: secondary_subcategory_two_id ? { type: "appCategories", id: secondary_subcategory_two_id } : nil
    }
  end

  data = {
    type: "appInfos",
    id: app_info_id
  }
  data[:relationships] = relationships unless relationships.empty?

  body = {
    data: data
  }

  tunes_request_client.patch("appInfos/#{app_info_id}", body)
end

#patch_app_info_localization(app_info_localization_id: nil, attributes: {}) ⇒ Object



596
597
598
599
600
601
602
603
604
605
606
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 596

def patch_app_info_localization(app_info_localization_id: nil, attributes: {})
  body = {
    data: {
      type: "appInfoLocalizations",
      id: app_info_localization_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("appInfoLocalizations/#{app_info_localization_id}", body)
end

#patch_app_preview(app_preview_id: nil, attributes: {}) ⇒ Object



231
232
233
234
235
236
237
238
239
240
241
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 231

def patch_app_preview(app_preview_id: nil, attributes: {})
  body = {
    data: {
      type: "appPreviews",
      id: app_preview_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("appPreviews/#{app_preview_id}", body)
end

#patch_app_preview_set_previews(app_preview_set_id: nil, app_preview_ids: nil) ⇒ Object



281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 281

def patch_app_preview_set_previews(app_preview_set_id: nil, app_preview_ids: nil)
  app_preview_ids ||= []

  body = {
    data: app_preview_ids.map do |app_preview_id|
      {
        type: "appPreviews",
        id: app_preview_id
      }
    end
  }

  tunes_request_client.patch("appPreviewSets/#{app_preview_set_id}/relationships/appPreviews", body)
end

#patch_app_screenshot(app_screenshot_id: nil, attributes: {}) ⇒ Object



443
444
445
446
447
448
449
450
451
452
453
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 443

def patch_app_screenshot(app_screenshot_id: nil, attributes: {})
  body = {
    data: {
      type: "appScreenshots",
      id: app_screenshot_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("appScreenshots/#{app_screenshot_id}", body)
end

#patch_app_screenshot_set_screenshots(app_screenshot_set_id: nil, app_screenshot_ids: nil) ⇒ Object



400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 400

def patch_app_screenshot_set_screenshots(app_screenshot_set_id: nil, app_screenshot_ids: nil)
  app_screenshot_ids ||= []

  body = {
    data: app_screenshot_ids.map do |app_screenshot_id|
      {
        type: "appScreenshots",
        id: app_screenshot_id
      }
    end
  }

  tunes_request_client.patch("appScreenshotSets/#{app_screenshot_set_id}/relationships/appScreenshots", body)
end

#patch_app_store_review_attachment(app_store_review_attachment_id: nil, attributes: {}) ⇒ Object



350
351
352
353
354
355
356
357
358
359
360
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 350

def patch_app_store_review_attachment(app_store_review_attachment_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreReviewAttachments",
      id: app_store_review_attachment_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("appStoreReviewAttachments/#{app_store_review_attachment_id}", body)
end

#patch_app_store_review_detail(app_store_review_detail_id: nil, attributes: {}) ⇒ Object



636
637
638
639
640
641
642
643
644
645
646
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 636

def patch_app_store_review_detail(app_store_review_detail_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreReviewDetails",
      id: app_store_review_detail_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("appStoreReviewDetails/#{app_store_review_detail_id}", body)
end

#patch_app_store_version(app_store_version_id: nil, attributes: {}) ⇒ Object



771
772
773
774
775
776
777
778
779
780
781
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 771

def patch_app_store_version(app_store_version_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreVersions",
      id: app_store_version_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("appStoreVersions/#{app_store_version_id}", body)
end

#patch_app_store_version_localization(app_store_version_localization_id: nil, attributes: {}) ⇒ Object



676
677
678
679
680
681
682
683
684
685
686
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 676

def patch_app_store_version_localization(app_store_version_localization_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreVersionLocalizations",
      id: app_store_version_localization_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("appStoreVersionLocalizations/#{app_store_version_localization_id}", body)
end

#patch_app_store_version_phased_release(app_store_version_phased_release_id: nil, attributes: {}) ⇒ Object



721
722
723
724
725
726
727
728
729
730
731
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 721

def patch_app_store_version_phased_release(app_store_version_phased_release_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreVersionPhasedReleases",
      attributes: attributes,
      id: app_store_version_phased_release_id
    }
  }

  tunes_request_client.patch("appStoreVersionPhasedReleases/#{app_store_version_phased_release_id}", body)
end

#patch_app_store_version_with_build(app_store_version_id: nil, build_id: nil) ⇒ Object



783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 783

def patch_app_store_version_with_build(app_store_version_id: nil, build_id: nil)
  data = nil
  if build_id
    data = {
      type: "builds",
      id: build_id
    }
  end

  body = {
    data: {
      type: "appStoreVersions",
      id: app_store_version_id,
      relationships: {
        build: {
          data: data
        }
      }
    }
  }

  tunes_request_client.patch("appStoreVersions/#{app_store_version_id}", body)
end

#patch_idfa_declaration(idfa_declaration_id: nil, attributes: nil) ⇒ Object



992
993
994
995
996
997
998
999
1000
1001
1002
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 992

def patch_idfa_declaration(idfa_declaration_id: nil, attributes: nil)
  body = {
    data: {
      type: "idfaDeclarations",
      id: idfa_declaration_id,
      attributes: attributes
    }
  }

  tunes_request_client.patch("idfaDeclarations/#{idfa_declaration_id}", body)
end

#post_app(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, company_name: nil) ⇒ Object

app



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 41

def post_app(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, company_name: nil)
  included = []
  included << {
    type: "appInfos",
    id: "${new-appInfo-id}",
    relationships: {
      appInfoLocalizations: {
        data: [
          {
            type: "appInfoLocalizations",
            id: "${new-appInfoLocalization-id}"
          }
        ]
      }
    }
  }
  included << {
    type: "appInfoLocalizations",
    id: "${new-appInfoLocalization-id}",
    attributes: {
      locale: primary_locale,
      name: name
    }
  }

  platforms.each do |platform|
    included << {
      type: "appStoreVersions",
      id: "${store-version-#{platform}}",
      attributes: {
        platform: platform,
        versionString: version_string
      },
      relationships: {
        appStoreVersionLocalizations: {
          data: [
            {
              type: "appStoreVersionLocalizations",
              id: "${new-#{platform}VersionLocalization-id}"
            }
          ]
        }
      }
    }

    included << {
      type: "appStoreVersionLocalizations",
      id: "${new-#{platform}VersionLocalization-id}",
      attributes: {
        locale: primary_locale
      }
    }
  end

  app_store_verions_data = platforms.map do |platform|
    {
      type: "appStoreVersions",
      id: "${store-version-#{platform}}"
    }
  end

  relationships = {
    appStoreVersions: {
      data: app_store_verions_data
    },
    appInfos: {
      data: [
        {
          type: "appInfos",
          id: "${new-appInfo-id}"
        }
      ]
    }
  }

  app_attributes = {
    sku: sku,
    primaryLocale: primary_locale,
    bundleId: bundle_id
  }
  app_attributes[:companyName] = company_name if company_name

  body = {
    data: {
      type: "apps",
      attributes: app_attributes,
      relationships: relationships
    },
    included: included
  }

  tunes_request_client.post("apps", body)
end

#post_app_info_localization(app_info_id: nil, attributes: {}) ⇒ Object



577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 577

def post_app_info_localization(app_info_id: nil, attributes: {})
  body = {
    data: {
      type: "appInfoLocalizations",
      attributes: attributes,
      relationships: {
        appStoreVersion: {
          data: {
            type: "appStoreVersions",
            id: app_info_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appInfoLocalizations", body)
end

#post_app_preview(app_preview_set_id: nil, attributes: {}) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 212

def post_app_preview(app_preview_set_id: nil, attributes: {})
  body = {
    data: {
      type: "appPreviews",
      attributes: attributes,
      relationships: {
        appPreviewSet: {
          data: {
            type: "appPreviewSets",
            id: app_preview_set_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appPreviews", body)
end

#post_app_preview_set(app_store_version_localization_id: nil, attributes: {}) ⇒ Object



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 262

def post_app_preview_set(app_store_version_localization_id: nil, attributes: {})
  body = {
    data: {
      type: "appPreviewSets",
      attributes: attributes,
      relationships: {
        appStoreVersionLocalization: {
          data: {
            type: "appStoreVersionLocalizations",
            id: app_store_version_localization_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appPreviewSets", body)
end

#post_app_screenshot(app_screenshot_set_id: nil, attributes: {}) ⇒ Object



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 424

def post_app_screenshot(app_screenshot_set_id: nil, attributes: {})
  body = {
    data: {
      type: "appScreenshots",
      attributes: attributes,
      relationships: {
        appScreenshotSet: {
          data: {
            type: "appScreenshotSets",
            id: app_screenshot_set_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appScreenshots", body, tries: 1)
end

#post_app_screenshot_set(app_store_version_localization_id: nil, attributes: {}) ⇒ Object



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 381

def post_app_screenshot_set(app_store_version_localization_id: nil, attributes: {})
  body = {
    data: {
      type: "appScreenshotSets",
      attributes: attributes,
      relationships: {
        appStoreVersionLocalization: {
          data: {
            type: "appStoreVersionLocalizations",
            id: app_store_version_localization_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appScreenshotSets", body)
end

#post_app_store_review_attachment(app_store_review_detail_id: nil, attributes: {}) ⇒ Object

appReviewAttachments



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 331

def post_app_store_review_attachment(app_store_review_detail_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreReviewAttachments",
      attributes: attributes,
      relationships: {
        appStoreReviewDetail: {
          data: {
            type: "appStoreReviewDetails",
            id: app_store_review_detail_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appStoreReviewAttachments", body)
end

#post_app_store_review_detail(app_store_version_id: nil, attributes: {}) ⇒ Object



617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 617

def post_app_store_review_detail(app_store_version_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreReviewDetails",
      attributes: attributes,
      relationships: {
        appStoreVersion: {
          data: {
            type: "appStoreVersions",
            id: app_store_version_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appStoreReviewDetails", body)
end

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



752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 752

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

  tunes_request_client.post("appStoreVersions", body)
end

#post_app_store_version_localization(app_store_version_id: nil, attributes: {}) ⇒ Object



657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 657

def post_app_store_version_localization(app_store_version_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreVersionLocalizations",
      attributes: attributes,
      relationships: {
        appStoreVersion: {
          data: {
            type: "appStoreVersions",
            id: app_store_version_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appStoreVersionLocalizations", body)
end

#post_app_store_version_phased_release(app_store_version_id: nil, attributes: {}) ⇒ Object



702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 702

def post_app_store_version_phased_release(app_store_version_id: nil, attributes: {})
  body = {
    data: {
      type: "appStoreVersionPhasedReleases",
      attributes: attributes,
      relationships: {
        appStoreVersion: {
          data: {
            type: "appStoreVersions",
            id: app_store_version_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appStoreVersionPhasedReleases", body)
end

#post_app_store_version_release_request(app_store_version_id: nil) ⇒ Object

appStoreVersionReleaseRequests



875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 875

def post_app_store_version_release_request(app_store_version_id: nil)
  body = {
      data: {
          type: "appStoreVersionReleaseRequests",
          relationships: {
              appStoreVersion: {
                  data: {
                      type: "appStoreVersions",
                      id: app_store_version_id
                  }
              }
          }
      }
  }

  tunes_request_client.post("appStoreVersionReleaseRequests", body)
end

#post_app_store_version_submission(app_store_version_id: nil) ⇒ Object



848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 848

def post_app_store_version_submission(app_store_version_id: nil)
  body = {
    data: {
      type: "appStoreVersionSubmissions",
      relationships: {
        appStoreVersion: {
          data: {
            type: "appStoreVersions",
            id: app_store_version_id
          }
        }
      }
    }
  }

  tunes_request_client.post("appStoreVersionSubmissions", body)
end

#post_custom_app_organization(app_id: nil, device_enrollment_program_id: nil, name: nil) ⇒ Object



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 937

def post_custom_app_organization(app_id: nil, device_enrollment_program_id: nil, name: nil)
  body = {
      data: {
          type: "customAppOrganizations",
          attributes: {
            deviceEnrollmentProgramId: device_enrollment_program_id,
            name: name
          },
          relationships: {
              app: {
                  data: {
                      type: "apps",
                      id: app_id
                  }
              }
          }
      }
  }

  tunes_request_client.post("customAppOrganizations", body)
end

#post_custom_app_user(app_id: nil, apple_id: nil) ⇒ Object



902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 902

def post_custom_app_user(app_id: nil, apple_id: nil)
  body = {
      data: {
          type: "customAppUsers",
          attributes: {
            appleId: apple_id
          },
          relationships: {
              app: {
                  data: {
                      type: "apps",
                      id: app_id
                  }
              }
          }
      }
  }

  tunes_request_client.post("customAppUsers", body)
end

#post_idfa_declaration(app_store_version_id: nil, attributes: nil) ⇒ Object



973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 973

def post_idfa_declaration(app_store_version_id: nil, attributes: nil)
  body = {
    data: {
      type: "idfaDeclarations",
      attributes: attributes,
      relationships: {
        appStoreVersion: {
          data: {
            type: "appStoreVersions",
            id: app_store_version_id
          }
        }
      }
    }
  }

  tunes_request_client.post("idfaDeclarations", body)
end

#post_reset_ratings_request(app_store_version_id: nil) ⇒ Object



816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 816

def post_reset_ratings_request(app_store_version_id: nil)
  body = {
    data: {
      type: "resetRatingsRequests",
      relationships: {
        appStoreVersion: {
          data: {
            type: "appStoreVersions",
            id: app_store_version_id
          }
        }
      }
    }
  }

  tunes_request_client.post("resetRatingsRequests", body)
end

#post_sandbox_tester(attributes: {}) ⇒ Object



1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 1018

def post_sandbox_tester(attributes: {})
  body = {
    data: {
      type: "sandboxTesters",
      attributes: attributes
    }
  }

  tunes_request_client.post("sandboxTesters", body)
end

#tunes_request_clientObject

Raises:

  • (TypeError)


11
12
13
14
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 11

def tunes_request_client
  return @tunes_request_client if @tunes_request_client
  raise TypeError, "You need to instantiate this module with tunes_request_client"
end

#tunes_request_client=(tunes_request_client) ⇒ Object



7
8
9
# File 'spaceship/lib/spaceship/connect_api/tunes/tunes.rb', line 7

def tunes_request_client=(tunes_request_client)
  @tunes_request_client = tunes_request_client
end