Shopify SDK for Unity
Public Member Functions | List of all members
Shopify.Unity.Image Class Reference

Represents an image resource. More...

Inheritance diagram for Shopify.Unity.Image:
Shopify.Unity.SDK.AbstractResponse

Public Member Functions

 Image (Dictionary< string, object > dataJSON)
 Accepts deserialized json data. Will further parse passed in data. More...
 
string altText ()
 A word or phrase to share the nature or contents of an image. More...
 
string id ()
 A unique identifier for the image. More...
 
string originalSrc ()
 The location of the original image as a URL. More...
 
string src ()
 The location of the image as a URL. More...
 
string transformedSrc (string alias=null)
 The location of the transformed image as a URL. More...
 
object Clone ()
 

Additional Inherited Members

- Protected Member Functions inherited from Shopify.Unity.SDK.AbstractResponse
Get< T > (string field, string alias=null)
 
- Protected Attributes inherited from Shopify.Unity.SDK.AbstractResponse
Dictionary< string, object > Data
 
- Properties inherited from Shopify.Unity.SDK.AbstractResponse
Dictionary< string, object > DataJSON [get, protected set]
 

Detailed Description

Represents an image resource.

Constructor & Destructor Documentation

◆ Image()

Shopify.Unity.Image.Image ( Dictionary< string, object >  dataJSON)
inline

Accepts deserialized json data. Will further parse passed in data.

Parameters
dataJSONDeserialized JSON data for Image

Member Function Documentation

◆ altText()

string Shopify.Unity.Image.altText ( )
inline

A word or phrase to share the nature or contents of an image.

◆ id()

string Shopify.Unity.Image.id ( )
inline

A unique identifier for the image.

◆ originalSrc()

string Shopify.Unity.Image.originalSrc ( )
inline

The location of the original image as a URL.

If there are any existing transformations in the original source URL, they will remain and not be stripped.

◆ src()

string Shopify.Unity.Image.src ( )
inline

The location of the image as a URL.

Deprecated:
Previously an image had a single src field. This could either return the original image location or a URL that contained transformations such as sizing or scale.

These transformations were specified by arguments on the parent field.

Now an image has two distinct URL fields: originalSrc and transformedSrc.

  • originalSrc - the original unmodified image URL
  • transformedSrc - the image URL with the specified transformations included

To migrate to the new fields, image transformations should be moved from the parent field to transformedSrc.

Before:

{
shop {
productImages(maxWidth: 200, scale: 2) {
edges {
node {
src
}
}
}
}
}

After:

{
shop {
productImages {
edges {
node {
transformedSrc(maxWidth: 200, scale: 2)
}
}
}
}
}

◆ transformedSrc()

string Shopify.Unity.Image.transformedSrc ( string  alias = null)
inline

The location of the transformed image as a URL.

All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. Otherwise any transformations which an image type does not support will be ignored.

Parameters
aliasIf the original field queried was queried using an alias, then pass the matching string.

The documentation for this class was generated from the following file: