Class: SpotifyWebApi::ChapterRestrictionObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- SpotifyWebApi::ChapterRestrictionObject
- Defined in:
- lib/spotify_web_api/models/chapter_restriction_object.rb
Overview
ChapterRestrictionObject Model.
Instance Attribute Summary collapse
-
#reason ⇒ String
The reason for the restriction.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(reason = SKIP) ⇒ ChapterRestrictionObject
constructor
A new instance of ChapterRestrictionObject.
Methods inherited from BaseModel
Constructor Details
#initialize(reason = SKIP) ⇒ ChapterRestrictionObject
Returns a new instance of ChapterRestrictionObject.
44 45 46 |
# File 'lib/spotify_web_api/models/chapter_restriction_object.rb', line 44 def initialize(reason = SKIP) @reason = reason unless reason == SKIP end |
Instance Attribute Details
#reason ⇒ String
The reason for the restriction. Supported values:
-
‘market` - The content item is not available in the given market.
-
‘product` - The content item is not available for the user’s
subscription type.
-
‘explicit` - The content item is explicit and the user’s account is set
to not play explicit content.
-
‘payment_required` - Payment is required to play the content item.
Additional reasons may be added in the future. Note: If you use this field, make sure that your application safely handles unknown values.
23 24 25 |
# File 'lib/spotify_web_api/models/chapter_restriction_object.rb', line 23 def reason @reason end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
49 50 51 52 53 54 55 56 57 |
# File 'lib/spotify_web_api/models/chapter_restriction_object.rb', line 49 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reason = hash.key?('reason') ? hash['reason'] : SKIP # Create object from extracted values. ChapterRestrictionObject.new(reason) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 |
# File 'lib/spotify_web_api/models/chapter_restriction_object.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['reason'] = 'reason' @_hash end |
.nullables ⇒ Object
An array for nullable fields
40 41 42 |
# File 'lib/spotify_web_api/models/chapter_restriction_object.rb', line 40 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 |
# File 'lib/spotify_web_api/models/chapter_restriction_object.rb', line 33 def self.optionals %w[ reason ] end |