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
/*
* OpenAI API
*
* The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
*
* The version of the OpenAPI document: 2.3.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CreateVaultCredentialAuthParamEnvironmentVariable : An HTTP credential for OpenAI-hosted environments only. The sandbox receives an environment variable containing a placeholder, not the secret. Use the placeholder unchanged in outgoing requests. The egress proxy replaces the placeholder with the secret for allowed HTTPS destinations on ports 443 and 8443. Sandbox code cannot read the real secret or use it for local computation, such as signing a request.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct CreateVaultCredentialAuthParamEnvironmentVariable {
/// The type of the object. Always `environment_variable`.
#[serde(rename = "type")]
pub r#type: Type,
/// The environment variable name that receives the placeholder, such as `SERVICE_API_KEY`. Use ASCII letters, digits, and underscores, starting with a letter or underscore. Names starting with `CODEX_` and managed proxy or certificate variable names are reserved.
#[serde(rename = "secret_name")]
pub secret_name: String,
/// The write-only secret to store. Never returned in credential resources or supplied directly to sandbox code. Must be nonempty and must not contain carriage returns, newlines, or NUL bytes.
#[serde(rename = "secret_value")]
pub secret_value: String,
#[serde(rename = "networking")]
pub networking: Box<models::VaultCredentialNetworkingParam>,
}
impl CreateVaultCredentialAuthParamEnvironmentVariable {
/// An HTTP credential for OpenAI-hosted environments only. The sandbox receives an environment variable containing a placeholder, not the secret. Use the placeholder unchanged in outgoing requests. The egress proxy replaces the placeholder with the secret for allowed HTTPS destinations on ports 443 and 8443. Sandbox code cannot read the real secret or use it for local computation, such as signing a request.
pub fn new(
r#type: Type,
secret_name: String,
secret_value: String,
networking: models::VaultCredentialNetworkingParam,
) -> CreateVaultCredentialAuthParamEnvironmentVariable {
CreateVaultCredentialAuthParamEnvironmentVariable {
r#type,
secret_name,
secret_value,
networking: Box::new(networking),
}
}
}
/// The type of the object. Always `environment_variable`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "environment_variable")]
EnvironmentVariable,
}
impl Default for Type {
fn default() -> Type {
Self::EnvironmentVariable
}
}
impl std::fmt::Display for CreateVaultCredentialAuthParamEnvironmentVariable {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}