Module: Shotstack::ShotstackGeneratedAssetOptions

Defined in:
lib/shotstack/models/shotstack_generated_asset_options.rb

Overview

Generate assets using the native Shotstack provider AI services. The following AI generation services are available: <ul> <li><a href="#tocs_shotstacktexttospeechoptions">ShotstackTextToSpeechOptions</a></li> <li><a href="#tocs_shotstacktexttoimageoptions">ShotstackTextToImageOptions</a></li> <li><a href="#tocs_shotstackimagetovideooptions">ShotstackImageToVideoOptions</a></li> <li><a href="#tocs_shotstacktextgeneratoroptions">ShotstackTextGeneratorOptions</a></li> </ul>

Class Method Summary collapse

Class Method Details

.build(data) ⇒ Object

Builds the object

Parameters:

  • Data (Mixed)

    to be matched against the list of oneOf items

Returns:

  • (Object)

    Returns the model or the data itself



48
49
50
51
52
53
54
55
56
# File 'lib/shotstack/models/shotstack_generated_asset_options.rb', line 48

def build(data)
  discriminator_value = data[openapi_discriminator_name]
  return nil if discriminator_value.nil?

  klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
  return nil unless klass

  Shotstack.const_get(klass).build_from_hash(data)
end

.openapi_discriminator_mappingObject

Discriminator’s mapping (OpenAPI v3)



36
37
38
39
40
41
42
43
# File 'lib/shotstack/models/shotstack_generated_asset_options.rb', line 36

def openapi_discriminator_mapping
  {
    :'image-to-video' => :'ShotstackImageToVideoOptions',
    :'text-generator' => :'ShotstackTextToImageOptions',
    :'text-to-image' => :'ShotstackTextToImageOptions',
    :'text-to-speech' => :'ShotstackTextToSpeechOptions'
  }
end

.openapi_discriminator_nameObject

Discriminator’s property name (OpenAPI v3)



31
32
33
# File 'lib/shotstack/models/shotstack_generated_asset_options.rb', line 31

def openapi_discriminator_name
  :'type'
end

.openapi_one_ofObject

List of class defined in oneOf (OpenAPI v3)



21
22
23
24
25
26
27
28
# File 'lib/shotstack/models/shotstack_generated_asset_options.rb', line 21

def openapi_one_of
  [
    :'ShotstackImageToVideoOptions',
    :'ShotstackTextGeneratorOptions',
    :'ShotstackTextToImageOptions',
    :'ShotstackTextToSpeechOptions'
  ]
end