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
LANGUAGE_CODE_ENUM =
[
  LANGUAGE_CODE_EN_US = 'en-US'.freeze,
  LANGUAGE_CODE_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



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
168
169
170
171
172
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 115

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)


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

def description
  @description
end

#display_nameString

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

Returns:

  • (String)


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

def display_name
  @display_name
end

#genderString

[Required] Gender of the speaker.

Returns:

  • (String)


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

def gender
  @gender
end

#is_default_voiceBOOLEAN

Whether this voice id is default voice used for inference.

Returns:

  • (BOOLEAN)


61
62
63
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 61

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)


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

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)


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

def language_description
  @language_description
end

#sample_rate_in_hertzInteger

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

Returns:

  • (Integer)


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

def sample_rate_in_hertz
  @sample_rate_in_hertz
end

#supported_modelsArray<String>

Models the particular speaker is aligned to.

Returns:

  • (Array<String>)


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

def supported_models
  @supported_models
end

#voice_idString

[Required] Unique Id of the voice.

Returns:

  • (String)


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

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)


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

def words_per_minute
  @words_per_minute
end

Class Method Details

.attribute_mapObject

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



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 64

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.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 82

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



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 207

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



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 246

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


226
227
228
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 226

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



235
236
237
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 235

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



279
280
281
282
283
284
285
286
287
288
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 279

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



273
274
275
# File 'lib/oci/ai_speech/models/voice_summary.rb', line 273

def to_s
  to_hash.to_s
end