Class: Spaceship::ConnectAPI::AgeRatingDeclaration
- Inherits:
-
Object
- Object
- Spaceship::ConnectAPI::AgeRatingDeclaration
- Includes:
- Model
- Defined in:
- spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb
Defined Under Namespace
Modules: AgeRating, KidsAge, KoreaAgeRating, Rating
Constant Summary collapse
- LEGACY_AGE_RATING_ITC_MAP =
{ "CARTOON_FANTASY_VIOLENCE" => "violenceCartoonOrFantasy", "REALISTIC_VIOLENCE" => "violenceRealistic", "PROLONGED_GRAPHIC_SADISTIC_REALISTIC_VIOLENCE" => "violenceRealisticProlongedGraphicOrSadistic", "PROFANITY_CRUDE_HUMOR" => "profanityOrCrudeHumor", "MATURE_SUGGESTIVE" => "matureOrSuggestiveThemes", "HORROR" => "horrorOrFearThemes", "MEDICAL_TREATMENT_INFO" => "medicalOrTreatmentInformation", "ALCOHOL_TOBACCO_DRUGS" => "alcoholTobaccoOrDrugUseOrReferences", "GAMBLING" => "gamblingSimulated", "SEXUAL_CONTENT_NUDITY" => "sexualContentOrNudity", "GRAPHIC_SEXUAL_CONTENT_NUDITY" => "sexualContentGraphicAndNudity", "UNRESTRICTED_WEB_ACCESS" => "unrestrictedWebAccess", "GAMBLING_CONTESTS" => "gamblingAndContests" }
- LEGACY_RATING_VALUE_ITC_MAP =
{ 0 => Rating::NONE, 1 => Rating::INFREQUENT_OR_MILD, 2 => Rating::FREQUENT_OR_INTENSE }
- LEGACY_BOOLEAN_VALUE_ITC_MAP =
{ 0 => false, 1 => true }
Instance Attribute Summary collapse
-
#advertising ⇒ Object
Boolean.
-
#age_assurance ⇒ Object
Returns the value of attribute age_assurance.
-
#age_rating_override_v2 ⇒ Object
AgeRating.
-
#alcohol_tobacco_or_drug_use_or_references ⇒ Object
Rating.
-
#contests ⇒ Object
Returns the value of attribute contests.
-
#developer_age_rating_info_url ⇒ Object
URL.
-
#gambling ⇒ Object
Returns the value of attribute gambling.
-
#gambling_and_contests ⇒ Object
Deprecated as of App Store Connect API 1.3.
-
#gambling_simulated ⇒ Object
Returns the value of attribute gambling_simulated.
-
#guns_or_other_weapons ⇒ Object
Returns the value of attribute guns_or_other_weapons.
-
#health_or_wellness_topics ⇒ Object
Returns the value of attribute health_or_wellness_topics.
-
#horror_or_fear_themes ⇒ Object
Returns the value of attribute horror_or_fear_themes.
-
#kids_age_band ⇒ Object
KidsAge.
-
#korea_age_rating_override ⇒ Object
KoreaAgeRating.
-
#loot_box ⇒ Object
Returns the value of attribute loot_box.
-
#mature_or_suggestive_themes ⇒ Object
Returns the value of attribute mature_or_suggestive_themes.
-
#medical_or_treatment_information ⇒ Object
Returns the value of attribute medical_or_treatment_information.
-
#messaging_and_chat ⇒ Object
Returns the value of attribute messaging_and_chat.
-
#parental_controls ⇒ Object
Returns the value of attribute parental_controls.
-
#profanity_or_crude_humor ⇒ Object
Returns the value of attribute profanity_or_crude_humor.
-
#sexual_content_graphic_and_nudity ⇒ Object
Returns the value of attribute sexual_content_graphic_and_nudity.
-
#sexual_content_or_nudity ⇒ Object
Returns the value of attribute sexual_content_or_nudity.
-
#unrestricted_web_access ⇒ Object
Returns the value of attribute unrestricted_web_access.
-
#user_generated_content ⇒ Object
Returns the value of attribute user_generated_content.
-
#violence_cartoon_or_fantasy ⇒ Object
Returns the value of attribute violence_cartoon_or_fantasy.
-
#violence_realistic ⇒ Object
Returns the value of attribute violence_realistic.
-
#violence_realistic_prolonged_graphic_or_sadistic ⇒ Object
Returns the value of attribute violence_realistic_prolonged_graphic_or_sadistic.
Attributes included from Model
Class Method Summary collapse
- .map_deprecation_if_possible(attributes) ⇒ Object
- .map_key_from_itc(key) ⇒ Object
- .map_value_from_itc(key, value) ⇒ Object
- .type ⇒ Object
Instance Method Summary collapse
Methods included from Model
#attr_mapping, included, #initialize, #reverse_attr_mapping, #to_json, #update_attributes
Instance Attribute Details
#advertising ⇒ Object
Boolean
23 24 25 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 23 def advertising @advertising end |
#age_assurance ⇒ Object
Returns the value of attribute age_assurance.
24 25 26 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 24 def age_assurance @age_assurance end |
#age_rating_override_v2 ⇒ Object
AgeRating
34 35 36 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 34 def end |
#alcohol_tobacco_or_drug_use_or_references ⇒ Object
Rating
8 9 10 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 8 def alcohol_tobacco_or_drug_use_or_references @alcohol_tobacco_or_drug_use_or_references end |
#contests ⇒ Object
Returns the value of attribute contests.
9 10 11 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 9 def contests @contests end |
#developer_age_rating_info_url ⇒ Object
URL
43 44 45 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 43 def end |
#gambling ⇒ Object
Returns the value of attribute gambling.
25 26 27 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 25 def gambling @gambling end |
#gambling_and_contests ⇒ Object
Deprecated as of App Store Connect API 1.3
46 47 48 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 46 def gambling_and_contests @gambling_and_contests end |
#gambling_simulated ⇒ Object
Returns the value of attribute gambling_simulated.
10 11 12 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 10 def gambling_simulated @gambling_simulated end |
#guns_or_other_weapons ⇒ Object
Returns the value of attribute guns_or_other_weapons.
11 12 13 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 11 def guns_or_other_weapons @guns_or_other_weapons end |
#health_or_wellness_topics ⇒ Object
Returns the value of attribute health_or_wellness_topics.
26 27 28 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 26 def health_or_wellness_topics @health_or_wellness_topics end |
#horror_or_fear_themes ⇒ Object
Returns the value of attribute horror_or_fear_themes.
12 13 14 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 12 def horror_or_fear_themes @horror_or_fear_themes end |
#kids_age_band ⇒ Object
KidsAge
40 41 42 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 40 def kids_age_band @kids_age_band end |
#korea_age_rating_override ⇒ Object
KoreaAgeRating
37 38 39 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 37 def end |
#loot_box ⇒ Object
Returns the value of attribute loot_box.
27 28 29 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 27 def loot_box @loot_box end |
#mature_or_suggestive_themes ⇒ Object
Returns the value of attribute mature_or_suggestive_themes.
13 14 15 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 13 def mature_or_suggestive_themes @mature_or_suggestive_themes end |
#medical_or_treatment_information ⇒ Object
Returns the value of attribute medical_or_treatment_information.
14 15 16 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 14 def medical_or_treatment_information @medical_or_treatment_information end |
#messaging_and_chat ⇒ Object
Returns the value of attribute messaging_and_chat.
28 29 30 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 28 def messaging_and_chat @messaging_and_chat end |
#parental_controls ⇒ Object
Returns the value of attribute parental_controls.
29 30 31 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 29 def parental_controls @parental_controls end |
#profanity_or_crude_humor ⇒ Object
Returns the value of attribute profanity_or_crude_humor.
15 16 17 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 15 def profanity_or_crude_humor @profanity_or_crude_humor end |
#sexual_content_graphic_and_nudity ⇒ Object
Returns the value of attribute sexual_content_graphic_and_nudity.
16 17 18 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 16 def sexual_content_graphic_and_nudity @sexual_content_graphic_and_nudity end |
#sexual_content_or_nudity ⇒ Object
Returns the value of attribute sexual_content_or_nudity.
17 18 19 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 17 def sexual_content_or_nudity @sexual_content_or_nudity end |
#unrestricted_web_access ⇒ Object
Returns the value of attribute unrestricted_web_access.
30 31 32 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 30 def unrestricted_web_access @unrestricted_web_access end |
#user_generated_content ⇒ Object
Returns the value of attribute user_generated_content.
31 32 33 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 31 def user_generated_content @user_generated_content end |
#violence_cartoon_or_fantasy ⇒ Object
Returns the value of attribute violence_cartoon_or_fantasy.
18 19 20 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 18 def violence_cartoon_or_fantasy @violence_cartoon_or_fantasy end |
#violence_realistic ⇒ Object
Returns the value of attribute violence_realistic.
20 21 22 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 20 def violence_realistic @violence_realistic end |
#violence_realistic_prolonged_graphic_or_sadistic ⇒ Object
Returns the value of attribute violence_realistic_prolonged_graphic_or_sadistic.
19 20 21 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 19 def violence_realistic_prolonged_graphic_or_sadistic @violence_realistic_prolonged_graphic_or_sadistic end |
Class Method Details
.map_deprecation_if_possible(attributes) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 140 def self.map_deprecation_if_possible(attributes) attributes = attributes.dup = [] errors = [] value = attributes.delete('gamblingAndContests') return attributes, , errors if value.nil? << "Age Rating 'gamblingAndContests' has been deprecated and split into 'gambling' and 'contests'" attributes['gambling'] = value if value == true errors << "'gamblingAndContests' could not be mapped to 'contests' - 'contests' requires a value of 'NONE', 'INFREQUENT_OR_MILD', or 'FREQUENT_OR_INTENSE'" attributes['contests'] = value else attributes['contests'] = 'NONE' end return attributes, , errors end |
.map_key_from_itc(key) ⇒ Object
161 162 163 164 165 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 161 def self.map_key_from_itc(key) key = key.gsub("MZGenre.", "") return nil if key.empty? LEGACY_AGE_RATING_ITC_MAP[key] || key end |
.map_value_from_itc(key, value) ⇒ Object
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 167 def self.map_value_from_itc(key, value) boolean_keys = [ "advertising", "ageAssurance", "gambling", "gamblingAndContests", "healthOrWellnessTopics", "lootBox", "messagingAndChat", "parentalControls", "unrestrictedWebAccess", "userGeneratedContent" ] if boolean_keys.include?(key) new_value = LEGACY_BOOLEAN_VALUE_ITC_MAP[value] return value if new_value.nil? return new_value else return LEGACY_RATING_VALUE_ITC_MAP[value] || value end return value end |
.type ⇒ Object
109 110 111 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 109 def self.type return "ageRatingDeclarations" end |
Instance Method Details
#update(client: nil, attributes: nil) ⇒ Object
API
196 197 198 199 200 |
# File 'spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb', line 196 def update(client: nil, attributes: nil) client ||= Spaceship::ConnectAPI attributes = reverse_attr_mapping(attributes) client.(age_rating_declaration_id: id, attributes: attributes) end |