Class: Spaceship::DUClient

Inherits:
Client
  • Object
show all
Defined in:
lib/spaceship/du/du_client.rb

Overview

This class is used to upload Digital files (Images, Videos, JSON files) onto the du-itc service. Its implementation is tied to the tunes module (in particular using AppVersion instances)

Constant Summary

Constants inherited from Client

Client::PROTOCOL_VERSION, Client::USER_AGENT

Instance Attribute Summary

Attributes inherited from Client

#client, #csrf_tokens, #logger, #user

Init and Login collapse

Images collapse

Methods inherited from Client

#UI, #cookie, #handle_two_factor, #handle_two_step, #initialize, #itc_service_key, #load_session_from_env, #load_session_from_file, login, #login, #page_size, #paging, #parse_response, #persistent_cookie_path, #request, #select_device, #send_shared_login_request, #store_cookie, #store_session, #with_retry

Constructor Details

This class inherits a constructor from Spaceship::Client

Class Method Details

.hostnameObject



9
10
11
# File 'lib/spaceship/du/du_client.rb', line 9

def self.hostname
  "https://du-itc.itunes.apple.com"
end

Instance Method Details

#upload_geojson(app_version, upload_file, content_provider_id, sso_token_for_image) ⇒ Object



29
30
31
# File 'lib/spaceship/du/du_client.rb', line 29

def upload_geojson(app_version, upload_file, content_provider_id, sso_token_for_image)
  upload_file(app_version, upload_file, '/upload/geo-json', content_provider_id, sso_token_for_image)
end

#upload_large_icon(app_version, upload_file, content_provider_id, sso_token_for_image) ⇒ Object



21
22
23
# File 'lib/spaceship/du/du_client.rb', line 21

def upload_large_icon(app_version, upload_file, content_provider_id, sso_token_for_image)
  upload_file(app_version, upload_file, '/upload/image', content_provider_id, sso_token_for_image, 'MZPFT.LargeApplicationIcon')
end

#upload_screenshot(app_version, upload_file, content_provider_id, sso_token_for_image, device, is_messages) ⇒ Object



17
18
19
# File 'lib/spaceship/du/du_client.rb', line 17

def upload_screenshot(app_version, upload_file, content_provider_id, sso_token_for_image, device, is_messages)
  upload_file(app_version, upload_file, '/upload/image', content_provider_id, sso_token_for_image, screenshot_picture_type(device, is_messages))
end

#upload_trailer(app_version, upload_file, content_provider_id, sso_token_for_video) ⇒ Object



33
34
35
# File 'lib/spaceship/du/du_client.rb', line 33

def upload_trailer(app_version, upload_file, content_provider_id, sso_token_for_video)
  upload_file(app_version, upload_file, '/upload/purple-video', content_provider_id, sso_token_for_video)
end

#upload_trailer_preview(app_version, upload_file, content_provider_id, sso_token_for_image) ⇒ Object



37
38
39
# File 'lib/spaceship/du/du_client.rb', line 37

def upload_trailer_preview(app_version, upload_file, content_provider_id, sso_token_for_image)
  upload_file(app_version, upload_file, '/upload/app-screenshot-image', content_provider_id, sso_token_for_image)
end

#upload_watch_icon(app_version, upload_file, content_provider_id, sso_token_for_image) ⇒ Object



25
26
27
# File 'lib/spaceship/du/du_client.rb', line 25

def upload_watch_icon(app_version, upload_file, content_provider_id, sso_token_for_image)
  upload_file(app_version, upload_file, '/upload/image', content_provider_id, sso_token_for_image, 'MZPFT.GizmoAppIcon')
end