azure_core/
constants.rs

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
/// Endpoints for Azure Resource Manager in different Azure clouds
pub mod resource_manager_endpoint {
    static_url!(
        /// Azure Resource Manager China cloud endpoint
        AZURE_CHINA_CLOUD,
        "https://management.chinacloudapi.cn"
    );

    static_url!(
        /// Azure Resource Manager Germany cloud endpoint
        AZURE_GERMANY_CLOUD,
        "https://management.microsoftazure.de"
    );

    static_url!(
        /// Azure Resource Manager public cloud endpoint
        AZURE_PUBLIC_CLOUD,
        "https://management.azure.com"
    );

    static_url!(
        /// Azure Resource Manager US government cloud endpoint
        AZURE_US_GOVERNMENT_CLOUD,
        "https://management.usgovcloudapi.net"
    );
}

/// A list of known Azure authority hosts
pub mod authority_hosts {
    static_url!(
        /// China-based Azure Authority Host
        AZURE_CHINA_CLOUD,
        "https://login.chinacloudapi.cn"
    );

    static_url!(
        /// Germany-based Azure Authority Host
        AZURE_GERMANY_CLOUD,
        "https://login.microsoftonline.de"
    );

    static_url!(
        /// US Government Azure Authority Host
        AZURE_US_GOVERNMENT_CLOUD,
        "https://login.microsoftonline.us"
    );

    static_url!(
        /// Public Cloud Azure Authority Host
        AZURE_PUBLIC_CLOUD,
        "https://login.microsoftonline.com"
    );
}

/// Constants related to the Content-Type header
///
/// <https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type>
pub mod content_type {
    use crate::headers::HeaderValue;

    // Form content types
    // https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

    pub const MULTIPART_FORM_DATA: HeaderValue = HeaderValue::from_static("multipart/form-data");
    pub const APPLICATION_X_WWW_FORM_URLENCODED: HeaderValue =
        HeaderValue::from_static("application/x-www-form-urlencoded");

    pub const APPLICATION_XML: HeaderValue = HeaderValue::from_static("application/xml");
    pub const APPLICATION_JSON: HeaderValue = HeaderValue::from_static("application/json");
    pub const APPLICATION_OCTET_STREAM: HeaderValue =
        HeaderValue::from_static("application/octet-stream");
    pub const TEXT_PLAIN: HeaderValue = HeaderValue::from_static("text/plain");
}

/// Constants related to query parameters
pub mod query_param {
    pub const API_VERSION: &str = "api-version";
}