class Spaceship::ConnectAPI::AgeRatingDeclaration
Constants
- LEGACY_AGE_RATING_ITC_MAP
- LEGACY_BOOLEAN_VALUE_ITC_MAP
- LEGACY_RATING_VALUE_ITC_MAP
Attributes
Boolean
Deprecated as of App
Store Connect API 1.3
Public Class Methods
Source
# File spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb, line 97 def self.map_deprecation_if_possible(attributes) attributes = attributes.dup messages = [] errors = [] value = attributes.delete('gamblingAndContests') return attributes, messages, errors if value.nil? messages << "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, messages, errors end
Source
# File spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb, line 118 def self.map_key_from_itc(key) key = key.gsub("MZGenre.", "") return nil if key.empty? LEGACY_AGE_RATING_ITC_MAP[key] || key end
Source
# File spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb, line 124 def self.map_value_from_itc(key, value) if ["gamblingAndContests", "unrestrictedWebAccess"].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
Source
# File spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb, line 66 def self.type return "ageRatingDeclarations" end
Public Instance Methods
Source
# File spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb, line 140 def update(client: nil, attributes: nil) client ||= Spaceship::ConnectAPI attributes = reverse_attr_mapping(attributes) client.patch_age_rating_declaration(age_rating_declaration_id: id, attributes: attributes) end
API