Class: Imagekitio::Models::SrcOptions

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/imagekitio/models/src_options.rb

Direct Known Subclasses

GetImageAttributesOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

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

Methods included from Internal::Util::SorbetRuntimeSupport

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

Constructor Details

#initialize(src:, url_endpoint:, expires_in: nil, query_parameters: nil, signed: nil, transformation: nil, transformation_position: nil) ⇒ Object

Some parameter documentations has been truncated, see Imagekitio::Models::SrcOptions for more details.

Options for generating ImageKit URLs with transformations. See the [Transformations guide](imagekit.io/docs/transformations).

Parameters:

  • Accepts a relative or absolute path of the resource. If a relative path is provi

  • Get your urlEndpoint from the [ImageKit dashboard](imagekit.io/dashboard

  • (defaults to: nil)

    When you want the signed URL to expire, specified in seconds. If expiresIn is

  • (defaults to: nil)

    These are additional query parameters that you want to add to the final URL.

  • (defaults to: nil)

    Whether to sign the URL or not. Set this to true if you want to generate a sig

  • (defaults to: nil)

    An array of objects specifying the transformations to be applied in the URL. If

  • (defaults to: nil)

    By default, the transformation string is added as a query parameter in the URL,



# File 'lib/imagekitio/models/src_options.rb', line 74


Instance Attribute Details

#expires_inFloat?

When you want the signed URL to expire, specified in seconds. If expiresIn is anything above 0, the URL will always be signed even if signed is set to false. If not specified and signed is true, the signed URL will not expire (valid indefinitely).

Example: Setting ‘expiresIn: 3600` will make the URL expire 1 hour from generation time. After the expiry time, the signed URL will no longer be valid and ImageKit will return a 401 Unauthorized status code.

[Learn more](imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls).

Returns:



34
# File 'lib/imagekitio/models/src_options.rb', line 34

optional :expires_in, Float, api_name: :expiresIn

#query_parametersHash{Symbol=>String}?

These are additional query parameters that you want to add to the final URL. They can be any query parameters and not necessarily related to ImageKit. This is especially useful if you want to add a versioning parameter to your URLs.

Returns:



42
# File 'lib/imagekitio/models/src_options.rb', line 42

optional :query_parameters, Imagekitio::Internal::Type::HashOf[String], api_name: :queryParameters

#signedBoolean?

Whether to sign the URL or not. Set this to true if you want to generate a signed URL. If signed is true and expiresIn is not specified, the signed URL will not expire (valid indefinitely). Note: If expiresIn is set to any value above 0, the URL will always be signed regardless of this setting. [Learn more](imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls).

Returns:



52
# File 'lib/imagekitio/models/src_options.rb', line 52

optional :signed, Imagekitio::Internal::Type::Boolean

#srcString

Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the urlEndpoint. If an absolute path is provided, urlEndpoint is ignored.

Returns:



12
# File 'lib/imagekitio/models/src_options.rb', line 12

required :src, String

#transformationArray<Imagekitio::Models::Transformation>?

An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. See [Chained transformations](imagekit.io/docs/transformations#chained-transformations).

Returns:



61
# File 'lib/imagekitio/models/src_options.rb', line 61

optional :transformation, -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::Transformation] }

#transformation_positionSymbol, ...

By default, the transformation string is added as a query parameter in the URL, e.g., ‘?tr=w-100,h-100`. If you want to add the transformation string in the path of the URL, set this to path. Learn more in the [Transformations guide](imagekit.io/docs/transformations).

Returns:



70
71
72
# File 'lib/imagekitio/models/src_options.rb', line 70

optional :transformation_position,
enum: -> { Imagekitio::TransformationPosition },
api_name: :transformationPosition

#url_endpointString

Get your urlEndpoint from the [ImageKit dashboard](imagekit.io/dashboard/url-endpoints).

Returns:



19
# File 'lib/imagekitio/models/src_options.rb', line 19

required :url_endpoint, String, api_name: :urlEndpoint