google_cloud_oslogin_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_oslogin_common;
25extern crate serde;
26extern crate serde_json;
27extern crate serde_with;
28extern crate std;
29extern crate tracing;
30extern crate wkt;
31
32mod debug;
33mod deserialize;
34mod serialize;
35
36/// The user profile information used for logging in to a virtual machine on
37/// Google Compute Engine.
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct LoginProfile {
41 /// Required. A unique user ID.
42 pub name: std::string::String,
43
44 /// The list of POSIX accounts associated with the user.
45 pub posix_accounts: std::vec::Vec<google_cloud_oslogin_common::model::PosixAccount>,
46
47 /// A map from SSH public key fingerprint to the associated key object.
48 pub ssh_public_keys: std::collections::HashMap<
49 std::string::String,
50 google_cloud_oslogin_common::model::SshPublicKey,
51 >,
52
53 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
54}
55
56impl LoginProfile {
57 /// Creates a new default instance.
58 pub fn new() -> Self {
59 std::default::Default::default()
60 }
61
62 /// Sets the value of [name][crate::model::LoginProfile::name].
63 ///
64 /// # Example
65 /// ```ignore,no_run
66 /// # use google_cloud_oslogin_v1::model::LoginProfile;
67 /// let x = LoginProfile::new().set_name("example");
68 /// ```
69 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
70 self.name = v.into();
71 self
72 }
73
74 /// Sets the value of [posix_accounts][crate::model::LoginProfile::posix_accounts].
75 ///
76 /// # Example
77 /// ```ignore,no_run
78 /// # use google_cloud_oslogin_v1::model::LoginProfile;
79 /// use google_cloud_oslogin_common::model::PosixAccount;
80 /// let x = LoginProfile::new()
81 /// .set_posix_accounts([
82 /// PosixAccount::default()/* use setters */,
83 /// PosixAccount::default()/* use (different) setters */,
84 /// ]);
85 /// ```
86 pub fn set_posix_accounts<T, V>(mut self, v: T) -> Self
87 where
88 T: std::iter::IntoIterator<Item = V>,
89 V: std::convert::Into<google_cloud_oslogin_common::model::PosixAccount>,
90 {
91 use std::iter::Iterator;
92 self.posix_accounts = v.into_iter().map(|i| i.into()).collect();
93 self
94 }
95
96 /// Sets the value of [ssh_public_keys][crate::model::LoginProfile::ssh_public_keys].
97 ///
98 /// # Example
99 /// ```ignore,no_run
100 /// # use google_cloud_oslogin_v1::model::LoginProfile;
101 /// use google_cloud_oslogin_common::model::SshPublicKey;
102 /// let x = LoginProfile::new().set_ssh_public_keys([
103 /// ("key0", SshPublicKey::default()/* use setters */),
104 /// ("key1", SshPublicKey::default()/* use (different) setters */),
105 /// ]);
106 /// ```
107 pub fn set_ssh_public_keys<T, K, V>(mut self, v: T) -> Self
108 where
109 T: std::iter::IntoIterator<Item = (K, V)>,
110 K: std::convert::Into<std::string::String>,
111 V: std::convert::Into<google_cloud_oslogin_common::model::SshPublicKey>,
112 {
113 use std::iter::Iterator;
114 self.ssh_public_keys = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
115 self
116 }
117}
118
119impl wkt::message::Message for LoginProfile {
120 fn typename() -> &'static str {
121 "type.googleapis.com/google.cloud.oslogin.v1.LoginProfile"
122 }
123}
124
125/// A request message for creating an SSH public key.
126#[derive(Clone, Default, PartialEq)]
127#[non_exhaustive]
128pub struct CreateSshPublicKeyRequest {
129 /// Required. The unique ID for the user in format `users/{user}`.
130 pub parent: std::string::String,
131
132 /// Required. The SSH public key and expiration time.
133 pub ssh_public_key: std::option::Option<google_cloud_oslogin_common::model::SshPublicKey>,
134
135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
136}
137
138impl CreateSshPublicKeyRequest {
139 /// Creates a new default instance.
140 pub fn new() -> Self {
141 std::default::Default::default()
142 }
143
144 /// Sets the value of [parent][crate::model::CreateSshPublicKeyRequest::parent].
145 ///
146 /// # Example
147 /// ```ignore,no_run
148 /// # use google_cloud_oslogin_v1::model::CreateSshPublicKeyRequest;
149 /// # let user_id = "user_id";
150 /// let x = CreateSshPublicKeyRequest::new().set_parent(format!("users/{user_id}"));
151 /// ```
152 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
153 self.parent = v.into();
154 self
155 }
156
157 /// Sets the value of [ssh_public_key][crate::model::CreateSshPublicKeyRequest::ssh_public_key].
158 ///
159 /// # Example
160 /// ```ignore,no_run
161 /// # use google_cloud_oslogin_v1::model::CreateSshPublicKeyRequest;
162 /// use google_cloud_oslogin_common::model::SshPublicKey;
163 /// let x = CreateSshPublicKeyRequest::new().set_ssh_public_key(SshPublicKey::default()/* use setters */);
164 /// ```
165 pub fn set_ssh_public_key<T>(mut self, v: T) -> Self
166 where
167 T: std::convert::Into<google_cloud_oslogin_common::model::SshPublicKey>,
168 {
169 self.ssh_public_key = std::option::Option::Some(v.into());
170 self
171 }
172
173 /// Sets or clears the value of [ssh_public_key][crate::model::CreateSshPublicKeyRequest::ssh_public_key].
174 ///
175 /// # Example
176 /// ```ignore,no_run
177 /// # use google_cloud_oslogin_v1::model::CreateSshPublicKeyRequest;
178 /// use google_cloud_oslogin_common::model::SshPublicKey;
179 /// let x = CreateSshPublicKeyRequest::new().set_or_clear_ssh_public_key(Some(SshPublicKey::default()/* use setters */));
180 /// let x = CreateSshPublicKeyRequest::new().set_or_clear_ssh_public_key(None::<SshPublicKey>);
181 /// ```
182 pub fn set_or_clear_ssh_public_key<T>(mut self, v: std::option::Option<T>) -> Self
183 where
184 T: std::convert::Into<google_cloud_oslogin_common::model::SshPublicKey>,
185 {
186 self.ssh_public_key = v.map(|x| x.into());
187 self
188 }
189}
190
191impl wkt::message::Message for CreateSshPublicKeyRequest {
192 fn typename() -> &'static str {
193 "type.googleapis.com/google.cloud.oslogin.v1.CreateSshPublicKeyRequest"
194 }
195}
196
197/// A request message for deleting a POSIX account entry.
198#[derive(Clone, Default, PartialEq)]
199#[non_exhaustive]
200pub struct DeletePosixAccountRequest {
201 /// Required. A reference to the POSIX account to update. POSIX accounts are
202 /// identified by the project ID they are associated with. A reference to the
203 /// POSIX account is in format `users/{user}/projects/{project}`.
204 pub name: std::string::String,
205
206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
207}
208
209impl DeletePosixAccountRequest {
210 /// Creates a new default instance.
211 pub fn new() -> Self {
212 std::default::Default::default()
213 }
214
215 /// Sets the value of [name][crate::model::DeletePosixAccountRequest::name].
216 ///
217 /// # Example
218 /// ```ignore,no_run
219 /// # use google_cloud_oslogin_v1::model::DeletePosixAccountRequest;
220 /// # let user_id = "user_id";
221 /// # let project_id = "project_id";
222 /// let x = DeletePosixAccountRequest::new().set_name(format!("users/{user_id}/projects/{project_id}"));
223 /// ```
224 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
225 self.name = v.into();
226 self
227 }
228}
229
230impl wkt::message::Message for DeletePosixAccountRequest {
231 fn typename() -> &'static str {
232 "type.googleapis.com/google.cloud.oslogin.v1.DeletePosixAccountRequest"
233 }
234}
235
236/// A request message for deleting an SSH public key.
237#[derive(Clone, Default, PartialEq)]
238#[non_exhaustive]
239pub struct DeleteSshPublicKeyRequest {
240 /// Required. The fingerprint of the public key to update. Public keys are
241 /// identified by their SHA-256 fingerprint. The fingerprint of the public key
242 /// is in format `users/{user}/sshPublicKeys/{fingerprint}`.
243 pub name: std::string::String,
244
245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
246}
247
248impl DeleteSshPublicKeyRequest {
249 /// Creates a new default instance.
250 pub fn new() -> Self {
251 std::default::Default::default()
252 }
253
254 /// Sets the value of [name][crate::model::DeleteSshPublicKeyRequest::name].
255 ///
256 /// # Example
257 /// ```ignore,no_run
258 /// # use google_cloud_oslogin_v1::model::DeleteSshPublicKeyRequest;
259 /// # let user_id = "user_id";
260 /// # let fingerprint_id = "fingerprint_id";
261 /// let x = DeleteSshPublicKeyRequest::new().set_name(format!("users/{user_id}/sshPublicKeys/{fingerprint_id}"));
262 /// ```
263 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
264 self.name = v.into();
265 self
266 }
267}
268
269impl wkt::message::Message for DeleteSshPublicKeyRequest {
270 fn typename() -> &'static str {
271 "type.googleapis.com/google.cloud.oslogin.v1.DeleteSshPublicKeyRequest"
272 }
273}
274
275/// A request message for retrieving the login profile information for a user.
276#[derive(Clone, Default, PartialEq)]
277#[non_exhaustive]
278pub struct GetLoginProfileRequest {
279 /// Required. The unique ID for the user in format `users/{user}`.
280 pub name: std::string::String,
281
282 /// The project ID of the Google Cloud Platform project.
283 pub project_id: std::string::String,
284
285 /// A system ID for filtering the results of the request.
286 pub system_id: std::string::String,
287
288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
289}
290
291impl GetLoginProfileRequest {
292 /// Creates a new default instance.
293 pub fn new() -> Self {
294 std::default::Default::default()
295 }
296
297 /// Sets the value of [name][crate::model::GetLoginProfileRequest::name].
298 ///
299 /// # Example
300 /// ```ignore,no_run
301 /// # use google_cloud_oslogin_v1::model::GetLoginProfileRequest;
302 /// # let user_id = "user_id";
303 /// let x = GetLoginProfileRequest::new().set_name(format!("users/{user_id}"));
304 /// ```
305 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
306 self.name = v.into();
307 self
308 }
309
310 /// Sets the value of [project_id][crate::model::GetLoginProfileRequest::project_id].
311 ///
312 /// # Example
313 /// ```ignore,no_run
314 /// # use google_cloud_oslogin_v1::model::GetLoginProfileRequest;
315 /// let x = GetLoginProfileRequest::new().set_project_id("example");
316 /// ```
317 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
318 self.project_id = v.into();
319 self
320 }
321
322 /// Sets the value of [system_id][crate::model::GetLoginProfileRequest::system_id].
323 ///
324 /// # Example
325 /// ```ignore,no_run
326 /// # use google_cloud_oslogin_v1::model::GetLoginProfileRequest;
327 /// let x = GetLoginProfileRequest::new().set_system_id("example");
328 /// ```
329 pub fn set_system_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
330 self.system_id = v.into();
331 self
332 }
333}
334
335impl wkt::message::Message for GetLoginProfileRequest {
336 fn typename() -> &'static str {
337 "type.googleapis.com/google.cloud.oslogin.v1.GetLoginProfileRequest"
338 }
339}
340
341/// A request message for retrieving an SSH public key.
342#[derive(Clone, Default, PartialEq)]
343#[non_exhaustive]
344pub struct GetSshPublicKeyRequest {
345 /// Required. The fingerprint of the public key to retrieve. Public keys are
346 /// identified by their SHA-256 fingerprint. The fingerprint of the public key
347 /// is in format `users/{user}/sshPublicKeys/{fingerprint}`.
348 pub name: std::string::String,
349
350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
351}
352
353impl GetSshPublicKeyRequest {
354 /// Creates a new default instance.
355 pub fn new() -> Self {
356 std::default::Default::default()
357 }
358
359 /// Sets the value of [name][crate::model::GetSshPublicKeyRequest::name].
360 ///
361 /// # Example
362 /// ```ignore,no_run
363 /// # use google_cloud_oslogin_v1::model::GetSshPublicKeyRequest;
364 /// # let user_id = "user_id";
365 /// # let fingerprint_id = "fingerprint_id";
366 /// let x = GetSshPublicKeyRequest::new().set_name(format!("users/{user_id}/sshPublicKeys/{fingerprint_id}"));
367 /// ```
368 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
369 self.name = v.into();
370 self
371 }
372}
373
374impl wkt::message::Message for GetSshPublicKeyRequest {
375 fn typename() -> &'static str {
376 "type.googleapis.com/google.cloud.oslogin.v1.GetSshPublicKeyRequest"
377 }
378}
379
380/// A request message for importing an SSH public key.
381#[derive(Clone, Default, PartialEq)]
382#[non_exhaustive]
383pub struct ImportSshPublicKeyRequest {
384 /// Required. The unique ID for the user in format `users/{user}`.
385 pub parent: std::string::String,
386
387 /// Optional. The SSH public key and expiration time.
388 pub ssh_public_key: std::option::Option<google_cloud_oslogin_common::model::SshPublicKey>,
389
390 /// The project ID of the Google Cloud Platform project.
391 pub project_id: std::string::String,
392
393 /// Optional. The regions to which to assert that the key was written.
394 /// If unspecified, defaults to all regions.
395 /// Regions are listed at <https://cloud.google.com/about/locations#region>.
396 pub regions: std::vec::Vec<std::string::String>,
397
398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
399}
400
401impl ImportSshPublicKeyRequest {
402 /// Creates a new default instance.
403 pub fn new() -> Self {
404 std::default::Default::default()
405 }
406
407 /// Sets the value of [parent][crate::model::ImportSshPublicKeyRequest::parent].
408 ///
409 /// # Example
410 /// ```ignore,no_run
411 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyRequest;
412 /// # let user_id = "user_id";
413 /// let x = ImportSshPublicKeyRequest::new().set_parent(format!("users/{user_id}"));
414 /// ```
415 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
416 self.parent = v.into();
417 self
418 }
419
420 /// Sets the value of [ssh_public_key][crate::model::ImportSshPublicKeyRequest::ssh_public_key].
421 ///
422 /// # Example
423 /// ```ignore,no_run
424 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyRequest;
425 /// use google_cloud_oslogin_common::model::SshPublicKey;
426 /// let x = ImportSshPublicKeyRequest::new().set_ssh_public_key(SshPublicKey::default()/* use setters */);
427 /// ```
428 pub fn set_ssh_public_key<T>(mut self, v: T) -> Self
429 where
430 T: std::convert::Into<google_cloud_oslogin_common::model::SshPublicKey>,
431 {
432 self.ssh_public_key = std::option::Option::Some(v.into());
433 self
434 }
435
436 /// Sets or clears the value of [ssh_public_key][crate::model::ImportSshPublicKeyRequest::ssh_public_key].
437 ///
438 /// # Example
439 /// ```ignore,no_run
440 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyRequest;
441 /// use google_cloud_oslogin_common::model::SshPublicKey;
442 /// let x = ImportSshPublicKeyRequest::new().set_or_clear_ssh_public_key(Some(SshPublicKey::default()/* use setters */));
443 /// let x = ImportSshPublicKeyRequest::new().set_or_clear_ssh_public_key(None::<SshPublicKey>);
444 /// ```
445 pub fn set_or_clear_ssh_public_key<T>(mut self, v: std::option::Option<T>) -> Self
446 where
447 T: std::convert::Into<google_cloud_oslogin_common::model::SshPublicKey>,
448 {
449 self.ssh_public_key = v.map(|x| x.into());
450 self
451 }
452
453 /// Sets the value of [project_id][crate::model::ImportSshPublicKeyRequest::project_id].
454 ///
455 /// # Example
456 /// ```ignore,no_run
457 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyRequest;
458 /// let x = ImportSshPublicKeyRequest::new().set_project_id("example");
459 /// ```
460 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
461 self.project_id = v.into();
462 self
463 }
464
465 /// Sets the value of [regions][crate::model::ImportSshPublicKeyRequest::regions].
466 ///
467 /// # Example
468 /// ```ignore,no_run
469 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyRequest;
470 /// let x = ImportSshPublicKeyRequest::new().set_regions(["a", "b", "c"]);
471 /// ```
472 pub fn set_regions<T, V>(mut self, v: T) -> Self
473 where
474 T: std::iter::IntoIterator<Item = V>,
475 V: std::convert::Into<std::string::String>,
476 {
477 use std::iter::Iterator;
478 self.regions = v.into_iter().map(|i| i.into()).collect();
479 self
480 }
481}
482
483impl wkt::message::Message for ImportSshPublicKeyRequest {
484 fn typename() -> &'static str {
485 "type.googleapis.com/google.cloud.oslogin.v1.ImportSshPublicKeyRequest"
486 }
487}
488
489/// A response message for importing an SSH public key.
490#[derive(Clone, Default, PartialEq)]
491#[non_exhaustive]
492pub struct ImportSshPublicKeyResponse {
493 /// The login profile information for the user.
494 pub login_profile: std::option::Option<crate::model::LoginProfile>,
495
496 /// Detailed information about import results.
497 pub details: std::string::String,
498
499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
500}
501
502impl ImportSshPublicKeyResponse {
503 /// Creates a new default instance.
504 pub fn new() -> Self {
505 std::default::Default::default()
506 }
507
508 /// Sets the value of [login_profile][crate::model::ImportSshPublicKeyResponse::login_profile].
509 ///
510 /// # Example
511 /// ```ignore,no_run
512 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyResponse;
513 /// use google_cloud_oslogin_v1::model::LoginProfile;
514 /// let x = ImportSshPublicKeyResponse::new().set_login_profile(LoginProfile::default()/* use setters */);
515 /// ```
516 pub fn set_login_profile<T>(mut self, v: T) -> Self
517 where
518 T: std::convert::Into<crate::model::LoginProfile>,
519 {
520 self.login_profile = std::option::Option::Some(v.into());
521 self
522 }
523
524 /// Sets or clears the value of [login_profile][crate::model::ImportSshPublicKeyResponse::login_profile].
525 ///
526 /// # Example
527 /// ```ignore,no_run
528 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyResponse;
529 /// use google_cloud_oslogin_v1::model::LoginProfile;
530 /// let x = ImportSshPublicKeyResponse::new().set_or_clear_login_profile(Some(LoginProfile::default()/* use setters */));
531 /// let x = ImportSshPublicKeyResponse::new().set_or_clear_login_profile(None::<LoginProfile>);
532 /// ```
533 pub fn set_or_clear_login_profile<T>(mut self, v: std::option::Option<T>) -> Self
534 where
535 T: std::convert::Into<crate::model::LoginProfile>,
536 {
537 self.login_profile = v.map(|x| x.into());
538 self
539 }
540
541 /// Sets the value of [details][crate::model::ImportSshPublicKeyResponse::details].
542 ///
543 /// # Example
544 /// ```ignore,no_run
545 /// # use google_cloud_oslogin_v1::model::ImportSshPublicKeyResponse;
546 /// let x = ImportSshPublicKeyResponse::new().set_details("example");
547 /// ```
548 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
549 self.details = v.into();
550 self
551 }
552}
553
554impl wkt::message::Message for ImportSshPublicKeyResponse {
555 fn typename() -> &'static str {
556 "type.googleapis.com/google.cloud.oslogin.v1.ImportSshPublicKeyResponse"
557 }
558}
559
560/// A request message for updating an SSH public key.
561#[derive(Clone, Default, PartialEq)]
562#[non_exhaustive]
563pub struct UpdateSshPublicKeyRequest {
564 /// Required. The fingerprint of the public key to update. Public keys are
565 /// identified by their SHA-256 fingerprint. The fingerprint of the public key
566 /// is in format `users/{user}/sshPublicKeys/{fingerprint}`.
567 pub name: std::string::String,
568
569 /// Required. The SSH public key and expiration time.
570 pub ssh_public_key: std::option::Option<google_cloud_oslogin_common::model::SshPublicKey>,
571
572 /// Mask to control which fields get updated. Updates all if not present.
573 pub update_mask: std::option::Option<wkt::FieldMask>,
574
575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
576}
577
578impl UpdateSshPublicKeyRequest {
579 /// Creates a new default instance.
580 pub fn new() -> Self {
581 std::default::Default::default()
582 }
583
584 /// Sets the value of [name][crate::model::UpdateSshPublicKeyRequest::name].
585 ///
586 /// # Example
587 /// ```ignore,no_run
588 /// # use google_cloud_oslogin_v1::model::UpdateSshPublicKeyRequest;
589 /// # let user_id = "user_id";
590 /// # let fingerprint_id = "fingerprint_id";
591 /// let x = UpdateSshPublicKeyRequest::new().set_name(format!("users/{user_id}/sshPublicKeys/{fingerprint_id}"));
592 /// ```
593 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
594 self.name = v.into();
595 self
596 }
597
598 /// Sets the value of [ssh_public_key][crate::model::UpdateSshPublicKeyRequest::ssh_public_key].
599 ///
600 /// # Example
601 /// ```ignore,no_run
602 /// # use google_cloud_oslogin_v1::model::UpdateSshPublicKeyRequest;
603 /// use google_cloud_oslogin_common::model::SshPublicKey;
604 /// let x = UpdateSshPublicKeyRequest::new().set_ssh_public_key(SshPublicKey::default()/* use setters */);
605 /// ```
606 pub fn set_ssh_public_key<T>(mut self, v: T) -> Self
607 where
608 T: std::convert::Into<google_cloud_oslogin_common::model::SshPublicKey>,
609 {
610 self.ssh_public_key = std::option::Option::Some(v.into());
611 self
612 }
613
614 /// Sets or clears the value of [ssh_public_key][crate::model::UpdateSshPublicKeyRequest::ssh_public_key].
615 ///
616 /// # Example
617 /// ```ignore,no_run
618 /// # use google_cloud_oslogin_v1::model::UpdateSshPublicKeyRequest;
619 /// use google_cloud_oslogin_common::model::SshPublicKey;
620 /// let x = UpdateSshPublicKeyRequest::new().set_or_clear_ssh_public_key(Some(SshPublicKey::default()/* use setters */));
621 /// let x = UpdateSshPublicKeyRequest::new().set_or_clear_ssh_public_key(None::<SshPublicKey>);
622 /// ```
623 pub fn set_or_clear_ssh_public_key<T>(mut self, v: std::option::Option<T>) -> Self
624 where
625 T: std::convert::Into<google_cloud_oslogin_common::model::SshPublicKey>,
626 {
627 self.ssh_public_key = v.map(|x| x.into());
628 self
629 }
630
631 /// Sets the value of [update_mask][crate::model::UpdateSshPublicKeyRequest::update_mask].
632 ///
633 /// # Example
634 /// ```ignore,no_run
635 /// # use google_cloud_oslogin_v1::model::UpdateSshPublicKeyRequest;
636 /// use wkt::FieldMask;
637 /// let x = UpdateSshPublicKeyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
638 /// ```
639 pub fn set_update_mask<T>(mut self, v: T) -> Self
640 where
641 T: std::convert::Into<wkt::FieldMask>,
642 {
643 self.update_mask = std::option::Option::Some(v.into());
644 self
645 }
646
647 /// Sets or clears the value of [update_mask][crate::model::UpdateSshPublicKeyRequest::update_mask].
648 ///
649 /// # Example
650 /// ```ignore,no_run
651 /// # use google_cloud_oslogin_v1::model::UpdateSshPublicKeyRequest;
652 /// use wkt::FieldMask;
653 /// let x = UpdateSshPublicKeyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
654 /// let x = UpdateSshPublicKeyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
655 /// ```
656 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
657 where
658 T: std::convert::Into<wkt::FieldMask>,
659 {
660 self.update_mask = v.map(|x| x.into());
661 self
662 }
663}
664
665impl wkt::message::Message for UpdateSshPublicKeyRequest {
666 fn typename() -> &'static str {
667 "type.googleapis.com/google.cloud.oslogin.v1.UpdateSshPublicKeyRequest"
668 }
669}