Class: Spaceship::Tunes::AppSubmission

Inherits:
TunesBase show all
Defined in:
spaceship/lib/spaceship/tunes/app_submission.rb

Overview

Represents a submission for review of an App Store Connect Application This class handles the submission of all review information and documents

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TunesBase

client

Methods inherited from Base

attr_accessor, attr_mapping, attributes, #attributes, #initialize, #inspect, mapping_module, method_missing, set_client, #to_s

Constructor Details

This class inherits a constructor from Spaceship::Base

Instance Attribute Details

#add_id_info_serves_adsBoolean

Returns Ad ID Info - Serves ads.

Returns:

  • (Boolean)

    Ad ID Info - Serves ads



26
27
28
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 26

def add_id_info_serves_ads
  @add_id_info_serves_ads
end

#add_id_info_tracks_actionBoolean

Returns Ad ID Info - Tracks actions.

Returns:

  • (Boolean)

    Ad ID Info - Tracks actions



29
30
31
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 29

def add_id_info_tracks_action
  @add_id_info_tracks_action
end

#add_id_info_tracks_installBoolean

Returns Ad ID Info - Tracks installs.

Returns:

  • (Boolean)

    Ad ID Info - Tracks installs



32
33
34
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 32

def add_id_info_tracks_install
  @add_id_info_tracks_install
end

#applicationSpaceship::Tunes::Application

Returns A reference to the application this submission is for.

Returns:



10
11
12
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 10

def application
  @application
end

#content_rights_contains_third_party_contentBoolean

Returns Content Rights - Contains third party content.

Returns:

  • (Boolean)

    Content Rights - Contains third party content



35
36
37
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 35

def content_rights_contains_third_party_content
  @content_rights_contains_third_party_content
end

#content_rights_has_rightsBoolean

Returns Content Rights - Has rights of content.

Returns:

  • (Boolean)

    Content Rights - Has rights of content



38
39
40
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 38

def content_rights_has_rights
  @content_rights_has_rights
end

#export_compliance_app_typeString

Returns Export Compliance - App type.

Returns:

  • (String)

    Export Compliance - App type



59
60
61
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 59

def export_compliance_app_type
  @export_compliance_app_type
end

#export_compliance_available_on_french_storeBoolean

Returns Export Compliance - Available on French Store.

Returns:

  • (Boolean)

    Export Compliance - Available on French Store



41
42
43
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 41

def export_compliance_available_on_french_store
  @export_compliance_available_on_french_store
end

#export_compliance_ccat_fileNot Yet Implemented

Returns Export Compliance - CCAT File.

Returns:

  • (Not Yet Implemented)

    Export Compliance - CCAT File



44
45
46
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 44

def export_compliance_ccat_file
  @export_compliance_ccat_file
end

#export_compliance_compliance_requiredBoolean

Returns Export Compliance - Compliance Required.

Returns:

  • (Boolean)

    Export Compliance - Compliance Required



65
66
67
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 65

def export_compliance_compliance_required
  @export_compliance_compliance_required
end

#export_compliance_contains_proprietary_cryptographyBoolean

Returns Export Compliance - Contains proprietary cryptography.

Returns:

  • (Boolean)

    Export Compliance - Contains proprietary cryptography



47
48
49
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 47

def export_compliance_contains_proprietary_cryptography
  @export_compliance_contains_proprietary_cryptography
end

#export_compliance_contains_third_party_cryptographyBoolean

Returns Export Compliance - Contains third-party cryptography.

Returns:

  • (Boolean)

    Export Compliance - Contains third-party cryptography



50
51
52
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 50

def export_compliance_contains_third_party_cryptography
  @export_compliance_contains_third_party_cryptography
end

#export_compliance_encryption_updatedBoolean

Returns Export Compliance - Encryption Updated.

Returns:

  • (Boolean)

    Export Compliance - Encryption Updated



62
63
64
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 62

def export_compliance_encryption_updated
  @export_compliance_encryption_updated
end

#export_compliance_is_exemptBoolean

Returns Export Compliance - Is exempt.

Returns:

  • (Boolean)

    Export Compliance - Is exempt



53
54
55
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 53

def export_compliance_is_exempt
  @export_compliance_is_exempt
end

#export_compliance_platformString

Returns Export Compliance - Platform.

Returns:

  • (String)

    Export Compliance - Platform



68
69
70
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 68

def export_compliance_platform
  @export_compliance_platform
end

#export_compliance_uses_encryptionBoolean

Returns Export Compliance - Uses encryption.

Returns:

  • (Boolean)

    Export Compliance - Uses encryption



56
57
58
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 56

def export_compliance_uses_encryption
  @export_compliance_uses_encryption
end

#platformString

Returns The platform of the device. This is usually “ios”.

Examples:

"appletvos"

Returns:

  • (String)

    The platform of the device. This is usually “ios”



18
19
20
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 18

def platform
  @platform
end

#submitted_for_reviewBoolean

Returns Submitted for Review.

Returns:

  • (Boolean)

    Submitted for Review



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

def 
  @submitted_for_review
end

#versionAppVersion

Returns The version to use for this submission.

Returns:

  • (AppVersion)

    The version to use for this submission



13
14
15
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 13

def version
  @version
end

Class Method Details

.create(application, version, platform: nil) ⇒ Object

Parameters:



114
115
116
117
118
119
120
121
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 114

def create(application, version, platform: nil)
  attrs = client.prepare_app_submissions(application.apple_id, application.edit_version(platform: platform).version_id)
  attrs[:application] = application
  attrs[:version] = version
  attrs[:platform] = platform

  return self.factory(attrs)
end

.factory(attrs) ⇒ Object

Create a new object based on a hash. This is used to create a new object based on the server response.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 96

def factory(attrs)
  # fill content rights section if iTC returns nil
  if attrs["contentRights"].nil?
    attrs["contentRights"] = {
      "containsThirdPartyContent" => {
        "value" => nil
      },
      "hasRights" => {
        "value" => nil
      }
    }
  end

  obj = self.new(attrs)
  return obj
end

Instance Method Details

#complete!Object

Save and complete the app submission



125
126
127
128
129
130
131
132
133
134
135
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 125

def complete!
  raw_data_clone = raw_data.dup
  if self.content_rights_has_rights.nil? || self.content_rights_contains_third_party_content.nil?
    raw_data_clone.set(["contentRights"], nil)
  end
  raw_data_clone.delete(:version)
  raw_data_clone.delete(:application)

  client.send_app_submission(application.apple_id, application.edit_version(platform: platform).version_id, raw_data_clone)
  @submitted_for_review = true
end

#setupObject



137
138
139
# File 'spaceship/lib/spaceship/tunes/app_submission.rb', line 137

def setup
  @submitted_for_review = false
end