Class: Imagekitio::Models::SrcOptions
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Imagekitio::Models::SrcOptions
- Defined in:
- lib/imagekitio/models/src_options.rb,
sig/imagekitio/models/src_options.rbs
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expires_in ⇒ Float?
When you want the signed URL to expire, specified in seconds.
-
#query_parameters ⇒ Hash{Symbol=>String}?
These are additional query parameters that you want to add to the final URL.
-
#signed ⇒ Boolean?
Whether to sign the URL or not.
-
#src ⇒ String
Accepts a relative or absolute path of the resource.
-
#transformation ⇒ Array<Imagekitio::Models::Transformation>?
An array of objects specifying the transformations to be applied in the URL.
-
#transformation_position ⇒ Symbol, ...
By default, the transformation string is added as a query parameter in the URL, e.g.,
?tr=w-100,h-100. -
#url_endpoint ⇒ String
Get your urlEndpoint from the ImageKit dashboard.
Instance Method Summary collapse
-
#initialize(src:, url_endpoint:, expires_in: nil, query_parameters: nil, signed: nil, transformation: nil, transformation_position: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see SrcOptions for more details.
- #to_hash ⇒ {
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.
|
|
# File 'lib/imagekitio/models/src_options.rb', line 74
|
Instance Attribute Details
#expires_in ⇒ Float?
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.
34 |
# File 'lib/imagekitio/models/src_options.rb', line 34 optional :expires_in, Float, api_name: :expiresIn |
#query_parameters ⇒ Hash{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.
42 |
# File 'lib/imagekitio/models/src_options.rb', line 42 optional :query_parameters, Imagekitio::Internal::Type::HashOf[String], api_name: :queryParameters |
#signed ⇒ Boolean?
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.
52 |
# File 'lib/imagekitio/models/src_options.rb', line 52 optional :signed, Imagekitio::Internal::Type::Boolean |
#src ⇒ String
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.
12 |
# File 'lib/imagekitio/models/src_options.rb', line 12 required :src, String |
#transformation ⇒ Array<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.
61 |
# File 'lib/imagekitio/models/src_options.rb', line 61 optional :transformation, -> { Imagekitio::Internal::Type::ArrayOf[Imagekitio::Transformation] } |
#transformation_position ⇒ Symbol, ...
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.
70 71 72 |
# File 'lib/imagekitio/models/src_options.rb', line 70 optional :transformation_position, enum: -> { Imagekitio::TransformationPosition }, api_name: :transformationPosition |
#url_endpoint ⇒ String
Get your urlEndpoint from the ImageKit dashboard.
19 |
# File 'lib/imagekitio/models/src_options.rb', line 19 required :url_endpoint, String, api_name: :urlEndpoint |
Instance Method Details
#to_hash ⇒ {
53 |
# File 'sig/imagekitio/models/src_options.rbs', line 53
def to_hash: -> {
|