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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
use serde::{Deserialize, Serialize}; /*
* Cloud SQL Admin API
*
* API for Cloud SQL database instance management
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::google_rest_apis::sqladmin_v1::models;
/// User : A Cloud SQL user resource.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct User {
/// Dual password status for the user.
#[serde(rename = "dualPasswordType", skip_serializing_if = "Option::is_none")]
pub dual_password_type: Option<DualPasswordType>,
/// This field is deprecated and will be removed from a future version of the API.
#[serde(rename = "etag", skip_serializing_if = "Option::is_none")]
pub etag: Option<String>,
/// Optional. The host from which the user can connect. For `insert` operations, host defaults to an empty string. For `update` operations, host is specified as part of the request URL. The host name cannot be updated after insertion. For a MySQL instance, it's required; for a PostgreSQL or SQL Server instance, it's optional.
#[serde(rename = "host", skip_serializing_if = "Option::is_none")]
pub host: Option<String>,
/// The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for `update` because it is already specified on the URL.
#[serde(rename = "instance", skip_serializing_if = "Option::is_none")]
pub instance: Option<String>,
/// This is always `sql#user`.
#[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
/// The name of the user in the Cloud SQL instance. Can be omitted for `update` because it is already specified in the URL.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// The password for the user.
#[serde(rename = "password", skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "passwordPolicy", skip_serializing_if = "Option::is_none")]
pub password_policy: Option<Box<models::UserPasswordValidationPolicy>>,
/// The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for `update` because it is already specified on the URL.
#[serde(rename = "project", skip_serializing_if = "Option::is_none")]
pub project: Option<String>,
#[serde(
rename = "sqlserverUserDetails",
skip_serializing_if = "Option::is_none"
)]
pub sqlserver_user_details: Option<Box<models::SqlServerUserDetails>>,
/// The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type.
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
}
impl User {
/// A Cloud SQL user resource.
pub fn new() -> User {
User {
dual_password_type: None,
etag: None,
host: None,
instance: None,
kind: None,
name: None,
password: None,
password_policy: None,
project: None,
sqlserver_user_details: None,
r#type: None,
}
}
}
/// Dual password status for the user.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DualPasswordType {
#[serde(rename = "DUAL_PASSWORD_TYPE_UNSPECIFIED")]
DualPasswordTypeUnspecified,
#[serde(rename = "NO_MODIFY_DUAL_PASSWORD")]
NoModifyDualPassword,
#[serde(rename = "NO_DUAL_PASSWORD")]
NoDualPassword,
#[serde(rename = "DUAL_PASSWORD")]
DualPassword,
}
impl Default for DualPasswordType {
fn default() -> DualPasswordType {
Self::DualPasswordTypeUnspecified
}
}
/// The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "BUILT_IN")]
BuiltIn,
#[serde(rename = "CLOUD_IAM_USER")]
CloudIamUser,
#[serde(rename = "CLOUD_IAM_SERVICE_ACCOUNT")]
CloudIamServiceAccount,
}
impl Default for Type {
fn default() -> Type {
Self::BuiltIn
}
}