1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! REST API client for Shopify Admin API.
//!
//! This module provides a higher-level REST API client built on top of the
//! [`HttpClient`](crate::clients::HttpClient) that offers convenient methods
//! for interacting with Shopify's REST Admin API.
//!
//! # Overview
//!
//! The main types in this module are:
//!
//! - [`RestClient`]: The REST API client with `get()`, `post()`, `put()`, `delete()` methods
//! - [`RestError`]: Error type for REST API operations
//!
//! # Deprecation Notice
//!
//! The Shopify Admin REST API is deprecated. Shopify recommends migrating to the
//! GraphQL Admin API for new development. This client logs a deprecation warning
//! when constructed and can be disabled via configuration.
//!
//! For more information, see:
//! <https://www.shopify.com/ca/partners/blog/all-in-on-graphql>
//!
//! # Example
//!
//! ```rust,ignore
//! use shopify_sdk::{RestClient, Session, ShopDomain, ShopifyConfig, ApiKey, ApiSecretKey};
//!
//! // Create a session
//! let session = Session::new(
//! "session-id".to_string(),
//! ShopDomain::new("my-store").unwrap(),
//! "access-token".to_string(),
//! "read_products".parse().unwrap(),
//! false,
//! None,
//! );
//!
//! // Create configuration
//! let config = ShopifyConfig::builder()
//! .api_key(ApiKey::new("your-api-key").unwrap())
//! .api_secret_key(ApiSecretKey::new("your-secret").unwrap())
//! .build()
//! .unwrap();
//!
//! // Create REST client
//! let client = RestClient::new(&session, Some(&config))?;
//!
//! // Make requests
//! let response = client.get("products", None).await?;
//! println!("Products: {}", response.body);
//! ```
//!
//! # Path Normalization
//!
//! The client normalizes paths following the Ruby SDK conventions:
//!
//! - Leading slashes are stripped: `/products` -> `products`
//! - Trailing `.json` is stripped and re-added: `products.json` -> `products.json`
//! - Paths starting with `admin/` bypass the base path construction
//!
//! # Retry Behavior
//!
//! By default, requests are attempted once (`tries=1`). You can configure
//! automatic retries on 429 (rate limited) and 500 (server error) responses
//! by specifying the `tries` parameter in request methods.
pub use RestClient;
pub use RestError;