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
72
73
74
75
76
77
78
79
80
81
82
//! HTTP client types for Shopify API communication.
//!
//! This module provides the foundational HTTP client layer for making
//! authenticated requests to the Shopify API. It handles request/response
//! processing, retry logic, and Shopify-specific header parsing.
//!
//! # Overview
//!
//! The main types in this module are:
//!
//! - [`HttpClient`]: The async HTTP client for API communication
//! - [`HttpRequest`]: A request to be sent to the API
//! - [`HttpResponse`]: A parsed response from the API
//! - [`HttpMethod`]: Supported HTTP methods (GET, POST, PUT, DELETE)
//! - [`DataType`]: Content types for request bodies
//! - [`rest::RestClient`]: Higher-level REST API client
//! - [`rest::RestError`]: REST-specific error types
//! - [`graphql::GraphqlClient`]: Higher-level GraphQL API client (Admin API)
//! - [`graphql::GraphqlError`]: GraphQL-specific error types
//! - [`storefront::StorefrontClient`]: GraphQL client for Storefront API
//! - [`storefront::StorefrontToken`]: Token type for Storefront API authentication
//!
//! # Example
//!
//! ```rust,ignore
//! use shopify_sdk::{HttpClient, HttpRequest, HttpMethod, DataType, Session, ShopDomain};
//!
//! // 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 an HTTP client
//! let client = HttpClient::new("/admin/api/2024-10", &session, None);
//!
//! // Build and send a request
//! let request = HttpRequest::builder(HttpMethod::Get, "products.json")
//! .build()
//! .unwrap();
//!
//! let response = client.request(request).await?;
//! ```
//!
//! # Retry Behavior
//!
//! The client implements automatic retry logic for transient failures:
//!
//! - **429 (Rate Limited)**: Retries using `Retry-After` header value, or 1 second if not present
//! - **500 (Server Error)**: Retries with fixed 1-second delay
//! - **Other errors (4xx)**: Returns immediately without retry
//!
//! The default `tries` is 1, meaning no automatic retries. Configure via
//! [`HttpRequest::builder`] with `.tries(n)` to enable retries.
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export REST client types at the clients module level
pub use ;
// Re-export GraphQL client types at the clients module level
pub use ;
// Re-export Storefront client types at the clients module level
pub use ;