pub enum ApiVersion {
V2024_01,
V2024_04,
V2024_07,
V2024_10,
V2025_01,
V2025_04,
V2025_07,
V2025_10,
V2026_01,
Unstable,
Custom(String),
}Expand description
Shopify API version.
Shopify releases new API versions quarterly (January, April, July, October).
This enum provides variants for known stable versions, plus an Unstable
variant for development and a Custom variant for future versions.
§Example
use shopify_sdk::ApiVersion;
// Use the latest stable version
let version = ApiVersion::latest();
assert!(version.is_stable());
// Parse from string
let version: ApiVersion = "2024-10".parse().unwrap();
assert_eq!(version, ApiVersion::V2024_10);
// Display as string
assert_eq!(format!("{}", ApiVersion::V2024_10), "2024-10");Variants§
V2024_01
API version 2024-01 (January 2024)
V2024_04
API version 2024-04 (April 2024)
V2024_07
API version 2024-07 (July 2024)
V2024_10
API version 2024-10 (October 2024)
V2025_01
API version 2025-01 (January 2025)
V2025_04
API version 2025-04 (April 2025)
V2025_07
API version 2025-07 (July 2025)
V2025_10
API version 2025-10 (October 2025)
V2026_01
API version 2026-01 (January 2026)
Unstable
Unstable API version for development and testing.
Custom(String)
Custom version string for future or unrecognized versions.
Implementations§
Source§impl ApiVersion
impl ApiVersion
Sourcepub const fn latest() -> Self
pub const fn latest() -> Self
Returns the latest stable API version.
This should be updated when new stable versions are released.
Sourcepub const fn is_stable(&self) -> bool
pub const fn is_stable(&self) -> bool
Returns true if this is a known stable API version.
Returns false for Unstable and Custom variants.
Sourcepub fn supported_versions() -> Vec<Self>
pub fn supported_versions() -> Vec<Self>
Returns all supported stable versions in chronological order.
This includes versions within Shopify’s approximately 12-month support window. Versions are ordered from oldest to newest.
§Example
use shopify_api::ApiVersion;
let versions = ApiVersion::supported_versions();
assert!(!versions.is_empty());
assert!(versions.contains(&ApiVersion::latest()));Sourcepub const fn minimum_supported() -> Self
pub const fn minimum_supported() -> Self
Returns the oldest supported API version.
This represents the minimum version within Shopify’s support window (approximately 12 months). Versions older than this are considered deprecated and may stop working at any time.
§Example
use shopify_api::ApiVersion;
let minimum = ApiVersion::minimum_supported();
assert!(minimum.is_supported());Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns true if this version is within Shopify’s support window.
Supported versions include:
- All stable versions from [
minimum_supported()] onwards - The
Unstableversion (always supported for development) Customversions (assumed supported as they may be newer versions)
§Example
use shopify_api::ApiVersion;
assert!(ApiVersion::V2025_10.is_supported());
assert!(ApiVersion::Unstable.is_supported());
assert!(!ApiVersion::V2024_01.is_supported());Sourcepub fn is_deprecated(&self) -> bool
pub fn is_deprecated(&self) -> bool
Returns true if this version is past Shopify’s support window.
Deprecated versions are older than [minimum_supported()] and may
stop working at any time. You should upgrade to a supported version.
Note: Unstable and Custom versions are never considered deprecated.
§Example
use shopify_api::ApiVersion;
assert!(ApiVersion::V2024_01.is_deprecated());
assert!(!ApiVersion::V2025_10.is_deprecated());
assert!(!ApiVersion::Unstable.is_deprecated());Trait Implementations§
Source§impl Clone for ApiVersion
impl Clone for ApiVersion
Source§fn clone(&self) -> ApiVersion
fn clone(&self) -> ApiVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ApiVersion
impl Debug for ApiVersion
Source§impl Display for ApiVersion
impl Display for ApiVersion
Source§impl FromStr for ApiVersion
impl FromStr for ApiVersion
Source§impl Hash for ApiVersion
impl Hash for ApiVersion
Source§impl Ord for ApiVersion
impl Ord for ApiVersion
Source§impl PartialEq for ApiVersion
impl PartialEq for ApiVersion
Source§impl PartialOrd for ApiVersion
impl PartialOrd for ApiVersion
impl Eq for ApiVersion
impl StructuralPartialEq for ApiVersion
Auto Trait Implementations§
impl Freeze for ApiVersion
impl RefUnwindSafe for ApiVersion
impl Send for ApiVersion
impl Sync for ApiVersion
impl Unpin for ApiVersion
impl UnwindSafe for ApiVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.