Class: OCI::AiSpeech::Models::VoiceSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/ai_speech/models/voice_summary.rb

Overview

Details related to the voice available for the given language code and voice type.

Constant Summary collapse

GENDER_ENUM =
[
  GENDER_MALE = 'MALE'.freeze,
  GENDER_FEMALE = 'FEMALE'.freeze,
  GENDER_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VoiceSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :voice_id (String)

    The value to assign to the #voice_id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :description (String)

    The value to assign to the #description property

  • :gender (String)

    The value to assign to the #gender property

  • :supported_models (Array<String>)

    The value to assign to the #supported_models property

  • :language_code (String)

    The value to assign to the #language_code property

  • :language_description (String)

    The value to assign to the #language_description property

  • :sample_rate_in_hertz (Integer)

    The value to assign to the #sample_rate_in_hertz property

  • :words_per_minute (Integer)

    The value to assign to the #words_per_minute property

  • :is_default_voice (BOOLEAN)

    The value to assign to the #is_default_voice property



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 110

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.voice_id = attributes[:'voiceId'] if attributes[:'voiceId']

  raise 'You cannot provide both :voiceId and :voice_id' if attributes.key?(:'voiceId') && attributes.key?(:'voice_id')

  self.voice_id = attributes[:'voice_id'] if attributes[:'voice_id']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']

  self.description = attributes[:'description'] if attributes[:'description']

  self.gender = attributes[:'gender'] if attributes[:'gender']

  self.supported_models = attributes[:'supportedModels'] if attributes[:'supportedModels']

  raise 'You cannot provide both :supportedModels and :supported_models' if attributes.key?(:'supportedModels') && attributes.key?(:'supported_models')

  self.supported_models = attributes[:'supported_models'] if attributes[:'supported_models']

  self.language_code = attributes[:'languageCode'] if attributes[:'languageCode']

  raise 'You cannot provide both :languageCode and :language_code' if attributes.key?(:'languageCode') && attributes.key?(:'language_code')

  self.language_code = attributes[:'language_code'] if attributes[:'language_code']

  self.language_description = attributes[:'languageDescription'] if attributes[:'languageDescription']

  raise 'You cannot provide both :languageDescription and :language_description' if attributes.key?(:'languageDescription') && attributes.key?(:'language_description')

  self.language_description = attributes[:'language_description'] if attributes[:'language_description']

  self.sample_rate_in_hertz = attributes[:'sampleRateInHertz'] if attributes[:'sampleRateInHertz']

  raise 'You cannot provide both :sampleRateInHertz and :sample_rate_in_hertz' if attributes.key?(:'sampleRateInHertz') && attributes.key?(:'sample_rate_in_hertz')

  self.sample_rate_in_hertz = attributes[:'sample_rate_in_hertz'] if attributes[:'sample_rate_in_hertz']

  self.words_per_minute = attributes[:'wordsPerMinute'] if attributes[:'wordsPerMinute']

  raise 'You cannot provide both :wordsPerMinute and :words_per_minute' if attributes.key?(:'wordsPerMinute') && attributes.key?(:'words_per_minute')

  self.words_per_minute = attributes[:'words_per_minute'] if attributes[:'words_per_minute']

  self.is_default_voice = attributes[:'isDefaultVoice'] unless attributes[:'isDefaultVoice'].nil?

  raise 'You cannot provide both :isDefaultVoice and :is_default_voice' if attributes.key?(:'isDefaultVoice') && attributes.key?(:'is_default_voice')

  self.is_default_voice = attributes[:'is_default_voice'] unless attributes[:'is_default_voice'].nil?
end

Instance Attribute Details

#descriptionString

A small description of the voice like its language and voice type.

Returns:

  • (String)


28
29
30
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 28

def description
  @description
end

#display_nameString

[Required] A user-friendly display name of the language for the user.

Returns:

  • (String)


24
25
26
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 24

def display_name
  @display_name
end

#genderString

[Required] Gender of the speaker.

Returns:

  • (String)


32
33
34
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 32

def gender
  @gender
end

#is_default_voiceBOOLEAN

Whether this voice id is default voice used for inference.

Returns:

  • (BOOLEAN)


56
57
58
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 56

def is_default_voice
  @is_default_voice
end

#language_codeString

An abbreviated notation of region to which the language and accent of the speaker belongs to.

Returns:

  • (String)


40
41
42
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 40

def language_code
  @language_code
end

#language_descriptionString

A description of region to which the language and accent of the speaker belongs to.

Returns:

  • (String)


44
45
46
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 44

def language_description
  @language_description
end

#sample_rate_in_hertzInteger

[Required] The sample rate of the speaker in Hertz.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 48

def sample_rate_in_hertz
  @sample_rate_in_hertz
end

#supported_modelsArray<String>

Models the particular speaker is aligned to.

Returns:

  • (Array<String>)


36
37
38
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 36

def supported_models
  @supported_models
end

#voice_idString

[Required] Unique Id of the voice.

Returns:

  • (String)


20
21
22
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 20

def voice_id
  @voice_id
end

#words_per_minuteInteger

[Required] The number of words the speaker can narrate per minute. It signifies the speed of the speech produced by the speaker.

Returns:

  • (Integer)


52
53
54
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 52

def words_per_minute
  @words_per_minute
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 59

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'voice_id': :'voiceId',
    'display_name': :'displayName',
    'description': :'description',
    'gender': :'gender',
    'supported_models': :'supportedModels',
    'language_code': :'languageCode',
    'language_description': :'languageDescription',
    'sample_rate_in_hertz': :'sampleRateInHertz',
    'words_per_minute': :'wordsPerMinute',
    'is_default_voice': :'isDefaultVoice'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 77

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'voice_id': :'String',
    'display_name': :'String',
    'description': :'String',
    'gender': :'String',
    'supported_models': :'Array<String>',
    'language_code': :'String',
    'language_description': :'String',
    'sample_rate_in_hertz': :'Integer',
    'words_per_minute': :'Integer',
    'is_default_voice': :'BOOLEAN'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 189

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    voice_id == other.voice_id &&
    display_name == other.display_name &&
    description == other.description &&
    gender == other.gender &&
    supported_models == other.supported_models &&
    language_code == other.language_code &&
    language_description == other.language_description &&
    sample_rate_in_hertz == other.sample_rate_in_hertz &&
    words_per_minute == other.words_per_minute &&
    is_default_voice == other.is_default_voice
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 228

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


208
209
210
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 208

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



217
218
219
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 217

def hash
  [voice_id, display_name, description, gender, supported_models, language_code, language_description, sample_rate_in_hertz, words_per_minute, is_default_voice].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



261
262
263
264
265
266
267
268
269
270
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 261

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



255
256
257
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 255

def to_s
  to_hash.to_s
end