Class: DetailTrackInfo

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/track_types.rb

Constant Summary collapse

TRACKID =
1
TITLE =
2
COVERPATH =
3
COVERSMALL =
4
COVERMIDDLE =
5
COVERLARGE =
6
SHORTINTRO =
7
TAGS =
8
PLAYPATH32 =
9
PLAYPATH64 =
10
DOWNLOADPATH =
11
DOWNLOADSIZE =
12
DURATION =
13
TRANSCODESTATE =
14
ISPUBLIC =
15
STATUS =
16
USERSOURCE =
17
UPLOADSOURCE =
18
UID =
19
ALBUMID =
20
CATEGORYID =
21
ACTIVITYID =
22
CREATEDAT =
23
UPDATEDAT =
24
SHORTRICHINTRO =
25
RICHINTRO =
26
LYRIC =
27
SUCCESS =
28
MSG =
29
FIELDS =
{
  TRACKID => {:type => ::Thrift::Types::I64, :name => 'trackId', :optional => true},
  TITLE => {:type => ::Thrift::Types::STRING, :name => 'title', :optional => true},
  COVERPATH => {:type => ::Thrift::Types::STRING, :name => 'coverPath', :optional => true},
  COVERSMALL => {:type => ::Thrift::Types::STRING, :name => 'coverSmall', :optional => true},
  COVERMIDDLE => {:type => ::Thrift::Types::STRING, :name => 'coverMiddle', :optional => true},
  COVERLARGE => {:type => ::Thrift::Types::STRING, :name => 'coverLarge', :optional => true},
  SHORTINTRO => {:type => ::Thrift::Types::STRING, :name => 'shortIntro', :optional => true},
  TAGS => {:type => ::Thrift::Types::STRING, :name => 'tags', :optional => true},
  PLAYPATH32 => {:type => ::Thrift::Types::STRING, :name => 'playPath32', :optional => true},
  PLAYPATH64 => {:type => ::Thrift::Types::STRING, :name => 'playPath64', :optional => true},
  DOWNLOADPATH => {:type => ::Thrift::Types::STRING, :name => 'downloadPath', :optional => true},
  DOWNLOADSIZE => {:type => ::Thrift::Types::I32, :name => 'downloadSize', :optional => true},
  DURATION => {:type => ::Thrift::Types::DOUBLE, :name => 'duration', :optional => true},
  TRANSCODESTATE => {:type => ::Thrift::Types::I32, :name => 'transcodeState', :optional => true},
  ISPUBLIC => {:type => ::Thrift::Types::BOOL, :name => 'isPublic', :optional => true},
  STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :optional => true, :enum_class => ::ApproveStatus},
  USERSOURCE => {:type => ::Thrift::Types::I32, :name => 'userSource', :optional => true, :enum_class => ::UserSource},
  UPLOADSOURCE => {:type => ::Thrift::Types::I32, :name => 'uploadSource', :optional => true, :enum_class => ::UploadSource},
  UID => {:type => ::Thrift::Types::I64, :name => 'uid', :optional => true},
  ALBUMID => {:type => ::Thrift::Types::I64, :name => 'albumId', :optional => true},
  CATEGORYID => {:type => ::Thrift::Types::I32, :name => 'categoryId', :optional => true},
  ACTIVITYID => {:type => ::Thrift::Types::I32, :name => 'activityId', :optional => true},
  CREATEDAT => {:type => ::Thrift::Types::I64, :name => 'createdAt', :optional => true},
  UPDATEDAT => {:type => ::Thrift::Types::I64, :name => 'updatedAt', :optional => true},
  SHORTRICHINTRO => {:type => ::Thrift::Types::STRING, :name => 'shortRichIntro', :optional => true},
  RICHINTRO => {:type => ::Thrift::Types::STRING, :name => 'richIntro', :optional => true},
  LYRIC => {:type => ::Thrift::Types::STRING, :name => 'lyric', :optional => true},
  SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success', :optional => true},
  MSG => {:type => ::Thrift::Types::STRING, :name => 'msg', :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



184
# File 'lib/track_types.rb', line 184

def struct_fields; FIELDS; end

#validateObject



186
187
188
189
190
191
192
193
194
195
196
# File 'lib/track_types.rb', line 186

def validate
  unless @status.nil? || ::ApproveStatus::VALID_VALUES.include?(@status)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field status!')
  end
  unless @userSource.nil? || ::UserSource::VALID_VALUES.include?(@userSource)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field userSource!')
  end
  unless @uploadSource.nil? || ::UploadSource::VALID_VALUES.include?(@uploadSource)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field uploadSource!')
  end
end