Module: Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post

Extended by:
Internal::Type::Union
Defined in:
lib/imagekitio/models/beta/v2/file_upload_params.rb

Defined Under Namespace

Classes: Abs, GifToVideo, Thumbnail, Transformation

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Instance Method Details

#initialize(value: nil, type: :thumbnail) ⇒ Object

Some parameter documentations has been truncated, see Thumbnail for more details.

Parameters:

  • value (String) (defaults to: nil)

    Optional transformation string.

  • type (Symbol, :thumbnail) (defaults to: :thumbnail)

    Generates a thumbnail image.



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/imagekitio/models/beta/v2/file_upload_params.rb', line 371

module Post
  extend Imagekitio::Internal::Type::Union

  discriminator :type

  variant :transformation,
          -> { Imagekitio::Beta::V2::FileUploadParams::Transformation::Post::Transformation }

  variant :"gif-to-video", -> { Imagekitio::Beta::V2::FileUploadParams::Transformation::Post::GifToVideo }

  variant :thumbnail, -> { Imagekitio::Beta::V2::FileUploadParams::Transformation::Post::Thumbnail }

  variant :abs, -> { Imagekitio::Beta::V2::FileUploadParams::Transformation::Post::Abs }

  class Transformation < Imagekitio::Internal::Type::BaseModel
    # @!attribute type
    #   Transformation type.
    #
    #   @return [Symbol, :transformation]
    required :type, const: :transformation

    # @!attribute value
    #   Transformation string (e.g. `w-200,h-200`).
    #   Same syntax as ImageKit URL-based transformations.
    #
    #   @return [String]
    required :value, String

    # @!method initialize(value:, type: :transformation)
    #   Some parameter documentations has been truncated, see
    #   {Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Transformation}
    #   for more details.
    #
    #   @param value [String] Transformation string (e.g. `w-200,h-200`).
    #
    #   @param type [Symbol, :transformation] Transformation type.
  end

  class GifToVideo < Imagekitio::Internal::Type::BaseModel
    # @!attribute type
    #   Converts an animated GIF into an MP4.
    #
    #   @return [Symbol, :"gif-to-video"]
    required :type, const: :"gif-to-video"

    # @!attribute value
    #   Optional transformation string to apply to the output video.
    #   **Example**: `q-80`
    #
    #   @return [String, nil]
    optional :value, String

    # @!method initialize(value: nil, type: :"gif-to-video")
    #   Some parameter documentations has been truncated, see
    #   {Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::GifToVideo}
    #   for more details.
    #
    #   @param value [String] Optional transformation string to apply to the output video.
    #
    #   @param type [Symbol, :"gif-to-video"] Converts an animated GIF into an MP4.
  end

  class Thumbnail < Imagekitio::Internal::Type::BaseModel
    # @!attribute type
    #   Generates a thumbnail image.
    #
    #   @return [Symbol, :thumbnail]
    required :type, const: :thumbnail

    # @!attribute value
    #   Optional transformation string.
    #   **Example**: `w-150,h-150`
    #
    #   @return [String, nil]
    optional :value, String

    # @!method initialize(value: nil, type: :thumbnail)
    #   Some parameter documentations has been truncated, see
    #   {Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Thumbnail}
    #   for more details.
    #
    #   @param value [String] Optional transformation string.
    #
    #   @param type [Symbol, :thumbnail] Generates a thumbnail image.
  end

  class Abs < Imagekitio::Internal::Type::BaseModel
    # @!attribute protocol
    #   Streaming protocol to use (`hls` or `dash`).
    #
    #   @return [Symbol, Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Abs::Protocol]
    required :protocol,
             enum: -> { Imagekitio::Beta::V2::FileUploadParams::Transformation::Post::Abs::Protocol }

    # @!attribute type
    #   Adaptive Bitrate Streaming (ABS) setup.
    #
    #   @return [Symbol, :abs]
    required :type, const: :abs

    # @!attribute value
    #   List of different representations you want to create separated by an underscore.
    #
    #   @return [String]
    required :value, String

    # @!method initialize(protocol:, value:, type: :abs)
    #   Some parameter documentations has been truncated, see
    #   {Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Abs} for
    #   more details.
    #
    #   @param protocol [Symbol, Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Abs::Protocol] Streaming protocol to use (`hls` or `dash`).
    #
    #   @param value [String] List of different representations you want to create separated by an underscore.
    #
    #   @param type [Symbol, :abs] Adaptive Bitrate Streaming (ABS) setup.

    # Streaming protocol to use (`hls` or `dash`).
    #
    # @see Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Abs#protocol
    module Protocol
      extend Imagekitio::Internal::Type::Enum

      HLS = :hls
      DASH = :dash

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

  # @!method self.variants
  #   @return [Array(Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Transformation, Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::GifToVideo, Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Thumbnail, Imagekitio::Models::Beta::V2::FileUploadParams::Transformation::Post::Abs)]
end