google_cloud_apihub_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 gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// The [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request.
41///
42/// [google.cloud.apihub.v1.ApiHub.CreateApi]: crate::client::ApiHub::create_api
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct CreateApiRequest {
46    /// Required. The parent resource for the API resource.
47    /// Format: `projects/{project}/locations/{location}`
48    pub parent: std::string::String,
49
50    /// Optional. The ID to use for the API resource, which will become the final
51    /// component of the API's resource name. This field is optional.
52    ///
53    /// * If provided, the same will be used. The service will throw an error if
54    ///   the specified id is already used by another API resource in the API hub.
55    /// * If not provided, a system generated id will be used.
56    ///
57    /// This value should be 4-500 characters, and valid characters
58    /// are /[a-z][A-Z][0-9]-_/.
59    pub api_id: std::string::String,
60
61    /// Required. The API resource to create.
62    pub api: std::option::Option<crate::model::Api>,
63
64    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
65}
66
67impl CreateApiRequest {
68    pub fn new() -> Self {
69        std::default::Default::default()
70    }
71
72    /// Sets the value of [parent][crate::model::CreateApiRequest::parent].
73    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74        self.parent = v.into();
75        self
76    }
77
78    /// Sets the value of [api_id][crate::model::CreateApiRequest::api_id].
79    pub fn set_api_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
80        self.api_id = v.into();
81        self
82    }
83
84    /// Sets the value of [api][crate::model::CreateApiRequest::api].
85    pub fn set_api<T>(mut self, v: T) -> Self
86    where
87        T: std::convert::Into<crate::model::Api>,
88    {
89        self.api = std::option::Option::Some(v.into());
90        self
91    }
92
93    /// Sets or clears the value of [api][crate::model::CreateApiRequest::api].
94    pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
95    where
96        T: std::convert::Into<crate::model::Api>,
97    {
98        self.api = v.map(|x| x.into());
99        self
100    }
101}
102
103impl wkt::message::Message for CreateApiRequest {
104    fn typename() -> &'static str {
105        "type.googleapis.com/google.cloud.apihub.v1.CreateApiRequest"
106    }
107}
108
109/// The [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request.
110///
111/// [google.cloud.apihub.v1.ApiHub.GetApi]: crate::client::ApiHub::get_api
112#[derive(Clone, Default, PartialEq)]
113#[non_exhaustive]
114pub struct GetApiRequest {
115    /// Required. The name of the API resource to retrieve.
116    /// Format: `projects/{project}/locations/{location}/apis/{api}`
117    pub name: std::string::String,
118
119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
120}
121
122impl GetApiRequest {
123    pub fn new() -> Self {
124        std::default::Default::default()
125    }
126
127    /// Sets the value of [name][crate::model::GetApiRequest::name].
128    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
129        self.name = v.into();
130        self
131    }
132}
133
134impl wkt::message::Message for GetApiRequest {
135    fn typename() -> &'static str {
136        "type.googleapis.com/google.cloud.apihub.v1.GetApiRequest"
137    }
138}
139
140/// The [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request.
141///
142/// [google.cloud.apihub.v1.ApiHub.UpdateApi]: crate::client::ApiHub::update_api
143#[derive(Clone, Default, PartialEq)]
144#[non_exhaustive]
145pub struct UpdateApiRequest {
146    /// Required. The API resource to update.
147    ///
148    /// The API resource's `name` field is used to identify the API resource to
149    /// update.
150    /// Format: `projects/{project}/locations/{location}/apis/{api}`
151    pub api: std::option::Option<crate::model::Api>,
152
153    /// Required. The list of fields to update.
154    pub update_mask: std::option::Option<wkt::FieldMask>,
155
156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
157}
158
159impl UpdateApiRequest {
160    pub fn new() -> Self {
161        std::default::Default::default()
162    }
163
164    /// Sets the value of [api][crate::model::UpdateApiRequest::api].
165    pub fn set_api<T>(mut self, v: T) -> Self
166    where
167        T: std::convert::Into<crate::model::Api>,
168    {
169        self.api = std::option::Option::Some(v.into());
170        self
171    }
172
173    /// Sets or clears the value of [api][crate::model::UpdateApiRequest::api].
174    pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
175    where
176        T: std::convert::Into<crate::model::Api>,
177    {
178        self.api = v.map(|x| x.into());
179        self
180    }
181
182    /// Sets the value of [update_mask][crate::model::UpdateApiRequest::update_mask].
183    pub fn set_update_mask<T>(mut self, v: T) -> Self
184    where
185        T: std::convert::Into<wkt::FieldMask>,
186    {
187        self.update_mask = std::option::Option::Some(v.into());
188        self
189    }
190
191    /// Sets or clears the value of [update_mask][crate::model::UpdateApiRequest::update_mask].
192    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
193    where
194        T: std::convert::Into<wkt::FieldMask>,
195    {
196        self.update_mask = v.map(|x| x.into());
197        self
198    }
199}
200
201impl wkt::message::Message for UpdateApiRequest {
202    fn typename() -> &'static str {
203        "type.googleapis.com/google.cloud.apihub.v1.UpdateApiRequest"
204    }
205}
206
207/// The [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request.
208///
209/// [google.cloud.apihub.v1.ApiHub.DeleteApi]: crate::client::ApiHub::delete_api
210#[derive(Clone, Default, PartialEq)]
211#[non_exhaustive]
212pub struct DeleteApiRequest {
213    /// Required. The name of the API resource to delete.
214    /// Format: `projects/{project}/locations/{location}/apis/{api}`
215    pub name: std::string::String,
216
217    /// Optional. If set to true, any versions from this API will also be deleted.
218    /// Otherwise, the request will only work if the API has no versions.
219    pub force: bool,
220
221    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
222}
223
224impl DeleteApiRequest {
225    pub fn new() -> Self {
226        std::default::Default::default()
227    }
228
229    /// Sets the value of [name][crate::model::DeleteApiRequest::name].
230    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
231        self.name = v.into();
232        self
233    }
234
235    /// Sets the value of [force][crate::model::DeleteApiRequest::force].
236    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
237        self.force = v.into();
238        self
239    }
240}
241
242impl wkt::message::Message for DeleteApiRequest {
243    fn typename() -> &'static str {
244        "type.googleapis.com/google.cloud.apihub.v1.DeleteApiRequest"
245    }
246}
247
248/// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request.
249///
250/// [google.cloud.apihub.v1.ApiHub.ListApis]: crate::client::ApiHub::list_apis
251#[derive(Clone, Default, PartialEq)]
252#[non_exhaustive]
253pub struct ListApisRequest {
254    /// Required. The parent, which owns this collection of API resources.
255    /// Format: `projects/{project}/locations/{location}`
256    pub parent: std::string::String,
257
258    /// Optional. An expression that filters the list of ApiResources.
259    ///
260    /// A filter expression consists of a field name, a comparison
261    /// operator, and a value for filtering. The value must be a string. The
262    /// comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
263    /// case sensitive.
264    ///
265    /// The following fields in the `ApiResource` are eligible for filtering:
266    ///
267    /// * `owner.email` - The email of the team which owns the ApiResource.
268    ///   Allowed comparison operators: `=`.
269    /// * `create_time` - The time at which the ApiResource was created. The
270    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
271    ///   format. Allowed comparison operators: `>` and `<`.
272    /// * `display_name` - The display name of the ApiResource. Allowed
273    ///   comparison operators: `=`.
274    /// * `target_user.enum_values.values.id` - The allowed value id of the
275    ///   target users attribute associated with the ApiResource. Allowed
276    ///   comparison operator is `:`.
277    /// * `target_user.enum_values.values.display_name` - The allowed value
278    ///   display name of the target users attribute associated with the
279    ///   ApiResource. Allowed comparison operator is `:`.
280    /// * `team.enum_values.values.id` - The allowed value id of the team
281    ///   attribute associated with the ApiResource. Allowed comparison operator is
282    ///   `:`.
283    /// * `team.enum_values.values.display_name` - The allowed value display name
284    ///   of the team attribute associated with the ApiResource. Allowed comparison
285    ///   operator is `:`.
286    /// * `business_unit.enum_values.values.id` - The allowed value id of the
287    ///   business unit attribute associated with the ApiResource. Allowed
288    ///   comparison operator is `:`.
289    /// * `business_unit.enum_values.values.display_name` - The allowed value
290    ///   display name of the business unit attribute associated with the
291    ///   ApiResource. Allowed comparison operator is `:`.
292    /// * `maturity_level.enum_values.values.id` - The allowed value id of the
293    ///   maturity level attribute associated with the ApiResource. Allowed
294    ///   comparison operator is `:`.
295    /// * `maturity_level.enum_values.values.display_name` - The allowed value
296    ///   display name of the maturity level attribute associated with the
297    ///   ApiResource. Allowed comparison operator is `:`.
298    /// * `api_style.enum_values.values.id` - The allowed value id of the
299    ///   api style attribute associated with the ApiResource. Allowed
300    ///   comparison operator is `:`.
301    /// * `api_style.enum_values.values.display_name` - The allowed value display
302    ///   name of the api style attribute associated with the ApiResource. Allowed
303    ///   comparison operator is `:`.
304    /// * `attributes.projects/test-project-id/locations/test-location-id/
305    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
306    ///   allowed value id of the user defined enum attribute associated with the
307    ///   Resource. Allowed comparison operator is `:`. Here
308    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
309    ///   any user defined enum attribute name.
310    /// * `attributes.projects/test-project-id/locations/test-location-id/
311    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
312    ///
313    /// - The allowed value display name of the user defined enum attribute
314    ///   associated with the Resource. Allowed comparison operator is `:`. Here
315    ///   user-defined-attribute-enum-display-name is a placeholder that can be
316    ///   replaced with any user defined enum attribute enum name.
317    ///
318    /// * `attributes.projects/test-project-id/locations/test-location-id/
319    ///   attributes/user-defined-attribute-id.string_values.values` - The
320    ///   allowed value of the user defined string attribute associated with the
321    ///   Resource. Allowed comparison operator is `:`. Here
322    ///   user-defined-attribute-string is a placeholder that can be replaced with
323    ///   any user defined string attribute name.
324    /// * `attributes.projects/test-project-id/locations/test-location-id/
325    ///   attributes/user-defined-attribute-id.json_values.values` - The
326    ///   allowed value of the user defined JSON attribute associated with the
327    ///   Resource. Allowed comparison operator is `:`. Here
328    ///   user-defined-attribute-json is a placeholder that can be replaced with
329    ///   any user defined JSON attribute name.
330    ///
331    /// A filter function is also supported in the filter string. The filter
332    /// function is `id(name)`. The `id(name)` function returns the id of the
333    /// resource name. For example, `id(name) = \"api-1\"` is equivalent to
334    /// `name = \"projects/test-project-id/locations/test-location-id/apis/api-1\"`
335    /// provided the parent is
336    /// `projects/test-project-id/locations/test-location-id`.
337    ///
338    /// Expressions are combined with either `AND` logic operator or `OR` logical
339    /// operator but not both of them together i.e. only one of the `AND` or `OR`
340    /// operator can be used throughout the filter string and both the operators
341    /// cannot be used together. No other logical operators are supported. At most
342    /// three filter fields are allowed in the filter string and if provided
343    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
344    ///
345    /// Here are a few examples:
346    ///
347    /// * `owner.email = \"apihub@google.com\"` -  - The owner team email is
348    ///   _apihub@google.com_.
349    /// * `owner.email = \"apihub@google.com\" AND create_time <
350    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
351    ///   The owner team email is _apihub@google.com_ and the api was created
352    ///   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
353    /// * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
354    ///   apihub-team-id` - The filter string specifies the APIs where the owner
355    ///   team email is _apihub@google.com_ or the id of the allowed value
356    ///   associated with the team attribute is _apihub-team-id_.
357    /// * `owner.email = \"apihub@google.com\" OR
358    ///   team.enum_values.values.display_name: ApiHub Team` - The filter string
359    ///   specifies the APIs where the owner team email is _apihub@google.com_ or
360    ///   the display name of the allowed value associated with the team attribute
361    ///   is `ApiHub Team`.
362    /// * `owner.email = \"apihub@google.com\" AND
363    ///   attributes.projects/test-project-id/locations/test-location-id/
364    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.enum_values.values.id:
365    ///   test_enum_id AND
366    ///   attributes.projects/test-project-id/locations/test-location-id/
367    ///   attributes/1765\0f90-4a29-5431-b3d0-d5532da3764c.string_values.values:
368    ///   test_string_value`  - The filter string specifies the APIs where the
369    ///   owner team email is _apihub@google.com_ and the id of the allowed value
370    ///   associated with the user defined attribute of type enum is _test_enum_id_
371    ///   and the value of the user defined attribute of type string is _test_..
372    pub filter: std::string::String,
373
374    /// Optional. The maximum number of API resources to return. The service may
375    /// return fewer than this value. If unspecified, at most 50 Apis will be
376    /// returned. The maximum value is 1000; values above 1000 will be coerced to
377    /// 1000.
378    pub page_size: i32,
379
380    /// Optional. A page token, received from a previous `ListApis` call.
381    /// Provide this to retrieve the subsequent page.
382    ///
383    /// When paginating, all other parameters (except page_size) provided to
384    /// `ListApis` must match the call that provided the page token.
385    pub page_token: std::string::String,
386
387    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
388}
389
390impl ListApisRequest {
391    pub fn new() -> Self {
392        std::default::Default::default()
393    }
394
395    /// Sets the value of [parent][crate::model::ListApisRequest::parent].
396    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
397        self.parent = v.into();
398        self
399    }
400
401    /// Sets the value of [filter][crate::model::ListApisRequest::filter].
402    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
403        self.filter = v.into();
404        self
405    }
406
407    /// Sets the value of [page_size][crate::model::ListApisRequest::page_size].
408    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
409        self.page_size = v.into();
410        self
411    }
412
413    /// Sets the value of [page_token][crate::model::ListApisRequest::page_token].
414    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
415        self.page_token = v.into();
416        self
417    }
418}
419
420impl wkt::message::Message for ListApisRequest {
421    fn typename() -> &'static str {
422        "type.googleapis.com/google.cloud.apihub.v1.ListApisRequest"
423    }
424}
425
426/// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response.
427///
428/// [google.cloud.apihub.v1.ApiHub.ListApis]: crate::client::ApiHub::list_apis
429#[derive(Clone, Default, PartialEq)]
430#[non_exhaustive]
431pub struct ListApisResponse {
432    /// The API resources present in the API hub.
433    pub apis: std::vec::Vec<crate::model::Api>,
434
435    /// A token, which can be sent as `page_token` to retrieve the next page.
436    /// If this field is omitted, there are no subsequent pages.
437    pub next_page_token: std::string::String,
438
439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
440}
441
442impl ListApisResponse {
443    pub fn new() -> Self {
444        std::default::Default::default()
445    }
446
447    /// Sets the value of [apis][crate::model::ListApisResponse::apis].
448    pub fn set_apis<T, V>(mut self, v: T) -> Self
449    where
450        T: std::iter::IntoIterator<Item = V>,
451        V: std::convert::Into<crate::model::Api>,
452    {
453        use std::iter::Iterator;
454        self.apis = v.into_iter().map(|i| i.into()).collect();
455        self
456    }
457
458    /// Sets the value of [next_page_token][crate::model::ListApisResponse::next_page_token].
459    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
460        self.next_page_token = v.into();
461        self
462    }
463}
464
465impl wkt::message::Message for ListApisResponse {
466    fn typename() -> &'static str {
467        "type.googleapis.com/google.cloud.apihub.v1.ListApisResponse"
468    }
469}
470
471#[doc(hidden)]
472impl gax::paginator::internal::PageableResponse for ListApisResponse {
473    type PageItem = crate::model::Api;
474
475    fn items(self) -> std::vec::Vec<Self::PageItem> {
476        self.apis
477    }
478
479    fn next_page_token(&self) -> std::string::String {
480        use std::clone::Clone;
481        self.next_page_token.clone()
482    }
483}
484
485/// The [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's
486/// request.
487///
488/// [google.cloud.apihub.v1.ApiHub.CreateVersion]: crate::client::ApiHub::create_version
489#[derive(Clone, Default, PartialEq)]
490#[non_exhaustive]
491pub struct CreateVersionRequest {
492    /// Required. The parent resource for API version.
493    /// Format: `projects/{project}/locations/{location}/apis/{api}`
494    pub parent: std::string::String,
495
496    /// Optional. The ID to use for the API version, which will become the final
497    /// component of the version's resource name. This field is optional.
498    ///
499    /// * If provided, the same will be used. The service will throw an error if
500    ///   the specified id is already used by another version in the API resource.
501    /// * If not provided, a system generated id will be used.
502    ///
503    /// This value should be 4-500 characters, overall resource name which will be
504    /// of format
505    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`,
506    /// its length is limited to 700 characters and valid characters are
507    /// /[a-z][A-Z][0-9]-_/.
508    pub version_id: std::string::String,
509
510    /// Required. The version to create.
511    pub version: std::option::Option<crate::model::Version>,
512
513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
514}
515
516impl CreateVersionRequest {
517    pub fn new() -> Self {
518        std::default::Default::default()
519    }
520
521    /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
522    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
523        self.parent = v.into();
524        self
525    }
526
527    /// Sets the value of [version_id][crate::model::CreateVersionRequest::version_id].
528    pub fn set_version_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
529        self.version_id = v.into();
530        self
531    }
532
533    /// Sets the value of [version][crate::model::CreateVersionRequest::version].
534    pub fn set_version<T>(mut self, v: T) -> Self
535    where
536        T: std::convert::Into<crate::model::Version>,
537    {
538        self.version = std::option::Option::Some(v.into());
539        self
540    }
541
542    /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
543    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
544    where
545        T: std::convert::Into<crate::model::Version>,
546    {
547        self.version = v.map(|x| x.into());
548        self
549    }
550}
551
552impl wkt::message::Message for CreateVersionRequest {
553    fn typename() -> &'static str {
554        "type.googleapis.com/google.cloud.apihub.v1.CreateVersionRequest"
555    }
556}
557
558/// The [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request.
559///
560/// [google.cloud.apihub.v1.ApiHub.GetVersion]: crate::client::ApiHub::get_version
561#[derive(Clone, Default, PartialEq)]
562#[non_exhaustive]
563pub struct GetVersionRequest {
564    /// Required. The name of the API version to retrieve.
565    /// Format:
566    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
567    pub name: std::string::String,
568
569    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
570}
571
572impl GetVersionRequest {
573    pub fn new() -> Self {
574        std::default::Default::default()
575    }
576
577    /// Sets the value of [name][crate::model::GetVersionRequest::name].
578    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
579        self.name = v.into();
580        self
581    }
582}
583
584impl wkt::message::Message for GetVersionRequest {
585    fn typename() -> &'static str {
586        "type.googleapis.com/google.cloud.apihub.v1.GetVersionRequest"
587    }
588}
589
590/// The [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's
591/// request.
592///
593/// [google.cloud.apihub.v1.ApiHub.UpdateVersion]: crate::client::ApiHub::update_version
594#[derive(Clone, Default, PartialEq)]
595#[non_exhaustive]
596pub struct UpdateVersionRequest {
597    /// Required. The API version to update.
598    ///
599    /// The version's `name` field is used to identify the API version to update.
600    /// Format:
601    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
602    pub version: std::option::Option<crate::model::Version>,
603
604    /// Required. The list of fields to update.
605    pub update_mask: std::option::Option<wkt::FieldMask>,
606
607    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
608}
609
610impl UpdateVersionRequest {
611    pub fn new() -> Self {
612        std::default::Default::default()
613    }
614
615    /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
616    pub fn set_version<T>(mut self, v: T) -> Self
617    where
618        T: std::convert::Into<crate::model::Version>,
619    {
620        self.version = std::option::Option::Some(v.into());
621        self
622    }
623
624    /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
625    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
626    where
627        T: std::convert::Into<crate::model::Version>,
628    {
629        self.version = v.map(|x| x.into());
630        self
631    }
632
633    /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
634    pub fn set_update_mask<T>(mut self, v: T) -> Self
635    where
636        T: std::convert::Into<wkt::FieldMask>,
637    {
638        self.update_mask = std::option::Option::Some(v.into());
639        self
640    }
641
642    /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
643    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
644    where
645        T: std::convert::Into<wkt::FieldMask>,
646    {
647        self.update_mask = v.map(|x| x.into());
648        self
649    }
650}
651
652impl wkt::message::Message for UpdateVersionRequest {
653    fn typename() -> &'static str {
654        "type.googleapis.com/google.cloud.apihub.v1.UpdateVersionRequest"
655    }
656}
657
658/// The [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's
659/// request.
660///
661/// [google.cloud.apihub.v1.ApiHub.DeleteVersion]: crate::client::ApiHub::delete_version
662#[derive(Clone, Default, PartialEq)]
663#[non_exhaustive]
664pub struct DeleteVersionRequest {
665    /// Required. The name of the version to delete.
666    /// Format:
667    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
668    pub name: std::string::String,
669
670    /// Optional. If set to true, any specs from this version will also be deleted.
671    /// Otherwise, the request will only work if the version has no specs.
672    pub force: bool,
673
674    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
675}
676
677impl DeleteVersionRequest {
678    pub fn new() -> Self {
679        std::default::Default::default()
680    }
681
682    /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
683    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
684        self.name = v.into();
685        self
686    }
687
688    /// Sets the value of [force][crate::model::DeleteVersionRequest::force].
689    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
690        self.force = v.into();
691        self
692    }
693}
694
695impl wkt::message::Message for DeleteVersionRequest {
696    fn typename() -> &'static str {
697        "type.googleapis.com/google.cloud.apihub.v1.DeleteVersionRequest"
698    }
699}
700
701/// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
702/// request.
703///
704/// [google.cloud.apihub.v1.ApiHub.ListVersions]: crate::client::ApiHub::list_versions
705#[derive(Clone, Default, PartialEq)]
706#[non_exhaustive]
707pub struct ListVersionsRequest {
708    /// Required. The parent which owns this collection of API versions i.e., the
709    /// API resource Format: `projects/{project}/locations/{location}/apis/{api}`
710    pub parent: std::string::String,
711
712    /// Optional. An expression that filters the list of Versions.
713    ///
714    /// A filter expression consists of a field name, a comparison
715    /// operator, and a value for filtering. The value must be a string, a
716    /// number, or a boolean. The comparison operator must be one of: `<`, `>` or
717    /// `=`. Filters are not case sensitive.
718    ///
719    /// The following fields in the `Version` are eligible for filtering:
720    ///
721    /// * `display_name` - The display name of the Version. Allowed
722    ///   comparison operators: `=`.
723    /// * `create_time` - The time at which the Version was created. The
724    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
725    ///   format. Allowed comparison operators: `>` and `<`.
726    /// * `lifecycle.enum_values.values.id` - The allowed value id of the
727    ///   lifecycle attribute associated with the Version. Allowed comparison
728    ///   operators: `:`.
729    /// * `lifecycle.enum_values.values.display_name` - The allowed value display
730    ///   name of the lifecycle attribute associated with the Version. Allowed
731    ///   comparison operators: `:`.
732    /// * `compliance.enum_values.values.id` -  The allowed value id of the
733    ///   compliances attribute associated with the Version. Allowed comparison
734    ///   operators: `:`.
735    /// * `compliance.enum_values.values.display_name` -  The allowed value
736    ///   display name of the compliances attribute associated with the Version.
737    ///   Allowed comparison operators: `:`.
738    /// * `accreditation.enum_values.values.id` - The allowed value id of the
739    ///   accreditations attribute associated with the Version. Allowed
740    ///   comparison operators: `:`.
741    /// * `accreditation.enum_values.values.display_name` - The allowed value
742    ///   display name of the accreditations attribute associated with the Version.
743    ///   Allowed comparison operators: `:`.
744    /// * `attributes.projects/test-project-id/locations/test-location-id/
745    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
746    ///   allowed value id of the user defined enum attribute associated with the
747    ///   Resource. Allowed comparison operator is `:`. Here
748    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
749    ///   any user defined enum attribute name.
750    /// * `attributes.projects/test-project-id/locations/test-location-id/
751    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
752    ///
753    /// - The allowed value display name of the user defined enum attribute
754    ///   associated with the Resource. Allowed comparison operator is `:`. Here
755    ///   user-defined-attribute-enum-display-name is a placeholder that can be
756    ///   replaced with any user defined enum attribute enum name.
757    ///
758    /// * `attributes.projects/test-project-id/locations/test-location-id/
759    ///   attributes/user-defined-attribute-id.string_values.values` - The
760    ///   allowed value of the user defined string attribute associated with the
761    ///   Resource. Allowed comparison operator is `:`. Here
762    ///   user-defined-attribute-string is a placeholder that can be replaced with
763    ///   any user defined string attribute name.
764    /// * `attributes.projects/test-project-id/locations/test-location-id/
765    ///   attributes/user-defined-attribute-id.json_values.values` - The
766    ///   allowed value of the user defined JSON attribute associated with the
767    ///   Resource. Allowed comparison operator is `:`. Here
768    ///   user-defined-attribute-json is a placeholder that can be replaced with
769    ///   any user defined JSON attribute name.
770    ///
771    /// Expressions are combined with either `AND` logic operator or `OR` logical
772    /// operator but not both of them together i.e. only one of the `AND` or `OR`
773    /// operator can be used throughout the filter string and both the operators
774    /// cannot be used together. No other logical operators are
775    /// supported. At most three filter fields are allowed in the filter
776    /// string and if provided more than that then `INVALID_ARGUMENT` error is
777    /// returned by the API.
778    ///
779    /// Here are a few examples:
780    ///
781    /// * `lifecycle.enum_values.values.id: preview-id` - The filter string
782    ///   specifies that the id of the allowed value associated with the lifecycle
783    ///   attribute of the Version is _preview-id_.
784    /// * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
785    ///   The filter string specifies that the display name of the allowed value
786    ///   associated with the lifecycle attribute of the Version is `Preview
787    ///   Display Name`.
788    /// * `lifecycle.enum_values.values.id: preview-id AND create_time <
789    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
790    ///   The id of the allowed value associated with the lifecycle attribute of
791    ///   the Version is _preview-id_ and it was created before _2021-08-15
792    ///   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
793    /// * `compliance.enum_values.values.id: gdpr-id OR
794    ///   compliance.enum_values.values.id: pci-dss-id`
795    ///
796    /// - The id of the allowed value associated with the compliance attribute is
797    ///   _gdpr-id_ or _pci-dss-id_.
798    ///
799    /// * `lifecycle.enum_values.values.id: preview-id AND
800    ///   attributes.projects/test-project-id/locations/test-location-id/
801    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.string_values.values:
802    ///   test`  - The filter string specifies that the id of the allowed value
803    ///   associated with the lifecycle attribute of the Version is _preview-id_
804    ///   and the value of the user defined attribute of type string is _test_.
805    pub filter: std::string::String,
806
807    /// Optional. The maximum number of versions to return. The service may return
808    /// fewer than this value. If unspecified, at most 50 versions will be
809    /// returned. The maximum value is 1000; values above 1000 will be coerced to
810    /// 1000.
811    pub page_size: i32,
812
813    /// Optional. A page token, received from a previous `ListVersions` call.
814    /// Provide this to retrieve the subsequent page.
815    ///
816    /// When paginating, all other parameters (except page_size) provided to
817    /// `ListVersions` must match the call that provided the page token.
818    pub page_token: std::string::String,
819
820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
821}
822
823impl ListVersionsRequest {
824    pub fn new() -> Self {
825        std::default::Default::default()
826    }
827
828    /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
829    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
830        self.parent = v.into();
831        self
832    }
833
834    /// Sets the value of [filter][crate::model::ListVersionsRequest::filter].
835    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
836        self.filter = v.into();
837        self
838    }
839
840    /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
841    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
842        self.page_size = v.into();
843        self
844    }
845
846    /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
847    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
848        self.page_token = v.into();
849        self
850    }
851}
852
853impl wkt::message::Message for ListVersionsRequest {
854    fn typename() -> &'static str {
855        "type.googleapis.com/google.cloud.apihub.v1.ListVersionsRequest"
856    }
857}
858
859/// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
860/// response.
861///
862/// [google.cloud.apihub.v1.ApiHub.ListVersions]: crate::client::ApiHub::list_versions
863#[derive(Clone, Default, PartialEq)]
864#[non_exhaustive]
865pub struct ListVersionsResponse {
866    /// The versions corresponding to an API.
867    pub versions: std::vec::Vec<crate::model::Version>,
868
869    /// A token, which can be sent as `page_token` to retrieve the next page.
870    /// If this field is omitted, there are no subsequent pages.
871    pub next_page_token: std::string::String,
872
873    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
874}
875
876impl ListVersionsResponse {
877    pub fn new() -> Self {
878        std::default::Default::default()
879    }
880
881    /// Sets the value of [versions][crate::model::ListVersionsResponse::versions].
882    pub fn set_versions<T, V>(mut self, v: T) -> Self
883    where
884        T: std::iter::IntoIterator<Item = V>,
885        V: std::convert::Into<crate::model::Version>,
886    {
887        use std::iter::Iterator;
888        self.versions = v.into_iter().map(|i| i.into()).collect();
889        self
890    }
891
892    /// Sets the value of [next_page_token][crate::model::ListVersionsResponse::next_page_token].
893    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
894        self.next_page_token = v.into();
895        self
896    }
897}
898
899impl wkt::message::Message for ListVersionsResponse {
900    fn typename() -> &'static str {
901        "type.googleapis.com/google.cloud.apihub.v1.ListVersionsResponse"
902    }
903}
904
905#[doc(hidden)]
906impl gax::paginator::internal::PageableResponse for ListVersionsResponse {
907    type PageItem = crate::model::Version;
908
909    fn items(self) -> std::vec::Vec<Self::PageItem> {
910        self.versions
911    }
912
913    fn next_page_token(&self) -> std::string::String {
914        use std::clone::Clone;
915        self.next_page_token.clone()
916    }
917}
918
919/// The [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request.
920///
921/// [google.cloud.apihub.v1.ApiHub.CreateSpec]: crate::client::ApiHub::create_spec
922#[derive(Clone, Default, PartialEq)]
923#[non_exhaustive]
924pub struct CreateSpecRequest {
925    /// Required. The parent resource for Spec.
926    /// Format:
927    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
928    pub parent: std::string::String,
929
930    /// Optional. The ID to use for the spec, which will become the final component
931    /// of the spec's resource name. This field is optional.
932    ///
933    /// * If provided, the same will be used. The service will throw an error if
934    ///   the specified id is already used by another spec in the API
935    ///   resource.
936    /// * If not provided, a system generated id will be used.
937    ///
938    /// This value should be 4-500 characters, overall resource name which will be
939    /// of format
940    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`,
941    /// its length is limited to 1000 characters and valid characters are
942    /// /[a-z][A-Z][0-9]-_/.
943    pub spec_id: std::string::String,
944
945    /// Required. The spec to create.
946    pub spec: std::option::Option<crate::model::Spec>,
947
948    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
949}
950
951impl CreateSpecRequest {
952    pub fn new() -> Self {
953        std::default::Default::default()
954    }
955
956    /// Sets the value of [parent][crate::model::CreateSpecRequest::parent].
957    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
958        self.parent = v.into();
959        self
960    }
961
962    /// Sets the value of [spec_id][crate::model::CreateSpecRequest::spec_id].
963    pub fn set_spec_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
964        self.spec_id = v.into();
965        self
966    }
967
968    /// Sets the value of [spec][crate::model::CreateSpecRequest::spec].
969    pub fn set_spec<T>(mut self, v: T) -> Self
970    where
971        T: std::convert::Into<crate::model::Spec>,
972    {
973        self.spec = std::option::Option::Some(v.into());
974        self
975    }
976
977    /// Sets or clears the value of [spec][crate::model::CreateSpecRequest::spec].
978    pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
979    where
980        T: std::convert::Into<crate::model::Spec>,
981    {
982        self.spec = v.map(|x| x.into());
983        self
984    }
985}
986
987impl wkt::message::Message for CreateSpecRequest {
988    fn typename() -> &'static str {
989        "type.googleapis.com/google.cloud.apihub.v1.CreateSpecRequest"
990    }
991}
992
993/// The [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request.
994///
995/// [google.cloud.apihub.v1.ApiHub.GetSpec]: crate::client::ApiHub::get_spec
996#[derive(Clone, Default, PartialEq)]
997#[non_exhaustive]
998pub struct GetSpecRequest {
999    /// Required. The name of the spec to retrieve.
1000    /// Format:
1001    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
1002    pub name: std::string::String,
1003
1004    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1005}
1006
1007impl GetSpecRequest {
1008    pub fn new() -> Self {
1009        std::default::Default::default()
1010    }
1011
1012    /// Sets the value of [name][crate::model::GetSpecRequest::name].
1013    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1014        self.name = v.into();
1015        self
1016    }
1017}
1018
1019impl wkt::message::Message for GetSpecRequest {
1020    fn typename() -> &'static str {
1021        "type.googleapis.com/google.cloud.apihub.v1.GetSpecRequest"
1022    }
1023}
1024
1025/// The [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request.
1026///
1027/// [google.cloud.apihub.v1.ApiHub.UpdateSpec]: crate::client::ApiHub::update_spec
1028#[derive(Clone, Default, PartialEq)]
1029#[non_exhaustive]
1030pub struct UpdateSpecRequest {
1031    /// Required. The spec to update.
1032    ///
1033    /// The spec's `name` field is used to identify the spec to
1034    /// update. Format:
1035    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
1036    pub spec: std::option::Option<crate::model::Spec>,
1037
1038    /// Required. The list of fields to update.
1039    pub update_mask: std::option::Option<wkt::FieldMask>,
1040
1041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1042}
1043
1044impl UpdateSpecRequest {
1045    pub fn new() -> Self {
1046        std::default::Default::default()
1047    }
1048
1049    /// Sets the value of [spec][crate::model::UpdateSpecRequest::spec].
1050    pub fn set_spec<T>(mut self, v: T) -> Self
1051    where
1052        T: std::convert::Into<crate::model::Spec>,
1053    {
1054        self.spec = std::option::Option::Some(v.into());
1055        self
1056    }
1057
1058    /// Sets or clears the value of [spec][crate::model::UpdateSpecRequest::spec].
1059    pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
1060    where
1061        T: std::convert::Into<crate::model::Spec>,
1062    {
1063        self.spec = v.map(|x| x.into());
1064        self
1065    }
1066
1067    /// Sets the value of [update_mask][crate::model::UpdateSpecRequest::update_mask].
1068    pub fn set_update_mask<T>(mut self, v: T) -> Self
1069    where
1070        T: std::convert::Into<wkt::FieldMask>,
1071    {
1072        self.update_mask = std::option::Option::Some(v.into());
1073        self
1074    }
1075
1076    /// Sets or clears the value of [update_mask][crate::model::UpdateSpecRequest::update_mask].
1077    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1078    where
1079        T: std::convert::Into<wkt::FieldMask>,
1080    {
1081        self.update_mask = v.map(|x| x.into());
1082        self
1083    }
1084}
1085
1086impl wkt::message::Message for UpdateSpecRequest {
1087    fn typename() -> &'static str {
1088        "type.googleapis.com/google.cloud.apihub.v1.UpdateSpecRequest"
1089    }
1090}
1091
1092/// The [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request.
1093///
1094/// [google.cloud.apihub.v1.ApiHub.DeleteSpec]: crate::client::ApiHub::delete_spec
1095#[derive(Clone, Default, PartialEq)]
1096#[non_exhaustive]
1097pub struct DeleteSpecRequest {
1098    /// Required. The name of the spec  to delete.
1099    /// Format:
1100    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
1101    pub name: std::string::String,
1102
1103    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1104}
1105
1106impl DeleteSpecRequest {
1107    pub fn new() -> Self {
1108        std::default::Default::default()
1109    }
1110
1111    /// Sets the value of [name][crate::model::DeleteSpecRequest::name].
1112    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1113        self.name = v.into();
1114        self
1115    }
1116}
1117
1118impl wkt::message::Message for DeleteSpecRequest {
1119    fn typename() -> &'static str {
1120        "type.googleapis.com/google.cloud.apihub.v1.DeleteSpecRequest"
1121    }
1122}
1123
1124/// The [ListSpecs][ListSpecs] method's request.
1125#[derive(Clone, Default, PartialEq)]
1126#[non_exhaustive]
1127pub struct ListSpecsRequest {
1128    /// Required. The parent, which owns this collection of specs.
1129    /// Format:
1130    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
1131    pub parent: std::string::String,
1132
1133    /// Optional. An expression that filters the list of Specs.
1134    ///
1135    /// A filter expression consists of a field name, a comparison
1136    /// operator, and a value for filtering. The value must be a string. The
1137    /// comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
1138    /// case sensitive.
1139    ///
1140    /// The following fields in the `Spec` are eligible for filtering:
1141    ///
1142    /// * `display_name` - The display name of the Spec. Allowed comparison
1143    ///   operators: `=`.
1144    /// * `create_time` - The time at which the Spec was created. The
1145    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
1146    ///   format. Allowed comparison operators: `>` and `<`.
1147    /// * `spec_type.enum_values.values.id` - The allowed value id of the
1148    ///   spec_type attribute associated with the Spec. Allowed comparison
1149    ///   operators: `:`.
1150    /// * `spec_type.enum_values.values.display_name` - The allowed value display
1151    ///   name of the spec_type attribute associated with the Spec. Allowed
1152    ///   comparison operators: `:`.
1153    /// * `lint_response.json_values.values` - The json value of the
1154    ///   lint_response attribute associated with the Spec. Allowed comparison
1155    ///   operators: `:`.
1156    /// * `mime_type` - The MIME type of the Spec. Allowed comparison
1157    ///   operators: `=`.
1158    /// * `attributes.projects/test-project-id/locations/test-location-id/
1159    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
1160    ///   allowed value id of the user defined enum attribute associated with the
1161    ///   Resource. Allowed comparison operator is `:`. Here
1162    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
1163    ///   any user defined enum attribute name.
1164    /// * `attributes.projects/test-project-id/locations/test-location-id/
1165    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
1166    ///
1167    /// - The allowed value display name of the user defined enum attribute
1168    ///   associated with the Resource. Allowed comparison operator is `:`. Here
1169    ///   user-defined-attribute-enum-display-name is a placeholder that can be
1170    ///   replaced with any user defined enum attribute enum name.
1171    ///
1172    /// * `attributes.projects/test-project-id/locations/test-location-id/
1173    ///   attributes/user-defined-attribute-id.string_values.values` - The
1174    ///   allowed value of the user defined string attribute associated with the
1175    ///   Resource. Allowed comparison operator is `:`. Here
1176    ///   user-defined-attribute-string is a placeholder that can be replaced with
1177    ///   any user defined string attribute name.
1178    /// * `attributes.projects/test-project-id/locations/test-location-id/
1179    ///   attributes/user-defined-attribute-id.json_values.values` - The
1180    ///   allowed value of the user defined JSON attribute associated with the
1181    ///   Resource. Allowed comparison operator is `:`. Here
1182    ///   user-defined-attribute-json is a placeholder that can be replaced with
1183    ///   any user defined JSON attribute name.
1184    ///
1185    /// Expressions are combined with either `AND` logic operator or `OR` logical
1186    /// operator but not both of them together i.e. only one of the `AND` or `OR`
1187    /// operator can be used throughout the filter string and both the operators
1188    /// cannot be used together. No other logical operators are
1189    /// supported. At most three filter fields are allowed in the filter
1190    /// string and if provided more than that then `INVALID_ARGUMENT` error is
1191    /// returned by the API.
1192    ///
1193    /// Here are a few examples:
1194    ///
1195    /// * `spec_type.enum_values.values.id: rest-id` -  The filter
1196    ///   string specifies that the id of the allowed value associated with the
1197    ///   spec_type attribute is _rest-id_.
1198    /// * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
1199    ///   The filter string specifies that the display name of the allowed value
1200    ///   associated with the spec_type attribute is `Rest Display Name`.
1201    /// * `spec_type.enum_values.values.id: grpc-id AND create_time <
1202    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
1203    ///   The id of the allowed value associated with the spec_type attribute is
1204    ///   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
1205    ///   after _2021-08-10 12:00:00 UTC_.
1206    /// * `spec_type.enum_values.values.id: rest-id OR
1207    ///   spec_type.enum_values.values.id: grpc-id`
1208    ///
1209    /// - The id of the allowed value associated with the spec_type attribute is
1210    ///   _rest-id_ or _grpc-id_.
1211    ///
1212    /// * `spec_type.enum_values.values.id: rest-id AND
1213    ///   attributes.projects/test-project-id/locations/test-location-id/
1214    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.enum_values.values.id:
1215    ///   test`  - The filter string specifies that the id of the allowed value
1216    ///   associated with the spec_type attribute is _rest-id_ and the id of the
1217    ///   allowed value associated with the user defined attribute of type enum is
1218    ///   _test_.
1219    pub filter: std::string::String,
1220
1221    /// Optional. The maximum number of specs to return. The service may return
1222    /// fewer than this value. If unspecified, at most 50 specs will be
1223    /// returned. The maximum value is 1000; values above 1000 will be coerced to
1224    /// 1000.
1225    pub page_size: i32,
1226
1227    /// Optional. A page token, received from a previous `ListSpecs` call.
1228    /// Provide this to retrieve the subsequent page.
1229    ///
1230    /// When paginating, all other parameters provided to `ListSpecs` must
1231    /// match the call that provided the page token.
1232    pub page_token: std::string::String,
1233
1234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1235}
1236
1237impl ListSpecsRequest {
1238    pub fn new() -> Self {
1239        std::default::Default::default()
1240    }
1241
1242    /// Sets the value of [parent][crate::model::ListSpecsRequest::parent].
1243    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1244        self.parent = v.into();
1245        self
1246    }
1247
1248    /// Sets the value of [filter][crate::model::ListSpecsRequest::filter].
1249    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1250        self.filter = v.into();
1251        self
1252    }
1253
1254    /// Sets the value of [page_size][crate::model::ListSpecsRequest::page_size].
1255    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1256        self.page_size = v.into();
1257        self
1258    }
1259
1260    /// Sets the value of [page_token][crate::model::ListSpecsRequest::page_token].
1261    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1262        self.page_token = v.into();
1263        self
1264    }
1265}
1266
1267impl wkt::message::Message for ListSpecsRequest {
1268    fn typename() -> &'static str {
1269        "type.googleapis.com/google.cloud.apihub.v1.ListSpecsRequest"
1270    }
1271}
1272
1273/// The [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response.
1274///
1275/// [google.cloud.apihub.v1.ApiHub.ListSpecs]: crate::client::ApiHub::list_specs
1276#[derive(Clone, Default, PartialEq)]
1277#[non_exhaustive]
1278pub struct ListSpecsResponse {
1279    /// The specs corresponding to an API Version.
1280    pub specs: std::vec::Vec<crate::model::Spec>,
1281
1282    /// A token, which can be sent as `page_token` to retrieve the next page.
1283    /// If this field is omitted, there are no subsequent pages.
1284    pub next_page_token: std::string::String,
1285
1286    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1287}
1288
1289impl ListSpecsResponse {
1290    pub fn new() -> Self {
1291        std::default::Default::default()
1292    }
1293
1294    /// Sets the value of [specs][crate::model::ListSpecsResponse::specs].
1295    pub fn set_specs<T, V>(mut self, v: T) -> Self
1296    where
1297        T: std::iter::IntoIterator<Item = V>,
1298        V: std::convert::Into<crate::model::Spec>,
1299    {
1300        use std::iter::Iterator;
1301        self.specs = v.into_iter().map(|i| i.into()).collect();
1302        self
1303    }
1304
1305    /// Sets the value of [next_page_token][crate::model::ListSpecsResponse::next_page_token].
1306    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1307        self.next_page_token = v.into();
1308        self
1309    }
1310}
1311
1312impl wkt::message::Message for ListSpecsResponse {
1313    fn typename() -> &'static str {
1314        "type.googleapis.com/google.cloud.apihub.v1.ListSpecsResponse"
1315    }
1316}
1317
1318#[doc(hidden)]
1319impl gax::paginator::internal::PageableResponse for ListSpecsResponse {
1320    type PageItem = crate::model::Spec;
1321
1322    fn items(self) -> std::vec::Vec<Self::PageItem> {
1323        self.specs
1324    }
1325
1326    fn next_page_token(&self) -> std::string::String {
1327        use std::clone::Clone;
1328        self.next_page_token.clone()
1329    }
1330}
1331
1332/// The [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's
1333/// request.
1334///
1335/// [google.cloud.apihub.v1.ApiHub.GetSpecContents]: crate::client::ApiHub::get_spec_contents
1336#[derive(Clone, Default, PartialEq)]
1337#[non_exhaustive]
1338pub struct GetSpecContentsRequest {
1339    /// Required. The name of the spec whose contents need to be retrieved.
1340    /// Format:
1341    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
1342    pub name: std::string::String,
1343
1344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1345}
1346
1347impl GetSpecContentsRequest {
1348    pub fn new() -> Self {
1349        std::default::Default::default()
1350    }
1351
1352    /// Sets the value of [name][crate::model::GetSpecContentsRequest::name].
1353    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1354        self.name = v.into();
1355        self
1356    }
1357}
1358
1359impl wkt::message::Message for GetSpecContentsRequest {
1360    fn typename() -> &'static str {
1361        "type.googleapis.com/google.cloud.apihub.v1.GetSpecContentsRequest"
1362    }
1363}
1364
1365/// The [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
1366/// method's request.
1367///
1368/// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
1369#[derive(Clone, Default, PartialEq)]
1370#[non_exhaustive]
1371pub struct CreateApiOperationRequest {
1372    /// Required. The parent resource for the operation resource.
1373    /// Format:
1374    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
1375    pub parent: std::string::String,
1376
1377    /// Optional. The ID to use for the operation resource, which will become the
1378    /// final component of the operation's resource name. This field is optional.
1379    ///
1380    /// * If provided, the same will be used. The service will throw an error if
1381    ///   the specified id is already used by another operation resource in the API
1382    ///   hub.
1383    /// * If not provided, a system generated id will be used.
1384    ///
1385    /// This value should be 4-500 characters, overall resource name which
1386    /// will be of format
1387    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`,
1388    /// its length is limited to 700 characters, and valid characters are
1389    /// /[a-z][A-Z][0-9]-_/.
1390    pub api_operation_id: std::string::String,
1391
1392    /// Required. The operation resource to create.
1393    pub api_operation: std::option::Option<crate::model::ApiOperation>,
1394
1395    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1396}
1397
1398impl CreateApiOperationRequest {
1399    pub fn new() -> Self {
1400        std::default::Default::default()
1401    }
1402
1403    /// Sets the value of [parent][crate::model::CreateApiOperationRequest::parent].
1404    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1405        self.parent = v.into();
1406        self
1407    }
1408
1409    /// Sets the value of [api_operation_id][crate::model::CreateApiOperationRequest::api_operation_id].
1410    pub fn set_api_operation_id<T: std::convert::Into<std::string::String>>(
1411        mut self,
1412        v: T,
1413    ) -> Self {
1414        self.api_operation_id = v.into();
1415        self
1416    }
1417
1418    /// Sets the value of [api_operation][crate::model::CreateApiOperationRequest::api_operation].
1419    pub fn set_api_operation<T>(mut self, v: T) -> Self
1420    where
1421        T: std::convert::Into<crate::model::ApiOperation>,
1422    {
1423        self.api_operation = std::option::Option::Some(v.into());
1424        self
1425    }
1426
1427    /// Sets or clears the value of [api_operation][crate::model::CreateApiOperationRequest::api_operation].
1428    pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1429    where
1430        T: std::convert::Into<crate::model::ApiOperation>,
1431    {
1432        self.api_operation = v.map(|x| x.into());
1433        self
1434    }
1435}
1436
1437impl wkt::message::Message for CreateApiOperationRequest {
1438    fn typename() -> &'static str {
1439        "type.googleapis.com/google.cloud.apihub.v1.CreateApiOperationRequest"
1440    }
1441}
1442
1443/// The [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's
1444/// request.
1445///
1446/// [google.cloud.apihub.v1.ApiHub.GetApiOperation]: crate::client::ApiHub::get_api_operation
1447#[derive(Clone, Default, PartialEq)]
1448#[non_exhaustive]
1449pub struct GetApiOperationRequest {
1450    /// Required. The name of the operation to retrieve.
1451    /// Format:
1452    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
1453    pub name: std::string::String,
1454
1455    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1456}
1457
1458impl GetApiOperationRequest {
1459    pub fn new() -> Self {
1460        std::default::Default::default()
1461    }
1462
1463    /// Sets the value of [name][crate::model::GetApiOperationRequest::name].
1464    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1465        self.name = v.into();
1466        self
1467    }
1468}
1469
1470impl wkt::message::Message for GetApiOperationRequest {
1471    fn typename() -> &'static str {
1472        "type.googleapis.com/google.cloud.apihub.v1.GetApiOperationRequest"
1473    }
1474}
1475
1476/// The [UpdateApiOperation][google.cloud.apihub.v1.ApiHub.UpdateApiOperation]
1477/// method's request.
1478///
1479/// [google.cloud.apihub.v1.ApiHub.UpdateApiOperation]: crate::client::ApiHub::update_api_operation
1480#[derive(Clone, Default, PartialEq)]
1481#[non_exhaustive]
1482pub struct UpdateApiOperationRequest {
1483    /// Required. The apiOperation resource to update.
1484    ///
1485    /// The operation resource's `name` field is used to identify the operation
1486    /// resource to update.
1487    /// Format:
1488    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
1489    pub api_operation: std::option::Option<crate::model::ApiOperation>,
1490
1491    /// Required. The list of fields to update.
1492    pub update_mask: std::option::Option<wkt::FieldMask>,
1493
1494    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1495}
1496
1497impl UpdateApiOperationRequest {
1498    pub fn new() -> Self {
1499        std::default::Default::default()
1500    }
1501
1502    /// Sets the value of [api_operation][crate::model::UpdateApiOperationRequest::api_operation].
1503    pub fn set_api_operation<T>(mut self, v: T) -> Self
1504    where
1505        T: std::convert::Into<crate::model::ApiOperation>,
1506    {
1507        self.api_operation = std::option::Option::Some(v.into());
1508        self
1509    }
1510
1511    /// Sets or clears the value of [api_operation][crate::model::UpdateApiOperationRequest::api_operation].
1512    pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1513    where
1514        T: std::convert::Into<crate::model::ApiOperation>,
1515    {
1516        self.api_operation = v.map(|x| x.into());
1517        self
1518    }
1519
1520    /// Sets the value of [update_mask][crate::model::UpdateApiOperationRequest::update_mask].
1521    pub fn set_update_mask<T>(mut self, v: T) -> Self
1522    where
1523        T: std::convert::Into<wkt::FieldMask>,
1524    {
1525        self.update_mask = std::option::Option::Some(v.into());
1526        self
1527    }
1528
1529    /// Sets or clears the value of [update_mask][crate::model::UpdateApiOperationRequest::update_mask].
1530    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1531    where
1532        T: std::convert::Into<wkt::FieldMask>,
1533    {
1534        self.update_mask = v.map(|x| x.into());
1535        self
1536    }
1537}
1538
1539impl wkt::message::Message for UpdateApiOperationRequest {
1540    fn typename() -> &'static str {
1541        "type.googleapis.com/google.cloud.apihub.v1.UpdateApiOperationRequest"
1542    }
1543}
1544
1545/// The [DeleteApiOperation][google.cloud.apihub.v1.ApiHub.DeleteApiOperation]
1546/// method's request.
1547///
1548/// [google.cloud.apihub.v1.ApiHub.DeleteApiOperation]: crate::client::ApiHub::delete_api_operation
1549#[derive(Clone, Default, PartialEq)]
1550#[non_exhaustive]
1551pub struct DeleteApiOperationRequest {
1552    /// Required. The name of the operation resource to delete.
1553    /// Format:
1554    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
1555    pub name: std::string::String,
1556
1557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1558}
1559
1560impl DeleteApiOperationRequest {
1561    pub fn new() -> Self {
1562        std::default::Default::default()
1563    }
1564
1565    /// Sets the value of [name][crate::model::DeleteApiOperationRequest::name].
1566    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567        self.name = v.into();
1568        self
1569    }
1570}
1571
1572impl wkt::message::Message for DeleteApiOperationRequest {
1573    fn typename() -> &'static str {
1574        "type.googleapis.com/google.cloud.apihub.v1.DeleteApiOperationRequest"
1575    }
1576}
1577
1578/// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
1579/// method's request.
1580///
1581/// [google.cloud.apihub.v1.ApiHub.ListApiOperations]: crate::client::ApiHub::list_api_operations
1582#[derive(Clone, Default, PartialEq)]
1583#[non_exhaustive]
1584pub struct ListApiOperationsRequest {
1585    /// Required. The parent which owns this collection of operations i.e., the API
1586    /// version. Format:
1587    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
1588    pub parent: std::string::String,
1589
1590    /// Optional. An expression that filters the list of ApiOperations.
1591    ///
1592    /// A filter expression consists of a field name, a comparison
1593    /// operator, and a value for filtering. The value must be a string or a
1594    /// boolean. The comparison operator must be one of: `<`, `>` or
1595    /// `=`. Filters are not case sensitive.
1596    ///
1597    /// The following fields in the `ApiOperation` are eligible for filtering:
1598    ///
1599    /// * `name` - The ApiOperation resource name. Allowed comparison
1600    ///   operators:
1601    ///   `=`.
1602    /// * `details.http_operation.path.path` - The http operation's complete path
1603    ///   relative to server endpoint. Allowed comparison operators: `=`.
1604    /// * `details.http_operation.method` - The http operation method type.
1605    ///   Allowed comparison operators: `=`.
1606    /// * `details.deprecated` - Indicates if the ApiOperation is deprecated.
1607    ///   Allowed values are True / False indicating the deprycation status of the
1608    ///   ApiOperation. Allowed comparison operators: `=`.
1609    /// * `create_time` - The time at which the ApiOperation was created. The
1610    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
1611    ///   format. Allowed comparison operators: `>` and `<`.
1612    /// * `attributes.projects/test-project-id/locations/test-location-id/
1613    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
1614    ///   allowed value id of the user defined enum attribute associated with the
1615    ///   Resource. Allowed comparison operator is `:`. Here
1616    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
1617    ///   any user defined enum attribute name.
1618    /// * `attributes.projects/test-project-id/locations/test-location-id/
1619    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
1620    ///
1621    /// - The allowed value display name of the user defined enum attribute
1622    ///   associated with the Resource. Allowed comparison operator is `:`. Here
1623    ///   user-defined-attribute-enum-display-name is a placeholder that can be
1624    ///   replaced with any user defined enum attribute enum name.
1625    ///
1626    /// * `attributes.projects/test-project-id/locations/test-location-id/
1627    ///   attributes/user-defined-attribute-id.string_values.values` - The
1628    ///   allowed value of the user defined string attribute associated with the
1629    ///   Resource. Allowed comparison operator is `:`. Here
1630    ///   user-defined-attribute-string is a placeholder that can be replaced with
1631    ///   any user defined string attribute name.
1632    /// * `attributes.projects/test-project-id/locations/test-location-id/
1633    ///   attributes/user-defined-attribute-id.json_values.values` - The
1634    ///   allowed value of the user defined JSON attribute associated with the
1635    ///   Resource. Allowed comparison operator is `:`. Here
1636    ///   user-defined-attribute-json is a placeholder that can be replaced with
1637    ///   any user defined JSON attribute name.
1638    ///
1639    /// Expressions are combined with either `AND` logic operator or `OR` logical
1640    /// operator but not both of them together i.e. only one of the `AND` or `OR`
1641    /// operator can be used throughout the filter string and both the operators
1642    /// cannot be used together. No other logical operators are supported. At most
1643    /// three filter fields are allowed in the filter string and if provided
1644    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
1645    ///
1646    /// Here are a few examples:
1647    ///
1648    /// * `details.deprecated = True` -  The ApiOperation is deprecated.
1649    /// * `details.http_operation.method = GET AND create_time <
1650    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
1651    ///   The method of the http operation of the ApiOperation is _GET_ and the
1652    ///   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
1653    ///   12:00:00 UTC_.
1654    /// * `details.http_operation.method = GET OR details.http_operation.method =
1655    ///   POST`. - The http operation of the method of ApiOperation is _GET_ or
1656    ///   _POST_.
1657    /// * `details.deprecated = True AND
1658    ///   attributes.projects/test-project-id/locations/test-location-id/
1659    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.string_values.values:
1660    ///   test`  - The filter string specifies that the ApiOperation is deprecated
1661    ///   and the value of the user defined attribute of type string is _test_.
1662    pub filter: std::string::String,
1663
1664    /// Optional. The maximum number of operations to return. The service may
1665    /// return fewer than this value. If unspecified, at most 50 operations will be
1666    /// returned. The maximum value is 1000; values above 1000 will be coerced to
1667    /// 1000.
1668    pub page_size: i32,
1669
1670    /// Optional. A page token, received from a previous `ListApiOperations` call.
1671    /// Provide this to retrieve the subsequent page.
1672    ///
1673    /// When paginating, all other parameters (except page_size) provided to
1674    /// `ListApiOperations` must match the call that provided the page token.
1675    pub page_token: std::string::String,
1676
1677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1678}
1679
1680impl ListApiOperationsRequest {
1681    pub fn new() -> Self {
1682        std::default::Default::default()
1683    }
1684
1685    /// Sets the value of [parent][crate::model::ListApiOperationsRequest::parent].
1686    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1687        self.parent = v.into();
1688        self
1689    }
1690
1691    /// Sets the value of [filter][crate::model::ListApiOperationsRequest::filter].
1692    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1693        self.filter = v.into();
1694        self
1695    }
1696
1697    /// Sets the value of [page_size][crate::model::ListApiOperationsRequest::page_size].
1698    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1699        self.page_size = v.into();
1700        self
1701    }
1702
1703    /// Sets the value of [page_token][crate::model::ListApiOperationsRequest::page_token].
1704    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1705        self.page_token = v.into();
1706        self
1707    }
1708}
1709
1710impl wkt::message::Message for ListApiOperationsRequest {
1711    fn typename() -> &'static str {
1712        "type.googleapis.com/google.cloud.apihub.v1.ListApiOperationsRequest"
1713    }
1714}
1715
1716/// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
1717/// method's response.
1718///
1719/// [google.cloud.apihub.v1.ApiHub.ListApiOperations]: crate::client::ApiHub::list_api_operations
1720#[derive(Clone, Default, PartialEq)]
1721#[non_exhaustive]
1722pub struct ListApiOperationsResponse {
1723    /// The operations corresponding to an API version.
1724    pub api_operations: std::vec::Vec<crate::model::ApiOperation>,
1725
1726    /// A token, which can be sent as `page_token` to retrieve the next page.
1727    /// If this field is omitted, there are no subsequent pages.
1728    pub next_page_token: std::string::String,
1729
1730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1731}
1732
1733impl ListApiOperationsResponse {
1734    pub fn new() -> Self {
1735        std::default::Default::default()
1736    }
1737
1738    /// Sets the value of [api_operations][crate::model::ListApiOperationsResponse::api_operations].
1739    pub fn set_api_operations<T, V>(mut self, v: T) -> Self
1740    where
1741        T: std::iter::IntoIterator<Item = V>,
1742        V: std::convert::Into<crate::model::ApiOperation>,
1743    {
1744        use std::iter::Iterator;
1745        self.api_operations = v.into_iter().map(|i| i.into()).collect();
1746        self
1747    }
1748
1749    /// Sets the value of [next_page_token][crate::model::ListApiOperationsResponse::next_page_token].
1750    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1751        self.next_page_token = v.into();
1752        self
1753    }
1754}
1755
1756impl wkt::message::Message for ListApiOperationsResponse {
1757    fn typename() -> &'static str {
1758        "type.googleapis.com/google.cloud.apihub.v1.ListApiOperationsResponse"
1759    }
1760}
1761
1762#[doc(hidden)]
1763impl gax::paginator::internal::PageableResponse for ListApiOperationsResponse {
1764    type PageItem = crate::model::ApiOperation;
1765
1766    fn items(self) -> std::vec::Vec<Self::PageItem> {
1767        self.api_operations
1768    }
1769
1770    fn next_page_token(&self) -> std::string::String {
1771        use std::clone::Clone;
1772        self.next_page_token.clone()
1773    }
1774}
1775
1776/// The [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's
1777/// request.
1778///
1779/// [google.cloud.apihub.v1.ApiHub.GetDefinition]: crate::client::ApiHub::get_definition
1780#[derive(Clone, Default, PartialEq)]
1781#[non_exhaustive]
1782pub struct GetDefinitionRequest {
1783    /// Required. The name of the definition to retrieve.
1784    /// Format:
1785    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
1786    pub name: std::string::String,
1787
1788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1789}
1790
1791impl GetDefinitionRequest {
1792    pub fn new() -> Self {
1793        std::default::Default::default()
1794    }
1795
1796    /// Sets the value of [name][crate::model::GetDefinitionRequest::name].
1797    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1798        self.name = v.into();
1799        self
1800    }
1801}
1802
1803impl wkt::message::Message for GetDefinitionRequest {
1804    fn typename() -> &'static str {
1805        "type.googleapis.com/google.cloud.apihub.v1.GetDefinitionRequest"
1806    }
1807}
1808
1809/// The [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment]
1810/// method's request.
1811///
1812/// [google.cloud.apihub.v1.ApiHub.CreateDeployment]: crate::client::ApiHub::create_deployment
1813#[derive(Clone, Default, PartialEq)]
1814#[non_exhaustive]
1815pub struct CreateDeploymentRequest {
1816    /// Required. The parent resource for the deployment resource.
1817    /// Format: `projects/{project}/locations/{location}`
1818    pub parent: std::string::String,
1819
1820    /// Optional. The ID to use for the deployment resource, which will become the
1821    /// final component of the deployment's resource name. This field is optional.
1822    ///
1823    /// * If provided, the same will be used. The service will throw an error if
1824    ///   the specified id is already used by another deployment resource in the API
1825    ///   hub.
1826    /// * If not provided, a system generated id will be used.
1827    ///
1828    /// This value should be 4-500 characters, and valid characters
1829    /// are /[a-z][A-Z][0-9]-_/.
1830    pub deployment_id: std::string::String,
1831
1832    /// Required. The deployment resource to create.
1833    pub deployment: std::option::Option<crate::model::Deployment>,
1834
1835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1836}
1837
1838impl CreateDeploymentRequest {
1839    pub fn new() -> Self {
1840        std::default::Default::default()
1841    }
1842
1843    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
1844    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1845        self.parent = v.into();
1846        self
1847    }
1848
1849    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
1850    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1851        self.deployment_id = v.into();
1852        self
1853    }
1854
1855    /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
1856    pub fn set_deployment<T>(mut self, v: T) -> Self
1857    where
1858        T: std::convert::Into<crate::model::Deployment>,
1859    {
1860        self.deployment = std::option::Option::Some(v.into());
1861        self
1862    }
1863
1864    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
1865    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1866    where
1867        T: std::convert::Into<crate::model::Deployment>,
1868    {
1869        self.deployment = v.map(|x| x.into());
1870        self
1871    }
1872}
1873
1874impl wkt::message::Message for CreateDeploymentRequest {
1875    fn typename() -> &'static str {
1876        "type.googleapis.com/google.cloud.apihub.v1.CreateDeploymentRequest"
1877    }
1878}
1879
1880/// The [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's
1881/// request.
1882///
1883/// [google.cloud.apihub.v1.ApiHub.GetDeployment]: crate::client::ApiHub::get_deployment
1884#[derive(Clone, Default, PartialEq)]
1885#[non_exhaustive]
1886pub struct GetDeploymentRequest {
1887    /// Required. The name of the deployment resource to retrieve.
1888    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
1889    pub name: std::string::String,
1890
1891    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1892}
1893
1894impl GetDeploymentRequest {
1895    pub fn new() -> Self {
1896        std::default::Default::default()
1897    }
1898
1899    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
1900    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1901        self.name = v.into();
1902        self
1903    }
1904}
1905
1906impl wkt::message::Message for GetDeploymentRequest {
1907    fn typename() -> &'static str {
1908        "type.googleapis.com/google.cloud.apihub.v1.GetDeploymentRequest"
1909    }
1910}
1911
1912/// The [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment]
1913/// method's request.
1914///
1915/// [google.cloud.apihub.v1.ApiHub.UpdateDeployment]: crate::client::ApiHub::update_deployment
1916#[derive(Clone, Default, PartialEq)]
1917#[non_exhaustive]
1918pub struct UpdateDeploymentRequest {
1919    /// Required. The deployment resource to update.
1920    ///
1921    /// The deployment resource's `name` field is used to identify the deployment
1922    /// resource to update.
1923    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
1924    pub deployment: std::option::Option<crate::model::Deployment>,
1925
1926    /// Required. The list of fields to update.
1927    pub update_mask: std::option::Option<wkt::FieldMask>,
1928
1929    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1930}
1931
1932impl UpdateDeploymentRequest {
1933    pub fn new() -> Self {
1934        std::default::Default::default()
1935    }
1936
1937    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
1938    pub fn set_deployment<T>(mut self, v: T) -> Self
1939    where
1940        T: std::convert::Into<crate::model::Deployment>,
1941    {
1942        self.deployment = std::option::Option::Some(v.into());
1943        self
1944    }
1945
1946    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
1947    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1948    where
1949        T: std::convert::Into<crate::model::Deployment>,
1950    {
1951        self.deployment = v.map(|x| x.into());
1952        self
1953    }
1954
1955    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
1956    pub fn set_update_mask<T>(mut self, v: T) -> Self
1957    where
1958        T: std::convert::Into<wkt::FieldMask>,
1959    {
1960        self.update_mask = std::option::Option::Some(v.into());
1961        self
1962    }
1963
1964    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
1965    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1966    where
1967        T: std::convert::Into<wkt::FieldMask>,
1968    {
1969        self.update_mask = v.map(|x| x.into());
1970        self
1971    }
1972}
1973
1974impl wkt::message::Message for UpdateDeploymentRequest {
1975    fn typename() -> &'static str {
1976        "type.googleapis.com/google.cloud.apihub.v1.UpdateDeploymentRequest"
1977    }
1978}
1979
1980/// The [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment]
1981/// method's request.
1982///
1983/// [google.cloud.apihub.v1.ApiHub.DeleteDeployment]: crate::client::ApiHub::delete_deployment
1984#[derive(Clone, Default, PartialEq)]
1985#[non_exhaustive]
1986pub struct DeleteDeploymentRequest {
1987    /// Required. The name of the deployment resource to delete.
1988    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
1989    pub name: std::string::String,
1990
1991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1992}
1993
1994impl DeleteDeploymentRequest {
1995    pub fn new() -> Self {
1996        std::default::Default::default()
1997    }
1998
1999    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
2000    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2001        self.name = v.into();
2002        self
2003    }
2004}
2005
2006impl wkt::message::Message for DeleteDeploymentRequest {
2007    fn typename() -> &'static str {
2008        "type.googleapis.com/google.cloud.apihub.v1.DeleteDeploymentRequest"
2009    }
2010}
2011
2012/// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
2013/// request.
2014///
2015/// [google.cloud.apihub.v1.ApiHub.ListDeployments]: crate::client::ApiHub::list_deployments
2016#[derive(Clone, Default, PartialEq)]
2017#[non_exhaustive]
2018pub struct ListDeploymentsRequest {
2019    /// Required. The parent, which owns this collection of deployment resources.
2020    /// Format: `projects/{project}/locations/{location}`
2021    pub parent: std::string::String,
2022
2023    /// Optional. An expression that filters the list of Deployments.
2024    ///
2025    /// A filter expression consists of a field name, a comparison
2026    /// operator, and a value for filtering. The value must be a string. The
2027    /// comparison operator must be one of: `<`, `>` or
2028    /// `=`. Filters are not case sensitive.
2029    ///
2030    /// The following fields in the `Deployments` are eligible for filtering:
2031    ///
2032    /// * `display_name` - The display name of the Deployment. Allowed
2033    ///   comparison operators: `=`.
2034    /// * `create_time` - The time at which the Deployment was created. The
2035    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
2036    ///   format. Allowed comparison operators: `>` and `<`.
2037    /// * `resource_uri` - A URI to the deployment resource. Allowed
2038    ///   comparison operators: `=`.
2039    /// * `api_versions` - The API versions linked to this deployment. Allowed
2040    ///   comparison operators: `:`.
2041    /// * `source_project` - The project/organization at source for the
2042    ///   deployment. Allowed comparison operators: `=`.
2043    /// * `source_environment` - The environment at source for the
2044    ///   deployment. Allowed comparison operators: `=`.
2045    /// * `deployment_type.enum_values.values.id` - The allowed value id of the
2046    ///   deployment_type attribute associated with the Deployment. Allowed
2047    ///   comparison operators: `:`.
2048    /// * `deployment_type.enum_values.values.display_name` - The allowed value
2049    ///   display name of the deployment_type attribute associated with the
2050    ///   Deployment. Allowed comparison operators: `:`.
2051    /// * `slo.string_values.values` -The allowed string value of the slo
2052    ///   attribute associated with the deployment. Allowed comparison
2053    ///   operators: `:`.
2054    /// * `environment.enum_values.values.id` - The allowed value id of the
2055    ///   environment attribute associated with the deployment. Allowed
2056    ///   comparison operators: `:`.
2057    /// * `environment.enum_values.values.display_name` - The allowed value
2058    ///   display name of the environment attribute associated with the deployment.
2059    ///   Allowed comparison operators: `:`.
2060    /// * `attributes.projects/test-project-id/locations/test-location-id/
2061    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
2062    ///   allowed value id of the user defined enum attribute associated with the
2063    ///   Resource. Allowed comparison operator is `:`. Here
2064    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
2065    ///   any user defined enum attribute name.
2066    /// * `attributes.projects/test-project-id/locations/test-location-id/
2067    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
2068    ///
2069    /// - The allowed value display name of the user defined enum attribute
2070    ///   associated with the Resource. Allowed comparison operator is `:`. Here
2071    ///   user-defined-attribute-enum-display-name is a placeholder that can be
2072    ///   replaced with any user defined enum attribute enum name.
2073    ///
2074    /// * `attributes.projects/test-project-id/locations/test-location-id/
2075    ///   attributes/user-defined-attribute-id.string_values.values` - The
2076    ///   allowed value of the user defined string attribute associated with the
2077    ///   Resource. Allowed comparison operator is `:`. Here
2078    ///   user-defined-attribute-string is a placeholder that can be replaced with
2079    ///   any user defined string attribute name.
2080    /// * `attributes.projects/test-project-id/locations/test-location-id/
2081    ///   attributes/user-defined-attribute-id.json_values.values` - The
2082    ///   allowed value of the user defined JSON attribute associated with the
2083    ///   Resource. Allowed comparison operator is `:`. Here
2084    ///   user-defined-attribute-json is a placeholder that can be replaced with
2085    ///   any user defined JSON attribute name.
2086    ///
2087    /// A filter function is also supported in the filter string. The filter
2088    /// function is `id(name)`. The `id(name)` function returns the id of the
2089    /// resource name. For example, `id(name) = \"deployment-1\"` is equivalent to
2090    /// `name =
2091    /// \"projects/test-project-id/locations/test-location-id/deployments/deployment-1\"`
2092    /// provided the parent is
2093    /// `projects/test-project-id/locations/test-location-id`.
2094    ///
2095    /// Expressions are combined with either `AND` logic operator or `OR` logical
2096    /// operator but not both of them together i.e. only one of the `AND` or `OR`
2097    /// operator can be used throughout the filter string and both the operators
2098    /// cannot be used together. No other logical operators are supported. At most
2099    /// three filter fields are allowed in the filter string and if provided
2100    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
2101    ///
2102    /// Here are a few examples:
2103    ///
2104    /// * `environment.enum_values.values.id: staging-id` - The allowed value id
2105    ///   of the environment attribute associated with the Deployment is
2106    ///   _staging-id_.
2107    /// * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
2108    ///   The allowed value display name of the environment attribute associated
2109    ///   with the Deployment is `Staging Deployment`.
2110    /// * `environment.enum_values.values.id: production-id AND create_time <
2111    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
2112    ///   The allowed value id of the environment attribute associated with the
2113    ///   Deployment is _production-id_ and Deployment was created before
2114    ///   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
2115    /// * `environment.enum_values.values.id: production-id OR
2116    ///   slo.string_values.values: \"99.99%\"`
2117    ///
2118    /// - The allowed value id of the environment attribute Deployment is
2119    ///   _production-id_ or string value of the slo attribute is _99.99%_.
2120    ///
2121    /// * `environment.enum_values.values.id: staging-id AND
2122    ///   attributes.projects/test-project-id/locations/test-location-id/
2123    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.string_values.values:
2124    ///   test`  - The filter string specifies that the allowed value id of the
2125    ///   environment attribute associated with the Deployment is _staging-id_ and
2126    ///   the value of the user defined attribute of type string is _test_.
2127    pub filter: std::string::String,
2128
2129    /// Optional. The maximum number of deployment resources to return. The service
2130    /// may return fewer than this value. If unspecified, at most 50 deployments
2131    /// will be returned. The maximum value is 1000; values above 1000 will be
2132    /// coerced to 1000.
2133    pub page_size: i32,
2134
2135    /// Optional. A page token, received from a previous `ListDeployments` call.
2136    /// Provide this to retrieve the subsequent page.
2137    ///
2138    /// When paginating, all other parameters (except page_size) provided to
2139    /// `ListDeployments` must match the call that provided the page token.
2140    pub page_token: std::string::String,
2141
2142    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2143}
2144
2145impl ListDeploymentsRequest {
2146    pub fn new() -> Self {
2147        std::default::Default::default()
2148    }
2149
2150    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
2151    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2152        self.parent = v.into();
2153        self
2154    }
2155
2156    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
2157    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2158        self.filter = v.into();
2159        self
2160    }
2161
2162    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
2163    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2164        self.page_size = v.into();
2165        self
2166    }
2167
2168    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
2169    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2170        self.page_token = v.into();
2171        self
2172    }
2173}
2174
2175impl wkt::message::Message for ListDeploymentsRequest {
2176    fn typename() -> &'static str {
2177        "type.googleapis.com/google.cloud.apihub.v1.ListDeploymentsRequest"
2178    }
2179}
2180
2181/// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
2182/// response.
2183///
2184/// [google.cloud.apihub.v1.ApiHub.ListDeployments]: crate::client::ApiHub::list_deployments
2185#[derive(Clone, Default, PartialEq)]
2186#[non_exhaustive]
2187pub struct ListDeploymentsResponse {
2188    /// The deployment resources present in the API hub.
2189    pub deployments: std::vec::Vec<crate::model::Deployment>,
2190
2191    /// A token, which can be sent as `page_token` to retrieve the next page.
2192    /// If this field is omitted, there are no subsequent pages.
2193    pub next_page_token: std::string::String,
2194
2195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2196}
2197
2198impl ListDeploymentsResponse {
2199    pub fn new() -> Self {
2200        std::default::Default::default()
2201    }
2202
2203    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
2204    pub fn set_deployments<T, V>(mut self, v: T) -> Self
2205    where
2206        T: std::iter::IntoIterator<Item = V>,
2207        V: std::convert::Into<crate::model::Deployment>,
2208    {
2209        use std::iter::Iterator;
2210        self.deployments = v.into_iter().map(|i| i.into()).collect();
2211        self
2212    }
2213
2214    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
2215    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2216        self.next_page_token = v.into();
2217        self
2218    }
2219}
2220
2221impl wkt::message::Message for ListDeploymentsResponse {
2222    fn typename() -> &'static str {
2223        "type.googleapis.com/google.cloud.apihub.v1.ListDeploymentsResponse"
2224    }
2225}
2226
2227#[doc(hidden)]
2228impl gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
2229    type PageItem = crate::model::Deployment;
2230
2231    fn items(self) -> std::vec::Vec<Self::PageItem> {
2232        self.deployments
2233    }
2234
2235    fn next_page_token(&self) -> std::string::String {
2236        use std::clone::Clone;
2237        self.next_page_token.clone()
2238    }
2239}
2240
2241/// The [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's
2242/// request.
2243///
2244/// [google.cloud.apihub.v1.ApiHub.CreateAttribute]: crate::client::ApiHub::create_attribute
2245#[derive(Clone, Default, PartialEq)]
2246#[non_exhaustive]
2247pub struct CreateAttributeRequest {
2248    /// Required. The parent resource for Attribute.
2249    /// Format: `projects/{project}/locations/{location}`
2250    pub parent: std::string::String,
2251
2252    /// Optional. The ID to use for the attribute, which will become the final
2253    /// component of the attribute's resource name. This field is optional.
2254    ///
2255    /// * If provided, the same will be used. The service will throw an error if
2256    ///   the specified id is already used by another attribute resource in the API
2257    ///   hub.
2258    /// * If not provided, a system generated id will be used.
2259    ///
2260    /// This value should be 4-500 characters, and valid characters
2261    /// are /[a-z][A-Z][0-9]-_/.
2262    pub attribute_id: std::string::String,
2263
2264    /// Required. The attribute to create.
2265    pub attribute: std::option::Option<crate::model::Attribute>,
2266
2267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2268}
2269
2270impl CreateAttributeRequest {
2271    pub fn new() -> Self {
2272        std::default::Default::default()
2273    }
2274
2275    /// Sets the value of [parent][crate::model::CreateAttributeRequest::parent].
2276    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2277        self.parent = v.into();
2278        self
2279    }
2280
2281    /// Sets the value of [attribute_id][crate::model::CreateAttributeRequest::attribute_id].
2282    pub fn set_attribute_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2283        self.attribute_id = v.into();
2284        self
2285    }
2286
2287    /// Sets the value of [attribute][crate::model::CreateAttributeRequest::attribute].
2288    pub fn set_attribute<T>(mut self, v: T) -> Self
2289    where
2290        T: std::convert::Into<crate::model::Attribute>,
2291    {
2292        self.attribute = std::option::Option::Some(v.into());
2293        self
2294    }
2295
2296    /// Sets or clears the value of [attribute][crate::model::CreateAttributeRequest::attribute].
2297    pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2298    where
2299        T: std::convert::Into<crate::model::Attribute>,
2300    {
2301        self.attribute = v.map(|x| x.into());
2302        self
2303    }
2304}
2305
2306impl wkt::message::Message for CreateAttributeRequest {
2307    fn typename() -> &'static str {
2308        "type.googleapis.com/google.cloud.apihub.v1.CreateAttributeRequest"
2309    }
2310}
2311
2312/// The [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's
2313/// request.
2314///
2315/// [google.cloud.apihub.v1.ApiHub.GetAttribute]: crate::client::ApiHub::get_attribute
2316#[derive(Clone, Default, PartialEq)]
2317#[non_exhaustive]
2318pub struct GetAttributeRequest {
2319    /// Required. The name of the attribute to retrieve.
2320    /// Format:
2321    /// `projects/{project}/locations/{location}/attributes/{attribute}`
2322    pub name: std::string::String,
2323
2324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2325}
2326
2327impl GetAttributeRequest {
2328    pub fn new() -> Self {
2329        std::default::Default::default()
2330    }
2331
2332    /// Sets the value of [name][crate::model::GetAttributeRequest::name].
2333    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2334        self.name = v.into();
2335        self
2336    }
2337}
2338
2339impl wkt::message::Message for GetAttributeRequest {
2340    fn typename() -> &'static str {
2341        "type.googleapis.com/google.cloud.apihub.v1.GetAttributeRequest"
2342    }
2343}
2344
2345/// The [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's
2346/// request.
2347///
2348/// [google.cloud.apihub.v1.ApiHub.UpdateAttribute]: crate::client::ApiHub::update_attribute
2349#[derive(Clone, Default, PartialEq)]
2350#[non_exhaustive]
2351pub struct UpdateAttributeRequest {
2352    /// Required. The attribute to update.
2353    ///
2354    /// The attribute's `name` field is used to identify the attribute to update.
2355    /// Format:
2356    /// `projects/{project}/locations/{location}/attributes/{attribute}`
2357    pub attribute: std::option::Option<crate::model::Attribute>,
2358
2359    /// Required. The list of fields to update.
2360    pub update_mask: std::option::Option<wkt::FieldMask>,
2361
2362    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2363}
2364
2365impl UpdateAttributeRequest {
2366    pub fn new() -> Self {
2367        std::default::Default::default()
2368    }
2369
2370    /// Sets the value of [attribute][crate::model::UpdateAttributeRequest::attribute].
2371    pub fn set_attribute<T>(mut self, v: T) -> Self
2372    where
2373        T: std::convert::Into<crate::model::Attribute>,
2374    {
2375        self.attribute = std::option::Option::Some(v.into());
2376        self
2377    }
2378
2379    /// Sets or clears the value of [attribute][crate::model::UpdateAttributeRequest::attribute].
2380    pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2381    where
2382        T: std::convert::Into<crate::model::Attribute>,
2383    {
2384        self.attribute = v.map(|x| x.into());
2385        self
2386    }
2387
2388    /// Sets the value of [update_mask][crate::model::UpdateAttributeRequest::update_mask].
2389    pub fn set_update_mask<T>(mut self, v: T) -> Self
2390    where
2391        T: std::convert::Into<wkt::FieldMask>,
2392    {
2393        self.update_mask = std::option::Option::Some(v.into());
2394        self
2395    }
2396
2397    /// Sets or clears the value of [update_mask][crate::model::UpdateAttributeRequest::update_mask].
2398    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2399    where
2400        T: std::convert::Into<wkt::FieldMask>,
2401    {
2402        self.update_mask = v.map(|x| x.into());
2403        self
2404    }
2405}
2406
2407impl wkt::message::Message for UpdateAttributeRequest {
2408    fn typename() -> &'static str {
2409        "type.googleapis.com/google.cloud.apihub.v1.UpdateAttributeRequest"
2410    }
2411}
2412
2413/// The [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's
2414/// request.
2415///
2416/// [google.cloud.apihub.v1.ApiHub.DeleteAttribute]: crate::client::ApiHub::delete_attribute
2417#[derive(Clone, Default, PartialEq)]
2418#[non_exhaustive]
2419pub struct DeleteAttributeRequest {
2420    /// Required. The name of the attribute to delete.
2421    /// Format:
2422    /// `projects/{project}/locations/{location}/attributes/{attribute}`
2423    pub name: std::string::String,
2424
2425    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2426}
2427
2428impl DeleteAttributeRequest {
2429    pub fn new() -> Self {
2430        std::default::Default::default()
2431    }
2432
2433    /// Sets the value of [name][crate::model::DeleteAttributeRequest::name].
2434    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2435        self.name = v.into();
2436        self
2437    }
2438}
2439
2440impl wkt::message::Message for DeleteAttributeRequest {
2441    fn typename() -> &'static str {
2442        "type.googleapis.com/google.cloud.apihub.v1.DeleteAttributeRequest"
2443    }
2444}
2445
2446/// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
2447/// request.
2448///
2449/// [google.cloud.apihub.v1.ApiHub.ListAttributes]: crate::client::ApiHub::list_attributes
2450#[derive(Clone, Default, PartialEq)]
2451#[non_exhaustive]
2452pub struct ListAttributesRequest {
2453    /// Required. The parent resource for Attribute.
2454    /// Format: `projects/{project}/locations/{location}`
2455    pub parent: std::string::String,
2456
2457    /// Optional. An expression that filters the list of Attributes.
2458    ///
2459    /// A filter expression consists of a field name, a comparison
2460    /// operator, and a value for filtering. The value must be a string or a
2461    /// boolean. The comparison operator must be one of: `<`, `>` or
2462    /// `=`. Filters are not case sensitive.
2463    ///
2464    /// The following fields in the `Attribute` are eligible for filtering:
2465    ///
2466    /// * `display_name` - The display name of the Attribute. Allowed
2467    ///   comparison operators: `=`.
2468    /// * `definition_type` - The definition type of the attribute. Allowed
2469    ///   comparison operators: `=`.
2470    /// * `scope` - The scope of the attribute. Allowed comparison operators:
2471    ///   `=`.
2472    /// * `data_type` - The type of the data of the attribute. Allowed
2473    ///   comparison operators: `=`.
2474    /// * `mandatory` - Denotes whether the attribute is mandatory or not.
2475    ///   Allowed comparison operators: `=`.
2476    /// * `create_time` - The time at which the Attribute was created. The
2477    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
2478    ///   format. Allowed comparison operators: `>` and `<`.
2479    ///
2480    /// Expressions are combined with either `AND` logic operator or `OR` logical
2481    /// operator but not both of them together i.e. only one of the `AND` or `OR`
2482    /// operator can be used throughout the filter string and both the operators
2483    /// cannot be used together. No other logical operators are
2484    /// supported. At most three filter fields are allowed in the filter
2485    /// string and if provided more than that then `INVALID_ARGUMENT` error is
2486    /// returned by the API.
2487    ///
2488    /// Here are a few examples:
2489    ///
2490    /// * `display_name = production` -  - The display name of the attribute is
2491    ///   _production_.
2492    /// * `(display_name = production) AND (create_time <
2493    ///   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
2494    ///   The display name of the attribute is _production_ and the attribute was
2495    ///   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
2496    ///   UTC_.
2497    /// * `display_name = production OR scope = api` -
2498    ///   The attribute where the display name is _production_ or the scope is
2499    ///   _api_.
2500    pub filter: std::string::String,
2501
2502    /// Optional. The maximum number of attribute resources to return. The service
2503    /// may return fewer than this value. If unspecified, at most 50 attributes
2504    /// will be returned. The maximum value is 1000; values above 1000 will be
2505    /// coerced to 1000.
2506    pub page_size: i32,
2507
2508    /// Optional. A page token, received from a previous `ListAttributes` call.
2509    /// Provide this to retrieve the subsequent page.
2510    ///
2511    /// When paginating, all other parameters provided to `ListAttributes` must
2512    /// match the call that provided the page token.
2513    pub page_token: std::string::String,
2514
2515    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2516}
2517
2518impl ListAttributesRequest {
2519    pub fn new() -> Self {
2520        std::default::Default::default()
2521    }
2522
2523    /// Sets the value of [parent][crate::model::ListAttributesRequest::parent].
2524    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2525        self.parent = v.into();
2526        self
2527    }
2528
2529    /// Sets the value of [filter][crate::model::ListAttributesRequest::filter].
2530    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2531        self.filter = v.into();
2532        self
2533    }
2534
2535    /// Sets the value of [page_size][crate::model::ListAttributesRequest::page_size].
2536    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2537        self.page_size = v.into();
2538        self
2539    }
2540
2541    /// Sets the value of [page_token][crate::model::ListAttributesRequest::page_token].
2542    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2543        self.page_token = v.into();
2544        self
2545    }
2546}
2547
2548impl wkt::message::Message for ListAttributesRequest {
2549    fn typename() -> &'static str {
2550        "type.googleapis.com/google.cloud.apihub.v1.ListAttributesRequest"
2551    }
2552}
2553
2554/// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
2555/// response.
2556///
2557/// [google.cloud.apihub.v1.ApiHub.ListAttributes]: crate::client::ApiHub::list_attributes
2558#[derive(Clone, Default, PartialEq)]
2559#[non_exhaustive]
2560pub struct ListAttributesResponse {
2561    /// The list of all attributes.
2562    pub attributes: std::vec::Vec<crate::model::Attribute>,
2563
2564    /// A token, which can be sent as `page_token` to retrieve the next page.
2565    /// If this field is omitted, there are no subsequent pages.
2566    pub next_page_token: std::string::String,
2567
2568    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2569}
2570
2571impl ListAttributesResponse {
2572    pub fn new() -> Self {
2573        std::default::Default::default()
2574    }
2575
2576    /// Sets the value of [attributes][crate::model::ListAttributesResponse::attributes].
2577    pub fn set_attributes<T, V>(mut self, v: T) -> Self
2578    where
2579        T: std::iter::IntoIterator<Item = V>,
2580        V: std::convert::Into<crate::model::Attribute>,
2581    {
2582        use std::iter::Iterator;
2583        self.attributes = v.into_iter().map(|i| i.into()).collect();
2584        self
2585    }
2586
2587    /// Sets the value of [next_page_token][crate::model::ListAttributesResponse::next_page_token].
2588    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2589        self.next_page_token = v.into();
2590        self
2591    }
2592}
2593
2594impl wkt::message::Message for ListAttributesResponse {
2595    fn typename() -> &'static str {
2596        "type.googleapis.com/google.cloud.apihub.v1.ListAttributesResponse"
2597    }
2598}
2599
2600#[doc(hidden)]
2601impl gax::paginator::internal::PageableResponse for ListAttributesResponse {
2602    type PageItem = crate::model::Attribute;
2603
2604    fn items(self) -> std::vec::Vec<Self::PageItem> {
2605        self.attributes
2606    }
2607
2608    fn next_page_token(&self) -> std::string::String {
2609        use std::clone::Clone;
2610        self.next_page_token.clone()
2611    }
2612}
2613
2614/// The [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's
2615/// request.
2616///
2617/// [google.cloud.apihub.v1.ApiHub.SearchResources]: crate::client::ApiHub::search_resources
2618#[derive(Clone, Default, PartialEq)]
2619#[non_exhaustive]
2620pub struct SearchResourcesRequest {
2621    /// Required. The resource name of the location which will be of the type
2622    /// `projects/{project_id}/locations/{location_id}`. This field is used to
2623    /// identify the instance of API-Hub in which resources should be searched.
2624    pub location: std::string::String,
2625
2626    /// Required. The free text search query. This query can contain keywords which
2627    /// could be related to any detail of the API-Hub resources such display names,
2628    /// descriptions, attributes etc.
2629    pub query: std::string::String,
2630
2631    /// Optional. An expression that filters the list of search results.
2632    ///
2633    /// A filter expression consists of a field name, a comparison operator,
2634    /// and a value for filtering. The value must be a string, a number, or a
2635    /// boolean. The comparison operator must be `=`. Filters are not case
2636    /// sensitive.
2637    ///
2638    /// The following field names are eligible for filtering:
2639    ///
2640    /// * `resource_type` - The type of resource in the search results.
2641    ///   Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
2642    ///   `Definition`, `Spec` or `Version`. This field can only be specified once
2643    ///   in the filter.
2644    ///
2645    /// Here are is an example:
2646    ///
2647    /// * `resource_type = Api` - The resource_type is _Api_.
2648    pub filter: std::string::String,
2649
2650    /// Optional. The maximum number of search results to return. The service may
2651    /// return fewer than this value. If unspecified at most 10 search results will
2652    /// be returned. If value is negative then `INVALID_ARGUMENT` error is
2653    /// returned. The maximum value is 25; values above 25 will be coerced to 25.
2654    /// While paginating, you can specify a new page size parameter for each page
2655    /// of search results to be listed.
2656    pub page_size: i32,
2657
2658    /// Optional. A page token, received from a previous
2659    /// [SearchResources][SearchResources]
2660    /// call. Specify this parameter to retrieve the next page of transactions.
2661    ///
2662    /// When paginating, you must specify the `page_token` parameter and all the
2663    /// other parameters except
2664    /// [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
2665    /// should be specified with the same value which was used in the previous
2666    /// call. If the other fields are set with a different value than the previous
2667    /// call then `INVALID_ARGUMENT` error is returned.
2668    ///
2669    /// [google.cloud.apihub.v1.SearchResourcesRequest.page_size]: crate::model::SearchResourcesRequest::page_size
2670    pub page_token: std::string::String,
2671
2672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2673}
2674
2675impl SearchResourcesRequest {
2676    pub fn new() -> Self {
2677        std::default::Default::default()
2678    }
2679
2680    /// Sets the value of [location][crate::model::SearchResourcesRequest::location].
2681    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2682        self.location = v.into();
2683        self
2684    }
2685
2686    /// Sets the value of [query][crate::model::SearchResourcesRequest::query].
2687    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2688        self.query = v.into();
2689        self
2690    }
2691
2692    /// Sets the value of [filter][crate::model::SearchResourcesRequest::filter].
2693    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2694        self.filter = v.into();
2695        self
2696    }
2697
2698    /// Sets the value of [page_size][crate::model::SearchResourcesRequest::page_size].
2699    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2700        self.page_size = v.into();
2701        self
2702    }
2703
2704    /// Sets the value of [page_token][crate::model::SearchResourcesRequest::page_token].
2705    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2706        self.page_token = v.into();
2707        self
2708    }
2709}
2710
2711impl wkt::message::Message for SearchResourcesRequest {
2712    fn typename() -> &'static str {
2713        "type.googleapis.com/google.cloud.apihub.v1.SearchResourcesRequest"
2714    }
2715}
2716
2717/// ApiHubResource is one of the resources such as Api, Operation, Deployment,
2718/// Definition, Spec and Version resources stored in API-Hub.
2719#[derive(Clone, Default, PartialEq)]
2720#[non_exhaustive]
2721pub struct ApiHubResource {
2722    pub resource: std::option::Option<crate::model::api_hub_resource::Resource>,
2723
2724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2725}
2726
2727impl ApiHubResource {
2728    pub fn new() -> Self {
2729        std::default::Default::default()
2730    }
2731
2732    /// Sets the value of [resource][crate::model::ApiHubResource::resource].
2733    ///
2734    /// Note that all the setters affecting `resource` are mutually
2735    /// exclusive.
2736    pub fn set_resource<
2737        T: std::convert::Into<std::option::Option<crate::model::api_hub_resource::Resource>>,
2738    >(
2739        mut self,
2740        v: T,
2741    ) -> Self {
2742        self.resource = v.into();
2743        self
2744    }
2745
2746    /// The value of [resource][crate::model::ApiHubResource::resource]
2747    /// if it holds a `Api`, `None` if the field is not set or
2748    /// holds a different branch.
2749    pub fn api(&self) -> std::option::Option<&std::boxed::Box<crate::model::Api>> {
2750        #[allow(unreachable_patterns)]
2751        self.resource.as_ref().and_then(|v| match v {
2752            crate::model::api_hub_resource::Resource::Api(v) => std::option::Option::Some(v),
2753            _ => std::option::Option::None,
2754        })
2755    }
2756
2757    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
2758    /// to hold a `Api`.
2759    ///
2760    /// Note that all the setters affecting `resource` are
2761    /// mutually exclusive.
2762    pub fn set_api<T: std::convert::Into<std::boxed::Box<crate::model::Api>>>(
2763        mut self,
2764        v: T,
2765    ) -> Self {
2766        self.resource =
2767            std::option::Option::Some(crate::model::api_hub_resource::Resource::Api(v.into()));
2768        self
2769    }
2770
2771    /// The value of [resource][crate::model::ApiHubResource::resource]
2772    /// if it holds a `Operation`, `None` if the field is not set or
2773    /// holds a different branch.
2774    pub fn operation(&self) -> std::option::Option<&std::boxed::Box<crate::model::ApiOperation>> {
2775        #[allow(unreachable_patterns)]
2776        self.resource.as_ref().and_then(|v| match v {
2777            crate::model::api_hub_resource::Resource::Operation(v) => std::option::Option::Some(v),
2778            _ => std::option::Option::None,
2779        })
2780    }
2781
2782    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
2783    /// to hold a `Operation`.
2784    ///
2785    /// Note that all the setters affecting `resource` are
2786    /// mutually exclusive.
2787    pub fn set_operation<T: std::convert::Into<std::boxed::Box<crate::model::ApiOperation>>>(
2788        mut self,
2789        v: T,
2790    ) -> Self {
2791        self.resource = std::option::Option::Some(
2792            crate::model::api_hub_resource::Resource::Operation(v.into()),
2793        );
2794        self
2795    }
2796
2797    /// The value of [resource][crate::model::ApiHubResource::resource]
2798    /// if it holds a `Deployment`, `None` if the field is not set or
2799    /// holds a different branch.
2800    pub fn deployment(&self) -> std::option::Option<&std::boxed::Box<crate::model::Deployment>> {
2801        #[allow(unreachable_patterns)]
2802        self.resource.as_ref().and_then(|v| match v {
2803            crate::model::api_hub_resource::Resource::Deployment(v) => std::option::Option::Some(v),
2804            _ => std::option::Option::None,
2805        })
2806    }
2807
2808    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
2809    /// to hold a `Deployment`.
2810    ///
2811    /// Note that all the setters affecting `resource` are
2812    /// mutually exclusive.
2813    pub fn set_deployment<T: std::convert::Into<std::boxed::Box<crate::model::Deployment>>>(
2814        mut self,
2815        v: T,
2816    ) -> Self {
2817        self.resource = std::option::Option::Some(
2818            crate::model::api_hub_resource::Resource::Deployment(v.into()),
2819        );
2820        self
2821    }
2822
2823    /// The value of [resource][crate::model::ApiHubResource::resource]
2824    /// if it holds a `Spec`, `None` if the field is not set or
2825    /// holds a different branch.
2826    pub fn spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::Spec>> {
2827        #[allow(unreachable_patterns)]
2828        self.resource.as_ref().and_then(|v| match v {
2829            crate::model::api_hub_resource::Resource::Spec(v) => std::option::Option::Some(v),
2830            _ => std::option::Option::None,
2831        })
2832    }
2833
2834    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
2835    /// to hold a `Spec`.
2836    ///
2837    /// Note that all the setters affecting `resource` are
2838    /// mutually exclusive.
2839    pub fn set_spec<T: std::convert::Into<std::boxed::Box<crate::model::Spec>>>(
2840        mut self,
2841        v: T,
2842    ) -> Self {
2843        self.resource =
2844            std::option::Option::Some(crate::model::api_hub_resource::Resource::Spec(v.into()));
2845        self
2846    }
2847
2848    /// The value of [resource][crate::model::ApiHubResource::resource]
2849    /// if it holds a `Definition`, `None` if the field is not set or
2850    /// holds a different branch.
2851    pub fn definition(&self) -> std::option::Option<&std::boxed::Box<crate::model::Definition>> {
2852        #[allow(unreachable_patterns)]
2853        self.resource.as_ref().and_then(|v| match v {
2854            crate::model::api_hub_resource::Resource::Definition(v) => std::option::Option::Some(v),
2855            _ => std::option::Option::None,
2856        })
2857    }
2858
2859    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
2860    /// to hold a `Definition`.
2861    ///
2862    /// Note that all the setters affecting `resource` are
2863    /// mutually exclusive.
2864    pub fn set_definition<T: std::convert::Into<std::boxed::Box<crate::model::Definition>>>(
2865        mut self,
2866        v: T,
2867    ) -> Self {
2868        self.resource = std::option::Option::Some(
2869            crate::model::api_hub_resource::Resource::Definition(v.into()),
2870        );
2871        self
2872    }
2873
2874    /// The value of [resource][crate::model::ApiHubResource::resource]
2875    /// if it holds a `Version`, `None` if the field is not set or
2876    /// holds a different branch.
2877    pub fn version(&self) -> std::option::Option<&std::boxed::Box<crate::model::Version>> {
2878        #[allow(unreachable_patterns)]
2879        self.resource.as_ref().and_then(|v| match v {
2880            crate::model::api_hub_resource::Resource::Version(v) => std::option::Option::Some(v),
2881            _ => std::option::Option::None,
2882        })
2883    }
2884
2885    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
2886    /// to hold a `Version`.
2887    ///
2888    /// Note that all the setters affecting `resource` are
2889    /// mutually exclusive.
2890    pub fn set_version<T: std::convert::Into<std::boxed::Box<crate::model::Version>>>(
2891        mut self,
2892        v: T,
2893    ) -> Self {
2894        self.resource =
2895            std::option::Option::Some(crate::model::api_hub_resource::Resource::Version(v.into()));
2896        self
2897    }
2898}
2899
2900impl wkt::message::Message for ApiHubResource {
2901    fn typename() -> &'static str {
2902        "type.googleapis.com/google.cloud.apihub.v1.ApiHubResource"
2903    }
2904}
2905
2906/// Defines additional types related to [ApiHubResource].
2907pub mod api_hub_resource {
2908    #[allow(unused_imports)]
2909    use super::*;
2910
2911    #[derive(Clone, Debug, PartialEq)]
2912    #[non_exhaustive]
2913    pub enum Resource {
2914        /// This represents Api resource in search results. Only name, display_name,
2915        /// description and owner fields are populated in search results.
2916        Api(std::boxed::Box<crate::model::Api>),
2917        /// This represents ApiOperation resource in search results. Only name,
2918        /// description, spec and details fields are populated in search results.
2919        Operation(std::boxed::Box<crate::model::ApiOperation>),
2920        /// This represents Deployment resource in search results. Only name,
2921        /// display_name, description, deployment_type and api_versions fields are
2922        /// populated in search results.
2923        Deployment(std::boxed::Box<crate::model::Deployment>),
2924        /// This represents Spec resource in search results. Only name,
2925        /// display_name, description, spec_type and documentation fields are
2926        /// populated in search results.
2927        Spec(std::boxed::Box<crate::model::Spec>),
2928        /// This represents Definition resource in search results.
2929        /// Only name field is populated in search results.
2930        Definition(std::boxed::Box<crate::model::Definition>),
2931        /// This represents Version resource in search results. Only name,
2932        /// display_name, description, lifecycle, compliance and accreditation fields
2933        /// are populated in search results.
2934        Version(std::boxed::Box<crate::model::Version>),
2935    }
2936}
2937
2938/// Represents the search results.
2939#[derive(Clone, Default, PartialEq)]
2940#[non_exhaustive]
2941pub struct SearchResult {
2942    /// This represents the ApiHubResource.
2943    /// Note: Only selected fields of the resources are populated in response.
2944    pub resource: std::option::Option<crate::model::ApiHubResource>,
2945
2946    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2947}
2948
2949impl SearchResult {
2950    pub fn new() -> Self {
2951        std::default::Default::default()
2952    }
2953
2954    /// Sets the value of [resource][crate::model::SearchResult::resource].
2955    pub fn set_resource<T>(mut self, v: T) -> Self
2956    where
2957        T: std::convert::Into<crate::model::ApiHubResource>,
2958    {
2959        self.resource = std::option::Option::Some(v.into());
2960        self
2961    }
2962
2963    /// Sets or clears the value of [resource][crate::model::SearchResult::resource].
2964    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2965    where
2966        T: std::convert::Into<crate::model::ApiHubResource>,
2967    {
2968        self.resource = v.map(|x| x.into());
2969        self
2970    }
2971}
2972
2973impl wkt::message::Message for SearchResult {
2974    fn typename() -> &'static str {
2975        "type.googleapis.com/google.cloud.apihub.v1.SearchResult"
2976    }
2977}
2978
2979/// Response for the
2980/// [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method.
2981///
2982/// [google.cloud.apihub.v1.ApiHub.SearchResources]: crate::client::ApiHub::search_resources
2983#[derive(Clone, Default, PartialEq)]
2984#[non_exhaustive]
2985pub struct SearchResourcesResponse {
2986    /// List of search results according to the filter and search query specified.
2987    /// The order of search results represents the ranking.
2988    pub search_results: std::vec::Vec<crate::model::SearchResult>,
2989
2990    /// Pass this token in the
2991    /// [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
2992    /// to continue to list results. If all results have been returned, this field
2993    /// is an empty string or not present in the response.
2994    ///
2995    /// [google.cloud.apihub.v1.SearchResourcesRequest]: crate::model::SearchResourcesRequest
2996    pub next_page_token: std::string::String,
2997
2998    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2999}
3000
3001impl SearchResourcesResponse {
3002    pub fn new() -> Self {
3003        std::default::Default::default()
3004    }
3005
3006    /// Sets the value of [search_results][crate::model::SearchResourcesResponse::search_results].
3007    pub fn set_search_results<T, V>(mut self, v: T) -> Self
3008    where
3009        T: std::iter::IntoIterator<Item = V>,
3010        V: std::convert::Into<crate::model::SearchResult>,
3011    {
3012        use std::iter::Iterator;
3013        self.search_results = v.into_iter().map(|i| i.into()).collect();
3014        self
3015    }
3016
3017    /// Sets the value of [next_page_token][crate::model::SearchResourcesResponse::next_page_token].
3018    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3019        self.next_page_token = v.into();
3020        self
3021    }
3022}
3023
3024impl wkt::message::Message for SearchResourcesResponse {
3025    fn typename() -> &'static str {
3026        "type.googleapis.com/google.cloud.apihub.v1.SearchResourcesResponse"
3027    }
3028}
3029
3030#[doc(hidden)]
3031impl gax::paginator::internal::PageableResponse for SearchResourcesResponse {
3032    type PageItem = crate::model::SearchResult;
3033
3034    fn items(self) -> std::vec::Vec<Self::PageItem> {
3035        self.search_results
3036    }
3037
3038    fn next_page_token(&self) -> std::string::String {
3039        use std::clone::Clone;
3040        self.next_page_token.clone()
3041    }
3042}
3043
3044/// The
3045/// [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency]
3046/// method's request.
3047///
3048/// [google.cloud.apihub.v1.ApiHubDependencies.CreateDependency]: crate::client::ApiHubDependencies::create_dependency
3049#[derive(Clone, Default, PartialEq)]
3050#[non_exhaustive]
3051pub struct CreateDependencyRequest {
3052    /// Required. The parent resource for the dependency resource.
3053    /// Format: `projects/{project}/locations/{location}`
3054    pub parent: std::string::String,
3055
3056    /// Optional. The ID to use for the dependency resource, which will become the
3057    /// final component of the dependency's resource name. This field is optional.
3058    ///
3059    /// * If provided, the same will be used. The service will throw an error if
3060    ///   duplicate id is provided by the client.
3061    /// * If not provided, a system generated id will be used.
3062    ///
3063    /// This value should be 4-500 characters, and valid characters
3064    /// are `[a-z][A-Z][0-9]-_`.
3065    pub dependency_id: std::string::String,
3066
3067    /// Required. The dependency resource to create.
3068    pub dependency: std::option::Option<crate::model::Dependency>,
3069
3070    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3071}
3072
3073impl CreateDependencyRequest {
3074    pub fn new() -> Self {
3075        std::default::Default::default()
3076    }
3077
3078    /// Sets the value of [parent][crate::model::CreateDependencyRequest::parent].
3079    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080        self.parent = v.into();
3081        self
3082    }
3083
3084    /// Sets the value of [dependency_id][crate::model::CreateDependencyRequest::dependency_id].
3085    pub fn set_dependency_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3086        self.dependency_id = v.into();
3087        self
3088    }
3089
3090    /// Sets the value of [dependency][crate::model::CreateDependencyRequest::dependency].
3091    pub fn set_dependency<T>(mut self, v: T) -> Self
3092    where
3093        T: std::convert::Into<crate::model::Dependency>,
3094    {
3095        self.dependency = std::option::Option::Some(v.into());
3096        self
3097    }
3098
3099    /// Sets or clears the value of [dependency][crate::model::CreateDependencyRequest::dependency].
3100    pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
3101    where
3102        T: std::convert::Into<crate::model::Dependency>,
3103    {
3104        self.dependency = v.map(|x| x.into());
3105        self
3106    }
3107}
3108
3109impl wkt::message::Message for CreateDependencyRequest {
3110    fn typename() -> &'static str {
3111        "type.googleapis.com/google.cloud.apihub.v1.CreateDependencyRequest"
3112    }
3113}
3114
3115/// The [GetDependency][.ApiHubDependencies.GetDependency]
3116/// method's request.
3117#[derive(Clone, Default, PartialEq)]
3118#[non_exhaustive]
3119pub struct GetDependencyRequest {
3120    /// Required. The name of the dependency resource to retrieve.
3121    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
3122    pub name: std::string::String,
3123
3124    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3125}
3126
3127impl GetDependencyRequest {
3128    pub fn new() -> Self {
3129        std::default::Default::default()
3130    }
3131
3132    /// Sets the value of [name][crate::model::GetDependencyRequest::name].
3133    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3134        self.name = v.into();
3135        self
3136    }
3137}
3138
3139impl wkt::message::Message for GetDependencyRequest {
3140    fn typename() -> &'static str {
3141        "type.googleapis.com/google.cloud.apihub.v1.GetDependencyRequest"
3142    }
3143}
3144
3145/// The
3146/// [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency]
3147/// method's request.
3148///
3149/// [google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency]: crate::client::ApiHubDependencies::update_dependency
3150#[derive(Clone, Default, PartialEq)]
3151#[non_exhaustive]
3152pub struct UpdateDependencyRequest {
3153    /// Required. The dependency resource to update.
3154    ///
3155    /// The dependency's `name` field is used to identify the dependency to update.
3156    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
3157    pub dependency: std::option::Option<crate::model::Dependency>,
3158
3159    /// Required. The list of fields to update.
3160    pub update_mask: std::option::Option<wkt::FieldMask>,
3161
3162    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3163}
3164
3165impl UpdateDependencyRequest {
3166    pub fn new() -> Self {
3167        std::default::Default::default()
3168    }
3169
3170    /// Sets the value of [dependency][crate::model::UpdateDependencyRequest::dependency].
3171    pub fn set_dependency<T>(mut self, v: T) -> Self
3172    where
3173        T: std::convert::Into<crate::model::Dependency>,
3174    {
3175        self.dependency = std::option::Option::Some(v.into());
3176        self
3177    }
3178
3179    /// Sets or clears the value of [dependency][crate::model::UpdateDependencyRequest::dependency].
3180    pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
3181    where
3182        T: std::convert::Into<crate::model::Dependency>,
3183    {
3184        self.dependency = v.map(|x| x.into());
3185        self
3186    }
3187
3188    /// Sets the value of [update_mask][crate::model::UpdateDependencyRequest::update_mask].
3189    pub fn set_update_mask<T>(mut self, v: T) -> Self
3190    where
3191        T: std::convert::Into<wkt::FieldMask>,
3192    {
3193        self.update_mask = std::option::Option::Some(v.into());
3194        self
3195    }
3196
3197    /// Sets or clears the value of [update_mask][crate::model::UpdateDependencyRequest::update_mask].
3198    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3199    where
3200        T: std::convert::Into<wkt::FieldMask>,
3201    {
3202        self.update_mask = v.map(|x| x.into());
3203        self
3204    }
3205}
3206
3207impl wkt::message::Message for UpdateDependencyRequest {
3208    fn typename() -> &'static str {
3209        "type.googleapis.com/google.cloud.apihub.v1.UpdateDependencyRequest"
3210    }
3211}
3212
3213/// The
3214/// [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency]
3215/// method's request.
3216///
3217/// [google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency]: crate::client::ApiHubDependencies::delete_dependency
3218#[derive(Clone, Default, PartialEq)]
3219#[non_exhaustive]
3220pub struct DeleteDependencyRequest {
3221    /// Required. The name of the dependency resource to delete.
3222    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
3223    pub name: std::string::String,
3224
3225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3226}
3227
3228impl DeleteDependencyRequest {
3229    pub fn new() -> Self {
3230        std::default::Default::default()
3231    }
3232
3233    /// Sets the value of [name][crate::model::DeleteDependencyRequest::name].
3234    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3235        self.name = v.into();
3236        self
3237    }
3238}
3239
3240impl wkt::message::Message for DeleteDependencyRequest {
3241    fn typename() -> &'static str {
3242        "type.googleapis.com/google.cloud.apihub.v1.DeleteDependencyRequest"
3243    }
3244}
3245
3246/// The
3247/// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
3248/// method's request.
3249///
3250/// [google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]: crate::client::ApiHubDependencies::list_dependencies
3251#[derive(Clone, Default, PartialEq)]
3252#[non_exhaustive]
3253pub struct ListDependenciesRequest {
3254    /// Required. The parent which owns this collection of dependency resources.
3255    /// Format: `projects/{project}/locations/{location}`
3256    pub parent: std::string::String,
3257
3258    /// Optional. An expression that filters the list of Dependencies.
3259    ///
3260    /// A filter expression consists of a field name, a comparison operator, and
3261    /// a value for filtering. The value must be a string. Allowed comparison
3262    /// operator is `=`. Filters are not case sensitive.
3263    ///
3264    /// The following fields in the `Dependency` are eligible for filtering:
3265    ///
3266    /// * `consumer.operation_resource_name` - The operation resource name for
3267    ///   the consumer entity involved in a dependency. Allowed comparison
3268    ///   operators: `=`.
3269    /// * `consumer.external_api_resource_name` - The external api resource name
3270    ///   for the consumer entity involved in a dependency. Allowed comparison
3271    ///   operators: `=`.
3272    /// * `supplier.operation_resource_name` - The operation resource name for
3273    ///   the supplier entity involved in a dependency. Allowed comparison
3274    ///   operators: `=`.
3275    /// * `supplier.external_api_resource_name` - The external api resource name
3276    ///   for the supplier entity involved in a dependency. Allowed comparison
3277    ///   operators: `=`.
3278    ///
3279    /// Expressions are combined with either `AND` logic operator or `OR` logical
3280    /// operator but not both of them together i.e. only one of the `AND` or `OR`
3281    /// operator can be used throughout the filter string and both the operators
3282    /// cannot be used together. No other logical operators are supported. At most
3283    /// three filter fields are allowed in the filter string and if provided
3284    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
3285    ///
3286    /// For example, `consumer.operation_resource_name =
3287    /// \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
3288    /// supplier.operation_resource_name =
3289    /// \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
3290    /// dependencies with either consumer or supplier operation resource name as
3291    /// _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
3292    pub filter: std::string::String,
3293
3294    /// Optional. The maximum number of dependency resources to return. The service
3295    /// may return fewer than this value. If unspecified, at most 50 dependencies
3296    /// will be returned. The maximum value is 1000; values above 1000 will be
3297    /// coerced to 1000.
3298    pub page_size: i32,
3299
3300    /// Optional. A page token, received from a previous `ListDependencies` call.
3301    /// Provide this to retrieve the subsequent page.
3302    ///
3303    /// When paginating, all other parameters provided to `ListDependencies` must
3304    /// match the call that provided the page token.
3305    pub page_token: std::string::String,
3306
3307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3308}
3309
3310impl ListDependenciesRequest {
3311    pub fn new() -> Self {
3312        std::default::Default::default()
3313    }
3314
3315    /// Sets the value of [parent][crate::model::ListDependenciesRequest::parent].
3316    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3317        self.parent = v.into();
3318        self
3319    }
3320
3321    /// Sets the value of [filter][crate::model::ListDependenciesRequest::filter].
3322    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3323        self.filter = v.into();
3324        self
3325    }
3326
3327    /// Sets the value of [page_size][crate::model::ListDependenciesRequest::page_size].
3328    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3329        self.page_size = v.into();
3330        self
3331    }
3332
3333    /// Sets the value of [page_token][crate::model::ListDependenciesRequest::page_token].
3334    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3335        self.page_token = v.into();
3336        self
3337    }
3338}
3339
3340impl wkt::message::Message for ListDependenciesRequest {
3341    fn typename() -> &'static str {
3342        "type.googleapis.com/google.cloud.apihub.v1.ListDependenciesRequest"
3343    }
3344}
3345
3346/// The
3347/// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
3348/// method's response.
3349///
3350/// [google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]: crate::client::ApiHubDependencies::list_dependencies
3351#[derive(Clone, Default, PartialEq)]
3352#[non_exhaustive]
3353pub struct ListDependenciesResponse {
3354    /// The dependency resources present in the API hub.
3355    pub dependencies: std::vec::Vec<crate::model::Dependency>,
3356
3357    /// A token, which can be sent as `page_token` to retrieve the next page.
3358    /// If this field is omitted, there are no subsequent pages.
3359    pub next_page_token: std::string::String,
3360
3361    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3362}
3363
3364impl ListDependenciesResponse {
3365    pub fn new() -> Self {
3366        std::default::Default::default()
3367    }
3368
3369    /// Sets the value of [dependencies][crate::model::ListDependenciesResponse::dependencies].
3370    pub fn set_dependencies<T, V>(mut self, v: T) -> Self
3371    where
3372        T: std::iter::IntoIterator<Item = V>,
3373        V: std::convert::Into<crate::model::Dependency>,
3374    {
3375        use std::iter::Iterator;
3376        self.dependencies = v.into_iter().map(|i| i.into()).collect();
3377        self
3378    }
3379
3380    /// Sets the value of [next_page_token][crate::model::ListDependenciesResponse::next_page_token].
3381    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3382        self.next_page_token = v.into();
3383        self
3384    }
3385}
3386
3387impl wkt::message::Message for ListDependenciesResponse {
3388    fn typename() -> &'static str {
3389        "type.googleapis.com/google.cloud.apihub.v1.ListDependenciesResponse"
3390    }
3391}
3392
3393#[doc(hidden)]
3394impl gax::paginator::internal::PageableResponse for ListDependenciesResponse {
3395    type PageItem = crate::model::Dependency;
3396
3397    fn items(self) -> std::vec::Vec<Self::PageItem> {
3398        self.dependencies
3399    }
3400
3401    fn next_page_token(&self) -> std::string::String {
3402        use std::clone::Clone;
3403        self.next_page_token.clone()
3404    }
3405}
3406
3407/// The [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi]
3408/// method's request.
3409///
3410/// [google.cloud.apihub.v1.ApiHub.CreateExternalApi]: crate::client::ApiHub::create_external_api
3411#[derive(Clone, Default, PartialEq)]
3412#[non_exhaustive]
3413pub struct CreateExternalApiRequest {
3414    /// Required. The parent resource for the External API resource.
3415    /// Format: `projects/{project}/locations/{location}`
3416    pub parent: std::string::String,
3417
3418    /// Optional. The ID to use for the External API resource, which will become
3419    /// the final component of the External API's resource name. This field is
3420    /// optional.
3421    ///
3422    /// * If provided, the same will be used. The service will throw an error if
3423    ///   the specified id is already used by another External API resource in the
3424    ///   API hub.
3425    /// * If not provided, a system generated id will be used.
3426    ///
3427    /// This value should be 4-500 characters, and valid characters
3428    /// are /[a-z][A-Z][0-9]-_/.
3429    pub external_api_id: std::string::String,
3430
3431    /// Required. The External API resource to create.
3432    pub external_api: std::option::Option<crate::model::ExternalApi>,
3433
3434    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3435}
3436
3437impl CreateExternalApiRequest {
3438    pub fn new() -> Self {
3439        std::default::Default::default()
3440    }
3441
3442    /// Sets the value of [parent][crate::model::CreateExternalApiRequest::parent].
3443    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3444        self.parent = v.into();
3445        self
3446    }
3447
3448    /// Sets the value of [external_api_id][crate::model::CreateExternalApiRequest::external_api_id].
3449    pub fn set_external_api_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3450        self.external_api_id = v.into();
3451        self
3452    }
3453
3454    /// Sets the value of [external_api][crate::model::CreateExternalApiRequest::external_api].
3455    pub fn set_external_api<T>(mut self, v: T) -> Self
3456    where
3457        T: std::convert::Into<crate::model::ExternalApi>,
3458    {
3459        self.external_api = std::option::Option::Some(v.into());
3460        self
3461    }
3462
3463    /// Sets or clears the value of [external_api][crate::model::CreateExternalApiRequest::external_api].
3464    pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
3465    where
3466        T: std::convert::Into<crate::model::ExternalApi>,
3467    {
3468        self.external_api = v.map(|x| x.into());
3469        self
3470    }
3471}
3472
3473impl wkt::message::Message for CreateExternalApiRequest {
3474    fn typename() -> &'static str {
3475        "type.googleapis.com/google.cloud.apihub.v1.CreateExternalApiRequest"
3476    }
3477}
3478
3479/// The [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's
3480/// request.
3481///
3482/// [google.cloud.apihub.v1.ApiHub.GetExternalApi]: crate::client::ApiHub::get_external_api
3483#[derive(Clone, Default, PartialEq)]
3484#[non_exhaustive]
3485pub struct GetExternalApiRequest {
3486    /// Required. The name of the External API resource to retrieve.
3487    /// Format:
3488    /// `projects/{project}/locations/{location}/externalApis/{externalApi}`
3489    pub name: std::string::String,
3490
3491    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3492}
3493
3494impl GetExternalApiRequest {
3495    pub fn new() -> Self {
3496        std::default::Default::default()
3497    }
3498
3499    /// Sets the value of [name][crate::model::GetExternalApiRequest::name].
3500    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3501        self.name = v.into();
3502        self
3503    }
3504}
3505
3506impl wkt::message::Message for GetExternalApiRequest {
3507    fn typename() -> &'static str {
3508        "type.googleapis.com/google.cloud.apihub.v1.GetExternalApiRequest"
3509    }
3510}
3511
3512/// The [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi]
3513/// method's request.
3514///
3515/// [google.cloud.apihub.v1.ApiHub.UpdateExternalApi]: crate::client::ApiHub::update_external_api
3516#[derive(Clone, Default, PartialEq)]
3517#[non_exhaustive]
3518pub struct UpdateExternalApiRequest {
3519    /// Required. The External API resource to update.
3520    ///
3521    /// The External API resource's `name` field is used to identify the External
3522    /// API resource to update. Format:
3523    /// `projects/{project}/locations/{location}/externalApis/{externalApi}`
3524    pub external_api: std::option::Option<crate::model::ExternalApi>,
3525
3526    /// Required. The list of fields to update.
3527    pub update_mask: std::option::Option<wkt::FieldMask>,
3528
3529    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3530}
3531
3532impl UpdateExternalApiRequest {
3533    pub fn new() -> Self {
3534        std::default::Default::default()
3535    }
3536
3537    /// Sets the value of [external_api][crate::model::UpdateExternalApiRequest::external_api].
3538    pub fn set_external_api<T>(mut self, v: T) -> Self
3539    where
3540        T: std::convert::Into<crate::model::ExternalApi>,
3541    {
3542        self.external_api = std::option::Option::Some(v.into());
3543        self
3544    }
3545
3546    /// Sets or clears the value of [external_api][crate::model::UpdateExternalApiRequest::external_api].
3547    pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
3548    where
3549        T: std::convert::Into<crate::model::ExternalApi>,
3550    {
3551        self.external_api = v.map(|x| x.into());
3552        self
3553    }
3554
3555    /// Sets the value of [update_mask][crate::model::UpdateExternalApiRequest::update_mask].
3556    pub fn set_update_mask<T>(mut self, v: T) -> Self
3557    where
3558        T: std::convert::Into<wkt::FieldMask>,
3559    {
3560        self.update_mask = std::option::Option::Some(v.into());
3561        self
3562    }
3563
3564    /// Sets or clears the value of [update_mask][crate::model::UpdateExternalApiRequest::update_mask].
3565    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3566    where
3567        T: std::convert::Into<wkt::FieldMask>,
3568    {
3569        self.update_mask = v.map(|x| x.into());
3570        self
3571    }
3572}
3573
3574impl wkt::message::Message for UpdateExternalApiRequest {
3575    fn typename() -> &'static str {
3576        "type.googleapis.com/google.cloud.apihub.v1.UpdateExternalApiRequest"
3577    }
3578}
3579
3580/// The [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi]
3581/// method's request.
3582///
3583/// [google.cloud.apihub.v1.ApiHub.DeleteExternalApi]: crate::client::ApiHub::delete_external_api
3584#[derive(Clone, Default, PartialEq)]
3585#[non_exhaustive]
3586pub struct DeleteExternalApiRequest {
3587    /// Required. The name of the External API resource to delete.
3588    /// Format:
3589    /// `projects/{project}/locations/{location}/externalApis/{externalApi}`
3590    pub name: std::string::String,
3591
3592    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3593}
3594
3595impl DeleteExternalApiRequest {
3596    pub fn new() -> Self {
3597        std::default::Default::default()
3598    }
3599
3600    /// Sets the value of [name][crate::model::DeleteExternalApiRequest::name].
3601    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3602        self.name = v.into();
3603        self
3604    }
3605}
3606
3607impl wkt::message::Message for DeleteExternalApiRequest {
3608    fn typename() -> &'static str {
3609        "type.googleapis.com/google.cloud.apihub.v1.DeleteExternalApiRequest"
3610    }
3611}
3612
3613/// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
3614/// method's request.
3615///
3616/// [google.cloud.apihub.v1.ApiHub.ListExternalApis]: crate::client::ApiHub::list_external_apis
3617#[derive(Clone, Default, PartialEq)]
3618#[non_exhaustive]
3619pub struct ListExternalApisRequest {
3620    /// Required. The parent, which owns this collection of External API resources.
3621    /// Format: `projects/{project}/locations/{location}`
3622    pub parent: std::string::String,
3623
3624    /// Optional. The maximum number of External API resources to return. The
3625    /// service may return fewer than this value. If unspecified, at most 50
3626    /// ExternalApis will be returned. The maximum value is 1000; values above 1000
3627    /// will be coerced to 1000.
3628    pub page_size: i32,
3629
3630    /// Optional. A page token, received from a previous `ListExternalApis` call.
3631    /// Provide this to retrieve the subsequent page.
3632    ///
3633    /// When paginating, all other parameters (except page_size) provided to
3634    /// `ListExternalApis` must match the call that provided the page token.
3635    pub page_token: std::string::String,
3636
3637    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3638}
3639
3640impl ListExternalApisRequest {
3641    pub fn new() -> Self {
3642        std::default::Default::default()
3643    }
3644
3645    /// Sets the value of [parent][crate::model::ListExternalApisRequest::parent].
3646    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3647        self.parent = v.into();
3648        self
3649    }
3650
3651    /// Sets the value of [page_size][crate::model::ListExternalApisRequest::page_size].
3652    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3653        self.page_size = v.into();
3654        self
3655    }
3656
3657    /// Sets the value of [page_token][crate::model::ListExternalApisRequest::page_token].
3658    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3659        self.page_token = v.into();
3660        self
3661    }
3662}
3663
3664impl wkt::message::Message for ListExternalApisRequest {
3665    fn typename() -> &'static str {
3666        "type.googleapis.com/google.cloud.apihub.v1.ListExternalApisRequest"
3667    }
3668}
3669
3670/// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
3671/// method's response.
3672///
3673/// [google.cloud.apihub.v1.ApiHub.ListExternalApis]: crate::client::ApiHub::list_external_apis
3674#[derive(Clone, Default, PartialEq)]
3675#[non_exhaustive]
3676pub struct ListExternalApisResponse {
3677    /// The External API resources present in the API hub.
3678    pub external_apis: std::vec::Vec<crate::model::ExternalApi>,
3679
3680    /// A token, which can be sent as `page_token` to retrieve the next page.
3681    /// If this field is omitted, there are no subsequent pages.
3682    pub next_page_token: std::string::String,
3683
3684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3685}
3686
3687impl ListExternalApisResponse {
3688    pub fn new() -> Self {
3689        std::default::Default::default()
3690    }
3691
3692    /// Sets the value of [external_apis][crate::model::ListExternalApisResponse::external_apis].
3693    pub fn set_external_apis<T, V>(mut self, v: T) -> Self
3694    where
3695        T: std::iter::IntoIterator<Item = V>,
3696        V: std::convert::Into<crate::model::ExternalApi>,
3697    {
3698        use std::iter::Iterator;
3699        self.external_apis = v.into_iter().map(|i| i.into()).collect();
3700        self
3701    }
3702
3703    /// Sets the value of [next_page_token][crate::model::ListExternalApisResponse::next_page_token].
3704    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3705        self.next_page_token = v.into();
3706        self
3707    }
3708}
3709
3710impl wkt::message::Message for ListExternalApisResponse {
3711    fn typename() -> &'static str {
3712        "type.googleapis.com/google.cloud.apihub.v1.ListExternalApisResponse"
3713    }
3714}
3715
3716#[doc(hidden)]
3717impl gax::paginator::internal::PageableResponse for ListExternalApisResponse {
3718    type PageItem = crate::model::ExternalApi;
3719
3720    fn items(self) -> std::vec::Vec<Self::PageItem> {
3721        self.external_apis
3722    }
3723
3724    fn next_page_token(&self) -> std::string::String {
3725        use std::clone::Clone;
3726        self.next_page_token.clone()
3727    }
3728}
3729
3730/// The CollectApiData method's request.
3731#[derive(Clone, Default, PartialEq)]
3732#[non_exhaustive]
3733pub struct CollectApiDataRequest {
3734    /// Required. The regional location of the API hub instance and its resources.
3735    /// Format: `projects/{project}/locations/{location}`
3736    pub location: std::string::String,
3737
3738    /// Required. The type of collection. Applies to all entries in
3739    /// [api_data][google.cloud.apihub.v1.CollectApiDataRequest.api_data].
3740    ///
3741    /// [google.cloud.apihub.v1.CollectApiDataRequest.api_data]: crate::model::CollectApiDataRequest::api_data
3742    pub collection_type: crate::model::CollectionType,
3743
3744    /// Required. The plugin instance collecting the API data.
3745    /// Format:
3746    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`.
3747    pub plugin_instance: std::string::String,
3748
3749    /// Required. The action ID to be used for collecting the API data.
3750    /// This should map to one of the action IDs specified
3751    /// in action configs in the plugin.
3752    pub action_id: std::string::String,
3753
3754    /// Required. The API data to be collected.
3755    pub api_data: std::option::Option<crate::model::ApiData>,
3756
3757    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3758}
3759
3760impl CollectApiDataRequest {
3761    pub fn new() -> Self {
3762        std::default::Default::default()
3763    }
3764
3765    /// Sets the value of [location][crate::model::CollectApiDataRequest::location].
3766    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3767        self.location = v.into();
3768        self
3769    }
3770
3771    /// Sets the value of [collection_type][crate::model::CollectApiDataRequest::collection_type].
3772    pub fn set_collection_type<T: std::convert::Into<crate::model::CollectionType>>(
3773        mut self,
3774        v: T,
3775    ) -> Self {
3776        self.collection_type = v.into();
3777        self
3778    }
3779
3780    /// Sets the value of [plugin_instance][crate::model::CollectApiDataRequest::plugin_instance].
3781    pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3782        self.plugin_instance = v.into();
3783        self
3784    }
3785
3786    /// Sets the value of [action_id][crate::model::CollectApiDataRequest::action_id].
3787    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3788        self.action_id = v.into();
3789        self
3790    }
3791
3792    /// Sets the value of [api_data][crate::model::CollectApiDataRequest::api_data].
3793    pub fn set_api_data<T>(mut self, v: T) -> Self
3794    where
3795        T: std::convert::Into<crate::model::ApiData>,
3796    {
3797        self.api_data = std::option::Option::Some(v.into());
3798        self
3799    }
3800
3801    /// Sets or clears the value of [api_data][crate::model::CollectApiDataRequest::api_data].
3802    pub fn set_or_clear_api_data<T>(mut self, v: std::option::Option<T>) -> Self
3803    where
3804        T: std::convert::Into<crate::model::ApiData>,
3805    {
3806        self.api_data = v.map(|x| x.into());
3807        self
3808    }
3809}
3810
3811impl wkt::message::Message for CollectApiDataRequest {
3812    fn typename() -> &'static str {
3813        "type.googleapis.com/google.cloud.apihub.v1.CollectApiDataRequest"
3814    }
3815}
3816
3817/// The API data to be collected.
3818#[derive(Clone, Default, PartialEq)]
3819#[non_exhaustive]
3820pub struct ApiData {
3821    /// The data to be collected.
3822    pub data: std::option::Option<crate::model::api_data::Data>,
3823
3824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3825}
3826
3827impl ApiData {
3828    pub fn new() -> Self {
3829        std::default::Default::default()
3830    }
3831
3832    /// Sets the value of [data][crate::model::ApiData::data].
3833    ///
3834    /// Note that all the setters affecting `data` are mutually
3835    /// exclusive.
3836    pub fn set_data<T: std::convert::Into<std::option::Option<crate::model::api_data::Data>>>(
3837        mut self,
3838        v: T,
3839    ) -> Self {
3840        self.data = v.into();
3841        self
3842    }
3843
3844    /// The value of [data][crate::model::ApiData::data]
3845    /// if it holds a `ApiMetadataList`, `None` if the field is not set or
3846    /// holds a different branch.
3847    pub fn api_metadata_list(
3848        &self,
3849    ) -> std::option::Option<&std::boxed::Box<crate::model::ApiMetadataList>> {
3850        #[allow(unreachable_patterns)]
3851        self.data.as_ref().and_then(|v| match v {
3852            crate::model::api_data::Data::ApiMetadataList(v) => std::option::Option::Some(v),
3853            _ => std::option::Option::None,
3854        })
3855    }
3856
3857    /// Sets the value of [data][crate::model::ApiData::data]
3858    /// to hold a `ApiMetadataList`.
3859    ///
3860    /// Note that all the setters affecting `data` are
3861    /// mutually exclusive.
3862    pub fn set_api_metadata_list<
3863        T: std::convert::Into<std::boxed::Box<crate::model::ApiMetadataList>>,
3864    >(
3865        mut self,
3866        v: T,
3867    ) -> Self {
3868        self.data =
3869            std::option::Option::Some(crate::model::api_data::Data::ApiMetadataList(v.into()));
3870        self
3871    }
3872}
3873
3874impl wkt::message::Message for ApiData {
3875    fn typename() -> &'static str {
3876        "type.googleapis.com/google.cloud.apihub.v1.ApiData"
3877    }
3878}
3879
3880/// Defines additional types related to [ApiData].
3881pub mod api_data {
3882    #[allow(unused_imports)]
3883    use super::*;
3884
3885    /// The data to be collected.
3886    #[derive(Clone, Debug, PartialEq)]
3887    #[non_exhaustive]
3888    pub enum Data {
3889        /// Optional. The list of API metadata.
3890        ApiMetadataList(std::boxed::Box<crate::model::ApiMetadataList>),
3891    }
3892}
3893
3894/// The message to hold repeated API metadata.
3895#[derive(Clone, Default, PartialEq)]
3896#[non_exhaustive]
3897pub struct ApiMetadataList {
3898    /// Required. The list of API metadata.
3899    pub api_metadata: std::vec::Vec<crate::model::APIMetadata>,
3900
3901    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3902}
3903
3904impl ApiMetadataList {
3905    pub fn new() -> Self {
3906        std::default::Default::default()
3907    }
3908
3909    /// Sets the value of [api_metadata][crate::model::ApiMetadataList::api_metadata].
3910    pub fn set_api_metadata<T, V>(mut self, v: T) -> Self
3911    where
3912        T: std::iter::IntoIterator<Item = V>,
3913        V: std::convert::Into<crate::model::APIMetadata>,
3914    {
3915        use std::iter::Iterator;
3916        self.api_metadata = v.into_iter().map(|i| i.into()).collect();
3917        self
3918    }
3919}
3920
3921impl wkt::message::Message for ApiMetadataList {
3922    fn typename() -> &'static str {
3923        "type.googleapis.com/google.cloud.apihub.v1.ApiMetadataList"
3924    }
3925}
3926
3927/// The API metadata.
3928#[derive(Clone, Default, PartialEq)]
3929#[non_exhaustive]
3930pub struct APIMetadata {
3931    /// Required. The API resource to be pushed to Hub's collect layer. The ID of
3932    /// the API resource will be generated by Hub to ensure uniqueness across all
3933    /// APIs across systems.
3934    pub api: std::option::Option<crate::model::Api>,
3935
3936    /// Optional. The list of versions present in an API resource.
3937    pub versions: std::vec::Vec<crate::model::VersionMetadata>,
3938
3939    /// Optional. The unique identifier of the API in the system where it was
3940    /// originally created.
3941    pub original_id: std::string::String,
3942
3943    /// Optional. Timestamp indicating when the API was created at the source.
3944    pub original_create_time: std::option::Option<wkt::Timestamp>,
3945
3946    /// Required. Timestamp indicating when the API was last updated at the source.
3947    pub original_update_time: std::option::Option<wkt::Timestamp>,
3948
3949    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3950}
3951
3952impl APIMetadata {
3953    pub fn new() -> Self {
3954        std::default::Default::default()
3955    }
3956
3957    /// Sets the value of [api][crate::model::APIMetadata::api].
3958    pub fn set_api<T>(mut self, v: T) -> Self
3959    where
3960        T: std::convert::Into<crate::model::Api>,
3961    {
3962        self.api = std::option::Option::Some(v.into());
3963        self
3964    }
3965
3966    /// Sets or clears the value of [api][crate::model::APIMetadata::api].
3967    pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
3968    where
3969        T: std::convert::Into<crate::model::Api>,
3970    {
3971        self.api = v.map(|x| x.into());
3972        self
3973    }
3974
3975    /// Sets the value of [versions][crate::model::APIMetadata::versions].
3976    pub fn set_versions<T, V>(mut self, v: T) -> Self
3977    where
3978        T: std::iter::IntoIterator<Item = V>,
3979        V: std::convert::Into<crate::model::VersionMetadata>,
3980    {
3981        use std::iter::Iterator;
3982        self.versions = v.into_iter().map(|i| i.into()).collect();
3983        self
3984    }
3985
3986    /// Sets the value of [original_id][crate::model::APIMetadata::original_id].
3987    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3988        self.original_id = v.into();
3989        self
3990    }
3991
3992    /// Sets the value of [original_create_time][crate::model::APIMetadata::original_create_time].
3993    pub fn set_original_create_time<T>(mut self, v: T) -> Self
3994    where
3995        T: std::convert::Into<wkt::Timestamp>,
3996    {
3997        self.original_create_time = std::option::Option::Some(v.into());
3998        self
3999    }
4000
4001    /// Sets or clears the value of [original_create_time][crate::model::APIMetadata::original_create_time].
4002    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4003    where
4004        T: std::convert::Into<wkt::Timestamp>,
4005    {
4006        self.original_create_time = v.map(|x| x.into());
4007        self
4008    }
4009
4010    /// Sets the value of [original_update_time][crate::model::APIMetadata::original_update_time].
4011    pub fn set_original_update_time<T>(mut self, v: T) -> Self
4012    where
4013        T: std::convert::Into<wkt::Timestamp>,
4014    {
4015        self.original_update_time = std::option::Option::Some(v.into());
4016        self
4017    }
4018
4019    /// Sets or clears the value of [original_update_time][crate::model::APIMetadata::original_update_time].
4020    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4021    where
4022        T: std::convert::Into<wkt::Timestamp>,
4023    {
4024        self.original_update_time = v.map(|x| x.into());
4025        self
4026    }
4027}
4028
4029impl wkt::message::Message for APIMetadata {
4030    fn typename() -> &'static str {
4031        "type.googleapis.com/google.cloud.apihub.v1.APIMetadata"
4032    }
4033}
4034
4035/// The metadata associated with a version of the API resource.
4036#[derive(Clone, Default, PartialEq)]
4037#[non_exhaustive]
4038pub struct VersionMetadata {
4039    /// Required. Represents a version of the API resource in API hub. The ID of
4040    /// the version will be generated by Hub.
4041    pub version: std::option::Option<crate::model::Version>,
4042
4043    /// Optional. The specs associated with this version.
4044    /// Note that an API version can be associated with multiple specs.
4045    pub specs: std::vec::Vec<crate::model::SpecMetadata>,
4046
4047    /// Optional. The deployments linked to this API version.
4048    /// Note: A particular API version could be deployed to multiple deployments
4049    /// (for dev deployment, UAT deployment, etc.)
4050    pub deployments: std::vec::Vec<crate::model::DeploymentMetadata>,
4051
4052    /// Optional. The unique identifier of the version in the system where it was
4053    /// originally created.
4054    pub original_id: std::string::String,
4055
4056    /// Optional. Timestamp indicating when the version was created at the source.
4057    pub original_create_time: std::option::Option<wkt::Timestamp>,
4058
4059    /// Required. Timestamp indicating when the version was last updated at the
4060    /// source.
4061    pub original_update_time: std::option::Option<wkt::Timestamp>,
4062
4063    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4064}
4065
4066impl VersionMetadata {
4067    pub fn new() -> Self {
4068        std::default::Default::default()
4069    }
4070
4071    /// Sets the value of [version][crate::model::VersionMetadata::version].
4072    pub fn set_version<T>(mut self, v: T) -> Self
4073    where
4074        T: std::convert::Into<crate::model::Version>,
4075    {
4076        self.version = std::option::Option::Some(v.into());
4077        self
4078    }
4079
4080    /// Sets or clears the value of [version][crate::model::VersionMetadata::version].
4081    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
4082    where
4083        T: std::convert::Into<crate::model::Version>,
4084    {
4085        self.version = v.map(|x| x.into());
4086        self
4087    }
4088
4089    /// Sets the value of [specs][crate::model::VersionMetadata::specs].
4090    pub fn set_specs<T, V>(mut self, v: T) -> Self
4091    where
4092        T: std::iter::IntoIterator<Item = V>,
4093        V: std::convert::Into<crate::model::SpecMetadata>,
4094    {
4095        use std::iter::Iterator;
4096        self.specs = v.into_iter().map(|i| i.into()).collect();
4097        self
4098    }
4099
4100    /// Sets the value of [deployments][crate::model::VersionMetadata::deployments].
4101    pub fn set_deployments<T, V>(mut self, v: T) -> Self
4102    where
4103        T: std::iter::IntoIterator<Item = V>,
4104        V: std::convert::Into<crate::model::DeploymentMetadata>,
4105    {
4106        use std::iter::Iterator;
4107        self.deployments = v.into_iter().map(|i| i.into()).collect();
4108        self
4109    }
4110
4111    /// Sets the value of [original_id][crate::model::VersionMetadata::original_id].
4112    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4113        self.original_id = v.into();
4114        self
4115    }
4116
4117    /// Sets the value of [original_create_time][crate::model::VersionMetadata::original_create_time].
4118    pub fn set_original_create_time<T>(mut self, v: T) -> Self
4119    where
4120        T: std::convert::Into<wkt::Timestamp>,
4121    {
4122        self.original_create_time = std::option::Option::Some(v.into());
4123        self
4124    }
4125
4126    /// Sets or clears the value of [original_create_time][crate::model::VersionMetadata::original_create_time].
4127    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4128    where
4129        T: std::convert::Into<wkt::Timestamp>,
4130    {
4131        self.original_create_time = v.map(|x| x.into());
4132        self
4133    }
4134
4135    /// Sets the value of [original_update_time][crate::model::VersionMetadata::original_update_time].
4136    pub fn set_original_update_time<T>(mut self, v: T) -> Self
4137    where
4138        T: std::convert::Into<wkt::Timestamp>,
4139    {
4140        self.original_update_time = std::option::Option::Some(v.into());
4141        self
4142    }
4143
4144    /// Sets or clears the value of [original_update_time][crate::model::VersionMetadata::original_update_time].
4145    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4146    where
4147        T: std::convert::Into<wkt::Timestamp>,
4148    {
4149        self.original_update_time = v.map(|x| x.into());
4150        self
4151    }
4152}
4153
4154impl wkt::message::Message for VersionMetadata {
4155    fn typename() -> &'static str {
4156        "type.googleapis.com/google.cloud.apihub.v1.VersionMetadata"
4157    }
4158}
4159
4160/// The metadata associated with a spec of the API version.
4161#[derive(Clone, Default, PartialEq)]
4162#[non_exhaustive]
4163pub struct SpecMetadata {
4164    /// Required. The spec resource to be pushed to Hub's collect layer. The ID of
4165    /// the spec will be generated by Hub.
4166    pub spec: std::option::Option<crate::model::Spec>,
4167
4168    /// Optional. The unique identifier of the spec in the system where it was
4169    /// originally created.
4170    pub original_id: std::string::String,
4171
4172    /// Optional. Timestamp indicating when the spec was created at the source.
4173    pub original_create_time: std::option::Option<wkt::Timestamp>,
4174
4175    /// Required. Timestamp indicating when the spec was last updated at the
4176    /// source.
4177    pub original_update_time: std::option::Option<wkt::Timestamp>,
4178
4179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4180}
4181
4182impl SpecMetadata {
4183    pub fn new() -> Self {
4184        std::default::Default::default()
4185    }
4186
4187    /// Sets the value of [spec][crate::model::SpecMetadata::spec].
4188    pub fn set_spec<T>(mut self, v: T) -> Self
4189    where
4190        T: std::convert::Into<crate::model::Spec>,
4191    {
4192        self.spec = std::option::Option::Some(v.into());
4193        self
4194    }
4195
4196    /// Sets or clears the value of [spec][crate::model::SpecMetadata::spec].
4197    pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
4198    where
4199        T: std::convert::Into<crate::model::Spec>,
4200    {
4201        self.spec = v.map(|x| x.into());
4202        self
4203    }
4204
4205    /// Sets the value of [original_id][crate::model::SpecMetadata::original_id].
4206    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4207        self.original_id = v.into();
4208        self
4209    }
4210
4211    /// Sets the value of [original_create_time][crate::model::SpecMetadata::original_create_time].
4212    pub fn set_original_create_time<T>(mut self, v: T) -> Self
4213    where
4214        T: std::convert::Into<wkt::Timestamp>,
4215    {
4216        self.original_create_time = std::option::Option::Some(v.into());
4217        self
4218    }
4219
4220    /// Sets or clears the value of [original_create_time][crate::model::SpecMetadata::original_create_time].
4221    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4222    where
4223        T: std::convert::Into<wkt::Timestamp>,
4224    {
4225        self.original_create_time = v.map(|x| x.into());
4226        self
4227    }
4228
4229    /// Sets the value of [original_update_time][crate::model::SpecMetadata::original_update_time].
4230    pub fn set_original_update_time<T>(mut self, v: T) -> Self
4231    where
4232        T: std::convert::Into<wkt::Timestamp>,
4233    {
4234        self.original_update_time = std::option::Option::Some(v.into());
4235        self
4236    }
4237
4238    /// Sets or clears the value of [original_update_time][crate::model::SpecMetadata::original_update_time].
4239    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4240    where
4241        T: std::convert::Into<wkt::Timestamp>,
4242    {
4243        self.original_update_time = v.map(|x| x.into());
4244        self
4245    }
4246}
4247
4248impl wkt::message::Message for SpecMetadata {
4249    fn typename() -> &'static str {
4250        "type.googleapis.com/google.cloud.apihub.v1.SpecMetadata"
4251    }
4252}
4253
4254/// The metadata associated with a deployment.
4255#[derive(Clone, Default, PartialEq)]
4256#[non_exhaustive]
4257pub struct DeploymentMetadata {
4258    /// Required. The deployment resource to be pushed to Hub's collect layer. The
4259    /// ID of the deployment will be generated by Hub.
4260    pub deployment: std::option::Option<crate::model::Deployment>,
4261
4262    /// Optional. The unique identifier of the deployment in the system where it
4263    /// was originally created.
4264    pub original_id: std::string::String,
4265
4266    /// Optional. Timestamp indicating when the deployment was created at the
4267    /// source.
4268    pub original_create_time: std::option::Option<wkt::Timestamp>,
4269
4270    /// Required. Timestamp indicating when the deployment was last updated at the
4271    /// source.
4272    pub original_update_time: std::option::Option<wkt::Timestamp>,
4273
4274    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4275}
4276
4277impl DeploymentMetadata {
4278    pub fn new() -> Self {
4279        std::default::Default::default()
4280    }
4281
4282    /// Sets the value of [deployment][crate::model::DeploymentMetadata::deployment].
4283    pub fn set_deployment<T>(mut self, v: T) -> Self
4284    where
4285        T: std::convert::Into<crate::model::Deployment>,
4286    {
4287        self.deployment = std::option::Option::Some(v.into());
4288        self
4289    }
4290
4291    /// Sets or clears the value of [deployment][crate::model::DeploymentMetadata::deployment].
4292    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
4293    where
4294        T: std::convert::Into<crate::model::Deployment>,
4295    {
4296        self.deployment = v.map(|x| x.into());
4297        self
4298    }
4299
4300    /// Sets the value of [original_id][crate::model::DeploymentMetadata::original_id].
4301    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4302        self.original_id = v.into();
4303        self
4304    }
4305
4306    /// Sets the value of [original_create_time][crate::model::DeploymentMetadata::original_create_time].
4307    pub fn set_original_create_time<T>(mut self, v: T) -> Self
4308    where
4309        T: std::convert::Into<wkt::Timestamp>,
4310    {
4311        self.original_create_time = std::option::Option::Some(v.into());
4312        self
4313    }
4314
4315    /// Sets or clears the value of [original_create_time][crate::model::DeploymentMetadata::original_create_time].
4316    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4317    where
4318        T: std::convert::Into<wkt::Timestamp>,
4319    {
4320        self.original_create_time = v.map(|x| x.into());
4321        self
4322    }
4323
4324    /// Sets the value of [original_update_time][crate::model::DeploymentMetadata::original_update_time].
4325    pub fn set_original_update_time<T>(mut self, v: T) -> Self
4326    where
4327        T: std::convert::Into<wkt::Timestamp>,
4328    {
4329        self.original_update_time = std::option::Option::Some(v.into());
4330        self
4331    }
4332
4333    /// Sets or clears the value of [original_update_time][crate::model::DeploymentMetadata::original_update_time].
4334    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4335    where
4336        T: std::convert::Into<wkt::Timestamp>,
4337    {
4338        self.original_update_time = v.map(|x| x.into());
4339        self
4340    }
4341}
4342
4343impl wkt::message::Message for DeploymentMetadata {
4344    fn typename() -> &'static str {
4345        "type.googleapis.com/google.cloud.apihub.v1.DeploymentMetadata"
4346    }
4347}
4348
4349/// The CollectApiData method's response.
4350#[derive(Clone, Default, PartialEq)]
4351#[non_exhaustive]
4352pub struct CollectApiDataResponse {
4353    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4354}
4355
4356impl CollectApiDataResponse {
4357    pub fn new() -> Self {
4358        std::default::Default::default()
4359    }
4360}
4361
4362impl wkt::message::Message for CollectApiDataResponse {
4363    fn typename() -> &'static str {
4364        "type.googleapis.com/google.cloud.apihub.v1.CollectApiDataResponse"
4365    }
4366}
4367
4368/// An API resource in the API Hub.
4369#[derive(Clone, Default, PartialEq)]
4370#[non_exhaustive]
4371pub struct Api {
4372    /// Identifier. The name of the API resource in the API Hub.
4373    ///
4374    /// Format:
4375    /// `projects/{project}/locations/{location}/apis/{api}`
4376    pub name: std::string::String,
4377
4378    /// Required. The display name of the API resource.
4379    pub display_name: std::string::String,
4380
4381    /// Optional. The description of the API resource.
4382    pub description: std::string::String,
4383
4384    /// Optional. The documentation for the API resource.
4385    pub documentation: std::option::Option<crate::model::Documentation>,
4386
4387    /// Optional. Owner details for the API resource.
4388    pub owner: std::option::Option<crate::model::Owner>,
4389
4390    /// Output only. The list of versions present in an API resource.
4391    /// Note: An API resource can be associated with more than 1 version.
4392    /// Format is
4393    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
4394    pub versions: std::vec::Vec<std::string::String>,
4395
4396    /// Output only. The time at which the API resource was created.
4397    pub create_time: std::option::Option<wkt::Timestamp>,
4398
4399    /// Output only. The time at which the API resource was last updated.
4400    pub update_time: std::option::Option<wkt::Timestamp>,
4401
4402    /// Optional. The target users for the API.
4403    /// This maps to the following system defined attribute:
4404    /// `projects/{project}/locations/{location}/attributes/system-target-user`
4405    /// attribute.
4406    /// The number of values for this attribute will be based on the
4407    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4408    /// API. All values should be from the list of allowed values defined for the
4409    /// attribute.
4410    pub target_user: std::option::Option<crate::model::AttributeValues>,
4411
4412    /// Optional. The team owning the API.
4413    /// This maps to the following system defined attribute:
4414    /// `projects/{project}/locations/{location}/attributes/system-team`
4415    /// attribute.
4416    /// The number of values for this attribute will be based on the
4417    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4418    /// API. All values should be from the list of allowed values defined for the
4419    /// attribute.
4420    pub team: std::option::Option<crate::model::AttributeValues>,
4421
4422    /// Optional. The business unit owning the API.
4423    /// This maps to the following system defined attribute:
4424    /// `projects/{project}/locations/{location}/attributes/system-business-unit`
4425    /// attribute.
4426    /// The number of values for this attribute will be based on the
4427    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4428    /// API. All values should be from the list of allowed values defined for the
4429    /// attribute.
4430    pub business_unit: std::option::Option<crate::model::AttributeValues>,
4431
4432    /// Optional. The maturity level of the API.
4433    /// This maps to the following system defined attribute:
4434    /// `projects/{project}/locations/{location}/attributes/system-maturity-level`
4435    /// attribute.
4436    /// The number of values for this attribute will be based on the
4437    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4438    /// API. All values should be from the list of allowed values defined for the
4439    /// attribute.
4440    pub maturity_level: std::option::Option<crate::model::AttributeValues>,
4441
4442    /// Optional. The list of user defined attributes associated with the API
4443    /// resource. The key is the attribute name. It will be of the format:
4444    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
4445    /// The value is the attribute values associated with the resource.
4446    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
4447
4448    /// Optional. The style of the API.
4449    /// This maps to the following system defined attribute:
4450    /// `projects/{project}/locations/{location}/attributes/system-api-style`
4451    /// attribute.
4452    /// The number of values for this attribute will be based on the
4453    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4454    /// API. All values should be from the list of allowed values defined for the
4455    /// attribute.
4456    pub api_style: std::option::Option<crate::model::AttributeValues>,
4457
4458    /// Optional. The selected version for an API resource.
4459    /// This can be used when special handling is needed on client side for
4460    /// particular version of the API. Format is
4461    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
4462    pub selected_version: std::string::String,
4463
4464    /// Optional. The api requirement doc associated with the API resource.
4465    /// Carinality is 1 for this attribute. This maps to the following system
4466    /// defined attribute:
4467    /// `projects/{project}/locations/{location}/attributes/system-api-requirements`
4468    /// attribute. The value of the attribute should be a proper URI, and in case
4469    /// of Cloud Storage URI, it should point to a Cloud Storage object,
4470    /// not a directory.
4471    pub api_requirements: std::option::Option<crate::model::AttributeValues>,
4472
4473    /// Optional. Fingerprint of the API resource.
4474    pub fingerprint: std::string::String,
4475
4476    /// Output only. The list of sources and metadata from the sources of the API
4477    /// resource.
4478    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
4479
4480    /// Optional. The api functional requirements associated with the API resource.
4481    /// Carinality is 1 for this attribute.
4482    /// This maps to the following system defined attribute:
4483    /// `projects/{project}/locations/{location}/attributes/system-api-functional-requirements`
4484    /// attribute. The value of the attribute should be a proper URI, and in case
4485    /// of Cloud Storage URI, it should point to a Cloud Storage object,
4486    /// not a directory.
4487    pub api_functional_requirements: std::option::Option<crate::model::AttributeValues>,
4488
4489    /// Optional. The api technical requirements associated with the API resource.
4490    /// Carinality is 1 for this attribute. This maps to the following system
4491    /// defined attribute:
4492    /// `projects/{project}/locations/{location}/attributes/system-api-technical-requirements`
4493    /// attribute. The value of the attribute should be a proper URI, and in case
4494    /// of Cloud Storage URI, it should point to a Cloud Storage object,
4495    /// not a directory.
4496    pub api_technical_requirements: std::option::Option<crate::model::AttributeValues>,
4497
4498    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4499}
4500
4501impl Api {
4502    pub fn new() -> Self {
4503        std::default::Default::default()
4504    }
4505
4506    /// Sets the value of [name][crate::model::Api::name].
4507    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4508        self.name = v.into();
4509        self
4510    }
4511
4512    /// Sets the value of [display_name][crate::model::Api::display_name].
4513    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4514        self.display_name = v.into();
4515        self
4516    }
4517
4518    /// Sets the value of [description][crate::model::Api::description].
4519    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4520        self.description = v.into();
4521        self
4522    }
4523
4524    /// Sets the value of [documentation][crate::model::Api::documentation].
4525    pub fn set_documentation<T>(mut self, v: T) -> Self
4526    where
4527        T: std::convert::Into<crate::model::Documentation>,
4528    {
4529        self.documentation = std::option::Option::Some(v.into());
4530        self
4531    }
4532
4533    /// Sets or clears the value of [documentation][crate::model::Api::documentation].
4534    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
4535    where
4536        T: std::convert::Into<crate::model::Documentation>,
4537    {
4538        self.documentation = v.map(|x| x.into());
4539        self
4540    }
4541
4542    /// Sets the value of [owner][crate::model::Api::owner].
4543    pub fn set_owner<T>(mut self, v: T) -> Self
4544    where
4545        T: std::convert::Into<crate::model::Owner>,
4546    {
4547        self.owner = std::option::Option::Some(v.into());
4548        self
4549    }
4550
4551    /// Sets or clears the value of [owner][crate::model::Api::owner].
4552    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
4553    where
4554        T: std::convert::Into<crate::model::Owner>,
4555    {
4556        self.owner = v.map(|x| x.into());
4557        self
4558    }
4559
4560    /// Sets the value of [versions][crate::model::Api::versions].
4561    pub fn set_versions<T, V>(mut self, v: T) -> Self
4562    where
4563        T: std::iter::IntoIterator<Item = V>,
4564        V: std::convert::Into<std::string::String>,
4565    {
4566        use std::iter::Iterator;
4567        self.versions = v.into_iter().map(|i| i.into()).collect();
4568        self
4569    }
4570
4571    /// Sets the value of [create_time][crate::model::Api::create_time].
4572    pub fn set_create_time<T>(mut self, v: T) -> Self
4573    where
4574        T: std::convert::Into<wkt::Timestamp>,
4575    {
4576        self.create_time = std::option::Option::Some(v.into());
4577        self
4578    }
4579
4580    /// Sets or clears the value of [create_time][crate::model::Api::create_time].
4581    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4582    where
4583        T: std::convert::Into<wkt::Timestamp>,
4584    {
4585        self.create_time = v.map(|x| x.into());
4586        self
4587    }
4588
4589    /// Sets the value of [update_time][crate::model::Api::update_time].
4590    pub fn set_update_time<T>(mut self, v: T) -> Self
4591    where
4592        T: std::convert::Into<wkt::Timestamp>,
4593    {
4594        self.update_time = std::option::Option::Some(v.into());
4595        self
4596    }
4597
4598    /// Sets or clears the value of [update_time][crate::model::Api::update_time].
4599    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4600    where
4601        T: std::convert::Into<wkt::Timestamp>,
4602    {
4603        self.update_time = v.map(|x| x.into());
4604        self
4605    }
4606
4607    /// Sets the value of [target_user][crate::model::Api::target_user].
4608    pub fn set_target_user<T>(mut self, v: T) -> Self
4609    where
4610        T: std::convert::Into<crate::model::AttributeValues>,
4611    {
4612        self.target_user = std::option::Option::Some(v.into());
4613        self
4614    }
4615
4616    /// Sets or clears the value of [target_user][crate::model::Api::target_user].
4617    pub fn set_or_clear_target_user<T>(mut self, v: std::option::Option<T>) -> Self
4618    where
4619        T: std::convert::Into<crate::model::AttributeValues>,
4620    {
4621        self.target_user = v.map(|x| x.into());
4622        self
4623    }
4624
4625    /// Sets the value of [team][crate::model::Api::team].
4626    pub fn set_team<T>(mut self, v: T) -> Self
4627    where
4628        T: std::convert::Into<crate::model::AttributeValues>,
4629    {
4630        self.team = std::option::Option::Some(v.into());
4631        self
4632    }
4633
4634    /// Sets or clears the value of [team][crate::model::Api::team].
4635    pub fn set_or_clear_team<T>(mut self, v: std::option::Option<T>) -> Self
4636    where
4637        T: std::convert::Into<crate::model::AttributeValues>,
4638    {
4639        self.team = v.map(|x| x.into());
4640        self
4641    }
4642
4643    /// Sets the value of [business_unit][crate::model::Api::business_unit].
4644    pub fn set_business_unit<T>(mut self, v: T) -> Self
4645    where
4646        T: std::convert::Into<crate::model::AttributeValues>,
4647    {
4648        self.business_unit = std::option::Option::Some(v.into());
4649        self
4650    }
4651
4652    /// Sets or clears the value of [business_unit][crate::model::Api::business_unit].
4653    pub fn set_or_clear_business_unit<T>(mut self, v: std::option::Option<T>) -> Self
4654    where
4655        T: std::convert::Into<crate::model::AttributeValues>,
4656    {
4657        self.business_unit = v.map(|x| x.into());
4658        self
4659    }
4660
4661    /// Sets the value of [maturity_level][crate::model::Api::maturity_level].
4662    pub fn set_maturity_level<T>(mut self, v: T) -> Self
4663    where
4664        T: std::convert::Into<crate::model::AttributeValues>,
4665    {
4666        self.maturity_level = std::option::Option::Some(v.into());
4667        self
4668    }
4669
4670    /// Sets or clears the value of [maturity_level][crate::model::Api::maturity_level].
4671    pub fn set_or_clear_maturity_level<T>(mut self, v: std::option::Option<T>) -> Self
4672    where
4673        T: std::convert::Into<crate::model::AttributeValues>,
4674    {
4675        self.maturity_level = v.map(|x| x.into());
4676        self
4677    }
4678
4679    /// Sets the value of [attributes][crate::model::Api::attributes].
4680    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
4681    where
4682        T: std::iter::IntoIterator<Item = (K, V)>,
4683        K: std::convert::Into<std::string::String>,
4684        V: std::convert::Into<crate::model::AttributeValues>,
4685    {
4686        use std::iter::Iterator;
4687        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4688        self
4689    }
4690
4691    /// Sets the value of [api_style][crate::model::Api::api_style].
4692    pub fn set_api_style<T>(mut self, v: T) -> Self
4693    where
4694        T: std::convert::Into<crate::model::AttributeValues>,
4695    {
4696        self.api_style = std::option::Option::Some(v.into());
4697        self
4698    }
4699
4700    /// Sets or clears the value of [api_style][crate::model::Api::api_style].
4701    pub fn set_or_clear_api_style<T>(mut self, v: std::option::Option<T>) -> Self
4702    where
4703        T: std::convert::Into<crate::model::AttributeValues>,
4704    {
4705        self.api_style = v.map(|x| x.into());
4706        self
4707    }
4708
4709    /// Sets the value of [selected_version][crate::model::Api::selected_version].
4710    pub fn set_selected_version<T: std::convert::Into<std::string::String>>(
4711        mut self,
4712        v: T,
4713    ) -> Self {
4714        self.selected_version = v.into();
4715        self
4716    }
4717
4718    /// Sets the value of [api_requirements][crate::model::Api::api_requirements].
4719    pub fn set_api_requirements<T>(mut self, v: T) -> Self
4720    where
4721        T: std::convert::Into<crate::model::AttributeValues>,
4722    {
4723        self.api_requirements = std::option::Option::Some(v.into());
4724        self
4725    }
4726
4727    /// Sets or clears the value of [api_requirements][crate::model::Api::api_requirements].
4728    pub fn set_or_clear_api_requirements<T>(mut self, v: std::option::Option<T>) -> Self
4729    where
4730        T: std::convert::Into<crate::model::AttributeValues>,
4731    {
4732        self.api_requirements = v.map(|x| x.into());
4733        self
4734    }
4735
4736    /// Sets the value of [fingerprint][crate::model::Api::fingerprint].
4737    pub fn set_fingerprint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4738        self.fingerprint = v.into();
4739        self
4740    }
4741
4742    /// Sets the value of [source_metadata][crate::model::Api::source_metadata].
4743    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
4744    where
4745        T: std::iter::IntoIterator<Item = V>,
4746        V: std::convert::Into<crate::model::SourceMetadata>,
4747    {
4748        use std::iter::Iterator;
4749        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
4750        self
4751    }
4752
4753    /// Sets the value of [api_functional_requirements][crate::model::Api::api_functional_requirements].
4754    pub fn set_api_functional_requirements<T>(mut self, v: T) -> Self
4755    where
4756        T: std::convert::Into<crate::model::AttributeValues>,
4757    {
4758        self.api_functional_requirements = std::option::Option::Some(v.into());
4759        self
4760    }
4761
4762    /// Sets or clears the value of [api_functional_requirements][crate::model::Api::api_functional_requirements].
4763    pub fn set_or_clear_api_functional_requirements<T>(mut self, v: std::option::Option<T>) -> Self
4764    where
4765        T: std::convert::Into<crate::model::AttributeValues>,
4766    {
4767        self.api_functional_requirements = v.map(|x| x.into());
4768        self
4769    }
4770
4771    /// Sets the value of [api_technical_requirements][crate::model::Api::api_technical_requirements].
4772    pub fn set_api_technical_requirements<T>(mut self, v: T) -> Self
4773    where
4774        T: std::convert::Into<crate::model::AttributeValues>,
4775    {
4776        self.api_technical_requirements = std::option::Option::Some(v.into());
4777        self
4778    }
4779
4780    /// Sets or clears the value of [api_technical_requirements][crate::model::Api::api_technical_requirements].
4781    pub fn set_or_clear_api_technical_requirements<T>(mut self, v: std::option::Option<T>) -> Self
4782    where
4783        T: std::convert::Into<crate::model::AttributeValues>,
4784    {
4785        self.api_technical_requirements = v.map(|x| x.into());
4786        self
4787    }
4788}
4789
4790impl wkt::message::Message for Api {
4791    fn typename() -> &'static str {
4792        "type.googleapis.com/google.cloud.apihub.v1.Api"
4793    }
4794}
4795
4796/// Represents a version of the API resource in API hub. This is also referred
4797/// to as the API version.
4798#[derive(Clone, Default, PartialEq)]
4799#[non_exhaustive]
4800pub struct Version {
4801    /// Identifier. The name of the version.
4802    ///
4803    /// Format:
4804    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
4805    pub name: std::string::String,
4806
4807    /// Required. The display name of the version.
4808    pub display_name: std::string::String,
4809
4810    /// Optional. The description of the version.
4811    pub description: std::string::String,
4812
4813    /// Optional. The documentation of the version.
4814    pub documentation: std::option::Option<crate::model::Documentation>,
4815
4816    /// Output only. The specs associated with this version.
4817    /// Note that an API version can be associated with multiple specs.
4818    /// Format is
4819    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
4820    pub specs: std::vec::Vec<std::string::String>,
4821
4822    /// Output only. The operations contained in the API version.
4823    /// These operations will be added to the version when a new spec is
4824    /// added or when an existing spec is updated. Format is
4825    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
4826    pub api_operations: std::vec::Vec<std::string::String>,
4827
4828    /// Output only. The definitions contained in the API version.
4829    /// These definitions will be added to the version when a new spec is
4830    /// added or when an existing spec is updated. Format is
4831    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
4832    pub definitions: std::vec::Vec<std::string::String>,
4833
4834    /// Optional. The deployments linked to this API version.
4835    /// Note: A particular API version could be deployed to multiple deployments
4836    /// (for dev deployment, UAT deployment, etc)
4837    /// Format is
4838    /// `projects/{project}/locations/{location}/deployments/{deployment}`
4839    pub deployments: std::vec::Vec<std::string::String>,
4840
4841    /// Output only. The time at which the version was created.
4842    pub create_time: std::option::Option<wkt::Timestamp>,
4843
4844    /// Output only. The time at which the version was last updated.
4845    pub update_time: std::option::Option<wkt::Timestamp>,
4846
4847    /// Optional. The lifecycle of the API version.
4848    /// This maps to the following system defined attribute:
4849    /// `projects/{project}/locations/{location}/attributes/system-lifecycle`
4850    /// attribute.
4851    /// The number of values for this attribute will be based on the
4852    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4853    /// API. All values should be from the list of allowed values defined for the
4854    /// attribute.
4855    pub lifecycle: std::option::Option<crate::model::AttributeValues>,
4856
4857    /// Optional. The compliance associated with the API version.
4858    /// This maps to the following system defined attribute:
4859    /// `projects/{project}/locations/{location}/attributes/system-compliance`
4860    /// attribute.
4861    /// The number of values for this attribute will be based on the
4862    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4863    /// API. All values should be from the list of allowed values defined for the
4864    /// attribute.
4865    pub compliance: std::option::Option<crate::model::AttributeValues>,
4866
4867    /// Optional. The accreditations associated with the API version.
4868    /// This maps to the following system defined attribute:
4869    /// `projects/{project}/locations/{location}/attributes/system-accreditation`
4870    /// attribute.
4871    /// The number of values for this attribute will be based on the
4872    /// cardinality of the attribute. The same can be retrieved via GetAttribute
4873    /// API. All values should be from the list of allowed values defined for the
4874    /// attribute.
4875    pub accreditation: std::option::Option<crate::model::AttributeValues>,
4876
4877    /// Optional. The list of user defined attributes associated with the Version
4878    /// resource. The key is the attribute name. It will be of the format:
4879    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
4880    /// The value is the attribute values associated with the resource.
4881    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
4882
4883    /// Optional. The selected deployment for a Version resource.
4884    /// This can be used when special handling is needed on client side for a
4885    /// particular deployment linked to the version.
4886    /// Format is
4887    /// `projects/{project}/locations/{location}/deployments/{deployment}`
4888    pub selected_deployment: std::string::String,
4889
4890    /// Output only. The list of sources and metadata from the sources of the
4891    /// version.
4892    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
4893
4894    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4895}
4896
4897impl Version {
4898    pub fn new() -> Self {
4899        std::default::Default::default()
4900    }
4901
4902    /// Sets the value of [name][crate::model::Version::name].
4903    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4904        self.name = v.into();
4905        self
4906    }
4907
4908    /// Sets the value of [display_name][crate::model::Version::display_name].
4909    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4910        self.display_name = v.into();
4911        self
4912    }
4913
4914    /// Sets the value of [description][crate::model::Version::description].
4915    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4916        self.description = v.into();
4917        self
4918    }
4919
4920    /// Sets the value of [documentation][crate::model::Version::documentation].
4921    pub fn set_documentation<T>(mut self, v: T) -> Self
4922    where
4923        T: std::convert::Into<crate::model::Documentation>,
4924    {
4925        self.documentation = std::option::Option::Some(v.into());
4926        self
4927    }
4928
4929    /// Sets or clears the value of [documentation][crate::model::Version::documentation].
4930    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
4931    where
4932        T: std::convert::Into<crate::model::Documentation>,
4933    {
4934        self.documentation = v.map(|x| x.into());
4935        self
4936    }
4937
4938    /// Sets the value of [specs][crate::model::Version::specs].
4939    pub fn set_specs<T, V>(mut self, v: T) -> Self
4940    where
4941        T: std::iter::IntoIterator<Item = V>,
4942        V: std::convert::Into<std::string::String>,
4943    {
4944        use std::iter::Iterator;
4945        self.specs = v.into_iter().map(|i| i.into()).collect();
4946        self
4947    }
4948
4949    /// Sets the value of [api_operations][crate::model::Version::api_operations].
4950    pub fn set_api_operations<T, V>(mut self, v: T) -> Self
4951    where
4952        T: std::iter::IntoIterator<Item = V>,
4953        V: std::convert::Into<std::string::String>,
4954    {
4955        use std::iter::Iterator;
4956        self.api_operations = v.into_iter().map(|i| i.into()).collect();
4957        self
4958    }
4959
4960    /// Sets the value of [definitions][crate::model::Version::definitions].
4961    pub fn set_definitions<T, V>(mut self, v: T) -> Self
4962    where
4963        T: std::iter::IntoIterator<Item = V>,
4964        V: std::convert::Into<std::string::String>,
4965    {
4966        use std::iter::Iterator;
4967        self.definitions = v.into_iter().map(|i| i.into()).collect();
4968        self
4969    }
4970
4971    /// Sets the value of [deployments][crate::model::Version::deployments].
4972    pub fn set_deployments<T, V>(mut self, v: T) -> Self
4973    where
4974        T: std::iter::IntoIterator<Item = V>,
4975        V: std::convert::Into<std::string::String>,
4976    {
4977        use std::iter::Iterator;
4978        self.deployments = v.into_iter().map(|i| i.into()).collect();
4979        self
4980    }
4981
4982    /// Sets the value of [create_time][crate::model::Version::create_time].
4983    pub fn set_create_time<T>(mut self, v: T) -> Self
4984    where
4985        T: std::convert::Into<wkt::Timestamp>,
4986    {
4987        self.create_time = std::option::Option::Some(v.into());
4988        self
4989    }
4990
4991    /// Sets or clears the value of [create_time][crate::model::Version::create_time].
4992    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4993    where
4994        T: std::convert::Into<wkt::Timestamp>,
4995    {
4996        self.create_time = v.map(|x| x.into());
4997        self
4998    }
4999
5000    /// Sets the value of [update_time][crate::model::Version::update_time].
5001    pub fn set_update_time<T>(mut self, v: T) -> Self
5002    where
5003        T: std::convert::Into<wkt::Timestamp>,
5004    {
5005        self.update_time = std::option::Option::Some(v.into());
5006        self
5007    }
5008
5009    /// Sets or clears the value of [update_time][crate::model::Version::update_time].
5010    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5011    where
5012        T: std::convert::Into<wkt::Timestamp>,
5013    {
5014        self.update_time = v.map(|x| x.into());
5015        self
5016    }
5017
5018    /// Sets the value of [lifecycle][crate::model::Version::lifecycle].
5019    pub fn set_lifecycle<T>(mut self, v: T) -> Self
5020    where
5021        T: std::convert::Into<crate::model::AttributeValues>,
5022    {
5023        self.lifecycle = std::option::Option::Some(v.into());
5024        self
5025    }
5026
5027    /// Sets or clears the value of [lifecycle][crate::model::Version::lifecycle].
5028    pub fn set_or_clear_lifecycle<T>(mut self, v: std::option::Option<T>) -> Self
5029    where
5030        T: std::convert::Into<crate::model::AttributeValues>,
5031    {
5032        self.lifecycle = v.map(|x| x.into());
5033        self
5034    }
5035
5036    /// Sets the value of [compliance][crate::model::Version::compliance].
5037    pub fn set_compliance<T>(mut self, v: T) -> Self
5038    where
5039        T: std::convert::Into<crate::model::AttributeValues>,
5040    {
5041        self.compliance = std::option::Option::Some(v.into());
5042        self
5043    }
5044
5045    /// Sets or clears the value of [compliance][crate::model::Version::compliance].
5046    pub fn set_or_clear_compliance<T>(mut self, v: std::option::Option<T>) -> Self
5047    where
5048        T: std::convert::Into<crate::model::AttributeValues>,
5049    {
5050        self.compliance = v.map(|x| x.into());
5051        self
5052    }
5053
5054    /// Sets the value of [accreditation][crate::model::Version::accreditation].
5055    pub fn set_accreditation<T>(mut self, v: T) -> Self
5056    where
5057        T: std::convert::Into<crate::model::AttributeValues>,
5058    {
5059        self.accreditation = std::option::Option::Some(v.into());
5060        self
5061    }
5062
5063    /// Sets or clears the value of [accreditation][crate::model::Version::accreditation].
5064    pub fn set_or_clear_accreditation<T>(mut self, v: std::option::Option<T>) -> Self
5065    where
5066        T: std::convert::Into<crate::model::AttributeValues>,
5067    {
5068        self.accreditation = v.map(|x| x.into());
5069        self
5070    }
5071
5072    /// Sets the value of [attributes][crate::model::Version::attributes].
5073    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5074    where
5075        T: std::iter::IntoIterator<Item = (K, V)>,
5076        K: std::convert::Into<std::string::String>,
5077        V: std::convert::Into<crate::model::AttributeValues>,
5078    {
5079        use std::iter::Iterator;
5080        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5081        self
5082    }
5083
5084    /// Sets the value of [selected_deployment][crate::model::Version::selected_deployment].
5085    pub fn set_selected_deployment<T: std::convert::Into<std::string::String>>(
5086        mut self,
5087        v: T,
5088    ) -> Self {
5089        self.selected_deployment = v.into();
5090        self
5091    }
5092
5093    /// Sets the value of [source_metadata][crate::model::Version::source_metadata].
5094    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
5095    where
5096        T: std::iter::IntoIterator<Item = V>,
5097        V: std::convert::Into<crate::model::SourceMetadata>,
5098    {
5099        use std::iter::Iterator;
5100        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
5101        self
5102    }
5103}
5104
5105impl wkt::message::Message for Version {
5106    fn typename() -> &'static str {
5107        "type.googleapis.com/google.cloud.apihub.v1.Version"
5108    }
5109}
5110
5111/// Represents a spec associated with an API version in the API
5112/// Hub. Note that specs of various types can be uploaded, however
5113/// parsing of details is supported for OpenAPI spec currently.
5114#[derive(Clone, Default, PartialEq)]
5115#[non_exhaustive]
5116pub struct Spec {
5117    /// Identifier. The name of the spec.
5118    ///
5119    /// Format:
5120    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
5121    pub name: std::string::String,
5122
5123    /// Required. The display name of the spec.
5124    /// This can contain the file name of the spec.
5125    pub display_name: std::string::String,
5126
5127    /// Required. The type of spec.
5128    /// The value should be one of the allowed values defined for
5129    /// `projects/{project}/locations/{location}/attributes/system-spec-type`
5130    /// attribute.
5131    /// The number of values for this attribute will be based on the
5132    /// cardinality of the attribute. The same can be retrieved via GetAttribute
5133    /// API.
5134    ///
5135    /// Note, this field is mandatory if content is provided.
5136    pub spec_type: std::option::Option<crate::model::AttributeValues>,
5137
5138    /// Optional. Input only. The contents of the uploaded spec.
5139    pub contents: std::option::Option<crate::model::SpecContents>,
5140
5141    /// Output only. Details parsed from the spec.
5142    pub details: std::option::Option<crate::model::SpecDetails>,
5143
5144    /// Optional. The URI of the spec source in case file is uploaded
5145    /// from an external version control system.
5146    pub source_uri: std::string::String,
5147
5148    /// Output only. The time at which the spec was created.
5149    pub create_time: std::option::Option<wkt::Timestamp>,
5150
5151    /// Output only. The time at which the spec was last updated.
5152    pub update_time: std::option::Option<wkt::Timestamp>,
5153
5154    /// Optional. The lint response for the spec.
5155    pub lint_response: std::option::Option<crate::model::LintResponse>,
5156
5157    /// Optional. The list of user defined attributes associated with the spec.
5158    /// The key is the attribute name. It will be of the format:
5159    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
5160    /// The value is the attribute values associated with the resource.
5161    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
5162
5163    /// Optional. The documentation of the spec.
5164    /// For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
5165    /// spec.
5166    pub documentation: std::option::Option<crate::model::Documentation>,
5167
5168    /// Optional. Input only. Enum specifying the parsing mode for OpenAPI
5169    /// Specification (OAS) parsing.
5170    pub parsing_mode: crate::model::spec::ParsingMode,
5171
5172    /// Output only. The list of sources and metadata from the sources of the spec.
5173    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
5174
5175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5176}
5177
5178impl Spec {
5179    pub fn new() -> Self {
5180        std::default::Default::default()
5181    }
5182
5183    /// Sets the value of [name][crate::model::Spec::name].
5184    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5185        self.name = v.into();
5186        self
5187    }
5188
5189    /// Sets the value of [display_name][crate::model::Spec::display_name].
5190    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5191        self.display_name = v.into();
5192        self
5193    }
5194
5195    /// Sets the value of [spec_type][crate::model::Spec::spec_type].
5196    pub fn set_spec_type<T>(mut self, v: T) -> Self
5197    where
5198        T: std::convert::Into<crate::model::AttributeValues>,
5199    {
5200        self.spec_type = std::option::Option::Some(v.into());
5201        self
5202    }
5203
5204    /// Sets or clears the value of [spec_type][crate::model::Spec::spec_type].
5205    pub fn set_or_clear_spec_type<T>(mut self, v: std::option::Option<T>) -> Self
5206    where
5207        T: std::convert::Into<crate::model::AttributeValues>,
5208    {
5209        self.spec_type = v.map(|x| x.into());
5210        self
5211    }
5212
5213    /// Sets the value of [contents][crate::model::Spec::contents].
5214    pub fn set_contents<T>(mut self, v: T) -> Self
5215    where
5216        T: std::convert::Into<crate::model::SpecContents>,
5217    {
5218        self.contents = std::option::Option::Some(v.into());
5219        self
5220    }
5221
5222    /// Sets or clears the value of [contents][crate::model::Spec::contents].
5223    pub fn set_or_clear_contents<T>(mut self, v: std::option::Option<T>) -> Self
5224    where
5225        T: std::convert::Into<crate::model::SpecContents>,
5226    {
5227        self.contents = v.map(|x| x.into());
5228        self
5229    }
5230
5231    /// Sets the value of [details][crate::model::Spec::details].
5232    pub fn set_details<T>(mut self, v: T) -> Self
5233    where
5234        T: std::convert::Into<crate::model::SpecDetails>,
5235    {
5236        self.details = std::option::Option::Some(v.into());
5237        self
5238    }
5239
5240    /// Sets or clears the value of [details][crate::model::Spec::details].
5241    pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
5242    where
5243        T: std::convert::Into<crate::model::SpecDetails>,
5244    {
5245        self.details = v.map(|x| x.into());
5246        self
5247    }
5248
5249    /// Sets the value of [source_uri][crate::model::Spec::source_uri].
5250    pub fn set_source_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5251        self.source_uri = v.into();
5252        self
5253    }
5254
5255    /// Sets the value of [create_time][crate::model::Spec::create_time].
5256    pub fn set_create_time<T>(mut self, v: T) -> Self
5257    where
5258        T: std::convert::Into<wkt::Timestamp>,
5259    {
5260        self.create_time = std::option::Option::Some(v.into());
5261        self
5262    }
5263
5264    /// Sets or clears the value of [create_time][crate::model::Spec::create_time].
5265    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5266    where
5267        T: std::convert::Into<wkt::Timestamp>,
5268    {
5269        self.create_time = v.map(|x| x.into());
5270        self
5271    }
5272
5273    /// Sets the value of [update_time][crate::model::Spec::update_time].
5274    pub fn set_update_time<T>(mut self, v: T) -> Self
5275    where
5276        T: std::convert::Into<wkt::Timestamp>,
5277    {
5278        self.update_time = std::option::Option::Some(v.into());
5279        self
5280    }
5281
5282    /// Sets or clears the value of [update_time][crate::model::Spec::update_time].
5283    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5284    where
5285        T: std::convert::Into<wkt::Timestamp>,
5286    {
5287        self.update_time = v.map(|x| x.into());
5288        self
5289    }
5290
5291    /// Sets the value of [lint_response][crate::model::Spec::lint_response].
5292    pub fn set_lint_response<T>(mut self, v: T) -> Self
5293    where
5294        T: std::convert::Into<crate::model::LintResponse>,
5295    {
5296        self.lint_response = std::option::Option::Some(v.into());
5297        self
5298    }
5299
5300    /// Sets or clears the value of [lint_response][crate::model::Spec::lint_response].
5301    pub fn set_or_clear_lint_response<T>(mut self, v: std::option::Option<T>) -> Self
5302    where
5303        T: std::convert::Into<crate::model::LintResponse>,
5304    {
5305        self.lint_response = v.map(|x| x.into());
5306        self
5307    }
5308
5309    /// Sets the value of [attributes][crate::model::Spec::attributes].
5310    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5311    where
5312        T: std::iter::IntoIterator<Item = (K, V)>,
5313        K: std::convert::Into<std::string::String>,
5314        V: std::convert::Into<crate::model::AttributeValues>,
5315    {
5316        use std::iter::Iterator;
5317        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5318        self
5319    }
5320
5321    /// Sets the value of [documentation][crate::model::Spec::documentation].
5322    pub fn set_documentation<T>(mut self, v: T) -> Self
5323    where
5324        T: std::convert::Into<crate::model::Documentation>,
5325    {
5326        self.documentation = std::option::Option::Some(v.into());
5327        self
5328    }
5329
5330    /// Sets or clears the value of [documentation][crate::model::Spec::documentation].
5331    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
5332    where
5333        T: std::convert::Into<crate::model::Documentation>,
5334    {
5335        self.documentation = v.map(|x| x.into());
5336        self
5337    }
5338
5339    /// Sets the value of [parsing_mode][crate::model::Spec::parsing_mode].
5340    pub fn set_parsing_mode<T: std::convert::Into<crate::model::spec::ParsingMode>>(
5341        mut self,
5342        v: T,
5343    ) -> Self {
5344        self.parsing_mode = v.into();
5345        self
5346    }
5347
5348    /// Sets the value of [source_metadata][crate::model::Spec::source_metadata].
5349    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
5350    where
5351        T: std::iter::IntoIterator<Item = V>,
5352        V: std::convert::Into<crate::model::SourceMetadata>,
5353    {
5354        use std::iter::Iterator;
5355        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
5356        self
5357    }
5358}
5359
5360impl wkt::message::Message for Spec {
5361    fn typename() -> &'static str {
5362        "type.googleapis.com/google.cloud.apihub.v1.Spec"
5363    }
5364}
5365
5366/// Defines additional types related to [Spec].
5367pub mod spec {
5368    #[allow(unused_imports)]
5369    use super::*;
5370
5371    /// Specifies the parsing mode for API specifications during creation and
5372    /// update.
5373    ///
5374    /// - `RELAXED`: Parsing errors in the specification content do not fail the
5375    ///   API call.
5376    /// - `STRICT`: Parsing errors in the specification content result in failure
5377    ///   of the API call.
5378    ///   If not specified, defaults to `RELAXED`.
5379    ///
5380    /// # Working with unknown values
5381    ///
5382    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5383    /// additional enum variants at any time. Adding new variants is not considered
5384    /// a breaking change. Applications should write their code in anticipation of:
5385    ///
5386    /// - New values appearing in future releases of the client library, **and**
5387    /// - New values received dynamically, without application changes.
5388    ///
5389    /// Please consult the [Working with enums] section in the user guide for some
5390    /// guidelines.
5391    ///
5392    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5393    #[derive(Clone, Debug, PartialEq)]
5394    #[non_exhaustive]
5395    pub enum ParsingMode {
5396        /// Defaults to `RELAXED`.
5397        Unspecified,
5398        /// Parsing of the Spec on create and update is relaxed, meaning that
5399        /// parsing errors the spec contents will not fail the API call.
5400        Relaxed,
5401        /// Parsing of the Spec on create and update is strict, meaning that
5402        /// parsing errors in the spec contents will fail the API call.
5403        Strict,
5404        /// If set, the enum was initialized with an unknown value.
5405        ///
5406        /// Applications can examine the value using [ParsingMode::value] or
5407        /// [ParsingMode::name].
5408        UnknownValue(parsing_mode::UnknownValue),
5409    }
5410
5411    #[doc(hidden)]
5412    pub mod parsing_mode {
5413        #[allow(unused_imports)]
5414        use super::*;
5415        #[derive(Clone, Debug, PartialEq)]
5416        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5417    }
5418
5419    impl ParsingMode {
5420        /// Gets the enum value.
5421        ///
5422        /// Returns `None` if the enum contains an unknown value deserialized from
5423        /// the string representation of enums.
5424        pub fn value(&self) -> std::option::Option<i32> {
5425            match self {
5426                Self::Unspecified => std::option::Option::Some(0),
5427                Self::Relaxed => std::option::Option::Some(1),
5428                Self::Strict => std::option::Option::Some(2),
5429                Self::UnknownValue(u) => u.0.value(),
5430            }
5431        }
5432
5433        /// Gets the enum value as a string.
5434        ///
5435        /// Returns `None` if the enum contains an unknown value deserialized from
5436        /// the integer representation of enums.
5437        pub fn name(&self) -> std::option::Option<&str> {
5438            match self {
5439                Self::Unspecified => std::option::Option::Some("PARSING_MODE_UNSPECIFIED"),
5440                Self::Relaxed => std::option::Option::Some("RELAXED"),
5441                Self::Strict => std::option::Option::Some("STRICT"),
5442                Self::UnknownValue(u) => u.0.name(),
5443            }
5444        }
5445    }
5446
5447    impl std::default::Default for ParsingMode {
5448        fn default() -> Self {
5449            use std::convert::From;
5450            Self::from(0)
5451        }
5452    }
5453
5454    impl std::fmt::Display for ParsingMode {
5455        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5456            wkt::internal::display_enum(f, self.name(), self.value())
5457        }
5458    }
5459
5460    impl std::convert::From<i32> for ParsingMode {
5461        fn from(value: i32) -> Self {
5462            match value {
5463                0 => Self::Unspecified,
5464                1 => Self::Relaxed,
5465                2 => Self::Strict,
5466                _ => Self::UnknownValue(parsing_mode::UnknownValue(
5467                    wkt::internal::UnknownEnumValue::Integer(value),
5468                )),
5469            }
5470        }
5471    }
5472
5473    impl std::convert::From<&str> for ParsingMode {
5474        fn from(value: &str) -> Self {
5475            use std::string::ToString;
5476            match value {
5477                "PARSING_MODE_UNSPECIFIED" => Self::Unspecified,
5478                "RELAXED" => Self::Relaxed,
5479                "STRICT" => Self::Strict,
5480                _ => Self::UnknownValue(parsing_mode::UnknownValue(
5481                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5482                )),
5483            }
5484        }
5485    }
5486
5487    impl serde::ser::Serialize for ParsingMode {
5488        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5489        where
5490            S: serde::Serializer,
5491        {
5492            match self {
5493                Self::Unspecified => serializer.serialize_i32(0),
5494                Self::Relaxed => serializer.serialize_i32(1),
5495                Self::Strict => serializer.serialize_i32(2),
5496                Self::UnknownValue(u) => u.0.serialize(serializer),
5497            }
5498        }
5499    }
5500
5501    impl<'de> serde::de::Deserialize<'de> for ParsingMode {
5502        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5503        where
5504            D: serde::Deserializer<'de>,
5505        {
5506            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParsingMode>::new(
5507                ".google.cloud.apihub.v1.Spec.ParsingMode",
5508            ))
5509        }
5510    }
5511}
5512
5513/// Details of the deployment where APIs are hosted.
5514/// A deployment could represent an Apigee proxy, API gateway, other Google Cloud
5515/// services or non-Google Cloud services as well. A deployment entity is a root
5516/// level entity in the API hub and exists independent of any API.
5517#[derive(Clone, Default, PartialEq)]
5518#[non_exhaustive]
5519pub struct Deployment {
5520    /// Identifier. The name of the deployment.
5521    ///
5522    /// Format:
5523    /// `projects/{project}/locations/{location}/deployments/{deployment}`
5524    pub name: std::string::String,
5525
5526    /// Required. The display name of the deployment.
5527    pub display_name: std::string::String,
5528
5529    /// Optional. The description of the deployment.
5530    pub description: std::string::String,
5531
5532    /// Optional. The documentation of the deployment.
5533    pub documentation: std::option::Option<crate::model::Documentation>,
5534
5535    /// Required. The type of deployment.
5536    /// This maps to the following system defined attribute:
5537    /// `projects/{project}/locations/{location}/attributes/system-deployment-type`
5538    /// attribute.
5539    /// The number of values for this attribute will be based on the
5540    /// cardinality of the attribute. The same can be retrieved via GetAttribute
5541    /// API. All values should be from the list of allowed values defined for the
5542    /// attribute.
5543    pub deployment_type: std::option::Option<crate::model::AttributeValues>,
5544
5545    /// Required. The resource URI identifies the deployment within its gateway.
5546    /// For Apigee gateways, its recommended to use the format:
5547    /// organizations/{org}/environments/{env}/apis/{api}.
5548    /// For ex: if a proxy with name `orders` is deployed in `staging`
5549    /// environment of `cymbal` organization, the resource URI would be:
5550    /// `organizations/cymbal/environments/staging/apis/orders`.
5551    pub resource_uri: std::string::String,
5552
5553    /// Required. The endpoints at which this deployment resource is listening for
5554    /// API requests. This could be a list of complete URIs, hostnames or an IP
5555    /// addresses.
5556    pub endpoints: std::vec::Vec<std::string::String>,
5557
5558    /// Output only. The API versions linked to this deployment.
5559    /// Note: A particular deployment could be linked to multiple different API
5560    /// versions (of same or different APIs).
5561    pub api_versions: std::vec::Vec<std::string::String>,
5562
5563    /// Output only. The time at which the deployment was created.
5564    pub create_time: std::option::Option<wkt::Timestamp>,
5565
5566    /// Output only. The time at which the deployment was last updated.
5567    pub update_time: std::option::Option<wkt::Timestamp>,
5568
5569    /// Optional. The SLO for this deployment.
5570    /// This maps to the following system defined attribute:
5571    /// `projects/{project}/locations/{location}/attributes/system-slo`
5572    /// attribute.
5573    /// The number of values for this attribute will be based on the
5574    /// cardinality of the attribute. The same can be retrieved via GetAttribute
5575    /// API. All values should be from the list of allowed values defined for the
5576    /// attribute.
5577    pub slo: std::option::Option<crate::model::AttributeValues>,
5578
5579    /// Optional. The environment mapping to this deployment.
5580    /// This maps to the following system defined attribute:
5581    /// `projects/{project}/locations/{location}/attributes/system-environment`
5582    /// attribute.
5583    /// The number of values for this attribute will be based on the
5584    /// cardinality of the attribute. The same can be retrieved via GetAttribute
5585    /// API. All values should be from the list of allowed values defined for the
5586    /// attribute.
5587    pub environment: std::option::Option<crate::model::AttributeValues>,
5588
5589    /// Optional. The list of user defined attributes associated with the
5590    /// deployment resource. The key is the attribute name. It will be of the
5591    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
5592    /// The value is the attribute values associated with the resource.
5593    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
5594
5595    /// Output only. The list of sources and metadata from the sources of the
5596    /// deployment.
5597    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
5598
5599    /// Optional. The uri where users can navigate to for the management of the
5600    /// deployment. This maps to the following system defined attribute:
5601    /// `projects/{project}/locations/{location}/attributes/system-management-url`
5602    /// The number of values for this attribute will be based on the
5603    /// cardinality of the attribute. The same can be retrieved via GetAttribute
5604    /// API. The value of the attribute should be a valid URL.
5605    pub management_url: std::option::Option<crate::model::AttributeValues>,
5606
5607    /// Optional. The uri where additional source specific information for this
5608    /// deployment can be found. This maps to the following system defined
5609    /// attribute:
5610    /// `projects/{project}/locations/{location}/attributes/system-source-uri`
5611    /// The number of values for this attribute will be based on the
5612    /// cardinality of the attribute. The same can be retrieved via GetAttribute
5613    /// API. The value of the attribute should be a valid URI, and in case
5614    /// of Cloud Storage URI, it should point to a Cloud Storage object,
5615    /// not a directory.
5616    pub source_uri: std::option::Option<crate::model::AttributeValues>,
5617
5618    /// Optional. The project to which the deployment belongs.
5619    /// For GCP gateways, this will refer to the project identifier.
5620    /// For others like Edge/OPDK, this will refer to the org identifier.
5621    pub source_project: std::string::String,
5622
5623    /// Optional. The environment at source for the deployment.
5624    /// For example: prod, dev, staging, etc.
5625    pub source_environment: std::string::String,
5626
5627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5628}
5629
5630impl Deployment {
5631    pub fn new() -> Self {
5632        std::default::Default::default()
5633    }
5634
5635    /// Sets the value of [name][crate::model::Deployment::name].
5636    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5637        self.name = v.into();
5638        self
5639    }
5640
5641    /// Sets the value of [display_name][crate::model::Deployment::display_name].
5642    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5643        self.display_name = v.into();
5644        self
5645    }
5646
5647    /// Sets the value of [description][crate::model::Deployment::description].
5648    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5649        self.description = v.into();
5650        self
5651    }
5652
5653    /// Sets the value of [documentation][crate::model::Deployment::documentation].
5654    pub fn set_documentation<T>(mut self, v: T) -> Self
5655    where
5656        T: std::convert::Into<crate::model::Documentation>,
5657    {
5658        self.documentation = std::option::Option::Some(v.into());
5659        self
5660    }
5661
5662    /// Sets or clears the value of [documentation][crate::model::Deployment::documentation].
5663    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
5664    where
5665        T: std::convert::Into<crate::model::Documentation>,
5666    {
5667        self.documentation = v.map(|x| x.into());
5668        self
5669    }
5670
5671    /// Sets the value of [deployment_type][crate::model::Deployment::deployment_type].
5672    pub fn set_deployment_type<T>(mut self, v: T) -> Self
5673    where
5674        T: std::convert::Into<crate::model::AttributeValues>,
5675    {
5676        self.deployment_type = std::option::Option::Some(v.into());
5677        self
5678    }
5679
5680    /// Sets or clears the value of [deployment_type][crate::model::Deployment::deployment_type].
5681    pub fn set_or_clear_deployment_type<T>(mut self, v: std::option::Option<T>) -> Self
5682    where
5683        T: std::convert::Into<crate::model::AttributeValues>,
5684    {
5685        self.deployment_type = v.map(|x| x.into());
5686        self
5687    }
5688
5689    /// Sets the value of [resource_uri][crate::model::Deployment::resource_uri].
5690    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5691        self.resource_uri = v.into();
5692        self
5693    }
5694
5695    /// Sets the value of [endpoints][crate::model::Deployment::endpoints].
5696    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
5697    where
5698        T: std::iter::IntoIterator<Item = V>,
5699        V: std::convert::Into<std::string::String>,
5700    {
5701        use std::iter::Iterator;
5702        self.endpoints = v.into_iter().map(|i| i.into()).collect();
5703        self
5704    }
5705
5706    /// Sets the value of [api_versions][crate::model::Deployment::api_versions].
5707    pub fn set_api_versions<T, V>(mut self, v: T) -> Self
5708    where
5709        T: std::iter::IntoIterator<Item = V>,
5710        V: std::convert::Into<std::string::String>,
5711    {
5712        use std::iter::Iterator;
5713        self.api_versions = v.into_iter().map(|i| i.into()).collect();
5714        self
5715    }
5716
5717    /// Sets the value of [create_time][crate::model::Deployment::create_time].
5718    pub fn set_create_time<T>(mut self, v: T) -> Self
5719    where
5720        T: std::convert::Into<wkt::Timestamp>,
5721    {
5722        self.create_time = std::option::Option::Some(v.into());
5723        self
5724    }
5725
5726    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
5727    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5728    where
5729        T: std::convert::Into<wkt::Timestamp>,
5730    {
5731        self.create_time = v.map(|x| x.into());
5732        self
5733    }
5734
5735    /// Sets the value of [update_time][crate::model::Deployment::update_time].
5736    pub fn set_update_time<T>(mut self, v: T) -> Self
5737    where
5738        T: std::convert::Into<wkt::Timestamp>,
5739    {
5740        self.update_time = std::option::Option::Some(v.into());
5741        self
5742    }
5743
5744    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
5745    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5746    where
5747        T: std::convert::Into<wkt::Timestamp>,
5748    {
5749        self.update_time = v.map(|x| x.into());
5750        self
5751    }
5752
5753    /// Sets the value of [slo][crate::model::Deployment::slo].
5754    pub fn set_slo<T>(mut self, v: T) -> Self
5755    where
5756        T: std::convert::Into<crate::model::AttributeValues>,
5757    {
5758        self.slo = std::option::Option::Some(v.into());
5759        self
5760    }
5761
5762    /// Sets or clears the value of [slo][crate::model::Deployment::slo].
5763    pub fn set_or_clear_slo<T>(mut self, v: std::option::Option<T>) -> Self
5764    where
5765        T: std::convert::Into<crate::model::AttributeValues>,
5766    {
5767        self.slo = v.map(|x| x.into());
5768        self
5769    }
5770
5771    /// Sets the value of [environment][crate::model::Deployment::environment].
5772    pub fn set_environment<T>(mut self, v: T) -> Self
5773    where
5774        T: std::convert::Into<crate::model::AttributeValues>,
5775    {
5776        self.environment = std::option::Option::Some(v.into());
5777        self
5778    }
5779
5780    /// Sets or clears the value of [environment][crate::model::Deployment::environment].
5781    pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
5782    where
5783        T: std::convert::Into<crate::model::AttributeValues>,
5784    {
5785        self.environment = v.map(|x| x.into());
5786        self
5787    }
5788
5789    /// Sets the value of [attributes][crate::model::Deployment::attributes].
5790    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5791    where
5792        T: std::iter::IntoIterator<Item = (K, V)>,
5793        K: std::convert::Into<std::string::String>,
5794        V: std::convert::Into<crate::model::AttributeValues>,
5795    {
5796        use std::iter::Iterator;
5797        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5798        self
5799    }
5800
5801    /// Sets the value of [source_metadata][crate::model::Deployment::source_metadata].
5802    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
5803    where
5804        T: std::iter::IntoIterator<Item = V>,
5805        V: std::convert::Into<crate::model::SourceMetadata>,
5806    {
5807        use std::iter::Iterator;
5808        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
5809        self
5810    }
5811
5812    /// Sets the value of [management_url][crate::model::Deployment::management_url].
5813    pub fn set_management_url<T>(mut self, v: T) -> Self
5814    where
5815        T: std::convert::Into<crate::model::AttributeValues>,
5816    {
5817        self.management_url = std::option::Option::Some(v.into());
5818        self
5819    }
5820
5821    /// Sets or clears the value of [management_url][crate::model::Deployment::management_url].
5822    pub fn set_or_clear_management_url<T>(mut self, v: std::option::Option<T>) -> Self
5823    where
5824        T: std::convert::Into<crate::model::AttributeValues>,
5825    {
5826        self.management_url = v.map(|x| x.into());
5827        self
5828    }
5829
5830    /// Sets the value of [source_uri][crate::model::Deployment::source_uri].
5831    pub fn set_source_uri<T>(mut self, v: T) -> Self
5832    where
5833        T: std::convert::Into<crate::model::AttributeValues>,
5834    {
5835        self.source_uri = std::option::Option::Some(v.into());
5836        self
5837    }
5838
5839    /// Sets or clears the value of [source_uri][crate::model::Deployment::source_uri].
5840    pub fn set_or_clear_source_uri<T>(mut self, v: std::option::Option<T>) -> Self
5841    where
5842        T: std::convert::Into<crate::model::AttributeValues>,
5843    {
5844        self.source_uri = v.map(|x| x.into());
5845        self
5846    }
5847
5848    /// Sets the value of [source_project][crate::model::Deployment::source_project].
5849    pub fn set_source_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5850        self.source_project = v.into();
5851        self
5852    }
5853
5854    /// Sets the value of [source_environment][crate::model::Deployment::source_environment].
5855    pub fn set_source_environment<T: std::convert::Into<std::string::String>>(
5856        mut self,
5857        v: T,
5858    ) -> Self {
5859        self.source_environment = v.into();
5860        self
5861    }
5862}
5863
5864impl wkt::message::Message for Deployment {
5865    fn typename() -> &'static str {
5866        "type.googleapis.com/google.cloud.apihub.v1.Deployment"
5867    }
5868}
5869
5870/// Represents an operation contained in an API version in the API Hub.
5871/// An operation is added/updated/deleted in an API version when a new spec is
5872/// added or an existing spec is updated/deleted in a version.
5873/// Currently, an operation will be created only corresponding to OpenAPI spec as
5874/// parsing is supported for OpenAPI spec.
5875/// Alternatively operations can be managed via create,update and delete APIs,
5876/// creation of apiOperation can be possible only for version with no parsed
5877/// operations and update/delete can be possible only for operations created via
5878/// create API.
5879#[derive(Clone, Default, PartialEq)]
5880#[non_exhaustive]
5881pub struct ApiOperation {
5882    /// Identifier. The name of the operation.
5883    ///
5884    /// Format:
5885    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
5886    pub name: std::string::String,
5887
5888    /// Output only. The name of the spec will be of the format:
5889    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
5890    /// Note:The name of the spec will be empty if the operation is created via
5891    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API.
5892    ///
5893    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
5894    pub spec: std::string::String,
5895
5896    /// Optional. Operation details.
5897    /// Note: Even though this field is optional, it is required for
5898    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
5899    /// API and we will fail the request if not provided.
5900    ///
5901    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
5902    pub details: std::option::Option<crate::model::OperationDetails>,
5903
5904    /// Output only. The time at which the operation was created.
5905    pub create_time: std::option::Option<wkt::Timestamp>,
5906
5907    /// Output only. The time at which the operation was last updated.
5908    pub update_time: std::option::Option<wkt::Timestamp>,
5909
5910    /// Optional. The list of user defined attributes associated with the API
5911    /// operation resource. The key is the attribute name. It will be of the
5912    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
5913    /// The value is the attribute values associated with the resource.
5914    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
5915
5916    /// Output only. The list of sources and metadata from the sources of the API
5917    /// operation.
5918    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
5919
5920    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5921}
5922
5923impl ApiOperation {
5924    pub fn new() -> Self {
5925        std::default::Default::default()
5926    }
5927
5928    /// Sets the value of [name][crate::model::ApiOperation::name].
5929    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5930        self.name = v.into();
5931        self
5932    }
5933
5934    /// Sets the value of [spec][crate::model::ApiOperation::spec].
5935    pub fn set_spec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5936        self.spec = v.into();
5937        self
5938    }
5939
5940    /// Sets the value of [details][crate::model::ApiOperation::details].
5941    pub fn set_details<T>(mut self, v: T) -> Self
5942    where
5943        T: std::convert::Into<crate::model::OperationDetails>,
5944    {
5945        self.details = std::option::Option::Some(v.into());
5946        self
5947    }
5948
5949    /// Sets or clears the value of [details][crate::model::ApiOperation::details].
5950    pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
5951    where
5952        T: std::convert::Into<crate::model::OperationDetails>,
5953    {
5954        self.details = v.map(|x| x.into());
5955        self
5956    }
5957
5958    /// Sets the value of [create_time][crate::model::ApiOperation::create_time].
5959    pub fn set_create_time<T>(mut self, v: T) -> Self
5960    where
5961        T: std::convert::Into<wkt::Timestamp>,
5962    {
5963        self.create_time = std::option::Option::Some(v.into());
5964        self
5965    }
5966
5967    /// Sets or clears the value of [create_time][crate::model::ApiOperation::create_time].
5968    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5969    where
5970        T: std::convert::Into<wkt::Timestamp>,
5971    {
5972        self.create_time = v.map(|x| x.into());
5973        self
5974    }
5975
5976    /// Sets the value of [update_time][crate::model::ApiOperation::update_time].
5977    pub fn set_update_time<T>(mut self, v: T) -> Self
5978    where
5979        T: std::convert::Into<wkt::Timestamp>,
5980    {
5981        self.update_time = std::option::Option::Some(v.into());
5982        self
5983    }
5984
5985    /// Sets or clears the value of [update_time][crate::model::ApiOperation::update_time].
5986    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5987    where
5988        T: std::convert::Into<wkt::Timestamp>,
5989    {
5990        self.update_time = v.map(|x| x.into());
5991        self
5992    }
5993
5994    /// Sets the value of [attributes][crate::model::ApiOperation::attributes].
5995    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5996    where
5997        T: std::iter::IntoIterator<Item = (K, V)>,
5998        K: std::convert::Into<std::string::String>,
5999        V: std::convert::Into<crate::model::AttributeValues>,
6000    {
6001        use std::iter::Iterator;
6002        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6003        self
6004    }
6005
6006    /// Sets the value of [source_metadata][crate::model::ApiOperation::source_metadata].
6007    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
6008    where
6009        T: std::iter::IntoIterator<Item = V>,
6010        V: std::convert::Into<crate::model::SourceMetadata>,
6011    {
6012        use std::iter::Iterator;
6013        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
6014        self
6015    }
6016}
6017
6018impl wkt::message::Message for ApiOperation {
6019    fn typename() -> &'static str {
6020        "type.googleapis.com/google.cloud.apihub.v1.ApiOperation"
6021    }
6022}
6023
6024/// Represents a definition for example schema, request, response definitions
6025/// contained in an API version.
6026/// A definition is added/updated/deleted in an API version when a new spec is
6027/// added or an existing spec is updated/deleted in a version. Currently,
6028/// definition will be created only corresponding to OpenAPI spec as parsing is
6029/// supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object
6030/// is supported.
6031#[derive(Clone, Default, PartialEq)]
6032#[non_exhaustive]
6033pub struct Definition {
6034    /// Identifier. The name of the definition.
6035    ///
6036    /// Format:
6037    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
6038    pub name: std::string::String,
6039
6040    /// Output only. The name of the spec from where the definition was parsed.
6041    /// Format is
6042    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
6043    pub spec: std::string::String,
6044
6045    /// Output only. The type of the definition.
6046    pub r#type: crate::model::definition::Type,
6047
6048    /// Output only. The time at which the definition was created.
6049    pub create_time: std::option::Option<wkt::Timestamp>,
6050
6051    /// Output only. The time at which the definition was last updated.
6052    pub update_time: std::option::Option<wkt::Timestamp>,
6053
6054    /// Optional. The list of user defined attributes associated with the
6055    /// definition resource. The key is the attribute name. It will be of the
6056    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
6057    /// The value is the attribute values associated with the resource.
6058    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
6059
6060    pub value: std::option::Option<crate::model::definition::Value>,
6061
6062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6063}
6064
6065impl Definition {
6066    pub fn new() -> Self {
6067        std::default::Default::default()
6068    }
6069
6070    /// Sets the value of [name][crate::model::Definition::name].
6071    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6072        self.name = v.into();
6073        self
6074    }
6075
6076    /// Sets the value of [spec][crate::model::Definition::spec].
6077    pub fn set_spec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6078        self.spec = v.into();
6079        self
6080    }
6081
6082    /// Sets the value of [r#type][crate::model::Definition::type].
6083    pub fn set_type<T: std::convert::Into<crate::model::definition::Type>>(mut self, v: T) -> Self {
6084        self.r#type = v.into();
6085        self
6086    }
6087
6088    /// Sets the value of [create_time][crate::model::Definition::create_time].
6089    pub fn set_create_time<T>(mut self, v: T) -> Self
6090    where
6091        T: std::convert::Into<wkt::Timestamp>,
6092    {
6093        self.create_time = std::option::Option::Some(v.into());
6094        self
6095    }
6096
6097    /// Sets or clears the value of [create_time][crate::model::Definition::create_time].
6098    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6099    where
6100        T: std::convert::Into<wkt::Timestamp>,
6101    {
6102        self.create_time = v.map(|x| x.into());
6103        self
6104    }
6105
6106    /// Sets the value of [update_time][crate::model::Definition::update_time].
6107    pub fn set_update_time<T>(mut self, v: T) -> Self
6108    where
6109        T: std::convert::Into<wkt::Timestamp>,
6110    {
6111        self.update_time = std::option::Option::Some(v.into());
6112        self
6113    }
6114
6115    /// Sets or clears the value of [update_time][crate::model::Definition::update_time].
6116    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6117    where
6118        T: std::convert::Into<wkt::Timestamp>,
6119    {
6120        self.update_time = v.map(|x| x.into());
6121        self
6122    }
6123
6124    /// Sets the value of [attributes][crate::model::Definition::attributes].
6125    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
6126    where
6127        T: std::iter::IntoIterator<Item = (K, V)>,
6128        K: std::convert::Into<std::string::String>,
6129        V: std::convert::Into<crate::model::AttributeValues>,
6130    {
6131        use std::iter::Iterator;
6132        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6133        self
6134    }
6135
6136    /// Sets the value of [value][crate::model::Definition::value].
6137    ///
6138    /// Note that all the setters affecting `value` are mutually
6139    /// exclusive.
6140    pub fn set_value<
6141        T: std::convert::Into<std::option::Option<crate::model::definition::Value>>,
6142    >(
6143        mut self,
6144        v: T,
6145    ) -> Self {
6146        self.value = v.into();
6147        self
6148    }
6149
6150    /// The value of [value][crate::model::Definition::value]
6151    /// if it holds a `Schema`, `None` if the field is not set or
6152    /// holds a different branch.
6153    pub fn schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::Schema>> {
6154        #[allow(unreachable_patterns)]
6155        self.value.as_ref().and_then(|v| match v {
6156            crate::model::definition::Value::Schema(v) => std::option::Option::Some(v),
6157            _ => std::option::Option::None,
6158        })
6159    }
6160
6161    /// Sets the value of [value][crate::model::Definition::value]
6162    /// to hold a `Schema`.
6163    ///
6164    /// Note that all the setters affecting `value` are
6165    /// mutually exclusive.
6166    pub fn set_schema<T: std::convert::Into<std::boxed::Box<crate::model::Schema>>>(
6167        mut self,
6168        v: T,
6169    ) -> Self {
6170        self.value = std::option::Option::Some(crate::model::definition::Value::Schema(v.into()));
6171        self
6172    }
6173}
6174
6175impl wkt::message::Message for Definition {
6176    fn typename() -> &'static str {
6177        "type.googleapis.com/google.cloud.apihub.v1.Definition"
6178    }
6179}
6180
6181/// Defines additional types related to [Definition].
6182pub mod definition {
6183    #[allow(unused_imports)]
6184    use super::*;
6185
6186    /// Enumeration of definition types.
6187    ///
6188    /// # Working with unknown values
6189    ///
6190    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6191    /// additional enum variants at any time. Adding new variants is not considered
6192    /// a breaking change. Applications should write their code in anticipation of:
6193    ///
6194    /// - New values appearing in future releases of the client library, **and**
6195    /// - New values received dynamically, without application changes.
6196    ///
6197    /// Please consult the [Working with enums] section in the user guide for some
6198    /// guidelines.
6199    ///
6200    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6201    #[derive(Clone, Debug, PartialEq)]
6202    #[non_exhaustive]
6203    pub enum Type {
6204        /// Definition type unspecified.
6205        Unspecified,
6206        /// Definition type schema.
6207        Schema,
6208        /// If set, the enum was initialized with an unknown value.
6209        ///
6210        /// Applications can examine the value using [Type::value] or
6211        /// [Type::name].
6212        UnknownValue(r#type::UnknownValue),
6213    }
6214
6215    #[doc(hidden)]
6216    pub mod r#type {
6217        #[allow(unused_imports)]
6218        use super::*;
6219        #[derive(Clone, Debug, PartialEq)]
6220        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6221    }
6222
6223    impl Type {
6224        /// Gets the enum value.
6225        ///
6226        /// Returns `None` if the enum contains an unknown value deserialized from
6227        /// the string representation of enums.
6228        pub fn value(&self) -> std::option::Option<i32> {
6229            match self {
6230                Self::Unspecified => std::option::Option::Some(0),
6231                Self::Schema => std::option::Option::Some(1),
6232                Self::UnknownValue(u) => u.0.value(),
6233            }
6234        }
6235
6236        /// Gets the enum value as a string.
6237        ///
6238        /// Returns `None` if the enum contains an unknown value deserialized from
6239        /// the integer representation of enums.
6240        pub fn name(&self) -> std::option::Option<&str> {
6241            match self {
6242                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
6243                Self::Schema => std::option::Option::Some("SCHEMA"),
6244                Self::UnknownValue(u) => u.0.name(),
6245            }
6246        }
6247    }
6248
6249    impl std::default::Default for Type {
6250        fn default() -> Self {
6251            use std::convert::From;
6252            Self::from(0)
6253        }
6254    }
6255
6256    impl std::fmt::Display for Type {
6257        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6258            wkt::internal::display_enum(f, self.name(), self.value())
6259        }
6260    }
6261
6262    impl std::convert::From<i32> for Type {
6263        fn from(value: i32) -> Self {
6264            match value {
6265                0 => Self::Unspecified,
6266                1 => Self::Schema,
6267                _ => Self::UnknownValue(r#type::UnknownValue(
6268                    wkt::internal::UnknownEnumValue::Integer(value),
6269                )),
6270            }
6271        }
6272    }
6273
6274    impl std::convert::From<&str> for Type {
6275        fn from(value: &str) -> Self {
6276            use std::string::ToString;
6277            match value {
6278                "TYPE_UNSPECIFIED" => Self::Unspecified,
6279                "SCHEMA" => Self::Schema,
6280                _ => Self::UnknownValue(r#type::UnknownValue(
6281                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6282                )),
6283            }
6284        }
6285    }
6286
6287    impl serde::ser::Serialize for Type {
6288        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6289        where
6290            S: serde::Serializer,
6291        {
6292            match self {
6293                Self::Unspecified => serializer.serialize_i32(0),
6294                Self::Schema => serializer.serialize_i32(1),
6295                Self::UnknownValue(u) => u.0.serialize(serializer),
6296            }
6297        }
6298    }
6299
6300    impl<'de> serde::de::Deserialize<'de> for Type {
6301        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6302        where
6303            D: serde::Deserializer<'de>,
6304        {
6305            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
6306                ".google.cloud.apihub.v1.Definition.Type",
6307            ))
6308        }
6309    }
6310
6311    #[derive(Clone, Debug, PartialEq)]
6312    #[non_exhaustive]
6313    pub enum Value {
6314        /// Output only. The value of a schema definition.
6315        Schema(std::boxed::Box<crate::model::Schema>),
6316    }
6317}
6318
6319/// An attribute in the API Hub.
6320/// An attribute is a name value pair which can be attached to different
6321/// resources in the API hub based on the scope of the attribute. Attributes can
6322/// either be pre-defined by the API Hub or created by users.
6323#[derive(Clone, Default, PartialEq)]
6324#[non_exhaustive]
6325pub struct Attribute {
6326    /// Identifier. The name of the attribute in the API Hub.
6327    ///
6328    /// Format:
6329    /// `projects/{project}/locations/{location}/attributes/{attribute}`
6330    pub name: std::string::String,
6331
6332    /// Required. The display name of the attribute.
6333    pub display_name: std::string::String,
6334
6335    /// Optional. The description of the attribute.
6336    pub description: std::string::String,
6337
6338    /// Output only. The definition type of the attribute.
6339    pub definition_type: crate::model::attribute::DefinitionType,
6340
6341    /// Required. The scope of the attribute. It represents the resource in the API
6342    /// Hub to which the attribute can be linked.
6343    pub scope: crate::model::attribute::Scope,
6344
6345    /// Required. The type of the data of the attribute.
6346    pub data_type: crate::model::attribute::DataType,
6347
6348    /// Optional. The list of allowed values when the attribute value is of type
6349    /// enum. This is required when the data_type of the attribute is ENUM. The
6350    /// maximum number of allowed values of an attribute will be 1000.
6351    pub allowed_values: std::vec::Vec<crate::model::attribute::AllowedValue>,
6352
6353    /// Optional. The maximum number of values that the attribute can have when
6354    /// associated with an API Hub resource. Cardinality 1 would represent a
6355    /// single-valued attribute. It must not be less than 1 or greater than 20. If
6356    /// not specified, the cardinality would be set to 1 by default and represent a
6357    /// single-valued attribute.
6358    pub cardinality: i32,
6359
6360    /// Output only. When mandatory is true, the attribute is mandatory for the
6361    /// resource specified in the scope. Only System defined attributes can be
6362    /// mandatory.
6363    pub mandatory: bool,
6364
6365    /// Output only. The time at which the attribute was created.
6366    pub create_time: std::option::Option<wkt::Timestamp>,
6367
6368    /// Output only. The time at which the attribute was last updated.
6369    pub update_time: std::option::Option<wkt::Timestamp>,
6370
6371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6372}
6373
6374impl Attribute {
6375    pub fn new() -> Self {
6376        std::default::Default::default()
6377    }
6378
6379    /// Sets the value of [name][crate::model::Attribute::name].
6380    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6381        self.name = v.into();
6382        self
6383    }
6384
6385    /// Sets the value of [display_name][crate::model::Attribute::display_name].
6386    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6387        self.display_name = v.into();
6388        self
6389    }
6390
6391    /// Sets the value of [description][crate::model::Attribute::description].
6392    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6393        self.description = v.into();
6394        self
6395    }
6396
6397    /// Sets the value of [definition_type][crate::model::Attribute::definition_type].
6398    pub fn set_definition_type<T: std::convert::Into<crate::model::attribute::DefinitionType>>(
6399        mut self,
6400        v: T,
6401    ) -> Self {
6402        self.definition_type = v.into();
6403        self
6404    }
6405
6406    /// Sets the value of [scope][crate::model::Attribute::scope].
6407    pub fn set_scope<T: std::convert::Into<crate::model::attribute::Scope>>(
6408        mut self,
6409        v: T,
6410    ) -> Self {
6411        self.scope = v.into();
6412        self
6413    }
6414
6415    /// Sets the value of [data_type][crate::model::Attribute::data_type].
6416    pub fn set_data_type<T: std::convert::Into<crate::model::attribute::DataType>>(
6417        mut self,
6418        v: T,
6419    ) -> Self {
6420        self.data_type = v.into();
6421        self
6422    }
6423
6424    /// Sets the value of [allowed_values][crate::model::Attribute::allowed_values].
6425    pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
6426    where
6427        T: std::iter::IntoIterator<Item = V>,
6428        V: std::convert::Into<crate::model::attribute::AllowedValue>,
6429    {
6430        use std::iter::Iterator;
6431        self.allowed_values = v.into_iter().map(|i| i.into()).collect();
6432        self
6433    }
6434
6435    /// Sets the value of [cardinality][crate::model::Attribute::cardinality].
6436    pub fn set_cardinality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6437        self.cardinality = v.into();
6438        self
6439    }
6440
6441    /// Sets the value of [mandatory][crate::model::Attribute::mandatory].
6442    pub fn set_mandatory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6443        self.mandatory = v.into();
6444        self
6445    }
6446
6447    /// Sets the value of [create_time][crate::model::Attribute::create_time].
6448    pub fn set_create_time<T>(mut self, v: T) -> Self
6449    where
6450        T: std::convert::Into<wkt::Timestamp>,
6451    {
6452        self.create_time = std::option::Option::Some(v.into());
6453        self
6454    }
6455
6456    /// Sets or clears the value of [create_time][crate::model::Attribute::create_time].
6457    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6458    where
6459        T: std::convert::Into<wkt::Timestamp>,
6460    {
6461        self.create_time = v.map(|x| x.into());
6462        self
6463    }
6464
6465    /// Sets the value of [update_time][crate::model::Attribute::update_time].
6466    pub fn set_update_time<T>(mut self, v: T) -> Self
6467    where
6468        T: std::convert::Into<wkt::Timestamp>,
6469    {
6470        self.update_time = std::option::Option::Some(v.into());
6471        self
6472    }
6473
6474    /// Sets or clears the value of [update_time][crate::model::Attribute::update_time].
6475    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6476    where
6477        T: std::convert::Into<wkt::Timestamp>,
6478    {
6479        self.update_time = v.map(|x| x.into());
6480        self
6481    }
6482}
6483
6484impl wkt::message::Message for Attribute {
6485    fn typename() -> &'static str {
6486        "type.googleapis.com/google.cloud.apihub.v1.Attribute"
6487    }
6488}
6489
6490/// Defines additional types related to [Attribute].
6491pub mod attribute {
6492    #[allow(unused_imports)]
6493    use super::*;
6494
6495    /// The value that can be assigned to the attribute when the data type is
6496    /// enum.
6497    #[derive(Clone, Default, PartialEq)]
6498    #[non_exhaustive]
6499    pub struct AllowedValue {
6500        /// Required. The ID of the allowed value.
6501        ///
6502        /// * If provided, the same will be used. The service will throw an error if
6503        ///   the specified id is already used by another allowed value in the same
6504        ///   attribute resource.
6505        /// * If not provided, a system generated id derived from the display name
6506        ///   will be used. In this case, the service will handle conflict resolution
6507        ///   by adding a system generated suffix in case of duplicates.
6508        ///
6509        /// This value should be 4-63 characters, and valid characters
6510        /// are /[a-z][0-9]-/.
6511        pub id: std::string::String,
6512
6513        /// Required. The display name of the allowed value.
6514        pub display_name: std::string::String,
6515
6516        /// Optional. The detailed description of the allowed value.
6517        pub description: std::string::String,
6518
6519        /// Optional. When set to true, the allowed value cannot be updated or
6520        /// deleted by the user. It can only be true for System defined attributes.
6521        pub immutable: bool,
6522
6523        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6524    }
6525
6526    impl AllowedValue {
6527        pub fn new() -> Self {
6528            std::default::Default::default()
6529        }
6530
6531        /// Sets the value of [id][crate::model::attribute::AllowedValue::id].
6532        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6533            self.id = v.into();
6534            self
6535        }
6536
6537        /// Sets the value of [display_name][crate::model::attribute::AllowedValue::display_name].
6538        pub fn set_display_name<T: std::convert::Into<std::string::String>>(
6539            mut self,
6540            v: T,
6541        ) -> Self {
6542            self.display_name = v.into();
6543            self
6544        }
6545
6546        /// Sets the value of [description][crate::model::attribute::AllowedValue::description].
6547        pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6548            self.description = v.into();
6549            self
6550        }
6551
6552        /// Sets the value of [immutable][crate::model::attribute::AllowedValue::immutable].
6553        pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6554            self.immutable = v.into();
6555            self
6556        }
6557    }
6558
6559    impl wkt::message::Message for AllowedValue {
6560        fn typename() -> &'static str {
6561            "type.googleapis.com/google.cloud.apihub.v1.Attribute.AllowedValue"
6562        }
6563    }
6564
6565    /// Enumeration of attribute definition types.
6566    ///
6567    /// # Working with unknown values
6568    ///
6569    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6570    /// additional enum variants at any time. Adding new variants is not considered
6571    /// a breaking change. Applications should write their code in anticipation of:
6572    ///
6573    /// - New values appearing in future releases of the client library, **and**
6574    /// - New values received dynamically, without application changes.
6575    ///
6576    /// Please consult the [Working with enums] section in the user guide for some
6577    /// guidelines.
6578    ///
6579    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6580    #[derive(Clone, Debug, PartialEq)]
6581    #[non_exhaustive]
6582    pub enum DefinitionType {
6583        /// Attribute definition type unspecified.
6584        Unspecified,
6585        /// The attribute is predefined by the API Hub. Note that only the list of
6586        /// allowed values can be updated in this case via UpdateAttribute method.
6587        SystemDefined,
6588        /// The attribute is defined by the user.
6589        UserDefined,
6590        /// If set, the enum was initialized with an unknown value.
6591        ///
6592        /// Applications can examine the value using [DefinitionType::value] or
6593        /// [DefinitionType::name].
6594        UnknownValue(definition_type::UnknownValue),
6595    }
6596
6597    #[doc(hidden)]
6598    pub mod definition_type {
6599        #[allow(unused_imports)]
6600        use super::*;
6601        #[derive(Clone, Debug, PartialEq)]
6602        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6603    }
6604
6605    impl DefinitionType {
6606        /// Gets the enum value.
6607        ///
6608        /// Returns `None` if the enum contains an unknown value deserialized from
6609        /// the string representation of enums.
6610        pub fn value(&self) -> std::option::Option<i32> {
6611            match self {
6612                Self::Unspecified => std::option::Option::Some(0),
6613                Self::SystemDefined => std::option::Option::Some(1),
6614                Self::UserDefined => std::option::Option::Some(2),
6615                Self::UnknownValue(u) => u.0.value(),
6616            }
6617        }
6618
6619        /// Gets the enum value as a string.
6620        ///
6621        /// Returns `None` if the enum contains an unknown value deserialized from
6622        /// the integer representation of enums.
6623        pub fn name(&self) -> std::option::Option<&str> {
6624            match self {
6625                Self::Unspecified => std::option::Option::Some("DEFINITION_TYPE_UNSPECIFIED"),
6626                Self::SystemDefined => std::option::Option::Some("SYSTEM_DEFINED"),
6627                Self::UserDefined => std::option::Option::Some("USER_DEFINED"),
6628                Self::UnknownValue(u) => u.0.name(),
6629            }
6630        }
6631    }
6632
6633    impl std::default::Default for DefinitionType {
6634        fn default() -> Self {
6635            use std::convert::From;
6636            Self::from(0)
6637        }
6638    }
6639
6640    impl std::fmt::Display for DefinitionType {
6641        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6642            wkt::internal::display_enum(f, self.name(), self.value())
6643        }
6644    }
6645
6646    impl std::convert::From<i32> for DefinitionType {
6647        fn from(value: i32) -> Self {
6648            match value {
6649                0 => Self::Unspecified,
6650                1 => Self::SystemDefined,
6651                2 => Self::UserDefined,
6652                _ => Self::UnknownValue(definition_type::UnknownValue(
6653                    wkt::internal::UnknownEnumValue::Integer(value),
6654                )),
6655            }
6656        }
6657    }
6658
6659    impl std::convert::From<&str> for DefinitionType {
6660        fn from(value: &str) -> Self {
6661            use std::string::ToString;
6662            match value {
6663                "DEFINITION_TYPE_UNSPECIFIED" => Self::Unspecified,
6664                "SYSTEM_DEFINED" => Self::SystemDefined,
6665                "USER_DEFINED" => Self::UserDefined,
6666                _ => Self::UnknownValue(definition_type::UnknownValue(
6667                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6668                )),
6669            }
6670        }
6671    }
6672
6673    impl serde::ser::Serialize for DefinitionType {
6674        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6675        where
6676            S: serde::Serializer,
6677        {
6678            match self {
6679                Self::Unspecified => serializer.serialize_i32(0),
6680                Self::SystemDefined => serializer.serialize_i32(1),
6681                Self::UserDefined => serializer.serialize_i32(2),
6682                Self::UnknownValue(u) => u.0.serialize(serializer),
6683            }
6684        }
6685    }
6686
6687    impl<'de> serde::de::Deserialize<'de> for DefinitionType {
6688        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6689        where
6690            D: serde::Deserializer<'de>,
6691        {
6692            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DefinitionType>::new(
6693                ".google.cloud.apihub.v1.Attribute.DefinitionType",
6694            ))
6695        }
6696    }
6697
6698    /// Enumeration for the scope of the attribute representing the resource in the
6699    /// API Hub to which the attribute can be linked.
6700    ///
6701    /// # Working with unknown values
6702    ///
6703    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6704    /// additional enum variants at any time. Adding new variants is not considered
6705    /// a breaking change. Applications should write their code in anticipation of:
6706    ///
6707    /// - New values appearing in future releases of the client library, **and**
6708    /// - New values received dynamically, without application changes.
6709    ///
6710    /// Please consult the [Working with enums] section in the user guide for some
6711    /// guidelines.
6712    ///
6713    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6714    #[derive(Clone, Debug, PartialEq)]
6715    #[non_exhaustive]
6716    pub enum Scope {
6717        /// Scope Unspecified.
6718        Unspecified,
6719        /// Attribute can be linked to an API.
6720        Api,
6721        /// Attribute can be linked to an API version.
6722        Version,
6723        /// Attribute can be linked to a Spec.
6724        Spec,
6725        /// Attribute can be linked to an API Operation.
6726        ApiOperation,
6727        /// Attribute can be linked to a Deployment.
6728        Deployment,
6729        /// Attribute can be linked to a Dependency.
6730        Dependency,
6731        /// Attribute can be linked to a definition.
6732        Definition,
6733        /// Attribute can be linked to a ExternalAPI.
6734        ExternalApi,
6735        /// Attribute can be linked to a Plugin.
6736        Plugin,
6737        /// If set, the enum was initialized with an unknown value.
6738        ///
6739        /// Applications can examine the value using [Scope::value] or
6740        /// [Scope::name].
6741        UnknownValue(scope::UnknownValue),
6742    }
6743
6744    #[doc(hidden)]
6745    pub mod scope {
6746        #[allow(unused_imports)]
6747        use super::*;
6748        #[derive(Clone, Debug, PartialEq)]
6749        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6750    }
6751
6752    impl Scope {
6753        /// Gets the enum value.
6754        ///
6755        /// Returns `None` if the enum contains an unknown value deserialized from
6756        /// the string representation of enums.
6757        pub fn value(&self) -> std::option::Option<i32> {
6758            match self {
6759                Self::Unspecified => std::option::Option::Some(0),
6760                Self::Api => std::option::Option::Some(1),
6761                Self::Version => std::option::Option::Some(2),
6762                Self::Spec => std::option::Option::Some(3),
6763                Self::ApiOperation => std::option::Option::Some(4),
6764                Self::Deployment => std::option::Option::Some(5),
6765                Self::Dependency => std::option::Option::Some(6),
6766                Self::Definition => std::option::Option::Some(7),
6767                Self::ExternalApi => std::option::Option::Some(8),
6768                Self::Plugin => std::option::Option::Some(9),
6769                Self::UnknownValue(u) => u.0.value(),
6770            }
6771        }
6772
6773        /// Gets the enum value as a string.
6774        ///
6775        /// Returns `None` if the enum contains an unknown value deserialized from
6776        /// the integer representation of enums.
6777        pub fn name(&self) -> std::option::Option<&str> {
6778            match self {
6779                Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
6780                Self::Api => std::option::Option::Some("API"),
6781                Self::Version => std::option::Option::Some("VERSION"),
6782                Self::Spec => std::option::Option::Some("SPEC"),
6783                Self::ApiOperation => std::option::Option::Some("API_OPERATION"),
6784                Self::Deployment => std::option::Option::Some("DEPLOYMENT"),
6785                Self::Dependency => std::option::Option::Some("DEPENDENCY"),
6786                Self::Definition => std::option::Option::Some("DEFINITION"),
6787                Self::ExternalApi => std::option::Option::Some("EXTERNAL_API"),
6788                Self::Plugin => std::option::Option::Some("PLUGIN"),
6789                Self::UnknownValue(u) => u.0.name(),
6790            }
6791        }
6792    }
6793
6794    impl std::default::Default for Scope {
6795        fn default() -> Self {
6796            use std::convert::From;
6797            Self::from(0)
6798        }
6799    }
6800
6801    impl std::fmt::Display for Scope {
6802        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6803            wkt::internal::display_enum(f, self.name(), self.value())
6804        }
6805    }
6806
6807    impl std::convert::From<i32> for Scope {
6808        fn from(value: i32) -> Self {
6809            match value {
6810                0 => Self::Unspecified,
6811                1 => Self::Api,
6812                2 => Self::Version,
6813                3 => Self::Spec,
6814                4 => Self::ApiOperation,
6815                5 => Self::Deployment,
6816                6 => Self::Dependency,
6817                7 => Self::Definition,
6818                8 => Self::ExternalApi,
6819                9 => Self::Plugin,
6820                _ => Self::UnknownValue(scope::UnknownValue(
6821                    wkt::internal::UnknownEnumValue::Integer(value),
6822                )),
6823            }
6824        }
6825    }
6826
6827    impl std::convert::From<&str> for Scope {
6828        fn from(value: &str) -> Self {
6829            use std::string::ToString;
6830            match value {
6831                "SCOPE_UNSPECIFIED" => Self::Unspecified,
6832                "API" => Self::Api,
6833                "VERSION" => Self::Version,
6834                "SPEC" => Self::Spec,
6835                "API_OPERATION" => Self::ApiOperation,
6836                "DEPLOYMENT" => Self::Deployment,
6837                "DEPENDENCY" => Self::Dependency,
6838                "DEFINITION" => Self::Definition,
6839                "EXTERNAL_API" => Self::ExternalApi,
6840                "PLUGIN" => Self::Plugin,
6841                _ => Self::UnknownValue(scope::UnknownValue(
6842                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6843                )),
6844            }
6845        }
6846    }
6847
6848    impl serde::ser::Serialize for Scope {
6849        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6850        where
6851            S: serde::Serializer,
6852        {
6853            match self {
6854                Self::Unspecified => serializer.serialize_i32(0),
6855                Self::Api => serializer.serialize_i32(1),
6856                Self::Version => serializer.serialize_i32(2),
6857                Self::Spec => serializer.serialize_i32(3),
6858                Self::ApiOperation => serializer.serialize_i32(4),
6859                Self::Deployment => serializer.serialize_i32(5),
6860                Self::Dependency => serializer.serialize_i32(6),
6861                Self::Definition => serializer.serialize_i32(7),
6862                Self::ExternalApi => serializer.serialize_i32(8),
6863                Self::Plugin => serializer.serialize_i32(9),
6864                Self::UnknownValue(u) => u.0.serialize(serializer),
6865            }
6866        }
6867    }
6868
6869    impl<'de> serde::de::Deserialize<'de> for Scope {
6870        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6871        where
6872            D: serde::Deserializer<'de>,
6873        {
6874            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
6875                ".google.cloud.apihub.v1.Attribute.Scope",
6876            ))
6877        }
6878    }
6879
6880    /// Enumeration of attribute's data type.
6881    ///
6882    /// # Working with unknown values
6883    ///
6884    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6885    /// additional enum variants at any time. Adding new variants is not considered
6886    /// a breaking change. Applications should write their code in anticipation of:
6887    ///
6888    /// - New values appearing in future releases of the client library, **and**
6889    /// - New values received dynamically, without application changes.
6890    ///
6891    /// Please consult the [Working with enums] section in the user guide for some
6892    /// guidelines.
6893    ///
6894    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6895    #[derive(Clone, Debug, PartialEq)]
6896    #[non_exhaustive]
6897    pub enum DataType {
6898        /// Attribute data type unspecified.
6899        Unspecified,
6900        /// Attribute's value is of type enum.
6901        Enum,
6902        /// Attribute's value is of type json.
6903        Json,
6904        /// Attribute's value is of type string.
6905        String,
6906        /// Attribute's value is of type uri.
6907        Uri,
6908        /// If set, the enum was initialized with an unknown value.
6909        ///
6910        /// Applications can examine the value using [DataType::value] or
6911        /// [DataType::name].
6912        UnknownValue(data_type::UnknownValue),
6913    }
6914
6915    #[doc(hidden)]
6916    pub mod data_type {
6917        #[allow(unused_imports)]
6918        use super::*;
6919        #[derive(Clone, Debug, PartialEq)]
6920        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6921    }
6922
6923    impl DataType {
6924        /// Gets the enum value.
6925        ///
6926        /// Returns `None` if the enum contains an unknown value deserialized from
6927        /// the string representation of enums.
6928        pub fn value(&self) -> std::option::Option<i32> {
6929            match self {
6930                Self::Unspecified => std::option::Option::Some(0),
6931                Self::Enum => std::option::Option::Some(1),
6932                Self::Json => std::option::Option::Some(2),
6933                Self::String => std::option::Option::Some(3),
6934                Self::Uri => std::option::Option::Some(4),
6935                Self::UnknownValue(u) => u.0.value(),
6936            }
6937        }
6938
6939        /// Gets the enum value as a string.
6940        ///
6941        /// Returns `None` if the enum contains an unknown value deserialized from
6942        /// the integer representation of enums.
6943        pub fn name(&self) -> std::option::Option<&str> {
6944            match self {
6945                Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
6946                Self::Enum => std::option::Option::Some("ENUM"),
6947                Self::Json => std::option::Option::Some("JSON"),
6948                Self::String => std::option::Option::Some("STRING"),
6949                Self::Uri => std::option::Option::Some("URI"),
6950                Self::UnknownValue(u) => u.0.name(),
6951            }
6952        }
6953    }
6954
6955    impl std::default::Default for DataType {
6956        fn default() -> Self {
6957            use std::convert::From;
6958            Self::from(0)
6959        }
6960    }
6961
6962    impl std::fmt::Display for DataType {
6963        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6964            wkt::internal::display_enum(f, self.name(), self.value())
6965        }
6966    }
6967
6968    impl std::convert::From<i32> for DataType {
6969        fn from(value: i32) -> Self {
6970            match value {
6971                0 => Self::Unspecified,
6972                1 => Self::Enum,
6973                2 => Self::Json,
6974                3 => Self::String,
6975                4 => Self::Uri,
6976                _ => Self::UnknownValue(data_type::UnknownValue(
6977                    wkt::internal::UnknownEnumValue::Integer(value),
6978                )),
6979            }
6980        }
6981    }
6982
6983    impl std::convert::From<&str> for DataType {
6984        fn from(value: &str) -> Self {
6985            use std::string::ToString;
6986            match value {
6987                "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
6988                "ENUM" => Self::Enum,
6989                "JSON" => Self::Json,
6990                "STRING" => Self::String,
6991                "URI" => Self::Uri,
6992                _ => Self::UnknownValue(data_type::UnknownValue(
6993                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6994                )),
6995            }
6996        }
6997    }
6998
6999    impl serde::ser::Serialize for DataType {
7000        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7001        where
7002            S: serde::Serializer,
7003        {
7004            match self {
7005                Self::Unspecified => serializer.serialize_i32(0),
7006                Self::Enum => serializer.serialize_i32(1),
7007                Self::Json => serializer.serialize_i32(2),
7008                Self::String => serializer.serialize_i32(3),
7009                Self::Uri => serializer.serialize_i32(4),
7010                Self::UnknownValue(u) => u.0.serialize(serializer),
7011            }
7012        }
7013    }
7014
7015    impl<'de> serde::de::Deserialize<'de> for DataType {
7016        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7017        where
7018            D: serde::Deserializer<'de>,
7019        {
7020            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
7021                ".google.cloud.apihub.v1.Attribute.DataType",
7022            ))
7023        }
7024    }
7025}
7026
7027/// The spec contents.
7028#[derive(Clone, Default, PartialEq)]
7029#[non_exhaustive]
7030pub struct SpecContents {
7031    /// Required. The contents of the spec.
7032    pub contents: ::bytes::Bytes,
7033
7034    /// Required. The mime type of the content for example application/json,
7035    /// application/yaml, application/wsdl etc.
7036    pub mime_type: std::string::String,
7037
7038    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7039}
7040
7041impl SpecContents {
7042    pub fn new() -> Self {
7043        std::default::Default::default()
7044    }
7045
7046    /// Sets the value of [contents][crate::model::SpecContents::contents].
7047    pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7048        self.contents = v.into();
7049        self
7050    }
7051
7052    /// Sets the value of [mime_type][crate::model::SpecContents::mime_type].
7053    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7054        self.mime_type = v.into();
7055        self
7056    }
7057}
7058
7059impl wkt::message::Message for SpecContents {
7060    fn typename() -> &'static str {
7061        "type.googleapis.com/google.cloud.apihub.v1.SpecContents"
7062    }
7063}
7064
7065/// SpecDetails contains the details parsed from supported
7066/// spec types.
7067#[derive(Clone, Default, PartialEq)]
7068#[non_exhaustive]
7069pub struct SpecDetails {
7070    /// Output only. The description of the spec.
7071    pub description: std::string::String,
7072
7073    pub details: std::option::Option<crate::model::spec_details::Details>,
7074
7075    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7076}
7077
7078impl SpecDetails {
7079    pub fn new() -> Self {
7080        std::default::Default::default()
7081    }
7082
7083    /// Sets the value of [description][crate::model::SpecDetails::description].
7084    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7085        self.description = v.into();
7086        self
7087    }
7088
7089    /// Sets the value of [details][crate::model::SpecDetails::details].
7090    ///
7091    /// Note that all the setters affecting `details` are mutually
7092    /// exclusive.
7093    pub fn set_details<
7094        T: std::convert::Into<std::option::Option<crate::model::spec_details::Details>>,
7095    >(
7096        mut self,
7097        v: T,
7098    ) -> Self {
7099        self.details = v.into();
7100        self
7101    }
7102
7103    /// The value of [details][crate::model::SpecDetails::details]
7104    /// if it holds a `OpenApiSpecDetails`, `None` if the field is not set or
7105    /// holds a different branch.
7106    pub fn open_api_spec_details(
7107        &self,
7108    ) -> std::option::Option<&std::boxed::Box<crate::model::OpenApiSpecDetails>> {
7109        #[allow(unreachable_patterns)]
7110        self.details.as_ref().and_then(|v| match v {
7111            crate::model::spec_details::Details::OpenApiSpecDetails(v) => {
7112                std::option::Option::Some(v)
7113            }
7114            _ => std::option::Option::None,
7115        })
7116    }
7117
7118    /// Sets the value of [details][crate::model::SpecDetails::details]
7119    /// to hold a `OpenApiSpecDetails`.
7120    ///
7121    /// Note that all the setters affecting `details` are
7122    /// mutually exclusive.
7123    pub fn set_open_api_spec_details<
7124        T: std::convert::Into<std::boxed::Box<crate::model::OpenApiSpecDetails>>,
7125    >(
7126        mut self,
7127        v: T,
7128    ) -> Self {
7129        self.details = std::option::Option::Some(
7130            crate::model::spec_details::Details::OpenApiSpecDetails(v.into()),
7131        );
7132        self
7133    }
7134}
7135
7136impl wkt::message::Message for SpecDetails {
7137    fn typename() -> &'static str {
7138        "type.googleapis.com/google.cloud.apihub.v1.SpecDetails"
7139    }
7140}
7141
7142/// Defines additional types related to [SpecDetails].
7143pub mod spec_details {
7144    #[allow(unused_imports)]
7145    use super::*;
7146
7147    #[derive(Clone, Debug, PartialEq)]
7148    #[non_exhaustive]
7149    pub enum Details {
7150        /// Output only. Additional details apart from `OperationDetails` parsed from
7151        /// an OpenAPI spec. The OperationDetails parsed from the spec can be
7152        /// obtained by using
7153        /// [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
7154        /// method.
7155        ///
7156        /// [google.cloud.apihub.v1.ApiHub.ListApiOperations]: crate::client::ApiHub::list_api_operations
7157        OpenApiSpecDetails(std::boxed::Box<crate::model::OpenApiSpecDetails>),
7158    }
7159}
7160
7161/// OpenApiSpecDetails contains the details parsed from an OpenAPI spec in
7162/// addition to the fields mentioned in
7163/// [SpecDetails][google.cloud.apihub.v1.SpecDetails].
7164///
7165/// [google.cloud.apihub.v1.SpecDetails]: crate::model::SpecDetails
7166#[derive(Clone, Default, PartialEq)]
7167#[non_exhaustive]
7168pub struct OpenApiSpecDetails {
7169    /// Output only. The format of the spec.
7170    pub format: crate::model::open_api_spec_details::Format,
7171
7172    /// Output only. The version in the spec.
7173    /// This maps to `info.version` in OpenAPI spec.
7174    pub version: std::string::String,
7175
7176    /// Output only. Owner details for the spec.
7177    /// This maps to `info.contact` in OpenAPI spec.
7178    pub owner: std::option::Option<crate::model::Owner>,
7179
7180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7181}
7182
7183impl OpenApiSpecDetails {
7184    pub fn new() -> Self {
7185        std::default::Default::default()
7186    }
7187
7188    /// Sets the value of [format][crate::model::OpenApiSpecDetails::format].
7189    pub fn set_format<T: std::convert::Into<crate::model::open_api_spec_details::Format>>(
7190        mut self,
7191        v: T,
7192    ) -> Self {
7193        self.format = v.into();
7194        self
7195    }
7196
7197    /// Sets the value of [version][crate::model::OpenApiSpecDetails::version].
7198    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7199        self.version = v.into();
7200        self
7201    }
7202
7203    /// Sets the value of [owner][crate::model::OpenApiSpecDetails::owner].
7204    pub fn set_owner<T>(mut self, v: T) -> Self
7205    where
7206        T: std::convert::Into<crate::model::Owner>,
7207    {
7208        self.owner = std::option::Option::Some(v.into());
7209        self
7210    }
7211
7212    /// Sets or clears the value of [owner][crate::model::OpenApiSpecDetails::owner].
7213    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
7214    where
7215        T: std::convert::Into<crate::model::Owner>,
7216    {
7217        self.owner = v.map(|x| x.into());
7218        self
7219    }
7220}
7221
7222impl wkt::message::Message for OpenApiSpecDetails {
7223    fn typename() -> &'static str {
7224        "type.googleapis.com/google.cloud.apihub.v1.OpenApiSpecDetails"
7225    }
7226}
7227
7228/// Defines additional types related to [OpenApiSpecDetails].
7229pub mod open_api_spec_details {
7230    #[allow(unused_imports)]
7231    use super::*;
7232
7233    /// Enumeration of spec formats.
7234    ///
7235    /// # Working with unknown values
7236    ///
7237    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7238    /// additional enum variants at any time. Adding new variants is not considered
7239    /// a breaking change. Applications should write their code in anticipation of:
7240    ///
7241    /// - New values appearing in future releases of the client library, **and**
7242    /// - New values received dynamically, without application changes.
7243    ///
7244    /// Please consult the [Working with enums] section in the user guide for some
7245    /// guidelines.
7246    ///
7247    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7248    #[derive(Clone, Debug, PartialEq)]
7249    #[non_exhaustive]
7250    pub enum Format {
7251        /// SpecFile type unspecified.
7252        Unspecified,
7253        /// OpenAPI Spec v2.0.
7254        OpenApiSpec20,
7255        /// OpenAPI Spec v3.0.
7256        OpenApiSpec30,
7257        /// OpenAPI Spec v3.1.
7258        OpenApiSpec31,
7259        /// If set, the enum was initialized with an unknown value.
7260        ///
7261        /// Applications can examine the value using [Format::value] or
7262        /// [Format::name].
7263        UnknownValue(format::UnknownValue),
7264    }
7265
7266    #[doc(hidden)]
7267    pub mod format {
7268        #[allow(unused_imports)]
7269        use super::*;
7270        #[derive(Clone, Debug, PartialEq)]
7271        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7272    }
7273
7274    impl Format {
7275        /// Gets the enum value.
7276        ///
7277        /// Returns `None` if the enum contains an unknown value deserialized from
7278        /// the string representation of enums.
7279        pub fn value(&self) -> std::option::Option<i32> {
7280            match self {
7281                Self::Unspecified => std::option::Option::Some(0),
7282                Self::OpenApiSpec20 => std::option::Option::Some(1),
7283                Self::OpenApiSpec30 => std::option::Option::Some(2),
7284                Self::OpenApiSpec31 => std::option::Option::Some(3),
7285                Self::UnknownValue(u) => u.0.value(),
7286            }
7287        }
7288
7289        /// Gets the enum value as a string.
7290        ///
7291        /// Returns `None` if the enum contains an unknown value deserialized from
7292        /// the integer representation of enums.
7293        pub fn name(&self) -> std::option::Option<&str> {
7294            match self {
7295                Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
7296                Self::OpenApiSpec20 => std::option::Option::Some("OPEN_API_SPEC_2_0"),
7297                Self::OpenApiSpec30 => std::option::Option::Some("OPEN_API_SPEC_3_0"),
7298                Self::OpenApiSpec31 => std::option::Option::Some("OPEN_API_SPEC_3_1"),
7299                Self::UnknownValue(u) => u.0.name(),
7300            }
7301        }
7302    }
7303
7304    impl std::default::Default for Format {
7305        fn default() -> Self {
7306            use std::convert::From;
7307            Self::from(0)
7308        }
7309    }
7310
7311    impl std::fmt::Display for Format {
7312        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7313            wkt::internal::display_enum(f, self.name(), self.value())
7314        }
7315    }
7316
7317    impl std::convert::From<i32> for Format {
7318        fn from(value: i32) -> Self {
7319            match value {
7320                0 => Self::Unspecified,
7321                1 => Self::OpenApiSpec20,
7322                2 => Self::OpenApiSpec30,
7323                3 => Self::OpenApiSpec31,
7324                _ => Self::UnknownValue(format::UnknownValue(
7325                    wkt::internal::UnknownEnumValue::Integer(value),
7326                )),
7327            }
7328        }
7329    }
7330
7331    impl std::convert::From<&str> for Format {
7332        fn from(value: &str) -> Self {
7333            use std::string::ToString;
7334            match value {
7335                "FORMAT_UNSPECIFIED" => Self::Unspecified,
7336                "OPEN_API_SPEC_2_0" => Self::OpenApiSpec20,
7337                "OPEN_API_SPEC_3_0" => Self::OpenApiSpec30,
7338                "OPEN_API_SPEC_3_1" => Self::OpenApiSpec31,
7339                _ => Self::UnknownValue(format::UnknownValue(
7340                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7341                )),
7342            }
7343        }
7344    }
7345
7346    impl serde::ser::Serialize for Format {
7347        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7348        where
7349            S: serde::Serializer,
7350        {
7351            match self {
7352                Self::Unspecified => serializer.serialize_i32(0),
7353                Self::OpenApiSpec20 => serializer.serialize_i32(1),
7354                Self::OpenApiSpec30 => serializer.serialize_i32(2),
7355                Self::OpenApiSpec31 => serializer.serialize_i32(3),
7356                Self::UnknownValue(u) => u.0.serialize(serializer),
7357            }
7358        }
7359    }
7360
7361    impl<'de> serde::de::Deserialize<'de> for Format {
7362        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7363        where
7364            D: serde::Deserializer<'de>,
7365        {
7366            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
7367                ".google.cloud.apihub.v1.OpenApiSpecDetails.Format",
7368            ))
7369        }
7370    }
7371}
7372
7373/// The operation details parsed from the spec.
7374#[derive(Clone, Default, PartialEq)]
7375#[non_exhaustive]
7376pub struct OperationDetails {
7377    /// Optional. Description of the operation behavior.
7378    /// For OpenAPI spec, this will map to `operation.description` in the
7379    /// spec, in case description is empty, `operation.summary` will be used.
7380    pub description: std::string::String,
7381
7382    /// Optional. Additional external documentation for this operation.
7383    /// For OpenAPI spec, this will map to `operation.documentation` in the spec.
7384    pub documentation: std::option::Option<crate::model::Documentation>,
7385
7386    /// Optional. For OpenAPI spec, this will be set if `operation.deprecated`is
7387    /// marked as `true` in the spec.
7388    pub deprecated: bool,
7389
7390    pub operation: std::option::Option<crate::model::operation_details::Operation>,
7391
7392    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7393}
7394
7395impl OperationDetails {
7396    pub fn new() -> Self {
7397        std::default::Default::default()
7398    }
7399
7400    /// Sets the value of [description][crate::model::OperationDetails::description].
7401    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7402        self.description = v.into();
7403        self
7404    }
7405
7406    /// Sets the value of [documentation][crate::model::OperationDetails::documentation].
7407    pub fn set_documentation<T>(mut self, v: T) -> Self
7408    where
7409        T: std::convert::Into<crate::model::Documentation>,
7410    {
7411        self.documentation = std::option::Option::Some(v.into());
7412        self
7413    }
7414
7415    /// Sets or clears the value of [documentation][crate::model::OperationDetails::documentation].
7416    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
7417    where
7418        T: std::convert::Into<crate::model::Documentation>,
7419    {
7420        self.documentation = v.map(|x| x.into());
7421        self
7422    }
7423
7424    /// Sets the value of [deprecated][crate::model::OperationDetails::deprecated].
7425    pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7426        self.deprecated = v.into();
7427        self
7428    }
7429
7430    /// Sets the value of [operation][crate::model::OperationDetails::operation].
7431    ///
7432    /// Note that all the setters affecting `operation` are mutually
7433    /// exclusive.
7434    pub fn set_operation<
7435        T: std::convert::Into<std::option::Option<crate::model::operation_details::Operation>>,
7436    >(
7437        mut self,
7438        v: T,
7439    ) -> Self {
7440        self.operation = v.into();
7441        self
7442    }
7443
7444    /// The value of [operation][crate::model::OperationDetails::operation]
7445    /// if it holds a `HttpOperation`, `None` if the field is not set or
7446    /// holds a different branch.
7447    pub fn http_operation(
7448        &self,
7449    ) -> std::option::Option<&std::boxed::Box<crate::model::HttpOperation>> {
7450        #[allow(unreachable_patterns)]
7451        self.operation.as_ref().and_then(|v| match v {
7452            crate::model::operation_details::Operation::HttpOperation(v) => {
7453                std::option::Option::Some(v)
7454            }
7455            _ => std::option::Option::None,
7456        })
7457    }
7458
7459    /// Sets the value of [operation][crate::model::OperationDetails::operation]
7460    /// to hold a `HttpOperation`.
7461    ///
7462    /// Note that all the setters affecting `operation` are
7463    /// mutually exclusive.
7464    pub fn set_http_operation<
7465        T: std::convert::Into<std::boxed::Box<crate::model::HttpOperation>>,
7466    >(
7467        mut self,
7468        v: T,
7469    ) -> Self {
7470        self.operation = std::option::Option::Some(
7471            crate::model::operation_details::Operation::HttpOperation(v.into()),
7472        );
7473        self
7474    }
7475}
7476
7477impl wkt::message::Message for OperationDetails {
7478    fn typename() -> &'static str {
7479        "type.googleapis.com/google.cloud.apihub.v1.OperationDetails"
7480    }
7481}
7482
7483/// Defines additional types related to [OperationDetails].
7484pub mod operation_details {
7485    #[allow(unused_imports)]
7486    use super::*;
7487
7488    #[derive(Clone, Debug, PartialEq)]
7489    #[non_exhaustive]
7490    pub enum Operation {
7491        /// The HTTP Operation.
7492        HttpOperation(std::boxed::Box<crate::model::HttpOperation>),
7493    }
7494}
7495
7496/// The HTTP Operation.
7497#[derive(Clone, Default, PartialEq)]
7498#[non_exhaustive]
7499pub struct HttpOperation {
7500    /// Optional. The path details for the Operation.
7501    /// Note: Even though this field is optional, it is required for
7502    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
7503    /// API and we will fail the request if not provided.
7504    ///
7505    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
7506    pub path: std::option::Option<crate::model::Path>,
7507
7508    /// Optional. Operation method
7509    /// Note: Even though this field is optional, it is required for
7510    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
7511    /// API and we will fail the request if not provided.
7512    ///
7513    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
7514    pub method: crate::model::http_operation::Method,
7515
7516    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7517}
7518
7519impl HttpOperation {
7520    pub fn new() -> Self {
7521        std::default::Default::default()
7522    }
7523
7524    /// Sets the value of [path][crate::model::HttpOperation::path].
7525    pub fn set_path<T>(mut self, v: T) -> Self
7526    where
7527        T: std::convert::Into<crate::model::Path>,
7528    {
7529        self.path = std::option::Option::Some(v.into());
7530        self
7531    }
7532
7533    /// Sets or clears the value of [path][crate::model::HttpOperation::path].
7534    pub fn set_or_clear_path<T>(mut self, v: std::option::Option<T>) -> Self
7535    where
7536        T: std::convert::Into<crate::model::Path>,
7537    {
7538        self.path = v.map(|x| x.into());
7539        self
7540    }
7541
7542    /// Sets the value of [method][crate::model::HttpOperation::method].
7543    pub fn set_method<T: std::convert::Into<crate::model::http_operation::Method>>(
7544        mut self,
7545        v: T,
7546    ) -> Self {
7547        self.method = v.into();
7548        self
7549    }
7550}
7551
7552impl wkt::message::Message for HttpOperation {
7553    fn typename() -> &'static str {
7554        "type.googleapis.com/google.cloud.apihub.v1.HttpOperation"
7555    }
7556}
7557
7558/// Defines additional types related to [HttpOperation].
7559pub mod http_operation {
7560    #[allow(unused_imports)]
7561    use super::*;
7562
7563    /// Enumeration of Method types.
7564    ///
7565    /// # Working with unknown values
7566    ///
7567    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7568    /// additional enum variants at any time. Adding new variants is not considered
7569    /// a breaking change. Applications should write their code in anticipation of:
7570    ///
7571    /// - New values appearing in future releases of the client library, **and**
7572    /// - New values received dynamically, without application changes.
7573    ///
7574    /// Please consult the [Working with enums] section in the user guide for some
7575    /// guidelines.
7576    ///
7577    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7578    #[derive(Clone, Debug, PartialEq)]
7579    #[non_exhaustive]
7580    pub enum Method {
7581        /// Method unspecified.
7582        Unspecified,
7583        /// Get Operation type.
7584        Get,
7585        /// Put Operation type.
7586        Put,
7587        /// Post Operation type.
7588        Post,
7589        /// Delete Operation type.
7590        Delete,
7591        /// Options Operation type.
7592        Options,
7593        /// Head Operation type.
7594        Head,
7595        /// Patch Operation type.
7596        Patch,
7597        /// Trace Operation type.
7598        Trace,
7599        /// If set, the enum was initialized with an unknown value.
7600        ///
7601        /// Applications can examine the value using [Method::value] or
7602        /// [Method::name].
7603        UnknownValue(method::UnknownValue),
7604    }
7605
7606    #[doc(hidden)]
7607    pub mod method {
7608        #[allow(unused_imports)]
7609        use super::*;
7610        #[derive(Clone, Debug, PartialEq)]
7611        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7612    }
7613
7614    impl Method {
7615        /// Gets the enum value.
7616        ///
7617        /// Returns `None` if the enum contains an unknown value deserialized from
7618        /// the string representation of enums.
7619        pub fn value(&self) -> std::option::Option<i32> {
7620            match self {
7621                Self::Unspecified => std::option::Option::Some(0),
7622                Self::Get => std::option::Option::Some(1),
7623                Self::Put => std::option::Option::Some(2),
7624                Self::Post => std::option::Option::Some(3),
7625                Self::Delete => std::option::Option::Some(4),
7626                Self::Options => std::option::Option::Some(5),
7627                Self::Head => std::option::Option::Some(6),
7628                Self::Patch => std::option::Option::Some(7),
7629                Self::Trace => std::option::Option::Some(8),
7630                Self::UnknownValue(u) => u.0.value(),
7631            }
7632        }
7633
7634        /// Gets the enum value as a string.
7635        ///
7636        /// Returns `None` if the enum contains an unknown value deserialized from
7637        /// the integer representation of enums.
7638        pub fn name(&self) -> std::option::Option<&str> {
7639            match self {
7640                Self::Unspecified => std::option::Option::Some("METHOD_UNSPECIFIED"),
7641                Self::Get => std::option::Option::Some("GET"),
7642                Self::Put => std::option::Option::Some("PUT"),
7643                Self::Post => std::option::Option::Some("POST"),
7644                Self::Delete => std::option::Option::Some("DELETE"),
7645                Self::Options => std::option::Option::Some("OPTIONS"),
7646                Self::Head => std::option::Option::Some("HEAD"),
7647                Self::Patch => std::option::Option::Some("PATCH"),
7648                Self::Trace => std::option::Option::Some("TRACE"),
7649                Self::UnknownValue(u) => u.0.name(),
7650            }
7651        }
7652    }
7653
7654    impl std::default::Default for Method {
7655        fn default() -> Self {
7656            use std::convert::From;
7657            Self::from(0)
7658        }
7659    }
7660
7661    impl std::fmt::Display for Method {
7662        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7663            wkt::internal::display_enum(f, self.name(), self.value())
7664        }
7665    }
7666
7667    impl std::convert::From<i32> for Method {
7668        fn from(value: i32) -> Self {
7669            match value {
7670                0 => Self::Unspecified,
7671                1 => Self::Get,
7672                2 => Self::Put,
7673                3 => Self::Post,
7674                4 => Self::Delete,
7675                5 => Self::Options,
7676                6 => Self::Head,
7677                7 => Self::Patch,
7678                8 => Self::Trace,
7679                _ => Self::UnknownValue(method::UnknownValue(
7680                    wkt::internal::UnknownEnumValue::Integer(value),
7681                )),
7682            }
7683        }
7684    }
7685
7686    impl std::convert::From<&str> for Method {
7687        fn from(value: &str) -> Self {
7688            use std::string::ToString;
7689            match value {
7690                "METHOD_UNSPECIFIED" => Self::Unspecified,
7691                "GET" => Self::Get,
7692                "PUT" => Self::Put,
7693                "POST" => Self::Post,
7694                "DELETE" => Self::Delete,
7695                "OPTIONS" => Self::Options,
7696                "HEAD" => Self::Head,
7697                "PATCH" => Self::Patch,
7698                "TRACE" => Self::Trace,
7699                _ => Self::UnknownValue(method::UnknownValue(
7700                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7701                )),
7702            }
7703        }
7704    }
7705
7706    impl serde::ser::Serialize for Method {
7707        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7708        where
7709            S: serde::Serializer,
7710        {
7711            match self {
7712                Self::Unspecified => serializer.serialize_i32(0),
7713                Self::Get => serializer.serialize_i32(1),
7714                Self::Put => serializer.serialize_i32(2),
7715                Self::Post => serializer.serialize_i32(3),
7716                Self::Delete => serializer.serialize_i32(4),
7717                Self::Options => serializer.serialize_i32(5),
7718                Self::Head => serializer.serialize_i32(6),
7719                Self::Patch => serializer.serialize_i32(7),
7720                Self::Trace => serializer.serialize_i32(8),
7721                Self::UnknownValue(u) => u.0.serialize(serializer),
7722            }
7723        }
7724    }
7725
7726    impl<'de> serde::de::Deserialize<'de> for Method {
7727        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7728        where
7729            D: serde::Deserializer<'de>,
7730        {
7731            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Method>::new(
7732                ".google.cloud.apihub.v1.HttpOperation.Method",
7733            ))
7734        }
7735    }
7736}
7737
7738/// The path details derived from the spec.
7739#[derive(Clone, Default, PartialEq)]
7740#[non_exhaustive]
7741pub struct Path {
7742    /// Optional. Complete path relative to server endpoint.
7743    /// Note: Even though this field is optional, it is required for
7744    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
7745    /// API and we will fail the request if not provided.
7746    ///
7747    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
7748    pub path: std::string::String,
7749
7750    /// Optional. A short description for the path applicable to all operations.
7751    pub description: std::string::String,
7752
7753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7754}
7755
7756impl Path {
7757    pub fn new() -> Self {
7758        std::default::Default::default()
7759    }
7760
7761    /// Sets the value of [path][crate::model::Path::path].
7762    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7763        self.path = v.into();
7764        self
7765    }
7766
7767    /// Sets the value of [description][crate::model::Path::description].
7768    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7769        self.description = v.into();
7770        self
7771    }
7772}
7773
7774impl wkt::message::Message for Path {
7775    fn typename() -> &'static str {
7776        "type.googleapis.com/google.cloud.apihub.v1.Path"
7777    }
7778}
7779
7780/// The schema details derived from the spec. Currently, this entity is supported
7781/// for OpenAPI spec only.
7782/// For OpenAPI spec, this maps to the schema defined in
7783/// the  `definitions` section for OpenAPI 2.0 version and in
7784/// `components.schemas` section for OpenAPI 3.0 and 3.1 version.
7785#[derive(Clone, Default, PartialEq)]
7786#[non_exhaustive]
7787pub struct Schema {
7788    /// Output only. The display name of the schema.
7789    /// This will map to the name of the schema in the spec.
7790    pub display_name: std::string::String,
7791
7792    /// Output only. The raw value of the schema definition corresponding to the
7793    /// schema name in the spec.
7794    pub raw_value: ::bytes::Bytes,
7795
7796    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7797}
7798
7799impl Schema {
7800    pub fn new() -> Self {
7801        std::default::Default::default()
7802    }
7803
7804    /// Sets the value of [display_name][crate::model::Schema::display_name].
7805    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7806        self.display_name = v.into();
7807        self
7808    }
7809
7810    /// Sets the value of [raw_value][crate::model::Schema::raw_value].
7811    pub fn set_raw_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7812        self.raw_value = v.into();
7813        self
7814    }
7815}
7816
7817impl wkt::message::Message for Schema {
7818    fn typename() -> &'static str {
7819        "type.googleapis.com/google.cloud.apihub.v1.Schema"
7820    }
7821}
7822
7823/// Owner details.
7824#[derive(Clone, Default, PartialEq)]
7825#[non_exhaustive]
7826pub struct Owner {
7827    /// Optional. The name of the owner.
7828    pub display_name: std::string::String,
7829
7830    /// Required. The email of the owner.
7831    pub email: std::string::String,
7832
7833    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7834}
7835
7836impl Owner {
7837    pub fn new() -> Self {
7838        std::default::Default::default()
7839    }
7840
7841    /// Sets the value of [display_name][crate::model::Owner::display_name].
7842    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7843        self.display_name = v.into();
7844        self
7845    }
7846
7847    /// Sets the value of [email][crate::model::Owner::email].
7848    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7849        self.email = v.into();
7850        self
7851    }
7852}
7853
7854impl wkt::message::Message for Owner {
7855    fn typename() -> &'static str {
7856        "type.googleapis.com/google.cloud.apihub.v1.Owner"
7857    }
7858}
7859
7860/// Documentation details.
7861#[derive(Clone, Default, PartialEq)]
7862#[non_exhaustive]
7863pub struct Documentation {
7864    /// Optional. The uri of the externally hosted documentation.
7865    pub external_uri: std::string::String,
7866
7867    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7868}
7869
7870impl Documentation {
7871    pub fn new() -> Self {
7872        std::default::Default::default()
7873    }
7874
7875    /// Sets the value of [external_uri][crate::model::Documentation::external_uri].
7876    pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7877        self.external_uri = v.into();
7878        self
7879    }
7880}
7881
7882impl wkt::message::Message for Documentation {
7883    fn typename() -> &'static str {
7884        "type.googleapis.com/google.cloud.apihub.v1.Documentation"
7885    }
7886}
7887
7888/// The attribute values associated with resource.
7889#[derive(Clone, Default, PartialEq)]
7890#[non_exhaustive]
7891pub struct AttributeValues {
7892    /// Output only. The name of the attribute.
7893    /// Format: projects/{project}/locations/{location}/attributes/{attribute}
7894    pub attribute: std::string::String,
7895
7896    /// The attribute values associated with the resource.
7897    pub value: std::option::Option<crate::model::attribute_values::Value>,
7898
7899    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7900}
7901
7902impl AttributeValues {
7903    pub fn new() -> Self {
7904        std::default::Default::default()
7905    }
7906
7907    /// Sets the value of [attribute][crate::model::AttributeValues::attribute].
7908    pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7909        self.attribute = v.into();
7910        self
7911    }
7912
7913    /// Sets the value of [value][crate::model::AttributeValues::value].
7914    ///
7915    /// Note that all the setters affecting `value` are mutually
7916    /// exclusive.
7917    pub fn set_value<
7918        T: std::convert::Into<std::option::Option<crate::model::attribute_values::Value>>,
7919    >(
7920        mut self,
7921        v: T,
7922    ) -> Self {
7923        self.value = v.into();
7924        self
7925    }
7926
7927    /// The value of [value][crate::model::AttributeValues::value]
7928    /// if it holds a `EnumValues`, `None` if the field is not set or
7929    /// holds a different branch.
7930    pub fn enum_values(
7931        &self,
7932    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>>
7933    {
7934        #[allow(unreachable_patterns)]
7935        self.value.as_ref().and_then(|v| match v {
7936            crate::model::attribute_values::Value::EnumValues(v) => std::option::Option::Some(v),
7937            _ => std::option::Option::None,
7938        })
7939    }
7940
7941    /// Sets the value of [value][crate::model::AttributeValues::value]
7942    /// to hold a `EnumValues`.
7943    ///
7944    /// Note that all the setters affecting `value` are
7945    /// mutually exclusive.
7946    pub fn set_enum_values<
7947        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>>,
7948    >(
7949        mut self,
7950        v: T,
7951    ) -> Self {
7952        self.value =
7953            std::option::Option::Some(crate::model::attribute_values::Value::EnumValues(v.into()));
7954        self
7955    }
7956
7957    /// The value of [value][crate::model::AttributeValues::value]
7958    /// if it holds a `StringValues`, `None` if the field is not set or
7959    /// holds a different branch.
7960    pub fn string_values(
7961        &self,
7962    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
7963    {
7964        #[allow(unreachable_patterns)]
7965        self.value.as_ref().and_then(|v| match v {
7966            crate::model::attribute_values::Value::StringValues(v) => std::option::Option::Some(v),
7967            _ => std::option::Option::None,
7968        })
7969    }
7970
7971    /// Sets the value of [value][crate::model::AttributeValues::value]
7972    /// to hold a `StringValues`.
7973    ///
7974    /// Note that all the setters affecting `value` are
7975    /// mutually exclusive.
7976    pub fn set_string_values<
7977        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
7978    >(
7979        mut self,
7980        v: T,
7981    ) -> Self {
7982        self.value = std::option::Option::Some(
7983            crate::model::attribute_values::Value::StringValues(v.into()),
7984        );
7985        self
7986    }
7987
7988    /// The value of [value][crate::model::AttributeValues::value]
7989    /// if it holds a `JsonValues`, `None` if the field is not set or
7990    /// holds a different branch.
7991    pub fn json_values(
7992        &self,
7993    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
7994    {
7995        #[allow(unreachable_patterns)]
7996        self.value.as_ref().and_then(|v| match v {
7997            crate::model::attribute_values::Value::JsonValues(v) => std::option::Option::Some(v),
7998            _ => std::option::Option::None,
7999        })
8000    }
8001
8002    /// Sets the value of [value][crate::model::AttributeValues::value]
8003    /// to hold a `JsonValues`.
8004    ///
8005    /// Note that all the setters affecting `value` are
8006    /// mutually exclusive.
8007    pub fn set_json_values<
8008        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
8009    >(
8010        mut self,
8011        v: T,
8012    ) -> Self {
8013        self.value =
8014            std::option::Option::Some(crate::model::attribute_values::Value::JsonValues(v.into()));
8015        self
8016    }
8017
8018    /// The value of [value][crate::model::AttributeValues::value]
8019    /// if it holds a `UriValues`, `None` if the field is not set or
8020    /// holds a different branch.
8021    pub fn uri_values(
8022        &self,
8023    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
8024    {
8025        #[allow(unreachable_patterns)]
8026        self.value.as_ref().and_then(|v| match v {
8027            crate::model::attribute_values::Value::UriValues(v) => std::option::Option::Some(v),
8028            _ => std::option::Option::None,
8029        })
8030    }
8031
8032    /// Sets the value of [value][crate::model::AttributeValues::value]
8033    /// to hold a `UriValues`.
8034    ///
8035    /// Note that all the setters affecting `value` are
8036    /// mutually exclusive.
8037    pub fn set_uri_values<
8038        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
8039    >(
8040        mut self,
8041        v: T,
8042    ) -> Self {
8043        self.value =
8044            std::option::Option::Some(crate::model::attribute_values::Value::UriValues(v.into()));
8045        self
8046    }
8047}
8048
8049impl wkt::message::Message for AttributeValues {
8050    fn typename() -> &'static str {
8051        "type.googleapis.com/google.cloud.apihub.v1.AttributeValues"
8052    }
8053}
8054
8055/// Defines additional types related to [AttributeValues].
8056pub mod attribute_values {
8057    #[allow(unused_imports)]
8058    use super::*;
8059
8060    /// The attribute values of data type enum.
8061    #[derive(Clone, Default, PartialEq)]
8062    #[non_exhaustive]
8063    pub struct EnumAttributeValues {
8064        /// Required. The attribute values in case attribute data type is enum.
8065        pub values: std::vec::Vec<crate::model::attribute::AllowedValue>,
8066
8067        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8068    }
8069
8070    impl EnumAttributeValues {
8071        pub fn new() -> Self {
8072            std::default::Default::default()
8073        }
8074
8075        /// Sets the value of [values][crate::model::attribute_values::EnumAttributeValues::values].
8076        pub fn set_values<T, V>(mut self, v: T) -> Self
8077        where
8078            T: std::iter::IntoIterator<Item = V>,
8079            V: std::convert::Into<crate::model::attribute::AllowedValue>,
8080        {
8081            use std::iter::Iterator;
8082            self.values = v.into_iter().map(|i| i.into()).collect();
8083            self
8084        }
8085    }
8086
8087    impl wkt::message::Message for EnumAttributeValues {
8088        fn typename() -> &'static str {
8089            "type.googleapis.com/google.cloud.apihub.v1.AttributeValues.EnumAttributeValues"
8090        }
8091    }
8092
8093    /// The attribute values of data type string or JSON.
8094    #[derive(Clone, Default, PartialEq)]
8095    #[non_exhaustive]
8096    pub struct StringAttributeValues {
8097        /// Required. The attribute values in case attribute data type is string or
8098        /// JSON.
8099        pub values: std::vec::Vec<std::string::String>,
8100
8101        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8102    }
8103
8104    impl StringAttributeValues {
8105        pub fn new() -> Self {
8106            std::default::Default::default()
8107        }
8108
8109        /// Sets the value of [values][crate::model::attribute_values::StringAttributeValues::values].
8110        pub fn set_values<T, V>(mut self, v: T) -> Self
8111        where
8112            T: std::iter::IntoIterator<Item = V>,
8113            V: std::convert::Into<std::string::String>,
8114        {
8115            use std::iter::Iterator;
8116            self.values = v.into_iter().map(|i| i.into()).collect();
8117            self
8118        }
8119    }
8120
8121    impl wkt::message::Message for StringAttributeValues {
8122        fn typename() -> &'static str {
8123            "type.googleapis.com/google.cloud.apihub.v1.AttributeValues.StringAttributeValues"
8124        }
8125    }
8126
8127    /// The attribute values associated with the resource.
8128    #[derive(Clone, Debug, PartialEq)]
8129    #[non_exhaustive]
8130    pub enum Value {
8131        /// The attribute values associated with a resource in case attribute data
8132        /// type is enum.
8133        EnumValues(std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>),
8134        /// The attribute values associated with a resource in case attribute data
8135        /// type is string.
8136        StringValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
8137        /// The attribute values associated with a resource in case attribute data
8138        /// type is JSON.
8139        JsonValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
8140        /// The attribute values associated with a resource in case attribute data
8141        /// type is URL, URI or IP, like gs://bucket-name/object-name.
8142        UriValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
8143    }
8144}
8145
8146/// A dependency resource defined in the API hub describes a dependency directed
8147/// from a consumer to a supplier entity. A dependency can be defined between two
8148/// [Operations][google.cloud.apihub.v1.ApiOperation] or between
8149/// an [Operation][google.cloud.apihub.v1.ApiOperation] and [External
8150/// API][google.cloud.apihub.v1.ExternalApi].
8151///
8152/// [google.cloud.apihub.v1.ApiOperation]: crate::model::ApiOperation
8153/// [google.cloud.apihub.v1.ExternalApi]: crate::model::ExternalApi
8154#[derive(Clone, Default, PartialEq)]
8155#[non_exhaustive]
8156pub struct Dependency {
8157    /// Identifier. The name of the dependency in the API Hub.
8158    ///
8159    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
8160    pub name: std::string::String,
8161
8162    /// Required. Immutable. The entity acting as the consumer in the dependency.
8163    pub consumer: std::option::Option<crate::model::DependencyEntityReference>,
8164
8165    /// Required. Immutable. The entity acting as the supplier in the dependency.
8166    pub supplier: std::option::Option<crate::model::DependencyEntityReference>,
8167
8168    /// Output only. State of the dependency.
8169    pub state: crate::model::dependency::State,
8170
8171    /// Optional. Human readable description corresponding of the dependency.
8172    pub description: std::string::String,
8173
8174    /// Output only. Discovery mode of the dependency.
8175    pub discovery_mode: crate::model::dependency::DiscoveryMode,
8176
8177    /// Output only. Error details of a dependency if the system has detected it
8178    /// internally.
8179    pub error_detail: std::option::Option<crate::model::DependencyErrorDetail>,
8180
8181    /// Output only. The time at which the dependency was created.
8182    pub create_time: std::option::Option<wkt::Timestamp>,
8183
8184    /// Output only. The time at which the dependency was last updated.
8185    pub update_time: std::option::Option<wkt::Timestamp>,
8186
8187    /// Optional. The list of user defined attributes associated with the
8188    /// dependency resource. The key is the attribute name. It will be of the
8189    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
8190    /// The value is the attribute values associated with the resource.
8191    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
8192
8193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8194}
8195
8196impl Dependency {
8197    pub fn new() -> Self {
8198        std::default::Default::default()
8199    }
8200
8201    /// Sets the value of [name][crate::model::Dependency::name].
8202    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8203        self.name = v.into();
8204        self
8205    }
8206
8207    /// Sets the value of [consumer][crate::model::Dependency::consumer].
8208    pub fn set_consumer<T>(mut self, v: T) -> Self
8209    where
8210        T: std::convert::Into<crate::model::DependencyEntityReference>,
8211    {
8212        self.consumer = std::option::Option::Some(v.into());
8213        self
8214    }
8215
8216    /// Sets or clears the value of [consumer][crate::model::Dependency::consumer].
8217    pub fn set_or_clear_consumer<T>(mut self, v: std::option::Option<T>) -> Self
8218    where
8219        T: std::convert::Into<crate::model::DependencyEntityReference>,
8220    {
8221        self.consumer = v.map(|x| x.into());
8222        self
8223    }
8224
8225    /// Sets the value of [supplier][crate::model::Dependency::supplier].
8226    pub fn set_supplier<T>(mut self, v: T) -> Self
8227    where
8228        T: std::convert::Into<crate::model::DependencyEntityReference>,
8229    {
8230        self.supplier = std::option::Option::Some(v.into());
8231        self
8232    }
8233
8234    /// Sets or clears the value of [supplier][crate::model::Dependency::supplier].
8235    pub fn set_or_clear_supplier<T>(mut self, v: std::option::Option<T>) -> Self
8236    where
8237        T: std::convert::Into<crate::model::DependencyEntityReference>,
8238    {
8239        self.supplier = v.map(|x| x.into());
8240        self
8241    }
8242
8243    /// Sets the value of [state][crate::model::Dependency::state].
8244    pub fn set_state<T: std::convert::Into<crate::model::dependency::State>>(
8245        mut self,
8246        v: T,
8247    ) -> Self {
8248        self.state = v.into();
8249        self
8250    }
8251
8252    /// Sets the value of [description][crate::model::Dependency::description].
8253    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8254        self.description = v.into();
8255        self
8256    }
8257
8258    /// Sets the value of [discovery_mode][crate::model::Dependency::discovery_mode].
8259    pub fn set_discovery_mode<T: std::convert::Into<crate::model::dependency::DiscoveryMode>>(
8260        mut self,
8261        v: T,
8262    ) -> Self {
8263        self.discovery_mode = v.into();
8264        self
8265    }
8266
8267    /// Sets the value of [error_detail][crate::model::Dependency::error_detail].
8268    pub fn set_error_detail<T>(mut self, v: T) -> Self
8269    where
8270        T: std::convert::Into<crate::model::DependencyErrorDetail>,
8271    {
8272        self.error_detail = std::option::Option::Some(v.into());
8273        self
8274    }
8275
8276    /// Sets or clears the value of [error_detail][crate::model::Dependency::error_detail].
8277    pub fn set_or_clear_error_detail<T>(mut self, v: std::option::Option<T>) -> Self
8278    where
8279        T: std::convert::Into<crate::model::DependencyErrorDetail>,
8280    {
8281        self.error_detail = v.map(|x| x.into());
8282        self
8283    }
8284
8285    /// Sets the value of [create_time][crate::model::Dependency::create_time].
8286    pub fn set_create_time<T>(mut self, v: T) -> Self
8287    where
8288        T: std::convert::Into<wkt::Timestamp>,
8289    {
8290        self.create_time = std::option::Option::Some(v.into());
8291        self
8292    }
8293
8294    /// Sets or clears the value of [create_time][crate::model::Dependency::create_time].
8295    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8296    where
8297        T: std::convert::Into<wkt::Timestamp>,
8298    {
8299        self.create_time = v.map(|x| x.into());
8300        self
8301    }
8302
8303    /// Sets the value of [update_time][crate::model::Dependency::update_time].
8304    pub fn set_update_time<T>(mut self, v: T) -> Self
8305    where
8306        T: std::convert::Into<wkt::Timestamp>,
8307    {
8308        self.update_time = std::option::Option::Some(v.into());
8309        self
8310    }
8311
8312    /// Sets or clears the value of [update_time][crate::model::Dependency::update_time].
8313    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8314    where
8315        T: std::convert::Into<wkt::Timestamp>,
8316    {
8317        self.update_time = v.map(|x| x.into());
8318        self
8319    }
8320
8321    /// Sets the value of [attributes][crate::model::Dependency::attributes].
8322    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
8323    where
8324        T: std::iter::IntoIterator<Item = (K, V)>,
8325        K: std::convert::Into<std::string::String>,
8326        V: std::convert::Into<crate::model::AttributeValues>,
8327    {
8328        use std::iter::Iterator;
8329        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8330        self
8331    }
8332}
8333
8334impl wkt::message::Message for Dependency {
8335    fn typename() -> &'static str {
8336        "type.googleapis.com/google.cloud.apihub.v1.Dependency"
8337    }
8338}
8339
8340/// Defines additional types related to [Dependency].
8341pub mod dependency {
8342    #[allow(unused_imports)]
8343    use super::*;
8344
8345    /// Possible states for a dependency.
8346    ///
8347    /// # Working with unknown values
8348    ///
8349    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8350    /// additional enum variants at any time. Adding new variants is not considered
8351    /// a breaking change. Applications should write their code in anticipation of:
8352    ///
8353    /// - New values appearing in future releases of the client library, **and**
8354    /// - New values received dynamically, without application changes.
8355    ///
8356    /// Please consult the [Working with enums] section in the user guide for some
8357    /// guidelines.
8358    ///
8359    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8360    #[derive(Clone, Debug, PartialEq)]
8361    #[non_exhaustive]
8362    pub enum State {
8363        /// Default value. This value is unused.
8364        Unspecified,
8365        /// Dependency will be in a proposed state when it is newly identified by the
8366        /// API hub on its own.
8367        Proposed,
8368        /// Dependency will be in a validated state when it is validated by the
8369        /// admin or manually created in the API hub.
8370        Validated,
8371        /// If set, the enum was initialized with an unknown value.
8372        ///
8373        /// Applications can examine the value using [State::value] or
8374        /// [State::name].
8375        UnknownValue(state::UnknownValue),
8376    }
8377
8378    #[doc(hidden)]
8379    pub mod state {
8380        #[allow(unused_imports)]
8381        use super::*;
8382        #[derive(Clone, Debug, PartialEq)]
8383        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8384    }
8385
8386    impl State {
8387        /// Gets the enum value.
8388        ///
8389        /// Returns `None` if the enum contains an unknown value deserialized from
8390        /// the string representation of enums.
8391        pub fn value(&self) -> std::option::Option<i32> {
8392            match self {
8393                Self::Unspecified => std::option::Option::Some(0),
8394                Self::Proposed => std::option::Option::Some(1),
8395                Self::Validated => std::option::Option::Some(2),
8396                Self::UnknownValue(u) => u.0.value(),
8397            }
8398        }
8399
8400        /// Gets the enum value as a string.
8401        ///
8402        /// Returns `None` if the enum contains an unknown value deserialized from
8403        /// the integer representation of enums.
8404        pub fn name(&self) -> std::option::Option<&str> {
8405            match self {
8406                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8407                Self::Proposed => std::option::Option::Some("PROPOSED"),
8408                Self::Validated => std::option::Option::Some("VALIDATED"),
8409                Self::UnknownValue(u) => u.0.name(),
8410            }
8411        }
8412    }
8413
8414    impl std::default::Default for State {
8415        fn default() -> Self {
8416            use std::convert::From;
8417            Self::from(0)
8418        }
8419    }
8420
8421    impl std::fmt::Display for State {
8422        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8423            wkt::internal::display_enum(f, self.name(), self.value())
8424        }
8425    }
8426
8427    impl std::convert::From<i32> for State {
8428        fn from(value: i32) -> Self {
8429            match value {
8430                0 => Self::Unspecified,
8431                1 => Self::Proposed,
8432                2 => Self::Validated,
8433                _ => Self::UnknownValue(state::UnknownValue(
8434                    wkt::internal::UnknownEnumValue::Integer(value),
8435                )),
8436            }
8437        }
8438    }
8439
8440    impl std::convert::From<&str> for State {
8441        fn from(value: &str) -> Self {
8442            use std::string::ToString;
8443            match value {
8444                "STATE_UNSPECIFIED" => Self::Unspecified,
8445                "PROPOSED" => Self::Proposed,
8446                "VALIDATED" => Self::Validated,
8447                _ => Self::UnknownValue(state::UnknownValue(
8448                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8449                )),
8450            }
8451        }
8452    }
8453
8454    impl serde::ser::Serialize for State {
8455        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8456        where
8457            S: serde::Serializer,
8458        {
8459            match self {
8460                Self::Unspecified => serializer.serialize_i32(0),
8461                Self::Proposed => serializer.serialize_i32(1),
8462                Self::Validated => serializer.serialize_i32(2),
8463                Self::UnknownValue(u) => u.0.serialize(serializer),
8464            }
8465        }
8466    }
8467
8468    impl<'de> serde::de::Deserialize<'de> for State {
8469        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8470        where
8471            D: serde::Deserializer<'de>,
8472        {
8473            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8474                ".google.cloud.apihub.v1.Dependency.State",
8475            ))
8476        }
8477    }
8478
8479    /// Possible modes of discovering the dependency.
8480    ///
8481    /// # Working with unknown values
8482    ///
8483    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8484    /// additional enum variants at any time. Adding new variants is not considered
8485    /// a breaking change. Applications should write their code in anticipation of:
8486    ///
8487    /// - New values appearing in future releases of the client library, **and**
8488    /// - New values received dynamically, without application changes.
8489    ///
8490    /// Please consult the [Working with enums] section in the user guide for some
8491    /// guidelines.
8492    ///
8493    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8494    #[derive(Clone, Debug, PartialEq)]
8495    #[non_exhaustive]
8496    pub enum DiscoveryMode {
8497        /// Default value. This value is unused.
8498        Unspecified,
8499        /// Manual mode of discovery when the dependency is defined by the user.
8500        Manual,
8501        /// If set, the enum was initialized with an unknown value.
8502        ///
8503        /// Applications can examine the value using [DiscoveryMode::value] or
8504        /// [DiscoveryMode::name].
8505        UnknownValue(discovery_mode::UnknownValue),
8506    }
8507
8508    #[doc(hidden)]
8509    pub mod discovery_mode {
8510        #[allow(unused_imports)]
8511        use super::*;
8512        #[derive(Clone, Debug, PartialEq)]
8513        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8514    }
8515
8516    impl DiscoveryMode {
8517        /// Gets the enum value.
8518        ///
8519        /// Returns `None` if the enum contains an unknown value deserialized from
8520        /// the string representation of enums.
8521        pub fn value(&self) -> std::option::Option<i32> {
8522            match self {
8523                Self::Unspecified => std::option::Option::Some(0),
8524                Self::Manual => std::option::Option::Some(1),
8525                Self::UnknownValue(u) => u.0.value(),
8526            }
8527        }
8528
8529        /// Gets the enum value as a string.
8530        ///
8531        /// Returns `None` if the enum contains an unknown value deserialized from
8532        /// the integer representation of enums.
8533        pub fn name(&self) -> std::option::Option<&str> {
8534            match self {
8535                Self::Unspecified => std::option::Option::Some("DISCOVERY_MODE_UNSPECIFIED"),
8536                Self::Manual => std::option::Option::Some("MANUAL"),
8537                Self::UnknownValue(u) => u.0.name(),
8538            }
8539        }
8540    }
8541
8542    impl std::default::Default for DiscoveryMode {
8543        fn default() -> Self {
8544            use std::convert::From;
8545            Self::from(0)
8546        }
8547    }
8548
8549    impl std::fmt::Display for DiscoveryMode {
8550        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8551            wkt::internal::display_enum(f, self.name(), self.value())
8552        }
8553    }
8554
8555    impl std::convert::From<i32> for DiscoveryMode {
8556        fn from(value: i32) -> Self {
8557            match value {
8558                0 => Self::Unspecified,
8559                1 => Self::Manual,
8560                _ => Self::UnknownValue(discovery_mode::UnknownValue(
8561                    wkt::internal::UnknownEnumValue::Integer(value),
8562                )),
8563            }
8564        }
8565    }
8566
8567    impl std::convert::From<&str> for DiscoveryMode {
8568        fn from(value: &str) -> Self {
8569            use std::string::ToString;
8570            match value {
8571                "DISCOVERY_MODE_UNSPECIFIED" => Self::Unspecified,
8572                "MANUAL" => Self::Manual,
8573                _ => Self::UnknownValue(discovery_mode::UnknownValue(
8574                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8575                )),
8576            }
8577        }
8578    }
8579
8580    impl serde::ser::Serialize for DiscoveryMode {
8581        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8582        where
8583            S: serde::Serializer,
8584        {
8585            match self {
8586                Self::Unspecified => serializer.serialize_i32(0),
8587                Self::Manual => serializer.serialize_i32(1),
8588                Self::UnknownValue(u) => u.0.serialize(serializer),
8589            }
8590        }
8591    }
8592
8593    impl<'de> serde::de::Deserialize<'de> for DiscoveryMode {
8594        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8595        where
8596            D: serde::Deserializer<'de>,
8597        {
8598            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryMode>::new(
8599                ".google.cloud.apihub.v1.Dependency.DiscoveryMode",
8600            ))
8601        }
8602    }
8603}
8604
8605/// Reference to an entity participating in a dependency.
8606#[derive(Clone, Default, PartialEq)]
8607#[non_exhaustive]
8608pub struct DependencyEntityReference {
8609    /// Output only. Display name of the entity.
8610    pub display_name: std::string::String,
8611
8612    /// Required. Unique identifier for the participating entity.
8613    pub identifier: std::option::Option<crate::model::dependency_entity_reference::Identifier>,
8614
8615    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8616}
8617
8618impl DependencyEntityReference {
8619    pub fn new() -> Self {
8620        std::default::Default::default()
8621    }
8622
8623    /// Sets the value of [display_name][crate::model::DependencyEntityReference::display_name].
8624    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8625        self.display_name = v.into();
8626        self
8627    }
8628
8629    /// Sets the value of [identifier][crate::model::DependencyEntityReference::identifier].
8630    ///
8631    /// Note that all the setters affecting `identifier` are mutually
8632    /// exclusive.
8633    pub fn set_identifier<
8634        T: std::convert::Into<
8635                std::option::Option<crate::model::dependency_entity_reference::Identifier>,
8636            >,
8637    >(
8638        mut self,
8639        v: T,
8640    ) -> Self {
8641        self.identifier = v.into();
8642        self
8643    }
8644
8645    /// The value of [identifier][crate::model::DependencyEntityReference::identifier]
8646    /// if it holds a `OperationResourceName`, `None` if the field is not set or
8647    /// holds a different branch.
8648    pub fn operation_resource_name(&self) -> std::option::Option<&std::string::String> {
8649        #[allow(unreachable_patterns)]
8650        self.identifier.as_ref().and_then(|v| match v {
8651            crate::model::dependency_entity_reference::Identifier::OperationResourceName(v) => {
8652                std::option::Option::Some(v)
8653            }
8654            _ => std::option::Option::None,
8655        })
8656    }
8657
8658    /// Sets the value of [identifier][crate::model::DependencyEntityReference::identifier]
8659    /// to hold a `OperationResourceName`.
8660    ///
8661    /// Note that all the setters affecting `identifier` are
8662    /// mutually exclusive.
8663    pub fn set_operation_resource_name<T: std::convert::Into<std::string::String>>(
8664        mut self,
8665        v: T,
8666    ) -> Self {
8667        self.identifier = std::option::Option::Some(
8668            crate::model::dependency_entity_reference::Identifier::OperationResourceName(v.into()),
8669        );
8670        self
8671    }
8672
8673    /// The value of [identifier][crate::model::DependencyEntityReference::identifier]
8674    /// if it holds a `ExternalApiResourceName`, `None` if the field is not set or
8675    /// holds a different branch.
8676    pub fn external_api_resource_name(&self) -> std::option::Option<&std::string::String> {
8677        #[allow(unreachable_patterns)]
8678        self.identifier.as_ref().and_then(|v| match v {
8679            crate::model::dependency_entity_reference::Identifier::ExternalApiResourceName(v) => {
8680                std::option::Option::Some(v)
8681            }
8682            _ => std::option::Option::None,
8683        })
8684    }
8685
8686    /// Sets the value of [identifier][crate::model::DependencyEntityReference::identifier]
8687    /// to hold a `ExternalApiResourceName`.
8688    ///
8689    /// Note that all the setters affecting `identifier` are
8690    /// mutually exclusive.
8691    pub fn set_external_api_resource_name<T: std::convert::Into<std::string::String>>(
8692        mut self,
8693        v: T,
8694    ) -> Self {
8695        self.identifier = std::option::Option::Some(
8696            crate::model::dependency_entity_reference::Identifier::ExternalApiResourceName(
8697                v.into(),
8698            ),
8699        );
8700        self
8701    }
8702}
8703
8704impl wkt::message::Message for DependencyEntityReference {
8705    fn typename() -> &'static str {
8706        "type.googleapis.com/google.cloud.apihub.v1.DependencyEntityReference"
8707    }
8708}
8709
8710/// Defines additional types related to [DependencyEntityReference].
8711pub mod dependency_entity_reference {
8712    #[allow(unused_imports)]
8713    use super::*;
8714
8715    /// Required. Unique identifier for the participating entity.
8716    #[derive(Clone, Debug, PartialEq)]
8717    #[non_exhaustive]
8718    pub enum Identifier {
8719        /// The resource name of an operation in the API Hub.
8720        ///
8721        /// Format:
8722        /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
8723        OperationResourceName(std::string::String),
8724        /// The resource name of an external API in the API Hub.
8725        ///
8726        /// Format:
8727        /// `projects/{project}/locations/{location}/externalApis/{external_api}`
8728        ExternalApiResourceName(std::string::String),
8729    }
8730}
8731
8732/// Details describing error condition of a dependency.
8733#[derive(Clone, Default, PartialEq)]
8734#[non_exhaustive]
8735pub struct DependencyErrorDetail {
8736    /// Optional. Error in the dependency.
8737    pub error: crate::model::dependency_error_detail::Error,
8738
8739    /// Optional. Timestamp at which the error was found.
8740    pub error_time: std::option::Option<wkt::Timestamp>,
8741
8742    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8743}
8744
8745impl DependencyErrorDetail {
8746    pub fn new() -> Self {
8747        std::default::Default::default()
8748    }
8749
8750    /// Sets the value of [error][crate::model::DependencyErrorDetail::error].
8751    pub fn set_error<T: std::convert::Into<crate::model::dependency_error_detail::Error>>(
8752        mut self,
8753        v: T,
8754    ) -> Self {
8755        self.error = v.into();
8756        self
8757    }
8758
8759    /// Sets the value of [error_time][crate::model::DependencyErrorDetail::error_time].
8760    pub fn set_error_time<T>(mut self, v: T) -> Self
8761    where
8762        T: std::convert::Into<wkt::Timestamp>,
8763    {
8764        self.error_time = std::option::Option::Some(v.into());
8765        self
8766    }
8767
8768    /// Sets or clears the value of [error_time][crate::model::DependencyErrorDetail::error_time].
8769    pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
8770    where
8771        T: std::convert::Into<wkt::Timestamp>,
8772    {
8773        self.error_time = v.map(|x| x.into());
8774        self
8775    }
8776}
8777
8778impl wkt::message::Message for DependencyErrorDetail {
8779    fn typename() -> &'static str {
8780        "type.googleapis.com/google.cloud.apihub.v1.DependencyErrorDetail"
8781    }
8782}
8783
8784/// Defines additional types related to [DependencyErrorDetail].
8785pub mod dependency_error_detail {
8786    #[allow(unused_imports)]
8787    use super::*;
8788
8789    /// Possible values representing an error in the dependency.
8790    ///
8791    /// # Working with unknown values
8792    ///
8793    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8794    /// additional enum variants at any time. Adding new variants is not considered
8795    /// a breaking change. Applications should write their code in anticipation of:
8796    ///
8797    /// - New values appearing in future releases of the client library, **and**
8798    /// - New values received dynamically, without application changes.
8799    ///
8800    /// Please consult the [Working with enums] section in the user guide for some
8801    /// guidelines.
8802    ///
8803    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8804    #[derive(Clone, Debug, PartialEq)]
8805    #[non_exhaustive]
8806    pub enum Error {
8807        /// Default value used for no error in the dependency.
8808        Unspecified,
8809        /// Supplier entity has been deleted.
8810        SupplierNotFound,
8811        /// Supplier entity has been recreated.
8812        SupplierRecreated,
8813        /// If set, the enum was initialized with an unknown value.
8814        ///
8815        /// Applications can examine the value using [Error::value] or
8816        /// [Error::name].
8817        UnknownValue(error::UnknownValue),
8818    }
8819
8820    #[doc(hidden)]
8821    pub mod error {
8822        #[allow(unused_imports)]
8823        use super::*;
8824        #[derive(Clone, Debug, PartialEq)]
8825        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8826    }
8827
8828    impl Error {
8829        /// Gets the enum value.
8830        ///
8831        /// Returns `None` if the enum contains an unknown value deserialized from
8832        /// the string representation of enums.
8833        pub fn value(&self) -> std::option::Option<i32> {
8834            match self {
8835                Self::Unspecified => std::option::Option::Some(0),
8836                Self::SupplierNotFound => std::option::Option::Some(1),
8837                Self::SupplierRecreated => std::option::Option::Some(2),
8838                Self::UnknownValue(u) => u.0.value(),
8839            }
8840        }
8841
8842        /// Gets the enum value as a string.
8843        ///
8844        /// Returns `None` if the enum contains an unknown value deserialized from
8845        /// the integer representation of enums.
8846        pub fn name(&self) -> std::option::Option<&str> {
8847            match self {
8848                Self::Unspecified => std::option::Option::Some("ERROR_UNSPECIFIED"),
8849                Self::SupplierNotFound => std::option::Option::Some("SUPPLIER_NOT_FOUND"),
8850                Self::SupplierRecreated => std::option::Option::Some("SUPPLIER_RECREATED"),
8851                Self::UnknownValue(u) => u.0.name(),
8852            }
8853        }
8854    }
8855
8856    impl std::default::Default for Error {
8857        fn default() -> Self {
8858            use std::convert::From;
8859            Self::from(0)
8860        }
8861    }
8862
8863    impl std::fmt::Display for Error {
8864        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8865            wkt::internal::display_enum(f, self.name(), self.value())
8866        }
8867    }
8868
8869    impl std::convert::From<i32> for Error {
8870        fn from(value: i32) -> Self {
8871            match value {
8872                0 => Self::Unspecified,
8873                1 => Self::SupplierNotFound,
8874                2 => Self::SupplierRecreated,
8875                _ => Self::UnknownValue(error::UnknownValue(
8876                    wkt::internal::UnknownEnumValue::Integer(value),
8877                )),
8878            }
8879        }
8880    }
8881
8882    impl std::convert::From<&str> for Error {
8883        fn from(value: &str) -> Self {
8884            use std::string::ToString;
8885            match value {
8886                "ERROR_UNSPECIFIED" => Self::Unspecified,
8887                "SUPPLIER_NOT_FOUND" => Self::SupplierNotFound,
8888                "SUPPLIER_RECREATED" => Self::SupplierRecreated,
8889                _ => Self::UnknownValue(error::UnknownValue(
8890                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8891                )),
8892            }
8893        }
8894    }
8895
8896    impl serde::ser::Serialize for Error {
8897        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8898        where
8899            S: serde::Serializer,
8900        {
8901            match self {
8902                Self::Unspecified => serializer.serialize_i32(0),
8903                Self::SupplierNotFound => serializer.serialize_i32(1),
8904                Self::SupplierRecreated => serializer.serialize_i32(2),
8905                Self::UnknownValue(u) => u.0.serialize(serializer),
8906            }
8907        }
8908    }
8909
8910    impl<'de> serde::de::Deserialize<'de> for Error {
8911        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8912        where
8913            D: serde::Deserializer<'de>,
8914        {
8915            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Error>::new(
8916                ".google.cloud.apihub.v1.DependencyErrorDetail.Error",
8917            ))
8918        }
8919    }
8920}
8921
8922/// LintResponse contains the response from the linter.
8923#[derive(Clone, Default, PartialEq)]
8924#[non_exhaustive]
8925pub struct LintResponse {
8926    /// Optional. Array of issues found in the analyzed document.
8927    pub issues: std::vec::Vec<crate::model::Issue>,
8928
8929    /// Optional. Summary of all issue types and counts for each severity level.
8930    pub summary: std::vec::Vec<crate::model::lint_response::SummaryEntry>,
8931
8932    /// Required. Lint state represents success or failure for linting.
8933    pub state: crate::model::LintState,
8934
8935    /// Required. Name of the linting application.
8936    pub source: std::string::String,
8937
8938    /// Required. Name of the linter used.
8939    pub linter: crate::model::Linter,
8940
8941    /// Required. Timestamp when the linting response was generated.
8942    pub create_time: std::option::Option<wkt::Timestamp>,
8943
8944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8945}
8946
8947impl LintResponse {
8948    pub fn new() -> Self {
8949        std::default::Default::default()
8950    }
8951
8952    /// Sets the value of [issues][crate::model::LintResponse::issues].
8953    pub fn set_issues<T, V>(mut self, v: T) -> Self
8954    where
8955        T: std::iter::IntoIterator<Item = V>,
8956        V: std::convert::Into<crate::model::Issue>,
8957    {
8958        use std::iter::Iterator;
8959        self.issues = v.into_iter().map(|i| i.into()).collect();
8960        self
8961    }
8962
8963    /// Sets the value of [summary][crate::model::LintResponse::summary].
8964    pub fn set_summary<T, V>(mut self, v: T) -> Self
8965    where
8966        T: std::iter::IntoIterator<Item = V>,
8967        V: std::convert::Into<crate::model::lint_response::SummaryEntry>,
8968    {
8969        use std::iter::Iterator;
8970        self.summary = v.into_iter().map(|i| i.into()).collect();
8971        self
8972    }
8973
8974    /// Sets the value of [state][crate::model::LintResponse::state].
8975    pub fn set_state<T: std::convert::Into<crate::model::LintState>>(mut self, v: T) -> Self {
8976        self.state = v.into();
8977        self
8978    }
8979
8980    /// Sets the value of [source][crate::model::LintResponse::source].
8981    pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8982        self.source = v.into();
8983        self
8984    }
8985
8986    /// Sets the value of [linter][crate::model::LintResponse::linter].
8987    pub fn set_linter<T: std::convert::Into<crate::model::Linter>>(mut self, v: T) -> Self {
8988        self.linter = v.into();
8989        self
8990    }
8991
8992    /// Sets the value of [create_time][crate::model::LintResponse::create_time].
8993    pub fn set_create_time<T>(mut self, v: T) -> Self
8994    where
8995        T: std::convert::Into<wkt::Timestamp>,
8996    {
8997        self.create_time = std::option::Option::Some(v.into());
8998        self
8999    }
9000
9001    /// Sets or clears the value of [create_time][crate::model::LintResponse::create_time].
9002    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9003    where
9004        T: std::convert::Into<wkt::Timestamp>,
9005    {
9006        self.create_time = v.map(|x| x.into());
9007        self
9008    }
9009}
9010
9011impl wkt::message::Message for LintResponse {
9012    fn typename() -> &'static str {
9013        "type.googleapis.com/google.cloud.apihub.v1.LintResponse"
9014    }
9015}
9016
9017/// Defines additional types related to [LintResponse].
9018pub mod lint_response {
9019    #[allow(unused_imports)]
9020    use super::*;
9021
9022    /// Count of issues with a given severity.
9023    #[derive(Clone, Default, PartialEq)]
9024    #[non_exhaustive]
9025    pub struct SummaryEntry {
9026        /// Required. Severity of the issue.
9027        pub severity: crate::model::Severity,
9028
9029        /// Required. Count of issues with the given severity.
9030        pub count: i32,
9031
9032        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9033    }
9034
9035    impl SummaryEntry {
9036        pub fn new() -> Self {
9037            std::default::Default::default()
9038        }
9039
9040        /// Sets the value of [severity][crate::model::lint_response::SummaryEntry::severity].
9041        pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
9042            self.severity = v.into();
9043            self
9044        }
9045
9046        /// Sets the value of [count][crate::model::lint_response::SummaryEntry::count].
9047        pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9048            self.count = v.into();
9049            self
9050        }
9051    }
9052
9053    impl wkt::message::Message for SummaryEntry {
9054        fn typename() -> &'static str {
9055            "type.googleapis.com/google.cloud.apihub.v1.LintResponse.SummaryEntry"
9056        }
9057    }
9058}
9059
9060/// Issue contains the details of a single issue found by the linter.
9061#[derive(Clone, Default, PartialEq)]
9062#[non_exhaustive]
9063pub struct Issue {
9064    /// Required. Rule code unique to each rule defined in linter.
9065    pub code: std::string::String,
9066
9067    /// Required. An array of strings indicating the location in the analyzed
9068    /// document where the rule was triggered.
9069    pub path: std::vec::Vec<std::string::String>,
9070
9071    /// Required. Human-readable message describing the issue found by the linter.
9072    pub message: std::string::String,
9073
9074    /// Required. Severity level of the rule violation.
9075    pub severity: crate::model::Severity,
9076
9077    /// Required. Object describing where in the file the issue was found.
9078    pub range: std::option::Option<crate::model::Range>,
9079
9080    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9081}
9082
9083impl Issue {
9084    pub fn new() -> Self {
9085        std::default::Default::default()
9086    }
9087
9088    /// Sets the value of [code][crate::model::Issue::code].
9089    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9090        self.code = v.into();
9091        self
9092    }
9093
9094    /// Sets the value of [path][crate::model::Issue::path].
9095    pub fn set_path<T, V>(mut self, v: T) -> Self
9096    where
9097        T: std::iter::IntoIterator<Item = V>,
9098        V: std::convert::Into<std::string::String>,
9099    {
9100        use std::iter::Iterator;
9101        self.path = v.into_iter().map(|i| i.into()).collect();
9102        self
9103    }
9104
9105    /// Sets the value of [message][crate::model::Issue::message].
9106    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9107        self.message = v.into();
9108        self
9109    }
9110
9111    /// Sets the value of [severity][crate::model::Issue::severity].
9112    pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
9113        self.severity = v.into();
9114        self
9115    }
9116
9117    /// Sets the value of [range][crate::model::Issue::range].
9118    pub fn set_range<T>(mut self, v: T) -> Self
9119    where
9120        T: std::convert::Into<crate::model::Range>,
9121    {
9122        self.range = std::option::Option::Some(v.into());
9123        self
9124    }
9125
9126    /// Sets or clears the value of [range][crate::model::Issue::range].
9127    pub fn set_or_clear_range<T>(mut self, v: std::option::Option<T>) -> Self
9128    where
9129        T: std::convert::Into<crate::model::Range>,
9130    {
9131        self.range = v.map(|x| x.into());
9132        self
9133    }
9134}
9135
9136impl wkt::message::Message for Issue {
9137    fn typename() -> &'static str {
9138        "type.googleapis.com/google.cloud.apihub.v1.Issue"
9139    }
9140}
9141
9142/// Object describing where in the file the issue was found.
9143#[derive(Clone, Default, PartialEq)]
9144#[non_exhaustive]
9145pub struct Range {
9146    /// Required. Start of the issue.
9147    pub start: std::option::Option<crate::model::Point>,
9148
9149    /// Required. End of the issue.
9150    pub end: std::option::Option<crate::model::Point>,
9151
9152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9153}
9154
9155impl Range {
9156    pub fn new() -> Self {
9157        std::default::Default::default()
9158    }
9159
9160    /// Sets the value of [start][crate::model::Range::start].
9161    pub fn set_start<T>(mut self, v: T) -> Self
9162    where
9163        T: std::convert::Into<crate::model::Point>,
9164    {
9165        self.start = std::option::Option::Some(v.into());
9166        self
9167    }
9168
9169    /// Sets or clears the value of [start][crate::model::Range::start].
9170    pub fn set_or_clear_start<T>(mut self, v: std::option::Option<T>) -> Self
9171    where
9172        T: std::convert::Into<crate::model::Point>,
9173    {
9174        self.start = v.map(|x| x.into());
9175        self
9176    }
9177
9178    /// Sets the value of [end][crate::model::Range::end].
9179    pub fn set_end<T>(mut self, v: T) -> Self
9180    where
9181        T: std::convert::Into<crate::model::Point>,
9182    {
9183        self.end = std::option::Option::Some(v.into());
9184        self
9185    }
9186
9187    /// Sets or clears the value of [end][crate::model::Range::end].
9188    pub fn set_or_clear_end<T>(mut self, v: std::option::Option<T>) -> Self
9189    where
9190        T: std::convert::Into<crate::model::Point>,
9191    {
9192        self.end = v.map(|x| x.into());
9193        self
9194    }
9195}
9196
9197impl wkt::message::Message for Range {
9198    fn typename() -> &'static str {
9199        "type.googleapis.com/google.cloud.apihub.v1.Range"
9200    }
9201}
9202
9203/// Point within the file (line and character).
9204#[derive(Clone, Default, PartialEq)]
9205#[non_exhaustive]
9206pub struct Point {
9207    /// Required. Line number (zero-indexed).
9208    pub line: i32,
9209
9210    /// Required. Character position within the line (zero-indexed).
9211    pub character: i32,
9212
9213    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9214}
9215
9216impl Point {
9217    pub fn new() -> Self {
9218        std::default::Default::default()
9219    }
9220
9221    /// Sets the value of [line][crate::model::Point::line].
9222    pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9223        self.line = v.into();
9224        self
9225    }
9226
9227    /// Sets the value of [character][crate::model::Point::character].
9228    pub fn set_character<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9229        self.character = v.into();
9230        self
9231    }
9232}
9233
9234impl wkt::message::Message for Point {
9235    fn typename() -> &'static str {
9236        "type.googleapis.com/google.cloud.apihub.v1.Point"
9237    }
9238}
9239
9240/// Represents the metadata of the long-running operation.
9241#[derive(Clone, Default, PartialEq)]
9242#[non_exhaustive]
9243pub struct OperationMetadata {
9244    /// Output only. The time the operation was created.
9245    pub create_time: std::option::Option<wkt::Timestamp>,
9246
9247    /// Output only. The time the operation finished running.
9248    pub end_time: std::option::Option<wkt::Timestamp>,
9249
9250    /// Output only. Server-defined resource path for the target of the operation.
9251    pub target: std::string::String,
9252
9253    /// Output only. Name of the verb executed by the operation.
9254    pub verb: std::string::String,
9255
9256    /// Output only. Human-readable status of the operation, if any.
9257    pub status_message: std::string::String,
9258
9259    /// Output only. Identifies whether the user has requested cancellation
9260    /// of the operation. Operations that have been cancelled successfully
9261    /// have [Operation.error][google.longrunning.Operation.error] value with a
9262    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
9263    /// `Code.CANCELLED`.
9264    ///
9265    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
9266    /// [google.rpc.Status.code]: rpc::model::Status::code
9267    pub requested_cancellation: bool,
9268
9269    /// Output only. API version used to start the operation.
9270    pub api_version: std::string::String,
9271
9272    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9273}
9274
9275impl OperationMetadata {
9276    pub fn new() -> Self {
9277        std::default::Default::default()
9278    }
9279
9280    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
9281    pub fn set_create_time<T>(mut self, v: T) -> Self
9282    where
9283        T: std::convert::Into<wkt::Timestamp>,
9284    {
9285        self.create_time = std::option::Option::Some(v.into());
9286        self
9287    }
9288
9289    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
9290    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9291    where
9292        T: std::convert::Into<wkt::Timestamp>,
9293    {
9294        self.create_time = v.map(|x| x.into());
9295        self
9296    }
9297
9298    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
9299    pub fn set_end_time<T>(mut self, v: T) -> Self
9300    where
9301        T: std::convert::Into<wkt::Timestamp>,
9302    {
9303        self.end_time = std::option::Option::Some(v.into());
9304        self
9305    }
9306
9307    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
9308    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9309    where
9310        T: std::convert::Into<wkt::Timestamp>,
9311    {
9312        self.end_time = v.map(|x| x.into());
9313        self
9314    }
9315
9316    /// Sets the value of [target][crate::model::OperationMetadata::target].
9317    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9318        self.target = v.into();
9319        self
9320    }
9321
9322    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
9323    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9324        self.verb = v.into();
9325        self
9326    }
9327
9328    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
9329    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9330        self.status_message = v.into();
9331        self
9332    }
9333
9334    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
9335    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9336        self.requested_cancellation = v.into();
9337        self
9338    }
9339
9340    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
9341    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9342        self.api_version = v.into();
9343        self
9344    }
9345}
9346
9347impl wkt::message::Message for OperationMetadata {
9348    fn typename() -> &'static str {
9349        "type.googleapis.com/google.cloud.apihub.v1.OperationMetadata"
9350    }
9351}
9352
9353/// An ApiHubInstance represents the instance resources of the API Hub.
9354/// Currently, only one ApiHub instance is allowed for each project.
9355#[derive(Clone, Default, PartialEq)]
9356#[non_exhaustive]
9357pub struct ApiHubInstance {
9358    /// Identifier. Format:
9359    /// `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
9360    pub name: std::string::String,
9361
9362    /// Output only. Creation timestamp.
9363    pub create_time: std::option::Option<wkt::Timestamp>,
9364
9365    /// Output only. Last update timestamp.
9366    pub update_time: std::option::Option<wkt::Timestamp>,
9367
9368    /// Output only. The current state of the ApiHub instance.
9369    pub state: crate::model::api_hub_instance::State,
9370
9371    /// Output only. Extra information about ApiHub instance state. Currently the
9372    /// message would be populated when state is `FAILED`.
9373    pub state_message: std::string::String,
9374
9375    /// Required. Config of the ApiHub instance.
9376    pub config: std::option::Option<crate::model::api_hub_instance::Config>,
9377
9378    /// Optional. Instance labels to represent user-provided metadata.
9379    /// Refer to cloud documentation on labels for more details.
9380    /// <https://cloud.google.com/compute/docs/labeling-resources>
9381    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9382
9383    /// Optional. Description of the ApiHub instance.
9384    pub description: std::string::String,
9385
9386    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9387}
9388
9389impl ApiHubInstance {
9390    pub fn new() -> Self {
9391        std::default::Default::default()
9392    }
9393
9394    /// Sets the value of [name][crate::model::ApiHubInstance::name].
9395    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9396        self.name = v.into();
9397        self
9398    }
9399
9400    /// Sets the value of [create_time][crate::model::ApiHubInstance::create_time].
9401    pub fn set_create_time<T>(mut self, v: T) -> Self
9402    where
9403        T: std::convert::Into<wkt::Timestamp>,
9404    {
9405        self.create_time = std::option::Option::Some(v.into());
9406        self
9407    }
9408
9409    /// Sets or clears the value of [create_time][crate::model::ApiHubInstance::create_time].
9410    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9411    where
9412        T: std::convert::Into<wkt::Timestamp>,
9413    {
9414        self.create_time = v.map(|x| x.into());
9415        self
9416    }
9417
9418    /// Sets the value of [update_time][crate::model::ApiHubInstance::update_time].
9419    pub fn set_update_time<T>(mut self, v: T) -> Self
9420    where
9421        T: std::convert::Into<wkt::Timestamp>,
9422    {
9423        self.update_time = std::option::Option::Some(v.into());
9424        self
9425    }
9426
9427    /// Sets or clears the value of [update_time][crate::model::ApiHubInstance::update_time].
9428    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9429    where
9430        T: std::convert::Into<wkt::Timestamp>,
9431    {
9432        self.update_time = v.map(|x| x.into());
9433        self
9434    }
9435
9436    /// Sets the value of [state][crate::model::ApiHubInstance::state].
9437    pub fn set_state<T: std::convert::Into<crate::model::api_hub_instance::State>>(
9438        mut self,
9439        v: T,
9440    ) -> Self {
9441        self.state = v.into();
9442        self
9443    }
9444
9445    /// Sets the value of [state_message][crate::model::ApiHubInstance::state_message].
9446    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9447        self.state_message = v.into();
9448        self
9449    }
9450
9451    /// Sets the value of [config][crate::model::ApiHubInstance::config].
9452    pub fn set_config<T>(mut self, v: T) -> Self
9453    where
9454        T: std::convert::Into<crate::model::api_hub_instance::Config>,
9455    {
9456        self.config = std::option::Option::Some(v.into());
9457        self
9458    }
9459
9460    /// Sets or clears the value of [config][crate::model::ApiHubInstance::config].
9461    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
9462    where
9463        T: std::convert::Into<crate::model::api_hub_instance::Config>,
9464    {
9465        self.config = v.map(|x| x.into());
9466        self
9467    }
9468
9469    /// Sets the value of [labels][crate::model::ApiHubInstance::labels].
9470    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9471    where
9472        T: std::iter::IntoIterator<Item = (K, V)>,
9473        K: std::convert::Into<std::string::String>,
9474        V: std::convert::Into<std::string::String>,
9475    {
9476        use std::iter::Iterator;
9477        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9478        self
9479    }
9480
9481    /// Sets the value of [description][crate::model::ApiHubInstance::description].
9482    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9483        self.description = v.into();
9484        self
9485    }
9486}
9487
9488impl wkt::message::Message for ApiHubInstance {
9489    fn typename() -> &'static str {
9490        "type.googleapis.com/google.cloud.apihub.v1.ApiHubInstance"
9491    }
9492}
9493
9494/// Defines additional types related to [ApiHubInstance].
9495pub mod api_hub_instance {
9496    #[allow(unused_imports)]
9497    use super::*;
9498
9499    /// Available configurations to provision an ApiHub Instance.
9500    #[derive(Clone, Default, PartialEq)]
9501    #[non_exhaustive]
9502    pub struct Config {
9503        /// Optional. The Customer Managed Encryption Key (CMEK) used for data
9504        /// encryption. The CMEK name should follow the format of
9505        /// `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
9506        /// where the location must match the instance location.
9507        /// If the CMEK is not provided, a GMEK will be created for the instance.
9508        pub cmek_key_name: std::string::String,
9509
9510        /// Optional. If true, the search will be disabled for the instance. The
9511        /// default value is false.
9512        pub disable_search: bool,
9513
9514        /// Optional. The name of the Vertex AI location where the data store is
9515        /// stored.
9516        pub vertex_location: std::string::String,
9517
9518        /// Optional. Encryption type for the region. If the encryption type is CMEK,
9519        /// the cmek_key_name must be provided. If no encryption type is provided,
9520        /// GMEK will be used.
9521        pub encryption_type: crate::model::api_hub_instance::config::EncryptionType,
9522
9523        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9524    }
9525
9526    impl Config {
9527        pub fn new() -> Self {
9528            std::default::Default::default()
9529        }
9530
9531        /// Sets the value of [cmek_key_name][crate::model::api_hub_instance::Config::cmek_key_name].
9532        pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(
9533            mut self,
9534            v: T,
9535        ) -> Self {
9536            self.cmek_key_name = v.into();
9537            self
9538        }
9539
9540        /// Sets the value of [disable_search][crate::model::api_hub_instance::Config::disable_search].
9541        pub fn set_disable_search<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9542            self.disable_search = v.into();
9543            self
9544        }
9545
9546        /// Sets the value of [vertex_location][crate::model::api_hub_instance::Config::vertex_location].
9547        pub fn set_vertex_location<T: std::convert::Into<std::string::String>>(
9548            mut self,
9549            v: T,
9550        ) -> Self {
9551            self.vertex_location = v.into();
9552            self
9553        }
9554
9555        /// Sets the value of [encryption_type][crate::model::api_hub_instance::Config::encryption_type].
9556        pub fn set_encryption_type<
9557            T: std::convert::Into<crate::model::api_hub_instance::config::EncryptionType>,
9558        >(
9559            mut self,
9560            v: T,
9561        ) -> Self {
9562            self.encryption_type = v.into();
9563            self
9564        }
9565    }
9566
9567    impl wkt::message::Message for Config {
9568        fn typename() -> &'static str {
9569            "type.googleapis.com/google.cloud.apihub.v1.ApiHubInstance.Config"
9570        }
9571    }
9572
9573    /// Defines additional types related to [Config].
9574    pub mod config {
9575        #[allow(unused_imports)]
9576        use super::*;
9577
9578        /// Types of data encryption.
9579        ///
9580        /// # Working with unknown values
9581        ///
9582        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9583        /// additional enum variants at any time. Adding new variants is not considered
9584        /// a breaking change. Applications should write their code in anticipation of:
9585        ///
9586        /// - New values appearing in future releases of the client library, **and**
9587        /// - New values received dynamically, without application changes.
9588        ///
9589        /// Please consult the [Working with enums] section in the user guide for some
9590        /// guidelines.
9591        ///
9592        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9593        #[derive(Clone, Debug, PartialEq)]
9594        #[non_exhaustive]
9595        pub enum EncryptionType {
9596            /// Encryption type unspecified.
9597            Unspecified,
9598            /// Default encryption using Google managed encryption key.
9599            Gmek,
9600            /// Encryption using customer managed encryption key.
9601            Cmek,
9602            /// If set, the enum was initialized with an unknown value.
9603            ///
9604            /// Applications can examine the value using [EncryptionType::value] or
9605            /// [EncryptionType::name].
9606            UnknownValue(encryption_type::UnknownValue),
9607        }
9608
9609        #[doc(hidden)]
9610        pub mod encryption_type {
9611            #[allow(unused_imports)]
9612            use super::*;
9613            #[derive(Clone, Debug, PartialEq)]
9614            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9615        }
9616
9617        impl EncryptionType {
9618            /// Gets the enum value.
9619            ///
9620            /// Returns `None` if the enum contains an unknown value deserialized from
9621            /// the string representation of enums.
9622            pub fn value(&self) -> std::option::Option<i32> {
9623                match self {
9624                    Self::Unspecified => std::option::Option::Some(0),
9625                    Self::Gmek => std::option::Option::Some(1),
9626                    Self::Cmek => std::option::Option::Some(2),
9627                    Self::UnknownValue(u) => u.0.value(),
9628                }
9629            }
9630
9631            /// Gets the enum value as a string.
9632            ///
9633            /// Returns `None` if the enum contains an unknown value deserialized from
9634            /// the integer representation of enums.
9635            pub fn name(&self) -> std::option::Option<&str> {
9636                match self {
9637                    Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
9638                    Self::Gmek => std::option::Option::Some("GMEK"),
9639                    Self::Cmek => std::option::Option::Some("CMEK"),
9640                    Self::UnknownValue(u) => u.0.name(),
9641                }
9642            }
9643        }
9644
9645        impl std::default::Default for EncryptionType {
9646            fn default() -> Self {
9647                use std::convert::From;
9648                Self::from(0)
9649            }
9650        }
9651
9652        impl std::fmt::Display for EncryptionType {
9653            fn fmt(
9654                &self,
9655                f: &mut std::fmt::Formatter<'_>,
9656            ) -> std::result::Result<(), std::fmt::Error> {
9657                wkt::internal::display_enum(f, self.name(), self.value())
9658            }
9659        }
9660
9661        impl std::convert::From<i32> for EncryptionType {
9662            fn from(value: i32) -> Self {
9663                match value {
9664                    0 => Self::Unspecified,
9665                    1 => Self::Gmek,
9666                    2 => Self::Cmek,
9667                    _ => Self::UnknownValue(encryption_type::UnknownValue(
9668                        wkt::internal::UnknownEnumValue::Integer(value),
9669                    )),
9670                }
9671            }
9672        }
9673
9674        impl std::convert::From<&str> for EncryptionType {
9675            fn from(value: &str) -> Self {
9676                use std::string::ToString;
9677                match value {
9678                    "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
9679                    "GMEK" => Self::Gmek,
9680                    "CMEK" => Self::Cmek,
9681                    _ => Self::UnknownValue(encryption_type::UnknownValue(
9682                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9683                    )),
9684                }
9685            }
9686        }
9687
9688        impl serde::ser::Serialize for EncryptionType {
9689            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9690            where
9691                S: serde::Serializer,
9692            {
9693                match self {
9694                    Self::Unspecified => serializer.serialize_i32(0),
9695                    Self::Gmek => serializer.serialize_i32(1),
9696                    Self::Cmek => serializer.serialize_i32(2),
9697                    Self::UnknownValue(u) => u.0.serialize(serializer),
9698                }
9699            }
9700        }
9701
9702        impl<'de> serde::de::Deserialize<'de> for EncryptionType {
9703            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9704            where
9705                D: serde::Deserializer<'de>,
9706            {
9707                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
9708                    ".google.cloud.apihub.v1.ApiHubInstance.Config.EncryptionType",
9709                ))
9710            }
9711        }
9712    }
9713
9714    /// State of the ApiHub Instance.
9715    ///
9716    /// # Working with unknown values
9717    ///
9718    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9719    /// additional enum variants at any time. Adding new variants is not considered
9720    /// a breaking change. Applications should write their code in anticipation of:
9721    ///
9722    /// - New values appearing in future releases of the client library, **and**
9723    /// - New values received dynamically, without application changes.
9724    ///
9725    /// Please consult the [Working with enums] section in the user guide for some
9726    /// guidelines.
9727    ///
9728    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9729    #[derive(Clone, Debug, PartialEq)]
9730    #[non_exhaustive]
9731    pub enum State {
9732        /// The default value. This value is used if the state is omitted.
9733        Unspecified,
9734        /// The ApiHub instance has not been initialized or has been deleted.
9735        Inactive,
9736        /// The ApiHub instance is being created.
9737        Creating,
9738        /// The ApiHub instance has been created and is ready for use.
9739        Active,
9740        /// The ApiHub instance is being updated.
9741        Updating,
9742        /// The ApiHub instance is being deleted.
9743        Deleting,
9744        /// The ApiHub instance encountered an error during a state change.
9745        Failed,
9746        /// If set, the enum was initialized with an unknown value.
9747        ///
9748        /// Applications can examine the value using [State::value] or
9749        /// [State::name].
9750        UnknownValue(state::UnknownValue),
9751    }
9752
9753    #[doc(hidden)]
9754    pub mod state {
9755        #[allow(unused_imports)]
9756        use super::*;
9757        #[derive(Clone, Debug, PartialEq)]
9758        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9759    }
9760
9761    impl State {
9762        /// Gets the enum value.
9763        ///
9764        /// Returns `None` if the enum contains an unknown value deserialized from
9765        /// the string representation of enums.
9766        pub fn value(&self) -> std::option::Option<i32> {
9767            match self {
9768                Self::Unspecified => std::option::Option::Some(0),
9769                Self::Inactive => std::option::Option::Some(1),
9770                Self::Creating => std::option::Option::Some(2),
9771                Self::Active => std::option::Option::Some(3),
9772                Self::Updating => std::option::Option::Some(4),
9773                Self::Deleting => std::option::Option::Some(5),
9774                Self::Failed => std::option::Option::Some(6),
9775                Self::UnknownValue(u) => u.0.value(),
9776            }
9777        }
9778
9779        /// Gets the enum value as a string.
9780        ///
9781        /// Returns `None` if the enum contains an unknown value deserialized from
9782        /// the integer representation of enums.
9783        pub fn name(&self) -> std::option::Option<&str> {
9784            match self {
9785                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9786                Self::Inactive => std::option::Option::Some("INACTIVE"),
9787                Self::Creating => std::option::Option::Some("CREATING"),
9788                Self::Active => std::option::Option::Some("ACTIVE"),
9789                Self::Updating => std::option::Option::Some("UPDATING"),
9790                Self::Deleting => std::option::Option::Some("DELETING"),
9791                Self::Failed => std::option::Option::Some("FAILED"),
9792                Self::UnknownValue(u) => u.0.name(),
9793            }
9794        }
9795    }
9796
9797    impl std::default::Default for State {
9798        fn default() -> Self {
9799            use std::convert::From;
9800            Self::from(0)
9801        }
9802    }
9803
9804    impl std::fmt::Display for State {
9805        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9806            wkt::internal::display_enum(f, self.name(), self.value())
9807        }
9808    }
9809
9810    impl std::convert::From<i32> for State {
9811        fn from(value: i32) -> Self {
9812            match value {
9813                0 => Self::Unspecified,
9814                1 => Self::Inactive,
9815                2 => Self::Creating,
9816                3 => Self::Active,
9817                4 => Self::Updating,
9818                5 => Self::Deleting,
9819                6 => Self::Failed,
9820                _ => Self::UnknownValue(state::UnknownValue(
9821                    wkt::internal::UnknownEnumValue::Integer(value),
9822                )),
9823            }
9824        }
9825    }
9826
9827    impl std::convert::From<&str> for State {
9828        fn from(value: &str) -> Self {
9829            use std::string::ToString;
9830            match value {
9831                "STATE_UNSPECIFIED" => Self::Unspecified,
9832                "INACTIVE" => Self::Inactive,
9833                "CREATING" => Self::Creating,
9834                "ACTIVE" => Self::Active,
9835                "UPDATING" => Self::Updating,
9836                "DELETING" => Self::Deleting,
9837                "FAILED" => Self::Failed,
9838                _ => Self::UnknownValue(state::UnknownValue(
9839                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9840                )),
9841            }
9842        }
9843    }
9844
9845    impl serde::ser::Serialize for State {
9846        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9847        where
9848            S: serde::Serializer,
9849        {
9850            match self {
9851                Self::Unspecified => serializer.serialize_i32(0),
9852                Self::Inactive => serializer.serialize_i32(1),
9853                Self::Creating => serializer.serialize_i32(2),
9854                Self::Active => serializer.serialize_i32(3),
9855                Self::Updating => serializer.serialize_i32(4),
9856                Self::Deleting => serializer.serialize_i32(5),
9857                Self::Failed => serializer.serialize_i32(6),
9858                Self::UnknownValue(u) => u.0.serialize(serializer),
9859            }
9860        }
9861    }
9862
9863    impl<'de> serde::de::Deserialize<'de> for State {
9864        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9865        where
9866            D: serde::Deserializer<'de>,
9867        {
9868            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9869                ".google.cloud.apihub.v1.ApiHubInstance.State",
9870            ))
9871        }
9872    }
9873}
9874
9875/// An external API represents an API being provided by external sources. This
9876/// can be used to model third-party APIs and can be used to define dependencies.
9877#[derive(Clone, Default, PartialEq)]
9878#[non_exhaustive]
9879pub struct ExternalApi {
9880    /// Identifier. Format:
9881    /// `projects/{project}/locations/{location}/externalApi/{externalApi}`.
9882    pub name: std::string::String,
9883
9884    /// Required. Display name of the external API. Max length is 63 characters
9885    /// (Unicode Code Points).
9886    pub display_name: std::string::String,
9887
9888    /// Optional. Description of the external API. Max length is 2000 characters
9889    /// (Unicode Code Points).
9890    pub description: std::string::String,
9891
9892    /// Optional. List of endpoints on which this API is accessible.
9893    pub endpoints: std::vec::Vec<std::string::String>,
9894
9895    /// Optional. List of paths served by this API.
9896    pub paths: std::vec::Vec<std::string::String>,
9897
9898    /// Optional. Documentation of the external API.
9899    pub documentation: std::option::Option<crate::model::Documentation>,
9900
9901    /// Optional. The list of user defined attributes associated with the Version
9902    /// resource. The key is the attribute name. It will be of the format:
9903    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
9904    /// The value is the attribute values associated with the resource.
9905    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
9906
9907    /// Output only. Creation timestamp.
9908    pub create_time: std::option::Option<wkt::Timestamp>,
9909
9910    /// Output only. Last update timestamp.
9911    pub update_time: std::option::Option<wkt::Timestamp>,
9912
9913    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9914}
9915
9916impl ExternalApi {
9917    pub fn new() -> Self {
9918        std::default::Default::default()
9919    }
9920
9921    /// Sets the value of [name][crate::model::ExternalApi::name].
9922    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9923        self.name = v.into();
9924        self
9925    }
9926
9927    /// Sets the value of [display_name][crate::model::ExternalApi::display_name].
9928    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9929        self.display_name = v.into();
9930        self
9931    }
9932
9933    /// Sets the value of [description][crate::model::ExternalApi::description].
9934    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9935        self.description = v.into();
9936        self
9937    }
9938
9939    /// Sets the value of [endpoints][crate::model::ExternalApi::endpoints].
9940    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
9941    where
9942        T: std::iter::IntoIterator<Item = V>,
9943        V: std::convert::Into<std::string::String>,
9944    {
9945        use std::iter::Iterator;
9946        self.endpoints = v.into_iter().map(|i| i.into()).collect();
9947        self
9948    }
9949
9950    /// Sets the value of [paths][crate::model::ExternalApi::paths].
9951    pub fn set_paths<T, V>(mut self, v: T) -> Self
9952    where
9953        T: std::iter::IntoIterator<Item = V>,
9954        V: std::convert::Into<std::string::String>,
9955    {
9956        use std::iter::Iterator;
9957        self.paths = v.into_iter().map(|i| i.into()).collect();
9958        self
9959    }
9960
9961    /// Sets the value of [documentation][crate::model::ExternalApi::documentation].
9962    pub fn set_documentation<T>(mut self, v: T) -> Self
9963    where
9964        T: std::convert::Into<crate::model::Documentation>,
9965    {
9966        self.documentation = std::option::Option::Some(v.into());
9967        self
9968    }
9969
9970    /// Sets or clears the value of [documentation][crate::model::ExternalApi::documentation].
9971    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
9972    where
9973        T: std::convert::Into<crate::model::Documentation>,
9974    {
9975        self.documentation = v.map(|x| x.into());
9976        self
9977    }
9978
9979    /// Sets the value of [attributes][crate::model::ExternalApi::attributes].
9980    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
9981    where
9982        T: std::iter::IntoIterator<Item = (K, V)>,
9983        K: std::convert::Into<std::string::String>,
9984        V: std::convert::Into<crate::model::AttributeValues>,
9985    {
9986        use std::iter::Iterator;
9987        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9988        self
9989    }
9990
9991    /// Sets the value of [create_time][crate::model::ExternalApi::create_time].
9992    pub fn set_create_time<T>(mut self, v: T) -> Self
9993    where
9994        T: std::convert::Into<wkt::Timestamp>,
9995    {
9996        self.create_time = std::option::Option::Some(v.into());
9997        self
9998    }
9999
10000    /// Sets or clears the value of [create_time][crate::model::ExternalApi::create_time].
10001    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10002    where
10003        T: std::convert::Into<wkt::Timestamp>,
10004    {
10005        self.create_time = v.map(|x| x.into());
10006        self
10007    }
10008
10009    /// Sets the value of [update_time][crate::model::ExternalApi::update_time].
10010    pub fn set_update_time<T>(mut self, v: T) -> Self
10011    where
10012        T: std::convert::Into<wkt::Timestamp>,
10013    {
10014        self.update_time = std::option::Option::Some(v.into());
10015        self
10016    }
10017
10018    /// Sets or clears the value of [update_time][crate::model::ExternalApi::update_time].
10019    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10020    where
10021        T: std::convert::Into<wkt::Timestamp>,
10022    {
10023        self.update_time = v.map(|x| x.into());
10024        self
10025    }
10026}
10027
10028impl wkt::message::Message for ExternalApi {
10029    fn typename() -> &'static str {
10030        "type.googleapis.com/google.cloud.apihub.v1.ExternalApi"
10031    }
10032}
10033
10034/// ConfigValueOption represents an option for a config variable of type enum or
10035/// multi select.
10036#[derive(Clone, Default, PartialEq)]
10037#[non_exhaustive]
10038pub struct ConfigValueOption {
10039    /// Required. Id of the option.
10040    pub id: std::string::String,
10041
10042    /// Required. Display name of the option.
10043    pub display_name: std::string::String,
10044
10045    /// Optional. Description of the option.
10046    pub description: std::string::String,
10047
10048    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10049}
10050
10051impl ConfigValueOption {
10052    pub fn new() -> Self {
10053        std::default::Default::default()
10054    }
10055
10056    /// Sets the value of [id][crate::model::ConfigValueOption::id].
10057    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10058        self.id = v.into();
10059        self
10060    }
10061
10062    /// Sets the value of [display_name][crate::model::ConfigValueOption::display_name].
10063    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10064        self.display_name = v.into();
10065        self
10066    }
10067
10068    /// Sets the value of [description][crate::model::ConfigValueOption::description].
10069    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10070        self.description = v.into();
10071        self
10072    }
10073}
10074
10075impl wkt::message::Message for ConfigValueOption {
10076    fn typename() -> &'static str {
10077        "type.googleapis.com/google.cloud.apihub.v1.ConfigValueOption"
10078    }
10079}
10080
10081/// Secret provides a reference to entries in Secret Manager.
10082#[derive(Clone, Default, PartialEq)]
10083#[non_exhaustive]
10084pub struct Secret {
10085    /// Required. The resource name of the secret version in the format,
10086    /// format as: `projects/*/secrets/*/versions/*`.
10087    pub secret_version: std::string::String,
10088
10089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10090}
10091
10092impl Secret {
10093    pub fn new() -> Self {
10094        std::default::Default::default()
10095    }
10096
10097    /// Sets the value of [secret_version][crate::model::Secret::secret_version].
10098    pub fn set_secret_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10099        self.secret_version = v.into();
10100        self
10101    }
10102}
10103
10104impl wkt::message::Message for Secret {
10105    fn typename() -> &'static str {
10106        "type.googleapis.com/google.cloud.apihub.v1.Secret"
10107    }
10108}
10109
10110/// ConfigVariableTemplate represents a configuration variable template present
10111/// in a Plugin Config.
10112#[derive(Clone, Default, PartialEq)]
10113#[non_exhaustive]
10114pub struct ConfigVariableTemplate {
10115    /// Required. ID of the config variable. Must be unique within the
10116    /// configuration.
10117    pub id: std::string::String,
10118
10119    /// Required. Type of the parameter: string, int, bool etc.
10120    pub value_type: crate::model::config_variable_template::ValueType,
10121
10122    /// Optional. Description.
10123    pub description: std::string::String,
10124
10125    /// Optional. Regular expression in RE2 syntax used for validating the `value`
10126    /// of a `ConfigVariable`.
10127    pub validation_regex: std::string::String,
10128
10129    /// Optional. Flag represents that this `ConfigVariable` must be provided for a
10130    /// PluginInstance.
10131    pub required: bool,
10132
10133    /// Optional. Enum options. To be populated if `ValueType` is `ENUM`.
10134    pub enum_options: std::vec::Vec<crate::model::ConfigValueOption>,
10135
10136    /// Optional. Multi select options. To be populated if `ValueType` is
10137    /// `MULTI_SELECT`.
10138    pub multi_select_options: std::vec::Vec<crate::model::ConfigValueOption>,
10139
10140    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10141}
10142
10143impl ConfigVariableTemplate {
10144    pub fn new() -> Self {
10145        std::default::Default::default()
10146    }
10147
10148    /// Sets the value of [id][crate::model::ConfigVariableTemplate::id].
10149    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10150        self.id = v.into();
10151        self
10152    }
10153
10154    /// Sets the value of [value_type][crate::model::ConfigVariableTemplate::value_type].
10155    pub fn set_value_type<
10156        T: std::convert::Into<crate::model::config_variable_template::ValueType>,
10157    >(
10158        mut self,
10159        v: T,
10160    ) -> Self {
10161        self.value_type = v.into();
10162        self
10163    }
10164
10165    /// Sets the value of [description][crate::model::ConfigVariableTemplate::description].
10166    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10167        self.description = v.into();
10168        self
10169    }
10170
10171    /// Sets the value of [validation_regex][crate::model::ConfigVariableTemplate::validation_regex].
10172    pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
10173        mut self,
10174        v: T,
10175    ) -> Self {
10176        self.validation_regex = v.into();
10177        self
10178    }
10179
10180    /// Sets the value of [required][crate::model::ConfigVariableTemplate::required].
10181    pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10182        self.required = v.into();
10183        self
10184    }
10185
10186    /// Sets the value of [enum_options][crate::model::ConfigVariableTemplate::enum_options].
10187    pub fn set_enum_options<T, V>(mut self, v: T) -> Self
10188    where
10189        T: std::iter::IntoIterator<Item = V>,
10190        V: std::convert::Into<crate::model::ConfigValueOption>,
10191    {
10192        use std::iter::Iterator;
10193        self.enum_options = v.into_iter().map(|i| i.into()).collect();
10194        self
10195    }
10196
10197    /// Sets the value of [multi_select_options][crate::model::ConfigVariableTemplate::multi_select_options].
10198    pub fn set_multi_select_options<T, V>(mut self, v: T) -> Self
10199    where
10200        T: std::iter::IntoIterator<Item = V>,
10201        V: std::convert::Into<crate::model::ConfigValueOption>,
10202    {
10203        use std::iter::Iterator;
10204        self.multi_select_options = v.into_iter().map(|i| i.into()).collect();
10205        self
10206    }
10207}
10208
10209impl wkt::message::Message for ConfigVariableTemplate {
10210    fn typename() -> &'static str {
10211        "type.googleapis.com/google.cloud.apihub.v1.ConfigVariableTemplate"
10212    }
10213}
10214
10215/// Defines additional types related to [ConfigVariableTemplate].
10216pub mod config_variable_template {
10217    #[allow(unused_imports)]
10218    use super::*;
10219
10220    /// ValueType indicates the data type of the value.
10221    ///
10222    /// # Working with unknown values
10223    ///
10224    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10225    /// additional enum variants at any time. Adding new variants is not considered
10226    /// a breaking change. Applications should write their code in anticipation of:
10227    ///
10228    /// - New values appearing in future releases of the client library, **and**
10229    /// - New values received dynamically, without application changes.
10230    ///
10231    /// Please consult the [Working with enums] section in the user guide for some
10232    /// guidelines.
10233    ///
10234    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10235    #[derive(Clone, Debug, PartialEq)]
10236    #[non_exhaustive]
10237    pub enum ValueType {
10238        /// Value type is not specified.
10239        Unspecified,
10240        /// Value type is string.
10241        String,
10242        /// Value type is integer.
10243        Int,
10244        /// Value type is boolean.
10245        Bool,
10246        /// Value type is secret.
10247        Secret,
10248        /// Value type is enum.
10249        Enum,
10250        /// Value type is multi select.
10251        MultiSelect,
10252        /// Value type is multi string.
10253        MultiString,
10254        /// Value type is multi int.
10255        MultiInt,
10256        /// If set, the enum was initialized with an unknown value.
10257        ///
10258        /// Applications can examine the value using [ValueType::value] or
10259        /// [ValueType::name].
10260        UnknownValue(value_type::UnknownValue),
10261    }
10262
10263    #[doc(hidden)]
10264    pub mod value_type {
10265        #[allow(unused_imports)]
10266        use super::*;
10267        #[derive(Clone, Debug, PartialEq)]
10268        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10269    }
10270
10271    impl ValueType {
10272        /// Gets the enum value.
10273        ///
10274        /// Returns `None` if the enum contains an unknown value deserialized from
10275        /// the string representation of enums.
10276        pub fn value(&self) -> std::option::Option<i32> {
10277            match self {
10278                Self::Unspecified => std::option::Option::Some(0),
10279                Self::String => std::option::Option::Some(1),
10280                Self::Int => std::option::Option::Some(2),
10281                Self::Bool => std::option::Option::Some(3),
10282                Self::Secret => std::option::Option::Some(4),
10283                Self::Enum => std::option::Option::Some(5),
10284                Self::MultiSelect => std::option::Option::Some(6),
10285                Self::MultiString => std::option::Option::Some(7),
10286                Self::MultiInt => std::option::Option::Some(8),
10287                Self::UnknownValue(u) => u.0.value(),
10288            }
10289        }
10290
10291        /// Gets the enum value as a string.
10292        ///
10293        /// Returns `None` if the enum contains an unknown value deserialized from
10294        /// the integer representation of enums.
10295        pub fn name(&self) -> std::option::Option<&str> {
10296            match self {
10297                Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
10298                Self::String => std::option::Option::Some("STRING"),
10299                Self::Int => std::option::Option::Some("INT"),
10300                Self::Bool => std::option::Option::Some("BOOL"),
10301                Self::Secret => std::option::Option::Some("SECRET"),
10302                Self::Enum => std::option::Option::Some("ENUM"),
10303                Self::MultiSelect => std::option::Option::Some("MULTI_SELECT"),
10304                Self::MultiString => std::option::Option::Some("MULTI_STRING"),
10305                Self::MultiInt => std::option::Option::Some("MULTI_INT"),
10306                Self::UnknownValue(u) => u.0.name(),
10307            }
10308        }
10309    }
10310
10311    impl std::default::Default for ValueType {
10312        fn default() -> Self {
10313            use std::convert::From;
10314            Self::from(0)
10315        }
10316    }
10317
10318    impl std::fmt::Display for ValueType {
10319        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10320            wkt::internal::display_enum(f, self.name(), self.value())
10321        }
10322    }
10323
10324    impl std::convert::From<i32> for ValueType {
10325        fn from(value: i32) -> Self {
10326            match value {
10327                0 => Self::Unspecified,
10328                1 => Self::String,
10329                2 => Self::Int,
10330                3 => Self::Bool,
10331                4 => Self::Secret,
10332                5 => Self::Enum,
10333                6 => Self::MultiSelect,
10334                7 => Self::MultiString,
10335                8 => Self::MultiInt,
10336                _ => Self::UnknownValue(value_type::UnknownValue(
10337                    wkt::internal::UnknownEnumValue::Integer(value),
10338                )),
10339            }
10340        }
10341    }
10342
10343    impl std::convert::From<&str> for ValueType {
10344        fn from(value: &str) -> Self {
10345            use std::string::ToString;
10346            match value {
10347                "VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
10348                "STRING" => Self::String,
10349                "INT" => Self::Int,
10350                "BOOL" => Self::Bool,
10351                "SECRET" => Self::Secret,
10352                "ENUM" => Self::Enum,
10353                "MULTI_SELECT" => Self::MultiSelect,
10354                "MULTI_STRING" => Self::MultiString,
10355                "MULTI_INT" => Self::MultiInt,
10356                _ => Self::UnknownValue(value_type::UnknownValue(
10357                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10358                )),
10359            }
10360        }
10361    }
10362
10363    impl serde::ser::Serialize for ValueType {
10364        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10365        where
10366            S: serde::Serializer,
10367        {
10368            match self {
10369                Self::Unspecified => serializer.serialize_i32(0),
10370                Self::String => serializer.serialize_i32(1),
10371                Self::Int => serializer.serialize_i32(2),
10372                Self::Bool => serializer.serialize_i32(3),
10373                Self::Secret => serializer.serialize_i32(4),
10374                Self::Enum => serializer.serialize_i32(5),
10375                Self::MultiSelect => serializer.serialize_i32(6),
10376                Self::MultiString => serializer.serialize_i32(7),
10377                Self::MultiInt => serializer.serialize_i32(8),
10378                Self::UnknownValue(u) => u.0.serialize(serializer),
10379            }
10380        }
10381    }
10382
10383    impl<'de> serde::de::Deserialize<'de> for ValueType {
10384        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10385        where
10386            D: serde::Deserializer<'de>,
10387        {
10388            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
10389                ".google.cloud.apihub.v1.ConfigVariableTemplate.ValueType",
10390            ))
10391        }
10392    }
10393}
10394
10395/// ConfigVariable represents a additional configuration variable present in a
10396/// PluginInstance Config or AuthConfig, based on a ConfigVariableTemplate.
10397#[derive(Clone, Default, PartialEq)]
10398#[non_exhaustive]
10399pub struct ConfigVariable {
10400    /// Output only. Key will be the
10401    /// [id][google.cloud.apihub.v1.ConfigVariableTemplate.id] to uniquely identify
10402    /// the config variable.
10403    ///
10404    /// [google.cloud.apihub.v1.ConfigVariableTemplate.id]: crate::model::ConfigVariableTemplate::id
10405    pub key: std::string::String,
10406
10407    /// The values associated with the config variable.
10408    pub value: std::option::Option<crate::model::config_variable::Value>,
10409
10410    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10411}
10412
10413impl ConfigVariable {
10414    pub fn new() -> Self {
10415        std::default::Default::default()
10416    }
10417
10418    /// Sets the value of [key][crate::model::ConfigVariable::key].
10419    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10420        self.key = v.into();
10421        self
10422    }
10423
10424    /// Sets the value of [value][crate::model::ConfigVariable::value].
10425    ///
10426    /// Note that all the setters affecting `value` are mutually
10427    /// exclusive.
10428    pub fn set_value<
10429        T: std::convert::Into<std::option::Option<crate::model::config_variable::Value>>,
10430    >(
10431        mut self,
10432        v: T,
10433    ) -> Self {
10434        self.value = v.into();
10435        self
10436    }
10437
10438    /// The value of [value][crate::model::ConfigVariable::value]
10439    /// if it holds a `StringValue`, `None` if the field is not set or
10440    /// holds a different branch.
10441    pub fn string_value(&self) -> std::option::Option<&std::string::String> {
10442        #[allow(unreachable_patterns)]
10443        self.value.as_ref().and_then(|v| match v {
10444            crate::model::config_variable::Value::StringValue(v) => std::option::Option::Some(v),
10445            _ => std::option::Option::None,
10446        })
10447    }
10448
10449    /// Sets the value of [value][crate::model::ConfigVariable::value]
10450    /// to hold a `StringValue`.
10451    ///
10452    /// Note that all the setters affecting `value` are
10453    /// mutually exclusive.
10454    pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10455        self.value =
10456            std::option::Option::Some(crate::model::config_variable::Value::StringValue(v.into()));
10457        self
10458    }
10459
10460    /// The value of [value][crate::model::ConfigVariable::value]
10461    /// if it holds a `IntValue`, `None` if the field is not set or
10462    /// holds a different branch.
10463    pub fn int_value(&self) -> std::option::Option<&i64> {
10464        #[allow(unreachable_patterns)]
10465        self.value.as_ref().and_then(|v| match v {
10466            crate::model::config_variable::Value::IntValue(v) => std::option::Option::Some(v),
10467            _ => std::option::Option::None,
10468        })
10469    }
10470
10471    /// Sets the value of [value][crate::model::ConfigVariable::value]
10472    /// to hold a `IntValue`.
10473    ///
10474    /// Note that all the setters affecting `value` are
10475    /// mutually exclusive.
10476    pub fn set_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10477        self.value =
10478            std::option::Option::Some(crate::model::config_variable::Value::IntValue(v.into()));
10479        self
10480    }
10481
10482    /// The value of [value][crate::model::ConfigVariable::value]
10483    /// if it holds a `BoolValue`, `None` if the field is not set or
10484    /// holds a different branch.
10485    pub fn bool_value(&self) -> std::option::Option<&bool> {
10486        #[allow(unreachable_patterns)]
10487        self.value.as_ref().and_then(|v| match v {
10488            crate::model::config_variable::Value::BoolValue(v) => std::option::Option::Some(v),
10489            _ => std::option::Option::None,
10490        })
10491    }
10492
10493    /// Sets the value of [value][crate::model::ConfigVariable::value]
10494    /// to hold a `BoolValue`.
10495    ///
10496    /// Note that all the setters affecting `value` are
10497    /// mutually exclusive.
10498    pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10499        self.value =
10500            std::option::Option::Some(crate::model::config_variable::Value::BoolValue(v.into()));
10501        self
10502    }
10503
10504    /// The value of [value][crate::model::ConfigVariable::value]
10505    /// if it holds a `SecretValue`, `None` if the field is not set or
10506    /// holds a different branch.
10507    pub fn secret_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Secret>> {
10508        #[allow(unreachable_patterns)]
10509        self.value.as_ref().and_then(|v| match v {
10510            crate::model::config_variable::Value::SecretValue(v) => std::option::Option::Some(v),
10511            _ => std::option::Option::None,
10512        })
10513    }
10514
10515    /// Sets the value of [value][crate::model::ConfigVariable::value]
10516    /// to hold a `SecretValue`.
10517    ///
10518    /// Note that all the setters affecting `value` are
10519    /// mutually exclusive.
10520    pub fn set_secret_value<T: std::convert::Into<std::boxed::Box<crate::model::Secret>>>(
10521        mut self,
10522        v: T,
10523    ) -> Self {
10524        self.value =
10525            std::option::Option::Some(crate::model::config_variable::Value::SecretValue(v.into()));
10526        self
10527    }
10528
10529    /// The value of [value][crate::model::ConfigVariable::value]
10530    /// if it holds a `EnumValue`, `None` if the field is not set or
10531    /// holds a different branch.
10532    pub fn enum_value(
10533        &self,
10534    ) -> std::option::Option<&std::boxed::Box<crate::model::ConfigValueOption>> {
10535        #[allow(unreachable_patterns)]
10536        self.value.as_ref().and_then(|v| match v {
10537            crate::model::config_variable::Value::EnumValue(v) => std::option::Option::Some(v),
10538            _ => std::option::Option::None,
10539        })
10540    }
10541
10542    /// Sets the value of [value][crate::model::ConfigVariable::value]
10543    /// to hold a `EnumValue`.
10544    ///
10545    /// Note that all the setters affecting `value` are
10546    /// mutually exclusive.
10547    pub fn set_enum_value<
10548        T: std::convert::Into<std::boxed::Box<crate::model::ConfigValueOption>>,
10549    >(
10550        mut self,
10551        v: T,
10552    ) -> Self {
10553        self.value =
10554            std::option::Option::Some(crate::model::config_variable::Value::EnumValue(v.into()));
10555        self
10556    }
10557
10558    /// The value of [value][crate::model::ConfigVariable::value]
10559    /// if it holds a `MultiSelectValues`, `None` if the field is not set or
10560    /// holds a different branch.
10561    pub fn multi_select_values(
10562        &self,
10563    ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiSelectValues>>
10564    {
10565        #[allow(unreachable_patterns)]
10566        self.value.as_ref().and_then(|v| match v {
10567            crate::model::config_variable::Value::MultiSelectValues(v) => {
10568                std::option::Option::Some(v)
10569            }
10570            _ => std::option::Option::None,
10571        })
10572    }
10573
10574    /// Sets the value of [value][crate::model::ConfigVariable::value]
10575    /// to hold a `MultiSelectValues`.
10576    ///
10577    /// Note that all the setters affecting `value` are
10578    /// mutually exclusive.
10579    pub fn set_multi_select_values<
10580        T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiSelectValues>>,
10581    >(
10582        mut self,
10583        v: T,
10584    ) -> Self {
10585        self.value = std::option::Option::Some(
10586            crate::model::config_variable::Value::MultiSelectValues(v.into()),
10587        );
10588        self
10589    }
10590
10591    /// The value of [value][crate::model::ConfigVariable::value]
10592    /// if it holds a `MultiStringValues`, `None` if the field is not set or
10593    /// holds a different branch.
10594    pub fn multi_string_values(
10595        &self,
10596    ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiStringValues>>
10597    {
10598        #[allow(unreachable_patterns)]
10599        self.value.as_ref().and_then(|v| match v {
10600            crate::model::config_variable::Value::MultiStringValues(v) => {
10601                std::option::Option::Some(v)
10602            }
10603            _ => std::option::Option::None,
10604        })
10605    }
10606
10607    /// Sets the value of [value][crate::model::ConfigVariable::value]
10608    /// to hold a `MultiStringValues`.
10609    ///
10610    /// Note that all the setters affecting `value` are
10611    /// mutually exclusive.
10612    pub fn set_multi_string_values<
10613        T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiStringValues>>,
10614    >(
10615        mut self,
10616        v: T,
10617    ) -> Self {
10618        self.value = std::option::Option::Some(
10619            crate::model::config_variable::Value::MultiStringValues(v.into()),
10620        );
10621        self
10622    }
10623
10624    /// The value of [value][crate::model::ConfigVariable::value]
10625    /// if it holds a `MultiIntValues`, `None` if the field is not set or
10626    /// holds a different branch.
10627    pub fn multi_int_values(
10628        &self,
10629    ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiIntValues>> {
10630        #[allow(unreachable_patterns)]
10631        self.value.as_ref().and_then(|v| match v {
10632            crate::model::config_variable::Value::MultiIntValues(v) => std::option::Option::Some(v),
10633            _ => std::option::Option::None,
10634        })
10635    }
10636
10637    /// Sets the value of [value][crate::model::ConfigVariable::value]
10638    /// to hold a `MultiIntValues`.
10639    ///
10640    /// Note that all the setters affecting `value` are
10641    /// mutually exclusive.
10642    pub fn set_multi_int_values<
10643        T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiIntValues>>,
10644    >(
10645        mut self,
10646        v: T,
10647    ) -> Self {
10648        self.value = std::option::Option::Some(
10649            crate::model::config_variable::Value::MultiIntValues(v.into()),
10650        );
10651        self
10652    }
10653}
10654
10655impl wkt::message::Message for ConfigVariable {
10656    fn typename() -> &'static str {
10657        "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable"
10658    }
10659}
10660
10661/// Defines additional types related to [ConfigVariable].
10662pub mod config_variable {
10663    #[allow(unused_imports)]
10664    use super::*;
10665
10666    /// The config variable value of data type multi select.
10667    #[derive(Clone, Default, PartialEq)]
10668    #[non_exhaustive]
10669    pub struct MultiSelectValues {
10670        /// Optional. The config variable value of data type multi select.
10671        pub values: std::vec::Vec<crate::model::ConfigValueOption>,
10672
10673        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10674    }
10675
10676    impl MultiSelectValues {
10677        pub fn new() -> Self {
10678            std::default::Default::default()
10679        }
10680
10681        /// Sets the value of [values][crate::model::config_variable::MultiSelectValues::values].
10682        pub fn set_values<T, V>(mut self, v: T) -> Self
10683        where
10684            T: std::iter::IntoIterator<Item = V>,
10685            V: std::convert::Into<crate::model::ConfigValueOption>,
10686        {
10687            use std::iter::Iterator;
10688            self.values = v.into_iter().map(|i| i.into()).collect();
10689            self
10690        }
10691    }
10692
10693    impl wkt::message::Message for MultiSelectValues {
10694        fn typename() -> &'static str {
10695            "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiSelectValues"
10696        }
10697    }
10698
10699    /// The config variable value of data type multi string.
10700    #[derive(Clone, Default, PartialEq)]
10701    #[non_exhaustive]
10702    pub struct MultiStringValues {
10703        /// Optional. The config variable value of data type multi string.
10704        pub values: std::vec::Vec<std::string::String>,
10705
10706        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10707    }
10708
10709    impl MultiStringValues {
10710        pub fn new() -> Self {
10711            std::default::Default::default()
10712        }
10713
10714        /// Sets the value of [values][crate::model::config_variable::MultiStringValues::values].
10715        pub fn set_values<T, V>(mut self, v: T) -> Self
10716        where
10717            T: std::iter::IntoIterator<Item = V>,
10718            V: std::convert::Into<std::string::String>,
10719        {
10720            use std::iter::Iterator;
10721            self.values = v.into_iter().map(|i| i.into()).collect();
10722            self
10723        }
10724    }
10725
10726    impl wkt::message::Message for MultiStringValues {
10727        fn typename() -> &'static str {
10728            "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiStringValues"
10729        }
10730    }
10731
10732    /// The config variable value of data type multi int.
10733    #[derive(Clone, Default, PartialEq)]
10734    #[non_exhaustive]
10735    pub struct MultiIntValues {
10736        /// Optional. The config variable value of data type multi int.
10737        pub values: std::vec::Vec<i32>,
10738
10739        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10740    }
10741
10742    impl MultiIntValues {
10743        pub fn new() -> Self {
10744            std::default::Default::default()
10745        }
10746
10747        /// Sets the value of [values][crate::model::config_variable::MultiIntValues::values].
10748        pub fn set_values<T, V>(mut self, v: T) -> Self
10749        where
10750            T: std::iter::IntoIterator<Item = V>,
10751            V: std::convert::Into<i32>,
10752        {
10753            use std::iter::Iterator;
10754            self.values = v.into_iter().map(|i| i.into()).collect();
10755            self
10756        }
10757    }
10758
10759    impl wkt::message::Message for MultiIntValues {
10760        fn typename() -> &'static str {
10761            "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiIntValues"
10762        }
10763    }
10764
10765    /// The values associated with the config variable.
10766    #[derive(Clone, Debug, PartialEq)]
10767    #[non_exhaustive]
10768    pub enum Value {
10769        /// Optional. The config variable value in case of config variable of type
10770        /// string.
10771        StringValue(std::string::String),
10772        /// Optional. The config variable value in case of config variable of type
10773        /// integer.
10774        IntValue(i64),
10775        /// Optional. The config variable value in case of config variable of type
10776        /// boolean.
10777        BoolValue(bool),
10778        /// Optional. The config variable value in case of config variable of type
10779        /// secret.
10780        SecretValue(std::boxed::Box<crate::model::Secret>),
10781        /// Optional. The config variable value in case of config variable of type
10782        /// enum.
10783        EnumValue(std::boxed::Box<crate::model::ConfigValueOption>),
10784        /// Optional. The config variable value in case of config variable of type
10785        /// multi select.
10786        MultiSelectValues(std::boxed::Box<crate::model::config_variable::MultiSelectValues>),
10787        /// Optional. The config variable value in case of config variable of type
10788        /// multi string.
10789        MultiStringValues(std::boxed::Box<crate::model::config_variable::MultiStringValues>),
10790        /// Optional. The config variable value in case of config variable of type
10791        /// multi integer.
10792        MultiIntValues(std::boxed::Box<crate::model::config_variable::MultiIntValues>),
10793    }
10794}
10795
10796/// Config for Google service account authentication.
10797#[derive(Clone, Default, PartialEq)]
10798#[non_exhaustive]
10799pub struct GoogleServiceAccountConfig {
10800    /// Required. The service account to be used for authenticating request.
10801    ///
10802    /// The `iam.serviceAccounts.getAccessToken` permission should be granted on
10803    /// this service account to the impersonator service account.
10804    pub service_account: std::string::String,
10805
10806    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10807}
10808
10809impl GoogleServiceAccountConfig {
10810    pub fn new() -> Self {
10811        std::default::Default::default()
10812    }
10813
10814    /// Sets the value of [service_account][crate::model::GoogleServiceAccountConfig::service_account].
10815    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10816        self.service_account = v.into();
10817        self
10818    }
10819}
10820
10821impl wkt::message::Message for GoogleServiceAccountConfig {
10822    fn typename() -> &'static str {
10823        "type.googleapis.com/google.cloud.apihub.v1.GoogleServiceAccountConfig"
10824    }
10825}
10826
10827/// AuthConfig represents the authentication information.
10828#[derive(Clone, Default, PartialEq)]
10829#[non_exhaustive]
10830pub struct AuthConfig {
10831    /// Required. The authentication type.
10832    pub auth_type: crate::model::AuthType,
10833
10834    /// Supported auth types.
10835    pub config: std::option::Option<crate::model::auth_config::Config>,
10836
10837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10838}
10839
10840impl AuthConfig {
10841    pub fn new() -> Self {
10842        std::default::Default::default()
10843    }
10844
10845    /// Sets the value of [auth_type][crate::model::AuthConfig::auth_type].
10846    pub fn set_auth_type<T: std::convert::Into<crate::model::AuthType>>(mut self, v: T) -> Self {
10847        self.auth_type = v.into();
10848        self
10849    }
10850
10851    /// Sets the value of [config][crate::model::AuthConfig::config].
10852    ///
10853    /// Note that all the setters affecting `config` are mutually
10854    /// exclusive.
10855    pub fn set_config<
10856        T: std::convert::Into<std::option::Option<crate::model::auth_config::Config>>,
10857    >(
10858        mut self,
10859        v: T,
10860    ) -> Self {
10861        self.config = v.into();
10862        self
10863    }
10864
10865    /// The value of [config][crate::model::AuthConfig::config]
10866    /// if it holds a `GoogleServiceAccountConfig`, `None` if the field is not set or
10867    /// holds a different branch.
10868    pub fn google_service_account_config(
10869        &self,
10870    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceAccountConfig>> {
10871        #[allow(unreachable_patterns)]
10872        self.config.as_ref().and_then(|v| match v {
10873            crate::model::auth_config::Config::GoogleServiceAccountConfig(v) => {
10874                std::option::Option::Some(v)
10875            }
10876            _ => std::option::Option::None,
10877        })
10878    }
10879
10880    /// Sets the value of [config][crate::model::AuthConfig::config]
10881    /// to hold a `GoogleServiceAccountConfig`.
10882    ///
10883    /// Note that all the setters affecting `config` are
10884    /// mutually exclusive.
10885    pub fn set_google_service_account_config<
10886        T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceAccountConfig>>,
10887    >(
10888        mut self,
10889        v: T,
10890    ) -> Self {
10891        self.config = std::option::Option::Some(
10892            crate::model::auth_config::Config::GoogleServiceAccountConfig(v.into()),
10893        );
10894        self
10895    }
10896
10897    /// The value of [config][crate::model::AuthConfig::config]
10898    /// if it holds a `UserPasswordConfig`, `None` if the field is not set or
10899    /// holds a different branch.
10900    pub fn user_password_config(
10901        &self,
10902    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::UserPasswordConfig>> {
10903        #[allow(unreachable_patterns)]
10904        self.config.as_ref().and_then(|v| match v {
10905            crate::model::auth_config::Config::UserPasswordConfig(v) => {
10906                std::option::Option::Some(v)
10907            }
10908            _ => std::option::Option::None,
10909        })
10910    }
10911
10912    /// Sets the value of [config][crate::model::AuthConfig::config]
10913    /// to hold a `UserPasswordConfig`.
10914    ///
10915    /// Note that all the setters affecting `config` are
10916    /// mutually exclusive.
10917    pub fn set_user_password_config<
10918        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::UserPasswordConfig>>,
10919    >(
10920        mut self,
10921        v: T,
10922    ) -> Self {
10923        self.config = std::option::Option::Some(
10924            crate::model::auth_config::Config::UserPasswordConfig(v.into()),
10925        );
10926        self
10927    }
10928
10929    /// The value of [config][crate::model::AuthConfig::config]
10930    /// if it holds a `ApiKeyConfig`, `None` if the field is not set or
10931    /// holds a different branch.
10932    pub fn api_key_config(
10933        &self,
10934    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::ApiKeyConfig>> {
10935        #[allow(unreachable_patterns)]
10936        self.config.as_ref().and_then(|v| match v {
10937            crate::model::auth_config::Config::ApiKeyConfig(v) => std::option::Option::Some(v),
10938            _ => std::option::Option::None,
10939        })
10940    }
10941
10942    /// Sets the value of [config][crate::model::AuthConfig::config]
10943    /// to hold a `ApiKeyConfig`.
10944    ///
10945    /// Note that all the setters affecting `config` are
10946    /// mutually exclusive.
10947    pub fn set_api_key_config<
10948        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::ApiKeyConfig>>,
10949    >(
10950        mut self,
10951        v: T,
10952    ) -> Self {
10953        self.config =
10954            std::option::Option::Some(crate::model::auth_config::Config::ApiKeyConfig(v.into()));
10955        self
10956    }
10957
10958    /// The value of [config][crate::model::AuthConfig::config]
10959    /// if it holds a `Oauth2ClientCredentialsConfig`, `None` if the field is not set or
10960    /// holds a different branch.
10961    pub fn oauth2_client_credentials_config(
10962        &self,
10963    ) -> std::option::Option<
10964        &std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
10965    > {
10966        #[allow(unreachable_patterns)]
10967        self.config.as_ref().and_then(|v| match v {
10968            crate::model::auth_config::Config::Oauth2ClientCredentialsConfig(v) => {
10969                std::option::Option::Some(v)
10970            }
10971            _ => std::option::Option::None,
10972        })
10973    }
10974
10975    /// Sets the value of [config][crate::model::AuthConfig::config]
10976    /// to hold a `Oauth2ClientCredentialsConfig`.
10977    ///
10978    /// Note that all the setters affecting `config` are
10979    /// mutually exclusive.
10980    pub fn set_oauth2_client_credentials_config<
10981        T: std::convert::Into<
10982                std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
10983            >,
10984    >(
10985        mut self,
10986        v: T,
10987    ) -> Self {
10988        self.config = std::option::Option::Some(
10989            crate::model::auth_config::Config::Oauth2ClientCredentialsConfig(v.into()),
10990        );
10991        self
10992    }
10993}
10994
10995impl wkt::message::Message for AuthConfig {
10996    fn typename() -> &'static str {
10997        "type.googleapis.com/google.cloud.apihub.v1.AuthConfig"
10998    }
10999}
11000
11001/// Defines additional types related to [AuthConfig].
11002pub mod auth_config {
11003    #[allow(unused_imports)]
11004    use super::*;
11005
11006    /// Parameters to support Username and Password Authentication.
11007    #[derive(Clone, Default, PartialEq)]
11008    #[non_exhaustive]
11009    pub struct UserPasswordConfig {
11010        /// Required. Username.
11011        pub username: std::string::String,
11012
11013        /// Required. Secret version reference containing the password.
11014        /// The `secretmanager.versions.access` permission should be
11015        /// granted to the service account accessing the secret.
11016        pub password: std::option::Option<crate::model::Secret>,
11017
11018        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11019    }
11020
11021    impl UserPasswordConfig {
11022        pub fn new() -> Self {
11023            std::default::Default::default()
11024        }
11025
11026        /// Sets the value of [username][crate::model::auth_config::UserPasswordConfig::username].
11027        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11028            self.username = v.into();
11029            self
11030        }
11031
11032        /// Sets the value of [password][crate::model::auth_config::UserPasswordConfig::password].
11033        pub fn set_password<T>(mut self, v: T) -> Self
11034        where
11035            T: std::convert::Into<crate::model::Secret>,
11036        {
11037            self.password = std::option::Option::Some(v.into());
11038            self
11039        }
11040
11041        /// Sets or clears the value of [password][crate::model::auth_config::UserPasswordConfig::password].
11042        pub fn set_or_clear_password<T>(mut self, v: std::option::Option<T>) -> Self
11043        where
11044            T: std::convert::Into<crate::model::Secret>,
11045        {
11046            self.password = v.map(|x| x.into());
11047            self
11048        }
11049    }
11050
11051    impl wkt::message::Message for UserPasswordConfig {
11052        fn typename() -> &'static str {
11053            "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.UserPasswordConfig"
11054        }
11055    }
11056
11057    /// Parameters to support Oauth 2.0 client credentials grant authentication.
11058    /// See <https://tools.ietf.org/html/rfc6749#section-1.3.4> for more details.
11059    #[derive(Clone, Default, PartialEq)]
11060    #[non_exhaustive]
11061    pub struct Oauth2ClientCredentialsConfig {
11062        /// Required. The client identifier.
11063        pub client_id: std::string::String,
11064
11065        /// Required. Secret version reference containing the client secret.
11066        /// The `secretmanager.versions.access` permission should be
11067        /// granted to the service account accessing the secret.
11068        pub client_secret: std::option::Option<crate::model::Secret>,
11069
11070        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11071    }
11072
11073    impl Oauth2ClientCredentialsConfig {
11074        pub fn new() -> Self {
11075            std::default::Default::default()
11076        }
11077
11078        /// Sets the value of [client_id][crate::model::auth_config::Oauth2ClientCredentialsConfig::client_id].
11079        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11080            self.client_id = v.into();
11081            self
11082        }
11083
11084        /// Sets the value of [client_secret][crate::model::auth_config::Oauth2ClientCredentialsConfig::client_secret].
11085        pub fn set_client_secret<T>(mut self, v: T) -> Self
11086        where
11087            T: std::convert::Into<crate::model::Secret>,
11088        {
11089            self.client_secret = std::option::Option::Some(v.into());
11090            self
11091        }
11092
11093        /// Sets or clears the value of [client_secret][crate::model::auth_config::Oauth2ClientCredentialsConfig::client_secret].
11094        pub fn set_or_clear_client_secret<T>(mut self, v: std::option::Option<T>) -> Self
11095        where
11096            T: std::convert::Into<crate::model::Secret>,
11097        {
11098            self.client_secret = v.map(|x| x.into());
11099            self
11100        }
11101    }
11102
11103    impl wkt::message::Message for Oauth2ClientCredentialsConfig {
11104        fn typename() -> &'static str {
11105            "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.Oauth2ClientCredentialsConfig"
11106        }
11107    }
11108
11109    /// Config for authentication with API key.
11110    #[derive(Clone, Default, PartialEq)]
11111    #[non_exhaustive]
11112    pub struct ApiKeyConfig {
11113        /// Required. The parameter name of the API key.
11114        /// E.g. If the API request is "<https://example.com/act?api_key=>\<API KEY\>",
11115        /// "api_key" would be the parameter name.
11116        pub name: std::string::String,
11117
11118        /// Required. The name of the SecretManager secret version resource storing
11119        /// the API key. Format:
11120        /// `projects/{project}/secrets/{secrete}/versions/{version}`. The
11121        /// `secretmanager.versions.access` permission should be granted to the
11122        /// service account accessing the secret.
11123        pub api_key: std::option::Option<crate::model::Secret>,
11124
11125        /// Required. The location of the API key.
11126        /// The default value is QUERY.
11127        pub http_element_location: crate::model::auth_config::api_key_config::HttpElementLocation,
11128
11129        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11130    }
11131
11132    impl ApiKeyConfig {
11133        pub fn new() -> Self {
11134            std::default::Default::default()
11135        }
11136
11137        /// Sets the value of [name][crate::model::auth_config::ApiKeyConfig::name].
11138        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11139            self.name = v.into();
11140            self
11141        }
11142
11143        /// Sets the value of [api_key][crate::model::auth_config::ApiKeyConfig::api_key].
11144        pub fn set_api_key<T>(mut self, v: T) -> Self
11145        where
11146            T: std::convert::Into<crate::model::Secret>,
11147        {
11148            self.api_key = std::option::Option::Some(v.into());
11149            self
11150        }
11151
11152        /// Sets or clears the value of [api_key][crate::model::auth_config::ApiKeyConfig::api_key].
11153        pub fn set_or_clear_api_key<T>(mut self, v: std::option::Option<T>) -> Self
11154        where
11155            T: std::convert::Into<crate::model::Secret>,
11156        {
11157            self.api_key = v.map(|x| x.into());
11158            self
11159        }
11160
11161        /// Sets the value of [http_element_location][crate::model::auth_config::ApiKeyConfig::http_element_location].
11162        pub fn set_http_element_location<
11163            T: std::convert::Into<crate::model::auth_config::api_key_config::HttpElementLocation>,
11164        >(
11165            mut self,
11166            v: T,
11167        ) -> Self {
11168            self.http_element_location = v.into();
11169            self
11170        }
11171    }
11172
11173    impl wkt::message::Message for ApiKeyConfig {
11174        fn typename() -> &'static str {
11175            "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.ApiKeyConfig"
11176        }
11177    }
11178
11179    /// Defines additional types related to [ApiKeyConfig].
11180    pub mod api_key_config {
11181        #[allow(unused_imports)]
11182        use super::*;
11183
11184        /// Enum of location an HTTP element can be.
11185        ///
11186        /// # Working with unknown values
11187        ///
11188        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11189        /// additional enum variants at any time. Adding new variants is not considered
11190        /// a breaking change. Applications should write their code in anticipation of:
11191        ///
11192        /// - New values appearing in future releases of the client library, **and**
11193        /// - New values received dynamically, without application changes.
11194        ///
11195        /// Please consult the [Working with enums] section in the user guide for some
11196        /// guidelines.
11197        ///
11198        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11199        #[derive(Clone, Debug, PartialEq)]
11200        #[non_exhaustive]
11201        pub enum HttpElementLocation {
11202            /// HTTP element location not specified.
11203            Unspecified,
11204            /// Element is in the HTTP request query.
11205            Query,
11206            /// Element is in the HTTP request header.
11207            Header,
11208            /// Element is in the HTTP request path.
11209            Path,
11210            /// Element is in the HTTP request body.
11211            Body,
11212            /// Element is in the HTTP request cookie.
11213            Cookie,
11214            /// If set, the enum was initialized with an unknown value.
11215            ///
11216            /// Applications can examine the value using [HttpElementLocation::value] or
11217            /// [HttpElementLocation::name].
11218            UnknownValue(http_element_location::UnknownValue),
11219        }
11220
11221        #[doc(hidden)]
11222        pub mod http_element_location {
11223            #[allow(unused_imports)]
11224            use super::*;
11225            #[derive(Clone, Debug, PartialEq)]
11226            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11227        }
11228
11229        impl HttpElementLocation {
11230            /// Gets the enum value.
11231            ///
11232            /// Returns `None` if the enum contains an unknown value deserialized from
11233            /// the string representation of enums.
11234            pub fn value(&self) -> std::option::Option<i32> {
11235                match self {
11236                    Self::Unspecified => std::option::Option::Some(0),
11237                    Self::Query => std::option::Option::Some(1),
11238                    Self::Header => std::option::Option::Some(2),
11239                    Self::Path => std::option::Option::Some(3),
11240                    Self::Body => std::option::Option::Some(4),
11241                    Self::Cookie => std::option::Option::Some(5),
11242                    Self::UnknownValue(u) => u.0.value(),
11243                }
11244            }
11245
11246            /// Gets the enum value as a string.
11247            ///
11248            /// Returns `None` if the enum contains an unknown value deserialized from
11249            /// the integer representation of enums.
11250            pub fn name(&self) -> std::option::Option<&str> {
11251                match self {
11252                    Self::Unspecified => {
11253                        std::option::Option::Some("HTTP_ELEMENT_LOCATION_UNSPECIFIED")
11254                    }
11255                    Self::Query => std::option::Option::Some("QUERY"),
11256                    Self::Header => std::option::Option::Some("HEADER"),
11257                    Self::Path => std::option::Option::Some("PATH"),
11258                    Self::Body => std::option::Option::Some("BODY"),
11259                    Self::Cookie => std::option::Option::Some("COOKIE"),
11260                    Self::UnknownValue(u) => u.0.name(),
11261                }
11262            }
11263        }
11264
11265        impl std::default::Default for HttpElementLocation {
11266            fn default() -> Self {
11267                use std::convert::From;
11268                Self::from(0)
11269            }
11270        }
11271
11272        impl std::fmt::Display for HttpElementLocation {
11273            fn fmt(
11274                &self,
11275                f: &mut std::fmt::Formatter<'_>,
11276            ) -> std::result::Result<(), std::fmt::Error> {
11277                wkt::internal::display_enum(f, self.name(), self.value())
11278            }
11279        }
11280
11281        impl std::convert::From<i32> for HttpElementLocation {
11282            fn from(value: i32) -> Self {
11283                match value {
11284                    0 => Self::Unspecified,
11285                    1 => Self::Query,
11286                    2 => Self::Header,
11287                    3 => Self::Path,
11288                    4 => Self::Body,
11289                    5 => Self::Cookie,
11290                    _ => Self::UnknownValue(http_element_location::UnknownValue(
11291                        wkt::internal::UnknownEnumValue::Integer(value),
11292                    )),
11293                }
11294            }
11295        }
11296
11297        impl std::convert::From<&str> for HttpElementLocation {
11298            fn from(value: &str) -> Self {
11299                use std::string::ToString;
11300                match value {
11301                    "HTTP_ELEMENT_LOCATION_UNSPECIFIED" => Self::Unspecified,
11302                    "QUERY" => Self::Query,
11303                    "HEADER" => Self::Header,
11304                    "PATH" => Self::Path,
11305                    "BODY" => Self::Body,
11306                    "COOKIE" => Self::Cookie,
11307                    _ => Self::UnknownValue(http_element_location::UnknownValue(
11308                        wkt::internal::UnknownEnumValue::String(value.to_string()),
11309                    )),
11310                }
11311            }
11312        }
11313
11314        impl serde::ser::Serialize for HttpElementLocation {
11315            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11316            where
11317                S: serde::Serializer,
11318            {
11319                match self {
11320                    Self::Unspecified => serializer.serialize_i32(0),
11321                    Self::Query => serializer.serialize_i32(1),
11322                    Self::Header => serializer.serialize_i32(2),
11323                    Self::Path => serializer.serialize_i32(3),
11324                    Self::Body => serializer.serialize_i32(4),
11325                    Self::Cookie => serializer.serialize_i32(5),
11326                    Self::UnknownValue(u) => u.0.serialize(serializer),
11327                }
11328            }
11329        }
11330
11331        impl<'de> serde::de::Deserialize<'de> for HttpElementLocation {
11332            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11333            where
11334                D: serde::Deserializer<'de>,
11335            {
11336                deserializer.deserialize_any(
11337                    wkt::internal::EnumVisitor::<HttpElementLocation>::new(
11338                        ".google.cloud.apihub.v1.AuthConfig.ApiKeyConfig.HttpElementLocation",
11339                    ),
11340                )
11341            }
11342        }
11343    }
11344
11345    /// Supported auth types.
11346    #[derive(Clone, Debug, PartialEq)]
11347    #[non_exhaustive]
11348    pub enum Config {
11349        /// Google Service Account.
11350        GoogleServiceAccountConfig(std::boxed::Box<crate::model::GoogleServiceAccountConfig>),
11351        /// User Password.
11352        UserPasswordConfig(std::boxed::Box<crate::model::auth_config::UserPasswordConfig>),
11353        /// Api Key Config.
11354        ApiKeyConfig(std::boxed::Box<crate::model::auth_config::ApiKeyConfig>),
11355        /// Oauth2.0 Client Credentials.
11356        Oauth2ClientCredentialsConfig(
11357            std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
11358        ),
11359    }
11360}
11361
11362/// SourceMetadata represents the metadata for a resource at the source.
11363#[derive(Clone, Default, PartialEq)]
11364#[non_exhaustive]
11365pub struct SourceMetadata {
11366    /// Output only. The type of the source.
11367    pub source_type: crate::model::source_metadata::SourceType,
11368
11369    /// Output only. The unique identifier of the resource at the source.
11370    pub original_resource_id: std::string::String,
11371
11372    /// Output only. The time at which the resource was created at the source.
11373    pub original_resource_create_time: std::option::Option<wkt::Timestamp>,
11374
11375    /// Output only. The time at which the resource was last updated at the source.
11376    pub original_resource_update_time: std::option::Option<wkt::Timestamp>,
11377
11378    /// The source of the resource.
11379    pub source: std::option::Option<crate::model::source_metadata::Source>,
11380
11381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11382}
11383
11384impl SourceMetadata {
11385    pub fn new() -> Self {
11386        std::default::Default::default()
11387    }
11388
11389    /// Sets the value of [source_type][crate::model::SourceMetadata::source_type].
11390    pub fn set_source_type<T: std::convert::Into<crate::model::source_metadata::SourceType>>(
11391        mut self,
11392        v: T,
11393    ) -> Self {
11394        self.source_type = v.into();
11395        self
11396    }
11397
11398    /// Sets the value of [original_resource_id][crate::model::SourceMetadata::original_resource_id].
11399    pub fn set_original_resource_id<T: std::convert::Into<std::string::String>>(
11400        mut self,
11401        v: T,
11402    ) -> Self {
11403        self.original_resource_id = v.into();
11404        self
11405    }
11406
11407    /// Sets the value of [original_resource_create_time][crate::model::SourceMetadata::original_resource_create_time].
11408    pub fn set_original_resource_create_time<T>(mut self, v: T) -> Self
11409    where
11410        T: std::convert::Into<wkt::Timestamp>,
11411    {
11412        self.original_resource_create_time = std::option::Option::Some(v.into());
11413        self
11414    }
11415
11416    /// Sets or clears the value of [original_resource_create_time][crate::model::SourceMetadata::original_resource_create_time].
11417    pub fn set_or_clear_original_resource_create_time<T>(
11418        mut self,
11419        v: std::option::Option<T>,
11420    ) -> Self
11421    where
11422        T: std::convert::Into<wkt::Timestamp>,
11423    {
11424        self.original_resource_create_time = v.map(|x| x.into());
11425        self
11426    }
11427
11428    /// Sets the value of [original_resource_update_time][crate::model::SourceMetadata::original_resource_update_time].
11429    pub fn set_original_resource_update_time<T>(mut self, v: T) -> Self
11430    where
11431        T: std::convert::Into<wkt::Timestamp>,
11432    {
11433        self.original_resource_update_time = std::option::Option::Some(v.into());
11434        self
11435    }
11436
11437    /// Sets or clears the value of [original_resource_update_time][crate::model::SourceMetadata::original_resource_update_time].
11438    pub fn set_or_clear_original_resource_update_time<T>(
11439        mut self,
11440        v: std::option::Option<T>,
11441    ) -> Self
11442    where
11443        T: std::convert::Into<wkt::Timestamp>,
11444    {
11445        self.original_resource_update_time = v.map(|x| x.into());
11446        self
11447    }
11448
11449    /// Sets the value of [source][crate::model::SourceMetadata::source].
11450    ///
11451    /// Note that all the setters affecting `source` are mutually
11452    /// exclusive.
11453    pub fn set_source<
11454        T: std::convert::Into<std::option::Option<crate::model::source_metadata::Source>>,
11455    >(
11456        mut self,
11457        v: T,
11458    ) -> Self {
11459        self.source = v.into();
11460        self
11461    }
11462
11463    /// The value of [source][crate::model::SourceMetadata::source]
11464    /// if it holds a `PluginInstanceActionSource`, `None` if the field is not set or
11465    /// holds a different branch.
11466    pub fn plugin_instance_action_source(
11467        &self,
11468    ) -> std::option::Option<
11469        &std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
11470    > {
11471        #[allow(unreachable_patterns)]
11472        self.source.as_ref().and_then(|v| match v {
11473            crate::model::source_metadata::Source::PluginInstanceActionSource(v) => {
11474                std::option::Option::Some(v)
11475            }
11476            _ => std::option::Option::None,
11477        })
11478    }
11479
11480    /// Sets the value of [source][crate::model::SourceMetadata::source]
11481    /// to hold a `PluginInstanceActionSource`.
11482    ///
11483    /// Note that all the setters affecting `source` are
11484    /// mutually exclusive.
11485    pub fn set_plugin_instance_action_source<
11486        T: std::convert::Into<
11487                std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
11488            >,
11489    >(
11490        mut self,
11491        v: T,
11492    ) -> Self {
11493        self.source = std::option::Option::Some(
11494            crate::model::source_metadata::Source::PluginInstanceActionSource(v.into()),
11495        );
11496        self
11497    }
11498}
11499
11500impl wkt::message::Message for SourceMetadata {
11501    fn typename() -> &'static str {
11502        "type.googleapis.com/google.cloud.apihub.v1.SourceMetadata"
11503    }
11504}
11505
11506/// Defines additional types related to [SourceMetadata].
11507pub mod source_metadata {
11508    #[allow(unused_imports)]
11509    use super::*;
11510
11511    /// PluginInstanceActionSource represents the plugin instance action source.
11512    #[derive(Clone, Default, PartialEq)]
11513    #[non_exhaustive]
11514    pub struct PluginInstanceActionSource {
11515        /// Output only. The resource name of the source plugin instance.
11516        /// Format is
11517        /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
11518        pub plugin_instance: std::string::String,
11519
11520        /// Output only. The id of the plugin instance action.
11521        pub action_id: std::string::String,
11522
11523        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11524    }
11525
11526    impl PluginInstanceActionSource {
11527        pub fn new() -> Self {
11528            std::default::Default::default()
11529        }
11530
11531        /// Sets the value of [plugin_instance][crate::model::source_metadata::PluginInstanceActionSource::plugin_instance].
11532        pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(
11533            mut self,
11534            v: T,
11535        ) -> Self {
11536            self.plugin_instance = v.into();
11537            self
11538        }
11539
11540        /// Sets the value of [action_id][crate::model::source_metadata::PluginInstanceActionSource::action_id].
11541        pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11542            self.action_id = v.into();
11543            self
11544        }
11545    }
11546
11547    impl wkt::message::Message for PluginInstanceActionSource {
11548        fn typename() -> &'static str {
11549            "type.googleapis.com/google.cloud.apihub.v1.SourceMetadata.PluginInstanceActionSource"
11550        }
11551    }
11552
11553    /// The possible types of the source.
11554    ///
11555    /// # Working with unknown values
11556    ///
11557    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11558    /// additional enum variants at any time. Adding new variants is not considered
11559    /// a breaking change. Applications should write their code in anticipation of:
11560    ///
11561    /// - New values appearing in future releases of the client library, **and**
11562    /// - New values received dynamically, without application changes.
11563    ///
11564    /// Please consult the [Working with enums] section in the user guide for some
11565    /// guidelines.
11566    ///
11567    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11568    #[derive(Clone, Debug, PartialEq)]
11569    #[non_exhaustive]
11570    pub enum SourceType {
11571        /// Source type not specified.
11572        Unspecified,
11573        /// Source type plugin.
11574        Plugin,
11575        /// If set, the enum was initialized with an unknown value.
11576        ///
11577        /// Applications can examine the value using [SourceType::value] or
11578        /// [SourceType::name].
11579        UnknownValue(source_type::UnknownValue),
11580    }
11581
11582    #[doc(hidden)]
11583    pub mod source_type {
11584        #[allow(unused_imports)]
11585        use super::*;
11586        #[derive(Clone, Debug, PartialEq)]
11587        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11588    }
11589
11590    impl SourceType {
11591        /// Gets the enum value.
11592        ///
11593        /// Returns `None` if the enum contains an unknown value deserialized from
11594        /// the string representation of enums.
11595        pub fn value(&self) -> std::option::Option<i32> {
11596            match self {
11597                Self::Unspecified => std::option::Option::Some(0),
11598                Self::Plugin => std::option::Option::Some(1),
11599                Self::UnknownValue(u) => u.0.value(),
11600            }
11601        }
11602
11603        /// Gets the enum value as a string.
11604        ///
11605        /// Returns `None` if the enum contains an unknown value deserialized from
11606        /// the integer representation of enums.
11607        pub fn name(&self) -> std::option::Option<&str> {
11608            match self {
11609                Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
11610                Self::Plugin => std::option::Option::Some("PLUGIN"),
11611                Self::UnknownValue(u) => u.0.name(),
11612            }
11613        }
11614    }
11615
11616    impl std::default::Default for SourceType {
11617        fn default() -> Self {
11618            use std::convert::From;
11619            Self::from(0)
11620        }
11621    }
11622
11623    impl std::fmt::Display for SourceType {
11624        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11625            wkt::internal::display_enum(f, self.name(), self.value())
11626        }
11627    }
11628
11629    impl std::convert::From<i32> for SourceType {
11630        fn from(value: i32) -> Self {
11631            match value {
11632                0 => Self::Unspecified,
11633                1 => Self::Plugin,
11634                _ => Self::UnknownValue(source_type::UnknownValue(
11635                    wkt::internal::UnknownEnumValue::Integer(value),
11636                )),
11637            }
11638        }
11639    }
11640
11641    impl std::convert::From<&str> for SourceType {
11642        fn from(value: &str) -> Self {
11643            use std::string::ToString;
11644            match value {
11645                "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
11646                "PLUGIN" => Self::Plugin,
11647                _ => Self::UnknownValue(source_type::UnknownValue(
11648                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11649                )),
11650            }
11651        }
11652    }
11653
11654    impl serde::ser::Serialize for SourceType {
11655        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11656        where
11657            S: serde::Serializer,
11658        {
11659            match self {
11660                Self::Unspecified => serializer.serialize_i32(0),
11661                Self::Plugin => serializer.serialize_i32(1),
11662                Self::UnknownValue(u) => u.0.serialize(serializer),
11663            }
11664        }
11665    }
11666
11667    impl<'de> serde::de::Deserialize<'de> for SourceType {
11668        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11669        where
11670            D: serde::Deserializer<'de>,
11671        {
11672            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
11673                ".google.cloud.apihub.v1.SourceMetadata.SourceType",
11674            ))
11675        }
11676    }
11677
11678    /// The source of the resource.
11679    #[derive(Clone, Debug, PartialEq)]
11680    #[non_exhaustive]
11681    pub enum Source {
11682        /// Output only. The source of the resource is a plugin instance action.
11683        PluginInstanceActionSource(
11684            std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
11685        ),
11686    }
11687}
11688
11689/// Respresents an API Observation observed in one of the sources.
11690#[derive(Clone, Default, PartialEq)]
11691#[non_exhaustive]
11692pub struct DiscoveredApiObservation {
11693    /// Identifier. The name of the discovered API Observation.
11694    ///
11695    /// Format:
11696    /// `projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}`
11697    pub name: std::string::String,
11698
11699    /// Optional. Style of ApiObservation
11700    pub style: crate::model::discovered_api_observation::Style,
11701
11702    /// Optional. The IP address (IPv4 or IPv6) of the origin server that the
11703    /// request was sent to. This field can include port information. Examples:
11704    /// `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
11705    pub server_ips: std::vec::Vec<std::string::String>,
11706
11707    /// Optional. The hostname of requests processed for this Observation.
11708    pub hostname: std::string::String,
11709
11710    /// Optional. Last event detected time stamp
11711    pub last_event_detected_time: std::option::Option<wkt::Timestamp>,
11712
11713    /// Optional. The location of the observation source.
11714    pub source_locations: std::vec::Vec<std::string::String>,
11715
11716    /// Optional. The number of observed API Operations.
11717    pub api_operation_count: i64,
11718
11719    /// Optional. For an observation pushed from a gcp resource, this would be the
11720    /// gcp project id.
11721    pub origin: std::string::String,
11722
11723    /// Optional. The type of the source from which the observation was collected.
11724    pub source_types: std::vec::Vec<crate::model::discovered_api_observation::SourceType>,
11725
11726    /// Output only. The number of known API Operations.
11727    pub known_operations_count: i64,
11728
11729    /// Output only. The number of unknown API Operations.
11730    pub unknown_operations_count: i64,
11731
11732    /// Output only. Create time stamp of the observation in API Hub.
11733    pub create_time: std::option::Option<wkt::Timestamp>,
11734
11735    /// Output only. Update time stamp of the observation in API Hub.
11736    pub update_time: std::option::Option<wkt::Timestamp>,
11737
11738    /// Output only. The metadata of the source from which the observation was
11739    /// collected.
11740    pub source_metadata: std::option::Option<crate::model::SourceMetadata>,
11741
11742    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11743}
11744
11745impl DiscoveredApiObservation {
11746    pub fn new() -> Self {
11747        std::default::Default::default()
11748    }
11749
11750    /// Sets the value of [name][crate::model::DiscoveredApiObservation::name].
11751    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11752        self.name = v.into();
11753        self
11754    }
11755
11756    /// Sets the value of [style][crate::model::DiscoveredApiObservation::style].
11757    pub fn set_style<T: std::convert::Into<crate::model::discovered_api_observation::Style>>(
11758        mut self,
11759        v: T,
11760    ) -> Self {
11761        self.style = v.into();
11762        self
11763    }
11764
11765    /// Sets the value of [server_ips][crate::model::DiscoveredApiObservation::server_ips].
11766    pub fn set_server_ips<T, V>(mut self, v: T) -> Self
11767    where
11768        T: std::iter::IntoIterator<Item = V>,
11769        V: std::convert::Into<std::string::String>,
11770    {
11771        use std::iter::Iterator;
11772        self.server_ips = v.into_iter().map(|i| i.into()).collect();
11773        self
11774    }
11775
11776    /// Sets the value of [hostname][crate::model::DiscoveredApiObservation::hostname].
11777    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11778        self.hostname = v.into();
11779        self
11780    }
11781
11782    /// Sets the value of [last_event_detected_time][crate::model::DiscoveredApiObservation::last_event_detected_time].
11783    pub fn set_last_event_detected_time<T>(mut self, v: T) -> Self
11784    where
11785        T: std::convert::Into<wkt::Timestamp>,
11786    {
11787        self.last_event_detected_time = std::option::Option::Some(v.into());
11788        self
11789    }
11790
11791    /// Sets or clears the value of [last_event_detected_time][crate::model::DiscoveredApiObservation::last_event_detected_time].
11792    pub fn set_or_clear_last_event_detected_time<T>(mut self, v: std::option::Option<T>) -> Self
11793    where
11794        T: std::convert::Into<wkt::Timestamp>,
11795    {
11796        self.last_event_detected_time = v.map(|x| x.into());
11797        self
11798    }
11799
11800    /// Sets the value of [source_locations][crate::model::DiscoveredApiObservation::source_locations].
11801    pub fn set_source_locations<T, V>(mut self, v: T) -> Self
11802    where
11803        T: std::iter::IntoIterator<Item = V>,
11804        V: std::convert::Into<std::string::String>,
11805    {
11806        use std::iter::Iterator;
11807        self.source_locations = v.into_iter().map(|i| i.into()).collect();
11808        self
11809    }
11810
11811    /// Sets the value of [api_operation_count][crate::model::DiscoveredApiObservation::api_operation_count].
11812    pub fn set_api_operation_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11813        self.api_operation_count = v.into();
11814        self
11815    }
11816
11817    /// Sets the value of [origin][crate::model::DiscoveredApiObservation::origin].
11818    pub fn set_origin<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11819        self.origin = v.into();
11820        self
11821    }
11822
11823    /// Sets the value of [source_types][crate::model::DiscoveredApiObservation::source_types].
11824    pub fn set_source_types<T, V>(mut self, v: T) -> Self
11825    where
11826        T: std::iter::IntoIterator<Item = V>,
11827        V: std::convert::Into<crate::model::discovered_api_observation::SourceType>,
11828    {
11829        use std::iter::Iterator;
11830        self.source_types = v.into_iter().map(|i| i.into()).collect();
11831        self
11832    }
11833
11834    /// Sets the value of [known_operations_count][crate::model::DiscoveredApiObservation::known_operations_count].
11835    pub fn set_known_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11836        self.known_operations_count = v.into();
11837        self
11838    }
11839
11840    /// Sets the value of [unknown_operations_count][crate::model::DiscoveredApiObservation::unknown_operations_count].
11841    pub fn set_unknown_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11842        self.unknown_operations_count = v.into();
11843        self
11844    }
11845
11846    /// Sets the value of [create_time][crate::model::DiscoveredApiObservation::create_time].
11847    pub fn set_create_time<T>(mut self, v: T) -> Self
11848    where
11849        T: std::convert::Into<wkt::Timestamp>,
11850    {
11851        self.create_time = std::option::Option::Some(v.into());
11852        self
11853    }
11854
11855    /// Sets or clears the value of [create_time][crate::model::DiscoveredApiObservation::create_time].
11856    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11857    where
11858        T: std::convert::Into<wkt::Timestamp>,
11859    {
11860        self.create_time = v.map(|x| x.into());
11861        self
11862    }
11863
11864    /// Sets the value of [update_time][crate::model::DiscoveredApiObservation::update_time].
11865    pub fn set_update_time<T>(mut self, v: T) -> Self
11866    where
11867        T: std::convert::Into<wkt::Timestamp>,
11868    {
11869        self.update_time = std::option::Option::Some(v.into());
11870        self
11871    }
11872
11873    /// Sets or clears the value of [update_time][crate::model::DiscoveredApiObservation::update_time].
11874    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11875    where
11876        T: std::convert::Into<wkt::Timestamp>,
11877    {
11878        self.update_time = v.map(|x| x.into());
11879        self
11880    }
11881
11882    /// Sets the value of [source_metadata][crate::model::DiscoveredApiObservation::source_metadata].
11883    pub fn set_source_metadata<T>(mut self, v: T) -> Self
11884    where
11885        T: std::convert::Into<crate::model::SourceMetadata>,
11886    {
11887        self.source_metadata = std::option::Option::Some(v.into());
11888        self
11889    }
11890
11891    /// Sets or clears the value of [source_metadata][crate::model::DiscoveredApiObservation::source_metadata].
11892    pub fn set_or_clear_source_metadata<T>(mut self, v: std::option::Option<T>) -> Self
11893    where
11894        T: std::convert::Into<crate::model::SourceMetadata>,
11895    {
11896        self.source_metadata = v.map(|x| x.into());
11897        self
11898    }
11899}
11900
11901impl wkt::message::Message for DiscoveredApiObservation {
11902    fn typename() -> &'static str {
11903        "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiObservation"
11904    }
11905}
11906
11907/// Defines additional types related to [DiscoveredApiObservation].
11908pub mod discovered_api_observation {
11909    #[allow(unused_imports)]
11910    use super::*;
11911
11912    /// DiscoveredApiObservation protocol style
11913    ///
11914    /// # Working with unknown values
11915    ///
11916    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11917    /// additional enum variants at any time. Adding new variants is not considered
11918    /// a breaking change. Applications should write their code in anticipation of:
11919    ///
11920    /// - New values appearing in future releases of the client library, **and**
11921    /// - New values received dynamically, without application changes.
11922    ///
11923    /// Please consult the [Working with enums] section in the user guide for some
11924    /// guidelines.
11925    ///
11926    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11927    #[derive(Clone, Debug, PartialEq)]
11928    #[non_exhaustive]
11929    pub enum Style {
11930        /// Unknown style
11931        Unspecified,
11932        /// Style is Rest API
11933        Rest,
11934        /// Style is Grpc API
11935        Grpc,
11936        /// Style is GraphQL API
11937        Graphql,
11938        /// If set, the enum was initialized with an unknown value.
11939        ///
11940        /// Applications can examine the value using [Style::value] or
11941        /// [Style::name].
11942        UnknownValue(style::UnknownValue),
11943    }
11944
11945    #[doc(hidden)]
11946    pub mod style {
11947        #[allow(unused_imports)]
11948        use super::*;
11949        #[derive(Clone, Debug, PartialEq)]
11950        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11951    }
11952
11953    impl Style {
11954        /// Gets the enum value.
11955        ///
11956        /// Returns `None` if the enum contains an unknown value deserialized from
11957        /// the string representation of enums.
11958        pub fn value(&self) -> std::option::Option<i32> {
11959            match self {
11960                Self::Unspecified => std::option::Option::Some(0),
11961                Self::Rest => std::option::Option::Some(1),
11962                Self::Grpc => std::option::Option::Some(2),
11963                Self::Graphql => std::option::Option::Some(3),
11964                Self::UnknownValue(u) => u.0.value(),
11965            }
11966        }
11967
11968        /// Gets the enum value as a string.
11969        ///
11970        /// Returns `None` if the enum contains an unknown value deserialized from
11971        /// the integer representation of enums.
11972        pub fn name(&self) -> std::option::Option<&str> {
11973            match self {
11974                Self::Unspecified => std::option::Option::Some("STYLE_UNSPECIFIED"),
11975                Self::Rest => std::option::Option::Some("REST"),
11976                Self::Grpc => std::option::Option::Some("GRPC"),
11977                Self::Graphql => std::option::Option::Some("GRAPHQL"),
11978                Self::UnknownValue(u) => u.0.name(),
11979            }
11980        }
11981    }
11982
11983    impl std::default::Default for Style {
11984        fn default() -> Self {
11985            use std::convert::From;
11986            Self::from(0)
11987        }
11988    }
11989
11990    impl std::fmt::Display for Style {
11991        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11992            wkt::internal::display_enum(f, self.name(), self.value())
11993        }
11994    }
11995
11996    impl std::convert::From<i32> for Style {
11997        fn from(value: i32) -> Self {
11998            match value {
11999                0 => Self::Unspecified,
12000                1 => Self::Rest,
12001                2 => Self::Grpc,
12002                3 => Self::Graphql,
12003                _ => Self::UnknownValue(style::UnknownValue(
12004                    wkt::internal::UnknownEnumValue::Integer(value),
12005                )),
12006            }
12007        }
12008    }
12009
12010    impl std::convert::From<&str> for Style {
12011        fn from(value: &str) -> Self {
12012            use std::string::ToString;
12013            match value {
12014                "STYLE_UNSPECIFIED" => Self::Unspecified,
12015                "REST" => Self::Rest,
12016                "GRPC" => Self::Grpc,
12017                "GRAPHQL" => Self::Graphql,
12018                _ => Self::UnknownValue(style::UnknownValue(
12019                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12020                )),
12021            }
12022        }
12023    }
12024
12025    impl serde::ser::Serialize for Style {
12026        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12027        where
12028            S: serde::Serializer,
12029        {
12030            match self {
12031                Self::Unspecified => serializer.serialize_i32(0),
12032                Self::Rest => serializer.serialize_i32(1),
12033                Self::Grpc => serializer.serialize_i32(2),
12034                Self::Graphql => serializer.serialize_i32(3),
12035                Self::UnknownValue(u) => u.0.serialize(serializer),
12036            }
12037        }
12038    }
12039
12040    impl<'de> serde::de::Deserialize<'de> for Style {
12041        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12042        where
12043            D: serde::Deserializer<'de>,
12044        {
12045            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Style>::new(
12046                ".google.cloud.apihub.v1.DiscoveredApiObservation.Style",
12047            ))
12048        }
12049    }
12050
12051    /// The possible types of the source from which the observation was collected.
12052    ///
12053    /// # Working with unknown values
12054    ///
12055    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12056    /// additional enum variants at any time. Adding new variants is not considered
12057    /// a breaking change. Applications should write their code in anticipation of:
12058    ///
12059    /// - New values appearing in future releases of the client library, **and**
12060    /// - New values received dynamically, without application changes.
12061    ///
12062    /// Please consult the [Working with enums] section in the user guide for some
12063    /// guidelines.
12064    ///
12065    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12066    #[derive(Clone, Debug, PartialEq)]
12067    #[non_exhaustive]
12068    pub enum SourceType {
12069        /// Source type not specified.
12070        Unspecified,
12071        /// GCP external load balancer.
12072        GcpXlb,
12073        /// GCP internal load balancer.
12074        GcpIlb,
12075        /// If set, the enum was initialized with an unknown value.
12076        ///
12077        /// Applications can examine the value using [SourceType::value] or
12078        /// [SourceType::name].
12079        UnknownValue(source_type::UnknownValue),
12080    }
12081
12082    #[doc(hidden)]
12083    pub mod source_type {
12084        #[allow(unused_imports)]
12085        use super::*;
12086        #[derive(Clone, Debug, PartialEq)]
12087        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12088    }
12089
12090    impl SourceType {
12091        /// Gets the enum value.
12092        ///
12093        /// Returns `None` if the enum contains an unknown value deserialized from
12094        /// the string representation of enums.
12095        pub fn value(&self) -> std::option::Option<i32> {
12096            match self {
12097                Self::Unspecified => std::option::Option::Some(0),
12098                Self::GcpXlb => std::option::Option::Some(1),
12099                Self::GcpIlb => std::option::Option::Some(2),
12100                Self::UnknownValue(u) => u.0.value(),
12101            }
12102        }
12103
12104        /// Gets the enum value as a string.
12105        ///
12106        /// Returns `None` if the enum contains an unknown value deserialized from
12107        /// the integer representation of enums.
12108        pub fn name(&self) -> std::option::Option<&str> {
12109            match self {
12110                Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
12111                Self::GcpXlb => std::option::Option::Some("GCP_XLB"),
12112                Self::GcpIlb => std::option::Option::Some("GCP_ILB"),
12113                Self::UnknownValue(u) => u.0.name(),
12114            }
12115        }
12116    }
12117
12118    impl std::default::Default for SourceType {
12119        fn default() -> Self {
12120            use std::convert::From;
12121            Self::from(0)
12122        }
12123    }
12124
12125    impl std::fmt::Display for SourceType {
12126        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12127            wkt::internal::display_enum(f, self.name(), self.value())
12128        }
12129    }
12130
12131    impl std::convert::From<i32> for SourceType {
12132        fn from(value: i32) -> Self {
12133            match value {
12134                0 => Self::Unspecified,
12135                1 => Self::GcpXlb,
12136                2 => Self::GcpIlb,
12137                _ => Self::UnknownValue(source_type::UnknownValue(
12138                    wkt::internal::UnknownEnumValue::Integer(value),
12139                )),
12140            }
12141        }
12142    }
12143
12144    impl std::convert::From<&str> for SourceType {
12145        fn from(value: &str) -> Self {
12146            use std::string::ToString;
12147            match value {
12148                "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12149                "GCP_XLB" => Self::GcpXlb,
12150                "GCP_ILB" => Self::GcpIlb,
12151                _ => Self::UnknownValue(source_type::UnknownValue(
12152                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12153                )),
12154            }
12155        }
12156    }
12157
12158    impl serde::ser::Serialize for SourceType {
12159        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12160        where
12161            S: serde::Serializer,
12162        {
12163            match self {
12164                Self::Unspecified => serializer.serialize_i32(0),
12165                Self::GcpXlb => serializer.serialize_i32(1),
12166                Self::GcpIlb => serializer.serialize_i32(2),
12167                Self::UnknownValue(u) => u.0.serialize(serializer),
12168            }
12169        }
12170    }
12171
12172    impl<'de> serde::de::Deserialize<'de> for SourceType {
12173        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12174        where
12175            D: serde::Deserializer<'de>,
12176        {
12177            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
12178                ".google.cloud.apihub.v1.DiscoveredApiObservation.SourceType",
12179            ))
12180        }
12181    }
12182}
12183
12184/// DiscoveredApiOperation represents an API Operation observed in one of the
12185/// sources.
12186#[derive(Clone, Default, PartialEq)]
12187#[non_exhaustive]
12188pub struct DiscoveredApiOperation {
12189    /// Identifier. The name of the discovered API Operation.
12190    ///
12191    /// Format:
12192    /// `projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}/discoveredApiOperations/{discovered_api_operation}`
12193    pub name: std::string::String,
12194
12195    /// Optional. First seen time stamp
12196    pub first_seen_time: std::option::Option<wkt::Timestamp>,
12197
12198    /// Optional. Last seen time stamp
12199    pub last_seen_time: std::option::Option<wkt::Timestamp>,
12200
12201    /// Optional. The number of occurrences of this API Operation.
12202    pub count: i64,
12203
12204    /// Output only. The classification of the discovered API operation.
12205    pub classification: crate::model::discovered_api_operation::Classification,
12206
12207    /// Output only. The list of matched results for the discovered API operation.
12208    /// This will be populated only if the classification is known. The current
12209    /// usecase is for a single match. Keeping it repeated to support multiple
12210    /// matches in future.
12211    pub match_results: std::vec::Vec<crate::model::discovered_api_operation::MatchResult>,
12212
12213    /// Output only. The metadata of the source from which the api operation was
12214    /// collected.
12215    pub source_metadata: std::option::Option<crate::model::SourceMetadata>,
12216
12217    /// Output only. Create time stamp of the discovered API operation in API Hub.
12218    pub create_time: std::option::Option<wkt::Timestamp>,
12219
12220    /// Output only. Update time stamp of the discovered API operation in API Hub.
12221    pub update_time: std::option::Option<wkt::Timestamp>,
12222
12223    /// ApiOperation protocol style
12224    pub operation: std::option::Option<crate::model::discovered_api_operation::Operation>,
12225
12226    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12227}
12228
12229impl DiscoveredApiOperation {
12230    pub fn new() -> Self {
12231        std::default::Default::default()
12232    }
12233
12234    /// Sets the value of [name][crate::model::DiscoveredApiOperation::name].
12235    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12236        self.name = v.into();
12237        self
12238    }
12239
12240    /// Sets the value of [first_seen_time][crate::model::DiscoveredApiOperation::first_seen_time].
12241    pub fn set_first_seen_time<T>(mut self, v: T) -> Self
12242    where
12243        T: std::convert::Into<wkt::Timestamp>,
12244    {
12245        self.first_seen_time = std::option::Option::Some(v.into());
12246        self
12247    }
12248
12249    /// Sets or clears the value of [first_seen_time][crate::model::DiscoveredApiOperation::first_seen_time].
12250    pub fn set_or_clear_first_seen_time<T>(mut self, v: std::option::Option<T>) -> Self
12251    where
12252        T: std::convert::Into<wkt::Timestamp>,
12253    {
12254        self.first_seen_time = v.map(|x| x.into());
12255        self
12256    }
12257
12258    /// Sets the value of [last_seen_time][crate::model::DiscoveredApiOperation::last_seen_time].
12259    pub fn set_last_seen_time<T>(mut self, v: T) -> Self
12260    where
12261        T: std::convert::Into<wkt::Timestamp>,
12262    {
12263        self.last_seen_time = std::option::Option::Some(v.into());
12264        self
12265    }
12266
12267    /// Sets or clears the value of [last_seen_time][crate::model::DiscoveredApiOperation::last_seen_time].
12268    pub fn set_or_clear_last_seen_time<T>(mut self, v: std::option::Option<T>) -> Self
12269    where
12270        T: std::convert::Into<wkt::Timestamp>,
12271    {
12272        self.last_seen_time = v.map(|x| x.into());
12273        self
12274    }
12275
12276    /// Sets the value of [count][crate::model::DiscoveredApiOperation::count].
12277    pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12278        self.count = v.into();
12279        self
12280    }
12281
12282    /// Sets the value of [classification][crate::model::DiscoveredApiOperation::classification].
12283    pub fn set_classification<
12284        T: std::convert::Into<crate::model::discovered_api_operation::Classification>,
12285    >(
12286        mut self,
12287        v: T,
12288    ) -> Self {
12289        self.classification = v.into();
12290        self
12291    }
12292
12293    /// Sets the value of [match_results][crate::model::DiscoveredApiOperation::match_results].
12294    pub fn set_match_results<T, V>(mut self, v: T) -> Self
12295    where
12296        T: std::iter::IntoIterator<Item = V>,
12297        V: std::convert::Into<crate::model::discovered_api_operation::MatchResult>,
12298    {
12299        use std::iter::Iterator;
12300        self.match_results = v.into_iter().map(|i| i.into()).collect();
12301        self
12302    }
12303
12304    /// Sets the value of [source_metadata][crate::model::DiscoveredApiOperation::source_metadata].
12305    pub fn set_source_metadata<T>(mut self, v: T) -> Self
12306    where
12307        T: std::convert::Into<crate::model::SourceMetadata>,
12308    {
12309        self.source_metadata = std::option::Option::Some(v.into());
12310        self
12311    }
12312
12313    /// Sets or clears the value of [source_metadata][crate::model::DiscoveredApiOperation::source_metadata].
12314    pub fn set_or_clear_source_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12315    where
12316        T: std::convert::Into<crate::model::SourceMetadata>,
12317    {
12318        self.source_metadata = v.map(|x| x.into());
12319        self
12320    }
12321
12322    /// Sets the value of [create_time][crate::model::DiscoveredApiOperation::create_time].
12323    pub fn set_create_time<T>(mut self, v: T) -> Self
12324    where
12325        T: std::convert::Into<wkt::Timestamp>,
12326    {
12327        self.create_time = std::option::Option::Some(v.into());
12328        self
12329    }
12330
12331    /// Sets or clears the value of [create_time][crate::model::DiscoveredApiOperation::create_time].
12332    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12333    where
12334        T: std::convert::Into<wkt::Timestamp>,
12335    {
12336        self.create_time = v.map(|x| x.into());
12337        self
12338    }
12339
12340    /// Sets the value of [update_time][crate::model::DiscoveredApiOperation::update_time].
12341    pub fn set_update_time<T>(mut self, v: T) -> Self
12342    where
12343        T: std::convert::Into<wkt::Timestamp>,
12344    {
12345        self.update_time = std::option::Option::Some(v.into());
12346        self
12347    }
12348
12349    /// Sets or clears the value of [update_time][crate::model::DiscoveredApiOperation::update_time].
12350    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12351    where
12352        T: std::convert::Into<wkt::Timestamp>,
12353    {
12354        self.update_time = v.map(|x| x.into());
12355        self
12356    }
12357
12358    /// Sets the value of [operation][crate::model::DiscoveredApiOperation::operation].
12359    ///
12360    /// Note that all the setters affecting `operation` are mutually
12361    /// exclusive.
12362    pub fn set_operation<
12363        T: std::convert::Into<std::option::Option<crate::model::discovered_api_operation::Operation>>,
12364    >(
12365        mut self,
12366        v: T,
12367    ) -> Self {
12368        self.operation = v.into();
12369        self
12370    }
12371
12372    /// The value of [operation][crate::model::DiscoveredApiOperation::operation]
12373    /// if it holds a `HttpOperation`, `None` if the field is not set or
12374    /// holds a different branch.
12375    pub fn http_operation(
12376        &self,
12377    ) -> std::option::Option<&std::boxed::Box<crate::model::HttpOperationDetails>> {
12378        #[allow(unreachable_patterns)]
12379        self.operation.as_ref().and_then(|v| match v {
12380            crate::model::discovered_api_operation::Operation::HttpOperation(v) => {
12381                std::option::Option::Some(v)
12382            }
12383            _ => std::option::Option::None,
12384        })
12385    }
12386
12387    /// Sets the value of [operation][crate::model::DiscoveredApiOperation::operation]
12388    /// to hold a `HttpOperation`.
12389    ///
12390    /// Note that all the setters affecting `operation` are
12391    /// mutually exclusive.
12392    pub fn set_http_operation<
12393        T: std::convert::Into<std::boxed::Box<crate::model::HttpOperationDetails>>,
12394    >(
12395        mut self,
12396        v: T,
12397    ) -> Self {
12398        self.operation = std::option::Option::Some(
12399            crate::model::discovered_api_operation::Operation::HttpOperation(v.into()),
12400        );
12401        self
12402    }
12403}
12404
12405impl wkt::message::Message for DiscoveredApiOperation {
12406    fn typename() -> &'static str {
12407        "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiOperation"
12408    }
12409}
12410
12411/// Defines additional types related to [DiscoveredApiOperation].
12412pub mod discovered_api_operation {
12413    #[allow(unused_imports)]
12414    use super::*;
12415
12416    /// MatchResult represents the result of matching a discovered API operation
12417    /// with a catalog API operation.
12418    #[derive(Clone, Default, PartialEq)]
12419    #[non_exhaustive]
12420    pub struct MatchResult {
12421        /// Output only. The name of the matched API Operation.
12422        ///
12423        /// Format:
12424        /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
12425        pub name: std::string::String,
12426
12427        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12428    }
12429
12430    impl MatchResult {
12431        pub fn new() -> Self {
12432            std::default::Default::default()
12433        }
12434
12435        /// Sets the value of [name][crate::model::discovered_api_operation::MatchResult::name].
12436        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12437            self.name = v.into();
12438            self
12439        }
12440    }
12441
12442    impl wkt::message::Message for MatchResult {
12443        fn typename() -> &'static str {
12444            "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiOperation.MatchResult"
12445        }
12446    }
12447
12448    /// The classification of the discovered API operation.
12449    ///
12450    /// # Working with unknown values
12451    ///
12452    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12453    /// additional enum variants at any time. Adding new variants is not considered
12454    /// a breaking change. Applications should write their code in anticipation of:
12455    ///
12456    /// - New values appearing in future releases of the client library, **and**
12457    /// - New values received dynamically, without application changes.
12458    ///
12459    /// Please consult the [Working with enums] section in the user guide for some
12460    /// guidelines.
12461    ///
12462    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12463    #[derive(Clone, Debug, PartialEq)]
12464    #[non_exhaustive]
12465    pub enum Classification {
12466        /// Operation is not classified as known or unknown.
12467        Unspecified,
12468        /// Operation has a matched catalog operation.
12469        Known,
12470        /// Operation does not have a matched catalog operation.
12471        Unknown,
12472        /// If set, the enum was initialized with an unknown value.
12473        ///
12474        /// Applications can examine the value using [Classification::value] or
12475        /// [Classification::name].
12476        UnknownValue(classification::UnknownValue),
12477    }
12478
12479    #[doc(hidden)]
12480    pub mod classification {
12481        #[allow(unused_imports)]
12482        use super::*;
12483        #[derive(Clone, Debug, PartialEq)]
12484        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12485    }
12486
12487    impl Classification {
12488        /// Gets the enum value.
12489        ///
12490        /// Returns `None` if the enum contains an unknown value deserialized from
12491        /// the string representation of enums.
12492        pub fn value(&self) -> std::option::Option<i32> {
12493            match self {
12494                Self::Unspecified => std::option::Option::Some(0),
12495                Self::Known => std::option::Option::Some(1),
12496                Self::Unknown => std::option::Option::Some(2),
12497                Self::UnknownValue(u) => u.0.value(),
12498            }
12499        }
12500
12501        /// Gets the enum value as a string.
12502        ///
12503        /// Returns `None` if the enum contains an unknown value deserialized from
12504        /// the integer representation of enums.
12505        pub fn name(&self) -> std::option::Option<&str> {
12506            match self {
12507                Self::Unspecified => std::option::Option::Some("CLASSIFICATION_UNSPECIFIED"),
12508                Self::Known => std::option::Option::Some("KNOWN"),
12509                Self::Unknown => std::option::Option::Some("UNKNOWN"),
12510                Self::UnknownValue(u) => u.0.name(),
12511            }
12512        }
12513    }
12514
12515    impl std::default::Default for Classification {
12516        fn default() -> Self {
12517            use std::convert::From;
12518            Self::from(0)
12519        }
12520    }
12521
12522    impl std::fmt::Display for Classification {
12523        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12524            wkt::internal::display_enum(f, self.name(), self.value())
12525        }
12526    }
12527
12528    impl std::convert::From<i32> for Classification {
12529        fn from(value: i32) -> Self {
12530            match value {
12531                0 => Self::Unspecified,
12532                1 => Self::Known,
12533                2 => Self::Unknown,
12534                _ => Self::UnknownValue(classification::UnknownValue(
12535                    wkt::internal::UnknownEnumValue::Integer(value),
12536                )),
12537            }
12538        }
12539    }
12540
12541    impl std::convert::From<&str> for Classification {
12542        fn from(value: &str) -> Self {
12543            use std::string::ToString;
12544            match value {
12545                "CLASSIFICATION_UNSPECIFIED" => Self::Unspecified,
12546                "KNOWN" => Self::Known,
12547                "UNKNOWN" => Self::Unknown,
12548                _ => Self::UnknownValue(classification::UnknownValue(
12549                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12550                )),
12551            }
12552        }
12553    }
12554
12555    impl serde::ser::Serialize for Classification {
12556        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12557        where
12558            S: serde::Serializer,
12559        {
12560            match self {
12561                Self::Unspecified => serializer.serialize_i32(0),
12562                Self::Known => serializer.serialize_i32(1),
12563                Self::Unknown => serializer.serialize_i32(2),
12564                Self::UnknownValue(u) => u.0.serialize(serializer),
12565            }
12566        }
12567    }
12568
12569    impl<'de> serde::de::Deserialize<'de> for Classification {
12570        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12571        where
12572            D: serde::Deserializer<'de>,
12573        {
12574            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Classification>::new(
12575                ".google.cloud.apihub.v1.DiscoveredApiOperation.Classification",
12576            ))
12577        }
12578    }
12579
12580    /// ApiOperation protocol style
12581    #[derive(Clone, Debug, PartialEq)]
12582    #[non_exhaustive]
12583    pub enum Operation {
12584        /// Optional. An HTTP Operation.
12585        HttpOperation(std::boxed::Box<crate::model::HttpOperationDetails>),
12586    }
12587}
12588
12589/// An HTTP-based API Operation, sometimes called a "REST" Operation.
12590#[derive(Clone, Default, PartialEq)]
12591#[non_exhaustive]
12592pub struct HttpOperationDetails {
12593    /// Required. An HTTP Operation.
12594    pub http_operation: std::option::Option<crate::model::HttpOperation>,
12595
12596    /// Optional. Path params of HttpOperation
12597    pub path_params: std::vec::Vec<crate::model::http_operation_details::PathParam>,
12598
12599    /// Optional. Query params of HttpOperation
12600    pub query_params: std::collections::HashMap<
12601        std::string::String,
12602        crate::model::http_operation_details::QueryParam,
12603    >,
12604
12605    /// Optional. Request metadata.
12606    pub request: std::option::Option<crate::model::http_operation_details::HttpRequest>,
12607
12608    /// Optional. Response metadata.
12609    pub response: std::option::Option<crate::model::http_operation_details::HttpResponse>,
12610
12611    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12612}
12613
12614impl HttpOperationDetails {
12615    pub fn new() -> Self {
12616        std::default::Default::default()
12617    }
12618
12619    /// Sets the value of [http_operation][crate::model::HttpOperationDetails::http_operation].
12620    pub fn set_http_operation<T>(mut self, v: T) -> Self
12621    where
12622        T: std::convert::Into<crate::model::HttpOperation>,
12623    {
12624        self.http_operation = std::option::Option::Some(v.into());
12625        self
12626    }
12627
12628    /// Sets or clears the value of [http_operation][crate::model::HttpOperationDetails::http_operation].
12629    pub fn set_or_clear_http_operation<T>(mut self, v: std::option::Option<T>) -> Self
12630    where
12631        T: std::convert::Into<crate::model::HttpOperation>,
12632    {
12633        self.http_operation = v.map(|x| x.into());
12634        self
12635    }
12636
12637    /// Sets the value of [path_params][crate::model::HttpOperationDetails::path_params].
12638    pub fn set_path_params<T, V>(mut self, v: T) -> Self
12639    where
12640        T: std::iter::IntoIterator<Item = V>,
12641        V: std::convert::Into<crate::model::http_operation_details::PathParam>,
12642    {
12643        use std::iter::Iterator;
12644        self.path_params = v.into_iter().map(|i| i.into()).collect();
12645        self
12646    }
12647
12648    /// Sets the value of [query_params][crate::model::HttpOperationDetails::query_params].
12649    pub fn set_query_params<T, K, V>(mut self, v: T) -> Self
12650    where
12651        T: std::iter::IntoIterator<Item = (K, V)>,
12652        K: std::convert::Into<std::string::String>,
12653        V: std::convert::Into<crate::model::http_operation_details::QueryParam>,
12654    {
12655        use std::iter::Iterator;
12656        self.query_params = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12657        self
12658    }
12659
12660    /// Sets the value of [request][crate::model::HttpOperationDetails::request].
12661    pub fn set_request<T>(mut self, v: T) -> Self
12662    where
12663        T: std::convert::Into<crate::model::http_operation_details::HttpRequest>,
12664    {
12665        self.request = std::option::Option::Some(v.into());
12666        self
12667    }
12668
12669    /// Sets or clears the value of [request][crate::model::HttpOperationDetails::request].
12670    pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
12671    where
12672        T: std::convert::Into<crate::model::http_operation_details::HttpRequest>,
12673    {
12674        self.request = v.map(|x| x.into());
12675        self
12676    }
12677
12678    /// Sets the value of [response][crate::model::HttpOperationDetails::response].
12679    pub fn set_response<T>(mut self, v: T) -> Self
12680    where
12681        T: std::convert::Into<crate::model::http_operation_details::HttpResponse>,
12682    {
12683        self.response = std::option::Option::Some(v.into());
12684        self
12685    }
12686
12687    /// Sets or clears the value of [response][crate::model::HttpOperationDetails::response].
12688    pub fn set_or_clear_response<T>(mut self, v: std::option::Option<T>) -> Self
12689    where
12690        T: std::convert::Into<crate::model::http_operation_details::HttpResponse>,
12691    {
12692        self.response = v.map(|x| x.into());
12693        self
12694    }
12695}
12696
12697impl wkt::message::Message for HttpOperationDetails {
12698    fn typename() -> &'static str {
12699        "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails"
12700    }
12701}
12702
12703/// Defines additional types related to [HttpOperationDetails].
12704pub mod http_operation_details {
12705    #[allow(unused_imports)]
12706    use super::*;
12707
12708    /// HTTP Path parameter.
12709    #[derive(Clone, Default, PartialEq)]
12710    #[non_exhaustive]
12711    pub struct PathParam {
12712        /// Optional. Segment location in the path, 1-indexed
12713        pub position: i32,
12714
12715        /// Optional. Data type of path param
12716        pub data_type: crate::model::http_operation_details::DataType,
12717
12718        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12719    }
12720
12721    impl PathParam {
12722        pub fn new() -> Self {
12723            std::default::Default::default()
12724        }
12725
12726        /// Sets the value of [position][crate::model::http_operation_details::PathParam::position].
12727        pub fn set_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12728            self.position = v.into();
12729            self
12730        }
12731
12732        /// Sets the value of [data_type][crate::model::http_operation_details::PathParam::data_type].
12733        pub fn set_data_type<
12734            T: std::convert::Into<crate::model::http_operation_details::DataType>,
12735        >(
12736            mut self,
12737            v: T,
12738        ) -> Self {
12739            self.data_type = v.into();
12740            self
12741        }
12742    }
12743
12744    impl wkt::message::Message for PathParam {
12745        fn typename() -> &'static str {
12746            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.PathParam"
12747        }
12748    }
12749
12750    /// An aggregation of HTTP query parameter occurrences.
12751    #[derive(Clone, Default, PartialEq)]
12752    #[non_exhaustive]
12753    pub struct QueryParam {
12754        /// Required. Name of query param
12755        pub name: std::string::String,
12756
12757        /// Optional. The number of occurrences of this query parameter across
12758        /// transactions.
12759        pub count: i64,
12760
12761        /// Optional. Data type of path param
12762        pub data_type: crate::model::http_operation_details::DataType,
12763
12764        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12765    }
12766
12767    impl QueryParam {
12768        pub fn new() -> Self {
12769            std::default::Default::default()
12770        }
12771
12772        /// Sets the value of [name][crate::model::http_operation_details::QueryParam::name].
12773        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12774            self.name = v.into();
12775            self
12776        }
12777
12778        /// Sets the value of [count][crate::model::http_operation_details::QueryParam::count].
12779        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12780            self.count = v.into();
12781            self
12782        }
12783
12784        /// Sets the value of [data_type][crate::model::http_operation_details::QueryParam::data_type].
12785        pub fn set_data_type<
12786            T: std::convert::Into<crate::model::http_operation_details::DataType>,
12787        >(
12788            mut self,
12789            v: T,
12790        ) -> Self {
12791            self.data_type = v.into();
12792            self
12793        }
12794    }
12795
12796    impl wkt::message::Message for QueryParam {
12797        fn typename() -> &'static str {
12798            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.QueryParam"
12799        }
12800    }
12801
12802    /// An aggregation of HTTP header occurrences.
12803    #[derive(Clone, Default, PartialEq)]
12804    #[non_exhaustive]
12805    pub struct Header {
12806        /// Header name.
12807        pub name: std::string::String,
12808
12809        /// The number of occurrences of this Header across transactions.
12810        pub count: i64,
12811
12812        /// Data type of header
12813        pub data_type: crate::model::http_operation_details::DataType,
12814
12815        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12816    }
12817
12818    impl Header {
12819        pub fn new() -> Self {
12820            std::default::Default::default()
12821        }
12822
12823        /// Sets the value of [name][crate::model::http_operation_details::Header::name].
12824        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12825            self.name = v.into();
12826            self
12827        }
12828
12829        /// Sets the value of [count][crate::model::http_operation_details::Header::count].
12830        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12831            self.count = v.into();
12832            self
12833        }
12834
12835        /// Sets the value of [data_type][crate::model::http_operation_details::Header::data_type].
12836        pub fn set_data_type<
12837            T: std::convert::Into<crate::model::http_operation_details::DataType>,
12838        >(
12839            mut self,
12840            v: T,
12841        ) -> Self {
12842            self.data_type = v.into();
12843            self
12844        }
12845    }
12846
12847    impl wkt::message::Message for Header {
12848        fn typename() -> &'static str {
12849            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.Header"
12850        }
12851    }
12852
12853    /// An aggregation of HTTP requests.
12854    #[derive(Clone, Default, PartialEq)]
12855    #[non_exhaustive]
12856    pub struct HttpRequest {
12857        /// Optional. Unordered map from header name to header metadata
12858        pub headers: std::collections::HashMap<
12859            std::string::String,
12860            crate::model::http_operation_details::Header,
12861        >,
12862
12863        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12864    }
12865
12866    impl HttpRequest {
12867        pub fn new() -> Self {
12868            std::default::Default::default()
12869        }
12870
12871        /// Sets the value of [headers][crate::model::http_operation_details::HttpRequest::headers].
12872        pub fn set_headers<T, K, V>(mut self, v: T) -> Self
12873        where
12874            T: std::iter::IntoIterator<Item = (K, V)>,
12875            K: std::convert::Into<std::string::String>,
12876            V: std::convert::Into<crate::model::http_operation_details::Header>,
12877        {
12878            use std::iter::Iterator;
12879            self.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12880            self
12881        }
12882    }
12883
12884    impl wkt::message::Message for HttpRequest {
12885        fn typename() -> &'static str {
12886            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.HttpRequest"
12887        }
12888    }
12889
12890    /// An aggregation of HTTP responses.
12891    #[derive(Clone, Default, PartialEq)]
12892    #[non_exhaustive]
12893    pub struct HttpResponse {
12894        /// Optional. Unordered map from header name to header metadata
12895        pub headers: std::collections::HashMap<
12896            std::string::String,
12897            crate::model::http_operation_details::Header,
12898        >,
12899
12900        /// Optional. Map of status code to observed count
12901        pub response_codes: std::collections::HashMap<i32, i64>,
12902
12903        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12904    }
12905
12906    impl HttpResponse {
12907        pub fn new() -> Self {
12908            std::default::Default::default()
12909        }
12910
12911        /// Sets the value of [headers][crate::model::http_operation_details::HttpResponse::headers].
12912        pub fn set_headers<T, K, V>(mut self, v: T) -> Self
12913        where
12914            T: std::iter::IntoIterator<Item = (K, V)>,
12915            K: std::convert::Into<std::string::String>,
12916            V: std::convert::Into<crate::model::http_operation_details::Header>,
12917        {
12918            use std::iter::Iterator;
12919            self.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12920            self
12921        }
12922
12923        /// Sets the value of [response_codes][crate::model::http_operation_details::HttpResponse::response_codes].
12924        pub fn set_response_codes<T, K, V>(mut self, v: T) -> Self
12925        where
12926            T: std::iter::IntoIterator<Item = (K, V)>,
12927            K: std::convert::Into<i32>,
12928            V: std::convert::Into<i64>,
12929        {
12930            use std::iter::Iterator;
12931            self.response_codes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12932            self
12933        }
12934    }
12935
12936    impl wkt::message::Message for HttpResponse {
12937        fn typename() -> &'static str {
12938            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.HttpResponse"
12939        }
12940    }
12941
12942    /// Type of data
12943    ///
12944    /// # Working with unknown values
12945    ///
12946    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12947    /// additional enum variants at any time. Adding new variants is not considered
12948    /// a breaking change. Applications should write their code in anticipation of:
12949    ///
12950    /// - New values appearing in future releases of the client library, **and**
12951    /// - New values received dynamically, without application changes.
12952    ///
12953    /// Please consult the [Working with enums] section in the user guide for some
12954    /// guidelines.
12955    ///
12956    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12957    #[derive(Clone, Debug, PartialEq)]
12958    #[non_exhaustive]
12959    pub enum DataType {
12960        /// Unspecified data type
12961        Unspecified,
12962        /// Boolean data type
12963        Bool,
12964        /// Integer data type
12965        Integer,
12966        /// Float data type
12967        Float,
12968        /// String data type
12969        String,
12970        /// UUID data type
12971        Uuid,
12972        /// If set, the enum was initialized with an unknown value.
12973        ///
12974        /// Applications can examine the value using [DataType::value] or
12975        /// [DataType::name].
12976        UnknownValue(data_type::UnknownValue),
12977    }
12978
12979    #[doc(hidden)]
12980    pub mod data_type {
12981        #[allow(unused_imports)]
12982        use super::*;
12983        #[derive(Clone, Debug, PartialEq)]
12984        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12985    }
12986
12987    impl DataType {
12988        /// Gets the enum value.
12989        ///
12990        /// Returns `None` if the enum contains an unknown value deserialized from
12991        /// the string representation of enums.
12992        pub fn value(&self) -> std::option::Option<i32> {
12993            match self {
12994                Self::Unspecified => std::option::Option::Some(0),
12995                Self::Bool => std::option::Option::Some(1),
12996                Self::Integer => std::option::Option::Some(2),
12997                Self::Float => std::option::Option::Some(3),
12998                Self::String => std::option::Option::Some(4),
12999                Self::Uuid => std::option::Option::Some(5),
13000                Self::UnknownValue(u) => u.0.value(),
13001            }
13002        }
13003
13004        /// Gets the enum value as a string.
13005        ///
13006        /// Returns `None` if the enum contains an unknown value deserialized from
13007        /// the integer representation of enums.
13008        pub fn name(&self) -> std::option::Option<&str> {
13009            match self {
13010                Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
13011                Self::Bool => std::option::Option::Some("BOOL"),
13012                Self::Integer => std::option::Option::Some("INTEGER"),
13013                Self::Float => std::option::Option::Some("FLOAT"),
13014                Self::String => std::option::Option::Some("STRING"),
13015                Self::Uuid => std::option::Option::Some("UUID"),
13016                Self::UnknownValue(u) => u.0.name(),
13017            }
13018        }
13019    }
13020
13021    impl std::default::Default for DataType {
13022        fn default() -> Self {
13023            use std::convert::From;
13024            Self::from(0)
13025        }
13026    }
13027
13028    impl std::fmt::Display for DataType {
13029        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13030            wkt::internal::display_enum(f, self.name(), self.value())
13031        }
13032    }
13033
13034    impl std::convert::From<i32> for DataType {
13035        fn from(value: i32) -> Self {
13036            match value {
13037                0 => Self::Unspecified,
13038                1 => Self::Bool,
13039                2 => Self::Integer,
13040                3 => Self::Float,
13041                4 => Self::String,
13042                5 => Self::Uuid,
13043                _ => Self::UnknownValue(data_type::UnknownValue(
13044                    wkt::internal::UnknownEnumValue::Integer(value),
13045                )),
13046            }
13047        }
13048    }
13049
13050    impl std::convert::From<&str> for DataType {
13051        fn from(value: &str) -> Self {
13052            use std::string::ToString;
13053            match value {
13054                "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
13055                "BOOL" => Self::Bool,
13056                "INTEGER" => Self::Integer,
13057                "FLOAT" => Self::Float,
13058                "STRING" => Self::String,
13059                "UUID" => Self::Uuid,
13060                _ => Self::UnknownValue(data_type::UnknownValue(
13061                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13062                )),
13063            }
13064        }
13065    }
13066
13067    impl serde::ser::Serialize for DataType {
13068        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13069        where
13070            S: serde::Serializer,
13071        {
13072            match self {
13073                Self::Unspecified => serializer.serialize_i32(0),
13074                Self::Bool => serializer.serialize_i32(1),
13075                Self::Integer => serializer.serialize_i32(2),
13076                Self::Float => serializer.serialize_i32(3),
13077                Self::String => serializer.serialize_i32(4),
13078                Self::Uuid => serializer.serialize_i32(5),
13079                Self::UnknownValue(u) => u.0.serialize(serializer),
13080            }
13081        }
13082    }
13083
13084    impl<'de> serde::de::Deserialize<'de> for DataType {
13085        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13086        where
13087            D: serde::Deserializer<'de>,
13088        {
13089            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
13090                ".google.cloud.apihub.v1.HttpOperationDetails.DataType",
13091            ))
13092        }
13093    }
13094}
13095
13096/// The [CreateCuration][ApiHub.CreateCuration] method's request.
13097#[derive(Clone, Default, PartialEq)]
13098#[non_exhaustive]
13099pub struct CreateCurationRequest {
13100    /// Required. The parent resource for the curation resource.
13101    /// Format: `projects/{project}/locations/{location}`
13102    pub parent: std::string::String,
13103
13104    /// Optional. The ID to use for the curation resource, which will become the
13105    /// final component of the curations's resource name. This field is optional.
13106    ///
13107    /// * If provided, the same will be used. The service will throw an error if
13108    ///   the specified ID is already used by another curation resource in the API
13109    ///   hub.
13110    /// * If not provided, a system generated ID will be used.
13111    ///
13112    /// This value should be 4-500 characters, and valid characters
13113    /// are /[a-z][A-Z][0-9]-_/.
13114    pub curation_id: std::string::String,
13115
13116    /// Required. The curation resource to create.
13117    pub curation: std::option::Option<crate::model::Curation>,
13118
13119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13120}
13121
13122impl CreateCurationRequest {
13123    pub fn new() -> Self {
13124        std::default::Default::default()
13125    }
13126
13127    /// Sets the value of [parent][crate::model::CreateCurationRequest::parent].
13128    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13129        self.parent = v.into();
13130        self
13131    }
13132
13133    /// Sets the value of [curation_id][crate::model::CreateCurationRequest::curation_id].
13134    pub fn set_curation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13135        self.curation_id = v.into();
13136        self
13137    }
13138
13139    /// Sets the value of [curation][crate::model::CreateCurationRequest::curation].
13140    pub fn set_curation<T>(mut self, v: T) -> Self
13141    where
13142        T: std::convert::Into<crate::model::Curation>,
13143    {
13144        self.curation = std::option::Option::Some(v.into());
13145        self
13146    }
13147
13148    /// Sets or clears the value of [curation][crate::model::CreateCurationRequest::curation].
13149    pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
13150    where
13151        T: std::convert::Into<crate::model::Curation>,
13152    {
13153        self.curation = v.map(|x| x.into());
13154        self
13155    }
13156}
13157
13158impl wkt::message::Message for CreateCurationRequest {
13159    fn typename() -> &'static str {
13160        "type.googleapis.com/google.cloud.apihub.v1.CreateCurationRequest"
13161    }
13162}
13163
13164/// The [GetCuration][ApiHub.GetCuration] method's request.
13165#[derive(Clone, Default, PartialEq)]
13166#[non_exhaustive]
13167pub struct GetCurationRequest {
13168    /// Required. The name of the curation resource to retrieve.
13169    /// Format: `projects/{project}/locations/{location}/curations/{curation}`
13170    pub name: std::string::String,
13171
13172    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13173}
13174
13175impl GetCurationRequest {
13176    pub fn new() -> Self {
13177        std::default::Default::default()
13178    }
13179
13180    /// Sets the value of [name][crate::model::GetCurationRequest::name].
13181    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13182        self.name = v.into();
13183        self
13184    }
13185}
13186
13187impl wkt::message::Message for GetCurationRequest {
13188    fn typename() -> &'static str {
13189        "type.googleapis.com/google.cloud.apihub.v1.GetCurationRequest"
13190    }
13191}
13192
13193/// The [UpdateCuration][ApiHub.UpdateCuration] method's request.
13194#[derive(Clone, Default, PartialEq)]
13195#[non_exhaustive]
13196pub struct UpdateCurationRequest {
13197    /// Required. The curation resource to update.
13198    ///
13199    /// The curation resource's `name` field is used to identify the curation
13200    /// resource to update.
13201    /// Format: `projects/{project}/locations/{location}/curations/{curation}`
13202    pub curation: std::option::Option<crate::model::Curation>,
13203
13204    /// Optional. The list of fields to update.
13205    pub update_mask: std::option::Option<wkt::FieldMask>,
13206
13207    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13208}
13209
13210impl UpdateCurationRequest {
13211    pub fn new() -> Self {
13212        std::default::Default::default()
13213    }
13214
13215    /// Sets the value of [curation][crate::model::UpdateCurationRequest::curation].
13216    pub fn set_curation<T>(mut self, v: T) -> Self
13217    where
13218        T: std::convert::Into<crate::model::Curation>,
13219    {
13220        self.curation = std::option::Option::Some(v.into());
13221        self
13222    }
13223
13224    /// Sets or clears the value of [curation][crate::model::UpdateCurationRequest::curation].
13225    pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
13226    where
13227        T: std::convert::Into<crate::model::Curation>,
13228    {
13229        self.curation = v.map(|x| x.into());
13230        self
13231    }
13232
13233    /// Sets the value of [update_mask][crate::model::UpdateCurationRequest::update_mask].
13234    pub fn set_update_mask<T>(mut self, v: T) -> Self
13235    where
13236        T: std::convert::Into<wkt::FieldMask>,
13237    {
13238        self.update_mask = std::option::Option::Some(v.into());
13239        self
13240    }
13241
13242    /// Sets or clears the value of [update_mask][crate::model::UpdateCurationRequest::update_mask].
13243    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13244    where
13245        T: std::convert::Into<wkt::FieldMask>,
13246    {
13247        self.update_mask = v.map(|x| x.into());
13248        self
13249    }
13250}
13251
13252impl wkt::message::Message for UpdateCurationRequest {
13253    fn typename() -> &'static str {
13254        "type.googleapis.com/google.cloud.apihub.v1.UpdateCurationRequest"
13255    }
13256}
13257
13258/// The [DeleteCuration][ApiHub.DeleteCuration] method's request.
13259#[derive(Clone, Default, PartialEq)]
13260#[non_exhaustive]
13261pub struct DeleteCurationRequest {
13262    /// Required. The name of the curation resource to delete.
13263    /// Format: `projects/{project}/locations/{location}/curations/{curation}`
13264    pub name: std::string::String,
13265
13266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13267}
13268
13269impl DeleteCurationRequest {
13270    pub fn new() -> Self {
13271        std::default::Default::default()
13272    }
13273
13274    /// Sets the value of [name][crate::model::DeleteCurationRequest::name].
13275    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13276        self.name = v.into();
13277        self
13278    }
13279}
13280
13281impl wkt::message::Message for DeleteCurationRequest {
13282    fn typename() -> &'static str {
13283        "type.googleapis.com/google.cloud.apihub.v1.DeleteCurationRequest"
13284    }
13285}
13286
13287/// The [ListCurations][ApiHub.ListCurations] method's request.
13288#[derive(Clone, Default, PartialEq)]
13289#[non_exhaustive]
13290pub struct ListCurationsRequest {
13291    /// Required. The parent, which owns this collection of curation resources.
13292    /// Format: `projects/{project}/locations/{location}`
13293    pub parent: std::string::String,
13294
13295    /// Optional. An expression that filters the list of curation resources.
13296    ///
13297    /// A filter expression consists of a field name, a comparison
13298    /// operator, and a value for filtering. The value must be a string. The
13299    /// comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are case
13300    /// insensitive.
13301    ///
13302    /// The following fields in the `curation resource` are eligible for filtering:
13303    ///
13304    /// * `create_time` - The time at which the curation was created.
13305    ///   The value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
13306    ///   format. Allowed comparison operators: `>` and `<`.
13307    /// * `display_name` - The display name of the curation. Allowed
13308    ///   comparison operators: `=`.
13309    /// * `state` - The state of the curation. Allowed comparison operators: `=`.
13310    ///
13311    /// Expressions are combined with either `AND` logic operator or `OR` logical
13312    /// operator but not both of them together i.e. only one of the `AND` or `OR`
13313    /// operator can be used throughout the filter string and both the operators
13314    /// cannot be used together. No other logical operators are supported. At most
13315    /// three filter fields are allowed in the filter string and if provided
13316    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
13317    ///
13318    /// Here are a few examples:
13319    ///
13320    /// * `create_time < \"2021-08-15T14:50:00Z\" AND create_time >
13321    ///   \"2021-08-10T12:00:00Z\"` -
13322    ///   The curation resource was created before _2021-08-15 14:50:00 UTC_ and
13323    ///   after _2021-08-10 12:00:00 UTC_.
13324    pub filter: std::string::String,
13325
13326    /// Optional. The maximum number of curation resources to return. The service
13327    /// may return fewer than this value. If unspecified, at most 50 curations will
13328    /// be returned. The maximum value is 1000; values above 1000 will be coerced
13329    /// to 1000.
13330    pub page_size: i32,
13331
13332    /// Optional. A page token, received from a previous `ListCurations` call.
13333    /// Provide this to retrieve the subsequent page.
13334    ///
13335    /// When paginating, all other parameters (except page_size) provided to
13336    /// `ListCurations` must match the call that provided the page token.
13337    pub page_token: std::string::String,
13338
13339    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13340}
13341
13342impl ListCurationsRequest {
13343    pub fn new() -> Self {
13344        std::default::Default::default()
13345    }
13346
13347    /// Sets the value of [parent][crate::model::ListCurationsRequest::parent].
13348    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13349        self.parent = v.into();
13350        self
13351    }
13352
13353    /// Sets the value of [filter][crate::model::ListCurationsRequest::filter].
13354    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13355        self.filter = v.into();
13356        self
13357    }
13358
13359    /// Sets the value of [page_size][crate::model::ListCurationsRequest::page_size].
13360    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13361        self.page_size = v.into();
13362        self
13363    }
13364
13365    /// Sets the value of [page_token][crate::model::ListCurationsRequest::page_token].
13366    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13367        self.page_token = v.into();
13368        self
13369    }
13370}
13371
13372impl wkt::message::Message for ListCurationsRequest {
13373    fn typename() -> &'static str {
13374        "type.googleapis.com/google.cloud.apihub.v1.ListCurationsRequest"
13375    }
13376}
13377
13378/// The [ListCurations][ApiHub.ListCurations] method's response.
13379#[derive(Clone, Default, PartialEq)]
13380#[non_exhaustive]
13381pub struct ListCurationsResponse {
13382    /// The curation resources present in the API hub.
13383    pub curations: std::vec::Vec<crate::model::Curation>,
13384
13385    /// A token, which can be sent as `page_token` to retrieve the next page.
13386    /// If this field is omitted, there are no subsequent pages.
13387    pub next_page_token: std::string::String,
13388
13389    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13390}
13391
13392impl ListCurationsResponse {
13393    pub fn new() -> Self {
13394        std::default::Default::default()
13395    }
13396
13397    /// Sets the value of [curations][crate::model::ListCurationsResponse::curations].
13398    pub fn set_curations<T, V>(mut self, v: T) -> Self
13399    where
13400        T: std::iter::IntoIterator<Item = V>,
13401        V: std::convert::Into<crate::model::Curation>,
13402    {
13403        use std::iter::Iterator;
13404        self.curations = v.into_iter().map(|i| i.into()).collect();
13405        self
13406    }
13407
13408    /// Sets the value of [next_page_token][crate::model::ListCurationsResponse::next_page_token].
13409    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13410        self.next_page_token = v.into();
13411        self
13412    }
13413}
13414
13415impl wkt::message::Message for ListCurationsResponse {
13416    fn typename() -> &'static str {
13417        "type.googleapis.com/google.cloud.apihub.v1.ListCurationsResponse"
13418    }
13419}
13420
13421#[doc(hidden)]
13422impl gax::paginator::internal::PageableResponse for ListCurationsResponse {
13423    type PageItem = crate::model::Curation;
13424
13425    fn items(self) -> std::vec::Vec<Self::PageItem> {
13426        self.curations
13427    }
13428
13429    fn next_page_token(&self) -> std::string::String {
13430        use std::clone::Clone;
13431        self.next_page_token.clone()
13432    }
13433}
13434
13435/// A curation resource in the API Hub.
13436#[derive(Clone, Default, PartialEq)]
13437#[non_exhaustive]
13438pub struct Curation {
13439    /// Identifier. The name of the curation.
13440    ///
13441    /// Format:
13442    /// `projects/{project}/locations/{location}/curations/{curation}`
13443    pub name: std::string::String,
13444
13445    /// Required. The display name of the curation.
13446    pub display_name: std::string::String,
13447
13448    /// Optional. The description of the curation.
13449    pub description: std::string::String,
13450
13451    /// Required. The endpoint to be triggered for curation.
13452    pub endpoint: std::option::Option<crate::model::Endpoint>,
13453
13454    /// Output only. The plugin instances and associated actions that are using the
13455    /// curation. Note: A particular curation could be used by multiple plugin
13456    /// instances or multiple actions in a plugin instance.
13457    pub plugin_instance_actions: std::vec::Vec<crate::model::curation::PluginInstanceActionID>,
13458
13459    /// Output only. The last execution state of the curation.
13460    pub last_execution_state: crate::model::curation::LastExecutionState,
13461
13462    /// Output only. The error code of the last execution of the curation. The
13463    /// error code is populated only when the last execution state is failed.
13464    pub last_execution_error_code: crate::model::curation::ErrorCode,
13465
13466    /// Output only. Error message describing the failure, if any, during the last
13467    /// execution of the curation.
13468    pub last_execution_error_message: std::string::String,
13469
13470    /// Output only. The time at which the curation was created.
13471    pub create_time: std::option::Option<wkt::Timestamp>,
13472
13473    /// Output only. The time at which the curation was last updated.
13474    pub update_time: std::option::Option<wkt::Timestamp>,
13475
13476    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13477}
13478
13479impl Curation {
13480    pub fn new() -> Self {
13481        std::default::Default::default()
13482    }
13483
13484    /// Sets the value of [name][crate::model::Curation::name].
13485    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13486        self.name = v.into();
13487        self
13488    }
13489
13490    /// Sets the value of [display_name][crate::model::Curation::display_name].
13491    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13492        self.display_name = v.into();
13493        self
13494    }
13495
13496    /// Sets the value of [description][crate::model::Curation::description].
13497    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13498        self.description = v.into();
13499        self
13500    }
13501
13502    /// Sets the value of [endpoint][crate::model::Curation::endpoint].
13503    pub fn set_endpoint<T>(mut self, v: T) -> Self
13504    where
13505        T: std::convert::Into<crate::model::Endpoint>,
13506    {
13507        self.endpoint = std::option::Option::Some(v.into());
13508        self
13509    }
13510
13511    /// Sets or clears the value of [endpoint][crate::model::Curation::endpoint].
13512    pub fn set_or_clear_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
13513    where
13514        T: std::convert::Into<crate::model::Endpoint>,
13515    {
13516        self.endpoint = v.map(|x| x.into());
13517        self
13518    }
13519
13520    /// Sets the value of [plugin_instance_actions][crate::model::Curation::plugin_instance_actions].
13521    pub fn set_plugin_instance_actions<T, V>(mut self, v: T) -> Self
13522    where
13523        T: std::iter::IntoIterator<Item = V>,
13524        V: std::convert::Into<crate::model::curation::PluginInstanceActionID>,
13525    {
13526        use std::iter::Iterator;
13527        self.plugin_instance_actions = v.into_iter().map(|i| i.into()).collect();
13528        self
13529    }
13530
13531    /// Sets the value of [last_execution_state][crate::model::Curation::last_execution_state].
13532    pub fn set_last_execution_state<
13533        T: std::convert::Into<crate::model::curation::LastExecutionState>,
13534    >(
13535        mut self,
13536        v: T,
13537    ) -> Self {
13538        self.last_execution_state = v.into();
13539        self
13540    }
13541
13542    /// Sets the value of [last_execution_error_code][crate::model::Curation::last_execution_error_code].
13543    pub fn set_last_execution_error_code<
13544        T: std::convert::Into<crate::model::curation::ErrorCode>,
13545    >(
13546        mut self,
13547        v: T,
13548    ) -> Self {
13549        self.last_execution_error_code = v.into();
13550        self
13551    }
13552
13553    /// Sets the value of [last_execution_error_message][crate::model::Curation::last_execution_error_message].
13554    pub fn set_last_execution_error_message<T: std::convert::Into<std::string::String>>(
13555        mut self,
13556        v: T,
13557    ) -> Self {
13558        self.last_execution_error_message = v.into();
13559        self
13560    }
13561
13562    /// Sets the value of [create_time][crate::model::Curation::create_time].
13563    pub fn set_create_time<T>(mut self, v: T) -> Self
13564    where
13565        T: std::convert::Into<wkt::Timestamp>,
13566    {
13567        self.create_time = std::option::Option::Some(v.into());
13568        self
13569    }
13570
13571    /// Sets or clears the value of [create_time][crate::model::Curation::create_time].
13572    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13573    where
13574        T: std::convert::Into<wkt::Timestamp>,
13575    {
13576        self.create_time = v.map(|x| x.into());
13577        self
13578    }
13579
13580    /// Sets the value of [update_time][crate::model::Curation::update_time].
13581    pub fn set_update_time<T>(mut self, v: T) -> Self
13582    where
13583        T: std::convert::Into<wkt::Timestamp>,
13584    {
13585        self.update_time = std::option::Option::Some(v.into());
13586        self
13587    }
13588
13589    /// Sets or clears the value of [update_time][crate::model::Curation::update_time].
13590    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13591    where
13592        T: std::convert::Into<wkt::Timestamp>,
13593    {
13594        self.update_time = v.map(|x| x.into());
13595        self
13596    }
13597}
13598
13599impl wkt::message::Message for Curation {
13600    fn typename() -> &'static str {
13601        "type.googleapis.com/google.cloud.apihub.v1.Curation"
13602    }
13603}
13604
13605/// Defines additional types related to [Curation].
13606pub mod curation {
13607    #[allow(unused_imports)]
13608    use super::*;
13609
13610    /// The plugin instance and associated action that is using the curation.
13611    #[derive(Clone, Default, PartialEq)]
13612    #[non_exhaustive]
13613    pub struct PluginInstanceActionID {
13614        /// Output only. Plugin instance that is using the curation.
13615        /// Format is
13616        /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
13617        pub plugin_instance: std::string::String,
13618
13619        /// Output only. The action ID that is using the curation.
13620        /// This should map to one of the action IDs specified
13621        /// in action configs in the plugin.
13622        pub action_id: std::string::String,
13623
13624        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13625    }
13626
13627    impl PluginInstanceActionID {
13628        pub fn new() -> Self {
13629            std::default::Default::default()
13630        }
13631
13632        /// Sets the value of [plugin_instance][crate::model::curation::PluginInstanceActionID::plugin_instance].
13633        pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(
13634            mut self,
13635            v: T,
13636        ) -> Self {
13637            self.plugin_instance = v.into();
13638            self
13639        }
13640
13641        /// Sets the value of [action_id][crate::model::curation::PluginInstanceActionID::action_id].
13642        pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13643            self.action_id = v.into();
13644            self
13645        }
13646    }
13647
13648    impl wkt::message::Message for PluginInstanceActionID {
13649        fn typename() -> &'static str {
13650            "type.googleapis.com/google.cloud.apihub.v1.Curation.PluginInstanceActionID"
13651        }
13652    }
13653
13654    /// The state of the last execution of the curation.
13655    ///
13656    /// # Working with unknown values
13657    ///
13658    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13659    /// additional enum variants at any time. Adding new variants is not considered
13660    /// a breaking change. Applications should write their code in anticipation of:
13661    ///
13662    /// - New values appearing in future releases of the client library, **and**
13663    /// - New values received dynamically, without application changes.
13664    ///
13665    /// Please consult the [Working with enums] section in the user guide for some
13666    /// guidelines.
13667    ///
13668    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13669    #[derive(Clone, Debug, PartialEq)]
13670    #[non_exhaustive]
13671    pub enum LastExecutionState {
13672        /// Default unspecified state.
13673        Unspecified,
13674        /// The last curation execution was successful.
13675        Succeeded,
13676        /// The last curation execution failed.
13677        Failed,
13678        /// If set, the enum was initialized with an unknown value.
13679        ///
13680        /// Applications can examine the value using [LastExecutionState::value] or
13681        /// [LastExecutionState::name].
13682        UnknownValue(last_execution_state::UnknownValue),
13683    }
13684
13685    #[doc(hidden)]
13686    pub mod last_execution_state {
13687        #[allow(unused_imports)]
13688        use super::*;
13689        #[derive(Clone, Debug, PartialEq)]
13690        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13691    }
13692
13693    impl LastExecutionState {
13694        /// Gets the enum value.
13695        ///
13696        /// Returns `None` if the enum contains an unknown value deserialized from
13697        /// the string representation of enums.
13698        pub fn value(&self) -> std::option::Option<i32> {
13699            match self {
13700                Self::Unspecified => std::option::Option::Some(0),
13701                Self::Succeeded => std::option::Option::Some(1),
13702                Self::Failed => std::option::Option::Some(2),
13703                Self::UnknownValue(u) => u.0.value(),
13704            }
13705        }
13706
13707        /// Gets the enum value as a string.
13708        ///
13709        /// Returns `None` if the enum contains an unknown value deserialized from
13710        /// the integer representation of enums.
13711        pub fn name(&self) -> std::option::Option<&str> {
13712            match self {
13713                Self::Unspecified => std::option::Option::Some("LAST_EXECUTION_STATE_UNSPECIFIED"),
13714                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13715                Self::Failed => std::option::Option::Some("FAILED"),
13716                Self::UnknownValue(u) => u.0.name(),
13717            }
13718        }
13719    }
13720
13721    impl std::default::Default for LastExecutionState {
13722        fn default() -> Self {
13723            use std::convert::From;
13724            Self::from(0)
13725        }
13726    }
13727
13728    impl std::fmt::Display for LastExecutionState {
13729        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13730            wkt::internal::display_enum(f, self.name(), self.value())
13731        }
13732    }
13733
13734    impl std::convert::From<i32> for LastExecutionState {
13735        fn from(value: i32) -> Self {
13736            match value {
13737                0 => Self::Unspecified,
13738                1 => Self::Succeeded,
13739                2 => Self::Failed,
13740                _ => Self::UnknownValue(last_execution_state::UnknownValue(
13741                    wkt::internal::UnknownEnumValue::Integer(value),
13742                )),
13743            }
13744        }
13745    }
13746
13747    impl std::convert::From<&str> for LastExecutionState {
13748        fn from(value: &str) -> Self {
13749            use std::string::ToString;
13750            match value {
13751                "LAST_EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
13752                "SUCCEEDED" => Self::Succeeded,
13753                "FAILED" => Self::Failed,
13754                _ => Self::UnknownValue(last_execution_state::UnknownValue(
13755                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13756                )),
13757            }
13758        }
13759    }
13760
13761    impl serde::ser::Serialize for LastExecutionState {
13762        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13763        where
13764            S: serde::Serializer,
13765        {
13766            match self {
13767                Self::Unspecified => serializer.serialize_i32(0),
13768                Self::Succeeded => serializer.serialize_i32(1),
13769                Self::Failed => serializer.serialize_i32(2),
13770                Self::UnknownValue(u) => u.0.serialize(serializer),
13771            }
13772        }
13773    }
13774
13775    impl<'de> serde::de::Deserialize<'de> for LastExecutionState {
13776        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13777        where
13778            D: serde::Deserializer<'de>,
13779        {
13780            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LastExecutionState>::new(
13781                ".google.cloud.apihub.v1.Curation.LastExecutionState",
13782            ))
13783        }
13784    }
13785
13786    /// The error codes for failed executions.
13787    ///
13788    /// # Working with unknown values
13789    ///
13790    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13791    /// additional enum variants at any time. Adding new variants is not considered
13792    /// a breaking change. Applications should write their code in anticipation of:
13793    ///
13794    /// - New values appearing in future releases of the client library, **and**
13795    /// - New values received dynamically, without application changes.
13796    ///
13797    /// Please consult the [Working with enums] section in the user guide for some
13798    /// guidelines.
13799    ///
13800    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13801    #[derive(Clone, Debug, PartialEq)]
13802    #[non_exhaustive]
13803    pub enum ErrorCode {
13804        /// Default unspecified error code.
13805        Unspecified,
13806        /// The execution failed due to an internal error.
13807        InternalError,
13808        /// The curation is not authorized to trigger the endpoint uri.
13809        Unauthorized,
13810        /// If set, the enum was initialized with an unknown value.
13811        ///
13812        /// Applications can examine the value using [ErrorCode::value] or
13813        /// [ErrorCode::name].
13814        UnknownValue(error_code::UnknownValue),
13815    }
13816
13817    #[doc(hidden)]
13818    pub mod error_code {
13819        #[allow(unused_imports)]
13820        use super::*;
13821        #[derive(Clone, Debug, PartialEq)]
13822        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13823    }
13824
13825    impl ErrorCode {
13826        /// Gets the enum value.
13827        ///
13828        /// Returns `None` if the enum contains an unknown value deserialized from
13829        /// the string representation of enums.
13830        pub fn value(&self) -> std::option::Option<i32> {
13831            match self {
13832                Self::Unspecified => std::option::Option::Some(0),
13833                Self::InternalError => std::option::Option::Some(1),
13834                Self::Unauthorized => std::option::Option::Some(2),
13835                Self::UnknownValue(u) => u.0.value(),
13836            }
13837        }
13838
13839        /// Gets the enum value as a string.
13840        ///
13841        /// Returns `None` if the enum contains an unknown value deserialized from
13842        /// the integer representation of enums.
13843        pub fn name(&self) -> std::option::Option<&str> {
13844            match self {
13845                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
13846                Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
13847                Self::Unauthorized => std::option::Option::Some("UNAUTHORIZED"),
13848                Self::UnknownValue(u) => u.0.name(),
13849            }
13850        }
13851    }
13852
13853    impl std::default::Default for ErrorCode {
13854        fn default() -> Self {
13855            use std::convert::From;
13856            Self::from(0)
13857        }
13858    }
13859
13860    impl std::fmt::Display for ErrorCode {
13861        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13862            wkt::internal::display_enum(f, self.name(), self.value())
13863        }
13864    }
13865
13866    impl std::convert::From<i32> for ErrorCode {
13867        fn from(value: i32) -> Self {
13868            match value {
13869                0 => Self::Unspecified,
13870                1 => Self::InternalError,
13871                2 => Self::Unauthorized,
13872                _ => Self::UnknownValue(error_code::UnknownValue(
13873                    wkt::internal::UnknownEnumValue::Integer(value),
13874                )),
13875            }
13876        }
13877    }
13878
13879    impl std::convert::From<&str> for ErrorCode {
13880        fn from(value: &str) -> Self {
13881            use std::string::ToString;
13882            match value {
13883                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
13884                "INTERNAL_ERROR" => Self::InternalError,
13885                "UNAUTHORIZED" => Self::Unauthorized,
13886                _ => Self::UnknownValue(error_code::UnknownValue(
13887                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13888                )),
13889            }
13890        }
13891    }
13892
13893    impl serde::ser::Serialize for ErrorCode {
13894        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13895        where
13896            S: serde::Serializer,
13897        {
13898            match self {
13899                Self::Unspecified => serializer.serialize_i32(0),
13900                Self::InternalError => serializer.serialize_i32(1),
13901                Self::Unauthorized => serializer.serialize_i32(2),
13902                Self::UnknownValue(u) => u.0.serialize(serializer),
13903            }
13904        }
13905    }
13906
13907    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
13908        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13909        where
13910            D: serde::Deserializer<'de>,
13911        {
13912            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
13913                ".google.cloud.apihub.v1.Curation.ErrorCode",
13914            ))
13915        }
13916    }
13917}
13918
13919/// The endpoint to be triggered for curation.
13920/// The endpoint will be invoked with a request payload containing
13921/// [ApiMetadata][google.cloud.apihub.v1.ApiHub.ApiMetadata].
13922/// Response should contain curated data in the form of
13923/// [ApiMetadata][google.cloud.apihub.v1.ApiHub.ApiMetadata].
13924#[derive(Clone, Default, PartialEq)]
13925#[non_exhaustive]
13926pub struct Endpoint {
13927    /// The details of the endpoint to be triggered for curation.
13928    pub endpoint_details: std::option::Option<crate::model::endpoint::EndpointDetails>,
13929
13930    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13931}
13932
13933impl Endpoint {
13934    pub fn new() -> Self {
13935        std::default::Default::default()
13936    }
13937
13938    /// Sets the value of [endpoint_details][crate::model::Endpoint::endpoint_details].
13939    ///
13940    /// Note that all the setters affecting `endpoint_details` are mutually
13941    /// exclusive.
13942    pub fn set_endpoint_details<
13943        T: std::convert::Into<std::option::Option<crate::model::endpoint::EndpointDetails>>,
13944    >(
13945        mut self,
13946        v: T,
13947    ) -> Self {
13948        self.endpoint_details = v.into();
13949        self
13950    }
13951
13952    /// The value of [endpoint_details][crate::model::Endpoint::endpoint_details]
13953    /// if it holds a `ApplicationIntegrationEndpointDetails`, `None` if the field is not set or
13954    /// holds a different branch.
13955    pub fn application_integration_endpoint_details(
13956        &self,
13957    ) -> std::option::Option<&std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>>
13958    {
13959        #[allow(unreachable_patterns)]
13960        self.endpoint_details.as_ref().and_then(|v| match v {
13961            crate::model::endpoint::EndpointDetails::ApplicationIntegrationEndpointDetails(v) => {
13962                std::option::Option::Some(v)
13963            }
13964            _ => std::option::Option::None,
13965        })
13966    }
13967
13968    /// Sets the value of [endpoint_details][crate::model::Endpoint::endpoint_details]
13969    /// to hold a `ApplicationIntegrationEndpointDetails`.
13970    ///
13971    /// Note that all the setters affecting `endpoint_details` are
13972    /// mutually exclusive.
13973    pub fn set_application_integration_endpoint_details<
13974        T: std::convert::Into<std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>>,
13975    >(
13976        mut self,
13977        v: T,
13978    ) -> Self {
13979        self.endpoint_details = std::option::Option::Some(
13980            crate::model::endpoint::EndpointDetails::ApplicationIntegrationEndpointDetails(
13981                v.into(),
13982            ),
13983        );
13984        self
13985    }
13986}
13987
13988impl wkt::message::Message for Endpoint {
13989    fn typename() -> &'static str {
13990        "type.googleapis.com/google.cloud.apihub.v1.Endpoint"
13991    }
13992}
13993
13994/// Defines additional types related to [Endpoint].
13995pub mod endpoint {
13996    #[allow(unused_imports)]
13997    use super::*;
13998
13999    /// The details of the endpoint to be triggered for curation.
14000    #[derive(Clone, Debug, PartialEq)]
14001    #[non_exhaustive]
14002    pub enum EndpointDetails {
14003        /// Required. The details of the Application Integration endpoint to be
14004        /// triggered for curation.
14005        ApplicationIntegrationEndpointDetails(
14006            std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>,
14007        ),
14008    }
14009}
14010
14011/// The details of the Application Integration endpoint to be triggered for
14012/// curation.
14013#[derive(Clone, Default, PartialEq)]
14014#[non_exhaustive]
14015pub struct ApplicationIntegrationEndpointDetails {
14016    /// Required. The endpoint URI should be a valid REST URI for triggering an
14017    /// Application Integration. Format:
14018    /// `<https://integrations.googleapis.com/v1/{name=projects/>*/locations/*/integrations/*}:execute`
14019    /// or
14020    /// `https://{location}-integrations.googleapis.com/v1/{name=projects/*/locations/*/integrations/*}:execute`
14021    pub uri: std::string::String,
14022
14023    /// Required. The API trigger ID of the Application Integration workflow.
14024    pub trigger_id: std::string::String,
14025
14026    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14027}
14028
14029impl ApplicationIntegrationEndpointDetails {
14030    pub fn new() -> Self {
14031        std::default::Default::default()
14032    }
14033
14034    /// Sets the value of [uri][crate::model::ApplicationIntegrationEndpointDetails::uri].
14035    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14036        self.uri = v.into();
14037        self
14038    }
14039
14040    /// Sets the value of [trigger_id][crate::model::ApplicationIntegrationEndpointDetails::trigger_id].
14041    pub fn set_trigger_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14042        self.trigger_id = v.into();
14043        self
14044    }
14045}
14046
14047impl wkt::message::Message for ApplicationIntegrationEndpointDetails {
14048    fn typename() -> &'static str {
14049        "type.googleapis.com/google.cloud.apihub.v1.ApplicationIntegrationEndpointDetails"
14050    }
14051}
14052
14053/// Message for requesting list of DiscoveredApiObservations
14054#[derive(Clone, Default, PartialEq)]
14055#[non_exhaustive]
14056pub struct ListDiscoveredApiObservationsRequest {
14057    /// Required. The parent, which owns this collection of ApiObservations.
14058    /// Format:
14059    /// projects/{project}/locations/{location}
14060    pub parent: std::string::String,
14061
14062    /// Optional. The maximum number of ApiObservations to return. The service may
14063    /// return fewer than this value. If unspecified, at most 10
14064    /// ApiObservations will be returned. The maximum value is 1000; values
14065    /// above 1000 will be coerced to 1000.
14066    pub page_size: i32,
14067
14068    /// Optional. A page token, received from a previous `ListApiObservations`
14069    /// call. Provide this to retrieve the subsequent page.
14070    ///
14071    /// When paginating, all other parameters provided to
14072    /// `ListApiObservations` must match the call that provided the page
14073    /// token.
14074    pub page_token: std::string::String,
14075
14076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14077}
14078
14079impl ListDiscoveredApiObservationsRequest {
14080    pub fn new() -> Self {
14081        std::default::Default::default()
14082    }
14083
14084    /// Sets the value of [parent][crate::model::ListDiscoveredApiObservationsRequest::parent].
14085    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14086        self.parent = v.into();
14087        self
14088    }
14089
14090    /// Sets the value of [page_size][crate::model::ListDiscoveredApiObservationsRequest::page_size].
14091    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14092        self.page_size = v.into();
14093        self
14094    }
14095
14096    /// Sets the value of [page_token][crate::model::ListDiscoveredApiObservationsRequest::page_token].
14097    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14098        self.page_token = v.into();
14099        self
14100    }
14101}
14102
14103impl wkt::message::Message for ListDiscoveredApiObservationsRequest {
14104    fn typename() -> &'static str {
14105        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiObservationsRequest"
14106    }
14107}
14108
14109/// Message for response to listing DiscoveredApiObservations
14110#[derive(Clone, Default, PartialEq)]
14111#[non_exhaustive]
14112pub struct ListDiscoveredApiObservationsResponse {
14113    /// The DiscoveredApiObservation from the specified project and location.
14114    pub discovered_api_observations: std::vec::Vec<crate::model::DiscoveredApiObservation>,
14115
14116    /// A token, which can be sent as `page_token` to retrieve the next page.
14117    /// If this field is omitted, there are no subsequent pages.
14118    pub next_page_token: std::string::String,
14119
14120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14121}
14122
14123impl ListDiscoveredApiObservationsResponse {
14124    pub fn new() -> Self {
14125        std::default::Default::default()
14126    }
14127
14128    /// Sets the value of [discovered_api_observations][crate::model::ListDiscoveredApiObservationsResponse::discovered_api_observations].
14129    pub fn set_discovered_api_observations<T, V>(mut self, v: T) -> Self
14130    where
14131        T: std::iter::IntoIterator<Item = V>,
14132        V: std::convert::Into<crate::model::DiscoveredApiObservation>,
14133    {
14134        use std::iter::Iterator;
14135        self.discovered_api_observations = v.into_iter().map(|i| i.into()).collect();
14136        self
14137    }
14138
14139    /// Sets the value of [next_page_token][crate::model::ListDiscoveredApiObservationsResponse::next_page_token].
14140    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14141        self.next_page_token = v.into();
14142        self
14143    }
14144}
14145
14146impl wkt::message::Message for ListDiscoveredApiObservationsResponse {
14147    fn typename() -> &'static str {
14148        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiObservationsResponse"
14149    }
14150}
14151
14152#[doc(hidden)]
14153impl gax::paginator::internal::PageableResponse for ListDiscoveredApiObservationsResponse {
14154    type PageItem = crate::model::DiscoveredApiObservation;
14155
14156    fn items(self) -> std::vec::Vec<Self::PageItem> {
14157        self.discovered_api_observations
14158    }
14159
14160    fn next_page_token(&self) -> std::string::String {
14161        use std::clone::Clone;
14162        self.next_page_token.clone()
14163    }
14164}
14165
14166/// Message for requesting list of DiscoveredApiOperations
14167#[derive(Clone, Default, PartialEq)]
14168#[non_exhaustive]
14169pub struct ListDiscoveredApiOperationsRequest {
14170    /// Required. The parent, which owns this collection of
14171    /// DiscoveredApiOperations. Format:
14172    /// projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}
14173    pub parent: std::string::String,
14174
14175    /// Optional. DiscoveredApiOperations will be returned. The maximum value is
14176    /// 1000; values above 1000 will be coerced to 1000.
14177    pub page_size: i32,
14178
14179    /// Optional. A page token, received from a previous
14180    /// `ListDiscoveredApiApiOperations` call. Provide this to retrieve the
14181    /// subsequent page.
14182    ///
14183    /// When paginating, all other parameters provided to
14184    /// `ListDiscoveredApiApiOperations` must match the call that provided the page
14185    /// token.
14186    pub page_token: std::string::String,
14187
14188    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14189}
14190
14191impl ListDiscoveredApiOperationsRequest {
14192    pub fn new() -> Self {
14193        std::default::Default::default()
14194    }
14195
14196    /// Sets the value of [parent][crate::model::ListDiscoveredApiOperationsRequest::parent].
14197    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14198        self.parent = v.into();
14199        self
14200    }
14201
14202    /// Sets the value of [page_size][crate::model::ListDiscoveredApiOperationsRequest::page_size].
14203    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14204        self.page_size = v.into();
14205        self
14206    }
14207
14208    /// Sets the value of [page_token][crate::model::ListDiscoveredApiOperationsRequest::page_token].
14209    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14210        self.page_token = v.into();
14211        self
14212    }
14213}
14214
14215impl wkt::message::Message for ListDiscoveredApiOperationsRequest {
14216    fn typename() -> &'static str {
14217        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiOperationsRequest"
14218    }
14219}
14220
14221/// Message for response to listing DiscoveredApiOperations
14222#[derive(Clone, Default, PartialEq)]
14223#[non_exhaustive]
14224pub struct ListDiscoveredApiOperationsResponse {
14225    /// The DiscoveredApiOperations from the specified project, location
14226    /// and DiscoveredApiObservation.
14227    pub discovered_api_operations: std::vec::Vec<crate::model::DiscoveredApiOperation>,
14228
14229    /// A token, which can be sent as `page_token` to retrieve the next page.
14230    /// If this field is omitted, there are no subsequent pages.
14231    pub next_page_token: std::string::String,
14232
14233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14234}
14235
14236impl ListDiscoveredApiOperationsResponse {
14237    pub fn new() -> Self {
14238        std::default::Default::default()
14239    }
14240
14241    /// Sets the value of [discovered_api_operations][crate::model::ListDiscoveredApiOperationsResponse::discovered_api_operations].
14242    pub fn set_discovered_api_operations<T, V>(mut self, v: T) -> Self
14243    where
14244        T: std::iter::IntoIterator<Item = V>,
14245        V: std::convert::Into<crate::model::DiscoveredApiOperation>,
14246    {
14247        use std::iter::Iterator;
14248        self.discovered_api_operations = v.into_iter().map(|i| i.into()).collect();
14249        self
14250    }
14251
14252    /// Sets the value of [next_page_token][crate::model::ListDiscoveredApiOperationsResponse::next_page_token].
14253    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14254        self.next_page_token = v.into();
14255        self
14256    }
14257}
14258
14259impl wkt::message::Message for ListDiscoveredApiOperationsResponse {
14260    fn typename() -> &'static str {
14261        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiOperationsResponse"
14262    }
14263}
14264
14265#[doc(hidden)]
14266impl gax::paginator::internal::PageableResponse for ListDiscoveredApiOperationsResponse {
14267    type PageItem = crate::model::DiscoveredApiOperation;
14268
14269    fn items(self) -> std::vec::Vec<Self::PageItem> {
14270        self.discovered_api_operations
14271    }
14272
14273    fn next_page_token(&self) -> std::string::String {
14274        use std::clone::Clone;
14275        self.next_page_token.clone()
14276    }
14277}
14278
14279/// Message for requesting a DiscoveredApiObservation
14280#[derive(Clone, Default, PartialEq)]
14281#[non_exhaustive]
14282pub struct GetDiscoveredApiObservationRequest {
14283    /// Required. The name of the DiscoveredApiObservation to retrieve.
14284    /// Format:
14285    /// projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}
14286    pub name: std::string::String,
14287
14288    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14289}
14290
14291impl GetDiscoveredApiObservationRequest {
14292    pub fn new() -> Self {
14293        std::default::Default::default()
14294    }
14295
14296    /// Sets the value of [name][crate::model::GetDiscoveredApiObservationRequest::name].
14297    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14298        self.name = v.into();
14299        self
14300    }
14301}
14302
14303impl wkt::message::Message for GetDiscoveredApiObservationRequest {
14304    fn typename() -> &'static str {
14305        "type.googleapis.com/google.cloud.apihub.v1.GetDiscoveredApiObservationRequest"
14306    }
14307}
14308
14309/// Message for requesting a DiscoveredApiOperation
14310#[derive(Clone, Default, PartialEq)]
14311#[non_exhaustive]
14312pub struct GetDiscoveredApiOperationRequest {
14313    /// Required. The name of the DiscoveredApiOperation to retrieve.
14314    /// Format:
14315    /// projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}/discoveredApiOperations/{discovered_api_operation}
14316    pub name: std::string::String,
14317
14318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14319}
14320
14321impl GetDiscoveredApiOperationRequest {
14322    pub fn new() -> Self {
14323        std::default::Default::default()
14324    }
14325
14326    /// Sets the value of [name][crate::model::GetDiscoveredApiOperationRequest::name].
14327    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14328        self.name = v.into();
14329        self
14330    }
14331}
14332
14333impl wkt::message::Message for GetDiscoveredApiOperationRequest {
14334    fn typename() -> &'static str {
14335        "type.googleapis.com/google.cloud.apihub.v1.GetDiscoveredApiOperationRequest"
14336    }
14337}
14338
14339/// The
14340/// [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration]
14341/// method's request.
14342///
14343/// [google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration]: crate::client::HostProjectRegistrationService::create_host_project_registration
14344#[derive(Clone, Default, PartialEq)]
14345#[non_exhaustive]
14346pub struct CreateHostProjectRegistrationRequest {
14347    /// Required. The parent resource for the host project.
14348    /// Format: `projects/{project}/locations/{location}`
14349    pub parent: std::string::String,
14350
14351    /// Required. The ID to use for the Host Project Registration, which will
14352    /// become the final component of the host project registration's resource
14353    /// name. The ID must be the same as the Google cloud project specified in the
14354    /// host_project_registration.gcp_project field.
14355    pub host_project_registration_id: std::string::String,
14356
14357    /// Required. The host project registration to register.
14358    pub host_project_registration: std::option::Option<crate::model::HostProjectRegistration>,
14359
14360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14361}
14362
14363impl CreateHostProjectRegistrationRequest {
14364    pub fn new() -> Self {
14365        std::default::Default::default()
14366    }
14367
14368    /// Sets the value of [parent][crate::model::CreateHostProjectRegistrationRequest::parent].
14369    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14370        self.parent = v.into();
14371        self
14372    }
14373
14374    /// Sets the value of [host_project_registration_id][crate::model::CreateHostProjectRegistrationRequest::host_project_registration_id].
14375    pub fn set_host_project_registration_id<T: std::convert::Into<std::string::String>>(
14376        mut self,
14377        v: T,
14378    ) -> Self {
14379        self.host_project_registration_id = v.into();
14380        self
14381    }
14382
14383    /// Sets the value of [host_project_registration][crate::model::CreateHostProjectRegistrationRequest::host_project_registration].
14384    pub fn set_host_project_registration<T>(mut self, v: T) -> Self
14385    where
14386        T: std::convert::Into<crate::model::HostProjectRegistration>,
14387    {
14388        self.host_project_registration = std::option::Option::Some(v.into());
14389        self
14390    }
14391
14392    /// Sets or clears the value of [host_project_registration][crate::model::CreateHostProjectRegistrationRequest::host_project_registration].
14393    pub fn set_or_clear_host_project_registration<T>(mut self, v: std::option::Option<T>) -> Self
14394    where
14395        T: std::convert::Into<crate::model::HostProjectRegistration>,
14396    {
14397        self.host_project_registration = v.map(|x| x.into());
14398        self
14399    }
14400}
14401
14402impl wkt::message::Message for CreateHostProjectRegistrationRequest {
14403    fn typename() -> &'static str {
14404        "type.googleapis.com/google.cloud.apihub.v1.CreateHostProjectRegistrationRequest"
14405    }
14406}
14407
14408/// The
14409/// [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration]
14410/// method's request.
14411///
14412/// [google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration]: crate::client::HostProjectRegistrationService::get_host_project_registration
14413#[derive(Clone, Default, PartialEq)]
14414#[non_exhaustive]
14415pub struct GetHostProjectRegistrationRequest {
14416    /// Required. Host project registration resource name.
14417    /// projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}
14418    pub name: std::string::String,
14419
14420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14421}
14422
14423impl GetHostProjectRegistrationRequest {
14424    pub fn new() -> Self {
14425        std::default::Default::default()
14426    }
14427
14428    /// Sets the value of [name][crate::model::GetHostProjectRegistrationRequest::name].
14429    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14430        self.name = v.into();
14431        self
14432    }
14433}
14434
14435impl wkt::message::Message for GetHostProjectRegistrationRequest {
14436    fn typename() -> &'static str {
14437        "type.googleapis.com/google.cloud.apihub.v1.GetHostProjectRegistrationRequest"
14438    }
14439}
14440
14441/// The
14442/// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
14443/// method's request.
14444///
14445/// [google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]: crate::client::HostProjectRegistrationService::list_host_project_registrations
14446#[derive(Clone, Default, PartialEq)]
14447#[non_exhaustive]
14448pub struct ListHostProjectRegistrationsRequest {
14449    /// Required. The parent, which owns this collection of host projects.
14450    /// Format: `projects/*/locations/*`
14451    pub parent: std::string::String,
14452
14453    /// Optional. The maximum number of host project registrations to return. The
14454    /// service may return fewer than this value. If unspecified, at most 50 host
14455    /// project registrations will be returned. The maximum value is 1000; values
14456    /// above 1000 will be coerced to 1000.
14457    pub page_size: i32,
14458
14459    /// Optional. A page token, received from a previous
14460    /// `ListHostProjectRegistrations` call. Provide this to retrieve the
14461    /// subsequent page.
14462    ///
14463    /// When paginating, all other parameters (except page_size) provided to
14464    /// `ListHostProjectRegistrations` must match the call that provided the page
14465    /// token.
14466    pub page_token: std::string::String,
14467
14468    /// Optional. An expression that filters the list of HostProjectRegistrations.
14469    ///
14470    /// A filter expression consists of a field name, a comparison
14471    /// operator, and a value for filtering. The value must be a string. All
14472    /// standard operators as documented at <https://google.aip.dev/160> are
14473    /// supported.
14474    ///
14475    /// The following fields in the `HostProjectRegistration` are eligible for
14476    /// filtering:
14477    ///
14478    /// * `name` - The name of the HostProjectRegistration.
14479    /// * `create_time` - The time at which the HostProjectRegistration was
14480    ///   created. The value should be in the
14481    ///   (RFC3339)[<https://tools.ietf.org/html/rfc3339>] format.
14482    /// * `gcp_project` - The Google cloud project associated with the
14483    ///   HostProjectRegistration.
14484    pub filter: std::string::String,
14485
14486    /// Optional. Hint for how to order the results.
14487    pub order_by: std::string::String,
14488
14489    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14490}
14491
14492impl ListHostProjectRegistrationsRequest {
14493    pub fn new() -> Self {
14494        std::default::Default::default()
14495    }
14496
14497    /// Sets the value of [parent][crate::model::ListHostProjectRegistrationsRequest::parent].
14498    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14499        self.parent = v.into();
14500        self
14501    }
14502
14503    /// Sets the value of [page_size][crate::model::ListHostProjectRegistrationsRequest::page_size].
14504    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14505        self.page_size = v.into();
14506        self
14507    }
14508
14509    /// Sets the value of [page_token][crate::model::ListHostProjectRegistrationsRequest::page_token].
14510    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14511        self.page_token = v.into();
14512        self
14513    }
14514
14515    /// Sets the value of [filter][crate::model::ListHostProjectRegistrationsRequest::filter].
14516    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14517        self.filter = v.into();
14518        self
14519    }
14520
14521    /// Sets the value of [order_by][crate::model::ListHostProjectRegistrationsRequest::order_by].
14522    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14523        self.order_by = v.into();
14524        self
14525    }
14526}
14527
14528impl wkt::message::Message for ListHostProjectRegistrationsRequest {
14529    fn typename() -> &'static str {
14530        "type.googleapis.com/google.cloud.apihub.v1.ListHostProjectRegistrationsRequest"
14531    }
14532}
14533
14534/// The
14535/// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
14536/// method's response.
14537///
14538/// [google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]: crate::client::HostProjectRegistrationService::list_host_project_registrations
14539#[derive(Clone, Default, PartialEq)]
14540#[non_exhaustive]
14541pub struct ListHostProjectRegistrationsResponse {
14542    /// The list of host project registrations.
14543    pub host_project_registrations: std::vec::Vec<crate::model::HostProjectRegistration>,
14544
14545    /// A token, which can be sent as `page_token` to retrieve the next page.
14546    /// If this field is omitted, there are no subsequent pages.
14547    pub next_page_token: std::string::String,
14548
14549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14550}
14551
14552impl ListHostProjectRegistrationsResponse {
14553    pub fn new() -> Self {
14554        std::default::Default::default()
14555    }
14556
14557    /// Sets the value of [host_project_registrations][crate::model::ListHostProjectRegistrationsResponse::host_project_registrations].
14558    pub fn set_host_project_registrations<T, V>(mut self, v: T) -> Self
14559    where
14560        T: std::iter::IntoIterator<Item = V>,
14561        V: std::convert::Into<crate::model::HostProjectRegistration>,
14562    {
14563        use std::iter::Iterator;
14564        self.host_project_registrations = v.into_iter().map(|i| i.into()).collect();
14565        self
14566    }
14567
14568    /// Sets the value of [next_page_token][crate::model::ListHostProjectRegistrationsResponse::next_page_token].
14569    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14570        self.next_page_token = v.into();
14571        self
14572    }
14573}
14574
14575impl wkt::message::Message for ListHostProjectRegistrationsResponse {
14576    fn typename() -> &'static str {
14577        "type.googleapis.com/google.cloud.apihub.v1.ListHostProjectRegistrationsResponse"
14578    }
14579}
14580
14581#[doc(hidden)]
14582impl gax::paginator::internal::PageableResponse for ListHostProjectRegistrationsResponse {
14583    type PageItem = crate::model::HostProjectRegistration;
14584
14585    fn items(self) -> std::vec::Vec<Self::PageItem> {
14586        self.host_project_registrations
14587    }
14588
14589    fn next_page_token(&self) -> std::string::String {
14590        use std::clone::Clone;
14591        self.next_page_token.clone()
14592    }
14593}
14594
14595/// Host project registration refers to the registration of a Google cloud
14596/// project with Api Hub as a host project. This is the project where Api Hub is
14597/// provisioned. It acts as the consumer project for the Api Hub instance
14598/// provisioned. Multiple runtime projects can be attached to the host project
14599/// and these attachments define the scope of Api Hub.
14600#[derive(Clone, Default, PartialEq)]
14601#[non_exhaustive]
14602pub struct HostProjectRegistration {
14603    /// Identifier. The name of the host project registration.
14604    /// Format:
14605    /// "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
14606    pub name: std::string::String,
14607
14608    /// Required. Immutable. Google cloud project name in the format:
14609    /// "projects/abc" or "projects/123". As input, project name with either
14610    /// project id or number are accepted. As output, this field will contain
14611    /// project number.
14612    pub gcp_project: std::string::String,
14613
14614    /// Output only. The time at which the host project registration was created.
14615    pub create_time: std::option::Option<wkt::Timestamp>,
14616
14617    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14618}
14619
14620impl HostProjectRegistration {
14621    pub fn new() -> Self {
14622        std::default::Default::default()
14623    }
14624
14625    /// Sets the value of [name][crate::model::HostProjectRegistration::name].
14626    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14627        self.name = v.into();
14628        self
14629    }
14630
14631    /// Sets the value of [gcp_project][crate::model::HostProjectRegistration::gcp_project].
14632    pub fn set_gcp_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14633        self.gcp_project = v.into();
14634        self
14635    }
14636
14637    /// Sets the value of [create_time][crate::model::HostProjectRegistration::create_time].
14638    pub fn set_create_time<T>(mut self, v: T) -> Self
14639    where
14640        T: std::convert::Into<wkt::Timestamp>,
14641    {
14642        self.create_time = std::option::Option::Some(v.into());
14643        self
14644    }
14645
14646    /// Sets or clears the value of [create_time][crate::model::HostProjectRegistration::create_time].
14647    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14648    where
14649        T: std::convert::Into<wkt::Timestamp>,
14650    {
14651        self.create_time = v.map(|x| x.into());
14652        self
14653    }
14654}
14655
14656impl wkt::message::Message for HostProjectRegistration {
14657    fn typename() -> &'static str {
14658        "type.googleapis.com/google.cloud.apihub.v1.HostProjectRegistration"
14659    }
14660}
14661
14662/// The [GetStyleGuide][google.cloud.apihub.v1.LintingService.GetStyleGuide]
14663/// method's request.
14664///
14665/// [google.cloud.apihub.v1.LintingService.GetStyleGuide]: crate::client::LintingService::get_style_guide
14666#[derive(Clone, Default, PartialEq)]
14667#[non_exhaustive]
14668pub struct GetStyleGuideRequest {
14669    /// Required. The name of the spec to retrieve.
14670    /// Format:
14671    /// `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
14672    pub name: std::string::String,
14673
14674    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14675}
14676
14677impl GetStyleGuideRequest {
14678    pub fn new() -> Self {
14679        std::default::Default::default()
14680    }
14681
14682    /// Sets the value of [name][crate::model::GetStyleGuideRequest::name].
14683    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14684        self.name = v.into();
14685        self
14686    }
14687}
14688
14689impl wkt::message::Message for GetStyleGuideRequest {
14690    fn typename() -> &'static str {
14691        "type.googleapis.com/google.cloud.apihub.v1.GetStyleGuideRequest"
14692    }
14693}
14694
14695/// The
14696/// [UpdateStyleGuide][google.cloud.apihub.v1.LintingService.UpdateStyleGuide]
14697/// method's request.
14698///
14699/// [google.cloud.apihub.v1.LintingService.UpdateStyleGuide]: crate::client::LintingService::update_style_guide
14700#[derive(Clone, Default, PartialEq)]
14701#[non_exhaustive]
14702pub struct UpdateStyleGuideRequest {
14703    /// Required. The Style guide resource to update.
14704    pub style_guide: std::option::Option<crate::model::StyleGuide>,
14705
14706    /// Optional. The list of fields to update.
14707    pub update_mask: std::option::Option<wkt::FieldMask>,
14708
14709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14710}
14711
14712impl UpdateStyleGuideRequest {
14713    pub fn new() -> Self {
14714        std::default::Default::default()
14715    }
14716
14717    /// Sets the value of [style_guide][crate::model::UpdateStyleGuideRequest::style_guide].
14718    pub fn set_style_guide<T>(mut self, v: T) -> Self
14719    where
14720        T: std::convert::Into<crate::model::StyleGuide>,
14721    {
14722        self.style_guide = std::option::Option::Some(v.into());
14723        self
14724    }
14725
14726    /// Sets or clears the value of [style_guide][crate::model::UpdateStyleGuideRequest::style_guide].
14727    pub fn set_or_clear_style_guide<T>(mut self, v: std::option::Option<T>) -> Self
14728    where
14729        T: std::convert::Into<crate::model::StyleGuide>,
14730    {
14731        self.style_guide = v.map(|x| x.into());
14732        self
14733    }
14734
14735    /// Sets the value of [update_mask][crate::model::UpdateStyleGuideRequest::update_mask].
14736    pub fn set_update_mask<T>(mut self, v: T) -> Self
14737    where
14738        T: std::convert::Into<wkt::FieldMask>,
14739    {
14740        self.update_mask = std::option::Option::Some(v.into());
14741        self
14742    }
14743
14744    /// Sets or clears the value of [update_mask][crate::model::UpdateStyleGuideRequest::update_mask].
14745    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14746    where
14747        T: std::convert::Into<wkt::FieldMask>,
14748    {
14749        self.update_mask = v.map(|x| x.into());
14750        self
14751    }
14752}
14753
14754impl wkt::message::Message for UpdateStyleGuideRequest {
14755    fn typename() -> &'static str {
14756        "type.googleapis.com/google.cloud.apihub.v1.UpdateStyleGuideRequest"
14757    }
14758}
14759
14760/// The
14761/// [GetStyleGuideContents][google.cloud.apihub.v1.LintingService.GetStyleGuideContents]
14762/// method's request.
14763///
14764/// [google.cloud.apihub.v1.LintingService.GetStyleGuideContents]: crate::client::LintingService::get_style_guide_contents
14765#[derive(Clone, Default, PartialEq)]
14766#[non_exhaustive]
14767pub struct GetStyleGuideContentsRequest {
14768    /// Required. The name of the StyleGuide whose contents need to be retrieved.
14769    /// There is exactly one style guide resource per project per location.
14770    /// The expected format is
14771    /// `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
14772    pub name: std::string::String,
14773
14774    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14775}
14776
14777impl GetStyleGuideContentsRequest {
14778    pub fn new() -> Self {
14779        std::default::Default::default()
14780    }
14781
14782    /// Sets the value of [name][crate::model::GetStyleGuideContentsRequest::name].
14783    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14784        self.name = v.into();
14785        self
14786    }
14787}
14788
14789impl wkt::message::Message for GetStyleGuideContentsRequest {
14790    fn typename() -> &'static str {
14791        "type.googleapis.com/google.cloud.apihub.v1.GetStyleGuideContentsRequest"
14792    }
14793}
14794
14795/// The [LintSpec][google.cloud.apihub.v1.LintingService.LintSpec] method's
14796/// request.
14797///
14798/// [google.cloud.apihub.v1.LintingService.LintSpec]: crate::client::LintingService::lint_spec
14799#[derive(Clone, Default, PartialEq)]
14800#[non_exhaustive]
14801pub struct LintSpecRequest {
14802    /// Required. The name of the spec to be linted.
14803    /// Format:
14804    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
14805    pub name: std::string::String,
14806
14807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14808}
14809
14810impl LintSpecRequest {
14811    pub fn new() -> Self {
14812        std::default::Default::default()
14813    }
14814
14815    /// Sets the value of [name][crate::model::LintSpecRequest::name].
14816    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14817        self.name = v.into();
14818        self
14819    }
14820}
14821
14822impl wkt::message::Message for LintSpecRequest {
14823    fn typename() -> &'static str {
14824        "type.googleapis.com/google.cloud.apihub.v1.LintSpecRequest"
14825    }
14826}
14827
14828/// The style guide contents.
14829#[derive(Clone, Default, PartialEq)]
14830#[non_exhaustive]
14831pub struct StyleGuideContents {
14832    /// Required. The contents of the style guide.
14833    pub contents: ::bytes::Bytes,
14834
14835    /// Required. The mime type of the content.
14836    pub mime_type: std::string::String,
14837
14838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14839}
14840
14841impl StyleGuideContents {
14842    pub fn new() -> Self {
14843        std::default::Default::default()
14844    }
14845
14846    /// Sets the value of [contents][crate::model::StyleGuideContents::contents].
14847    pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
14848        self.contents = v.into();
14849        self
14850    }
14851
14852    /// Sets the value of [mime_type][crate::model::StyleGuideContents::mime_type].
14853    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14854        self.mime_type = v.into();
14855        self
14856    }
14857}
14858
14859impl wkt::message::Message for StyleGuideContents {
14860    fn typename() -> &'static str {
14861        "type.googleapis.com/google.cloud.apihub.v1.StyleGuideContents"
14862    }
14863}
14864
14865/// Represents a singleton style guide resource to be used for linting Open API
14866/// specs.
14867#[derive(Clone, Default, PartialEq)]
14868#[non_exhaustive]
14869pub struct StyleGuide {
14870    /// Identifier. The name of the style guide.
14871    ///
14872    /// Format:
14873    /// `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
14874    pub name: std::string::String,
14875
14876    /// Required. Target linter for the style guide.
14877    pub linter: crate::model::Linter,
14878
14879    /// Required. Input only. The contents of the uploaded style guide.
14880    pub contents: std::option::Option<crate::model::StyleGuideContents>,
14881
14882    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14883}
14884
14885impl StyleGuide {
14886    pub fn new() -> Self {
14887        std::default::Default::default()
14888    }
14889
14890    /// Sets the value of [name][crate::model::StyleGuide::name].
14891    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14892        self.name = v.into();
14893        self
14894    }
14895
14896    /// Sets the value of [linter][crate::model::StyleGuide::linter].
14897    pub fn set_linter<T: std::convert::Into<crate::model::Linter>>(mut self, v: T) -> Self {
14898        self.linter = v.into();
14899        self
14900    }
14901
14902    /// Sets the value of [contents][crate::model::StyleGuide::contents].
14903    pub fn set_contents<T>(mut self, v: T) -> Self
14904    where
14905        T: std::convert::Into<crate::model::StyleGuideContents>,
14906    {
14907        self.contents = std::option::Option::Some(v.into());
14908        self
14909    }
14910
14911    /// Sets or clears the value of [contents][crate::model::StyleGuide::contents].
14912    pub fn set_or_clear_contents<T>(mut self, v: std::option::Option<T>) -> Self
14913    where
14914        T: std::convert::Into<crate::model::StyleGuideContents>,
14915    {
14916        self.contents = v.map(|x| x.into());
14917        self
14918    }
14919}
14920
14921impl wkt::message::Message for StyleGuide {
14922    fn typename() -> &'static str {
14923        "type.googleapis.com/google.cloud.apihub.v1.StyleGuide"
14924    }
14925}
14926
14927/// A plugin resource in the API Hub.
14928#[derive(Clone, Default, PartialEq)]
14929#[non_exhaustive]
14930pub struct Plugin {
14931    /// Identifier. The name of the plugin.
14932    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`
14933    pub name: std::string::String,
14934
14935    /// Required. The display name of the plugin. Max length is 50 characters
14936    /// (Unicode code points).
14937    pub display_name: std::string::String,
14938
14939    /// Optional. The type of the API.
14940    /// This maps to the following system defined attribute:
14941    /// `projects/{project}/locations/{location}/attributes/system-plugin-type`
14942    /// attribute.
14943    /// The number of allowed values for this attribute will be based on the
14944    /// cardinality of the attribute. The same can be retrieved via GetAttribute
14945    /// API. All values should be from the list of allowed values defined for the
14946    /// attribute.
14947    /// Note this field is not required for plugins developed via plugin framework.
14948    pub r#type: std::option::Option<crate::model::AttributeValues>,
14949
14950    /// Optional. The plugin description. Max length is 2000 characters (Unicode
14951    /// code points).
14952    pub description: std::string::String,
14953
14954    /// Output only. Represents the state of the plugin.
14955    /// Note this field will not be set for plugins developed via plugin
14956    /// framework as the state will be managed at plugin instance level.
14957    pub state: crate::model::plugin::State,
14958
14959    /// Output only. The type of the plugin, indicating whether it is
14960    /// 'SYSTEM_OWNED' or 'USER_OWNED'.
14961    pub ownership_type: crate::model::plugin::OwnershipType,
14962
14963    /// Optional. This field is optional. It is used to notify the plugin hosting
14964    /// service for any lifecycle changes of the plugin instance and trigger
14965    /// execution of plugin instance actions in case of API hub managed actions.
14966    ///
14967    /// This field should be provided if the plugin instance lifecycle of the
14968    /// developed plugin needs to be managed from API hub. Also, in this case the
14969    /// plugin hosting service interface needs to be implemented.
14970    ///
14971    /// This field should not be provided if the plugin wants to manage plugin
14972    /// instance lifecycle events outside of hub interface and use plugin framework
14973    /// for only registering of plugin and plugin instances to capture the source
14974    /// of data into hub. Note, in this case the plugin hosting service interface
14975    /// is not required to be implemented. Also, the plugin instance lifecycle
14976    /// actions will be disabled from API hub's UI.
14977    pub hosting_service: std::option::Option<crate::model::plugin::HostingService>,
14978
14979    /// Optional. The configuration of actions supported by the plugin.
14980    /// **REQUIRED**: This field must be provided when creating or updating a
14981    /// Plugin. The server will reject requests if this field is missing.
14982    pub actions_config: std::vec::Vec<crate::model::PluginActionConfig>,
14983
14984    /// Optional. The documentation of the plugin, that explains how to set up and
14985    /// use the plugin.
14986    pub documentation: std::option::Option<crate::model::Documentation>,
14987
14988    /// Optional. The category of the plugin, identifying its primary category or
14989    /// purpose. This field is required for all plugins.
14990    pub plugin_category: crate::model::PluginCategory,
14991
14992    /// Optional. The configuration template for the plugin.
14993    pub config_template: std::option::Option<crate::model::plugin::ConfigTemplate>,
14994
14995    /// Output only. Timestamp indicating when the plugin was created.
14996    pub create_time: std::option::Option<wkt::Timestamp>,
14997
14998    /// Output only. Timestamp indicating when the plugin was last updated.
14999    pub update_time: std::option::Option<wkt::Timestamp>,
15000
15001    /// Optional. The type of the gateway.
15002    pub gateway_type: crate::model::GatewayType,
15003
15004    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15005}
15006
15007impl Plugin {
15008    pub fn new() -> Self {
15009        std::default::Default::default()
15010    }
15011
15012    /// Sets the value of [name][crate::model::Plugin::name].
15013    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15014        self.name = v.into();
15015        self
15016    }
15017
15018    /// Sets the value of [display_name][crate::model::Plugin::display_name].
15019    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15020        self.display_name = v.into();
15021        self
15022    }
15023
15024    /// Sets the value of [r#type][crate::model::Plugin::type].
15025    pub fn set_type<T>(mut self, v: T) -> Self
15026    where
15027        T: std::convert::Into<crate::model::AttributeValues>,
15028    {
15029        self.r#type = std::option::Option::Some(v.into());
15030        self
15031    }
15032
15033    /// Sets or clears the value of [r#type][crate::model::Plugin::type].
15034    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
15035    where
15036        T: std::convert::Into<crate::model::AttributeValues>,
15037    {
15038        self.r#type = v.map(|x| x.into());
15039        self
15040    }
15041
15042    /// Sets the value of [description][crate::model::Plugin::description].
15043    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15044        self.description = v.into();
15045        self
15046    }
15047
15048    /// Sets the value of [state][crate::model::Plugin::state].
15049    pub fn set_state<T: std::convert::Into<crate::model::plugin::State>>(mut self, v: T) -> Self {
15050        self.state = v.into();
15051        self
15052    }
15053
15054    /// Sets the value of [ownership_type][crate::model::Plugin::ownership_type].
15055    pub fn set_ownership_type<T: std::convert::Into<crate::model::plugin::OwnershipType>>(
15056        mut self,
15057        v: T,
15058    ) -> Self {
15059        self.ownership_type = v.into();
15060        self
15061    }
15062
15063    /// Sets the value of [hosting_service][crate::model::Plugin::hosting_service].
15064    pub fn set_hosting_service<T>(mut self, v: T) -> Self
15065    where
15066        T: std::convert::Into<crate::model::plugin::HostingService>,
15067    {
15068        self.hosting_service = std::option::Option::Some(v.into());
15069        self
15070    }
15071
15072    /// Sets or clears the value of [hosting_service][crate::model::Plugin::hosting_service].
15073    pub fn set_or_clear_hosting_service<T>(mut self, v: std::option::Option<T>) -> Self
15074    where
15075        T: std::convert::Into<crate::model::plugin::HostingService>,
15076    {
15077        self.hosting_service = v.map(|x| x.into());
15078        self
15079    }
15080
15081    /// Sets the value of [actions_config][crate::model::Plugin::actions_config].
15082    pub fn set_actions_config<T, V>(mut self, v: T) -> Self
15083    where
15084        T: std::iter::IntoIterator<Item = V>,
15085        V: std::convert::Into<crate::model::PluginActionConfig>,
15086    {
15087        use std::iter::Iterator;
15088        self.actions_config = v.into_iter().map(|i| i.into()).collect();
15089        self
15090    }
15091
15092    /// Sets the value of [documentation][crate::model::Plugin::documentation].
15093    pub fn set_documentation<T>(mut self, v: T) -> Self
15094    where
15095        T: std::convert::Into<crate::model::Documentation>,
15096    {
15097        self.documentation = std::option::Option::Some(v.into());
15098        self
15099    }
15100
15101    /// Sets or clears the value of [documentation][crate::model::Plugin::documentation].
15102    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
15103    where
15104        T: std::convert::Into<crate::model::Documentation>,
15105    {
15106        self.documentation = v.map(|x| x.into());
15107        self
15108    }
15109
15110    /// Sets the value of [plugin_category][crate::model::Plugin::plugin_category].
15111    pub fn set_plugin_category<T: std::convert::Into<crate::model::PluginCategory>>(
15112        mut self,
15113        v: T,
15114    ) -> Self {
15115        self.plugin_category = v.into();
15116        self
15117    }
15118
15119    /// Sets the value of [config_template][crate::model::Plugin::config_template].
15120    pub fn set_config_template<T>(mut self, v: T) -> Self
15121    where
15122        T: std::convert::Into<crate::model::plugin::ConfigTemplate>,
15123    {
15124        self.config_template = std::option::Option::Some(v.into());
15125        self
15126    }
15127
15128    /// Sets or clears the value of [config_template][crate::model::Plugin::config_template].
15129    pub fn set_or_clear_config_template<T>(mut self, v: std::option::Option<T>) -> Self
15130    where
15131        T: std::convert::Into<crate::model::plugin::ConfigTemplate>,
15132    {
15133        self.config_template = v.map(|x| x.into());
15134        self
15135    }
15136
15137    /// Sets the value of [create_time][crate::model::Plugin::create_time].
15138    pub fn set_create_time<T>(mut self, v: T) -> Self
15139    where
15140        T: std::convert::Into<wkt::Timestamp>,
15141    {
15142        self.create_time = std::option::Option::Some(v.into());
15143        self
15144    }
15145
15146    /// Sets or clears the value of [create_time][crate::model::Plugin::create_time].
15147    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15148    where
15149        T: std::convert::Into<wkt::Timestamp>,
15150    {
15151        self.create_time = v.map(|x| x.into());
15152        self
15153    }
15154
15155    /// Sets the value of [update_time][crate::model::Plugin::update_time].
15156    pub fn set_update_time<T>(mut self, v: T) -> Self
15157    where
15158        T: std::convert::Into<wkt::Timestamp>,
15159    {
15160        self.update_time = std::option::Option::Some(v.into());
15161        self
15162    }
15163
15164    /// Sets or clears the value of [update_time][crate::model::Plugin::update_time].
15165    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15166    where
15167        T: std::convert::Into<wkt::Timestamp>,
15168    {
15169        self.update_time = v.map(|x| x.into());
15170        self
15171    }
15172
15173    /// Sets the value of [gateway_type][crate::model::Plugin::gateway_type].
15174    pub fn set_gateway_type<T: std::convert::Into<crate::model::GatewayType>>(
15175        mut self,
15176        v: T,
15177    ) -> Self {
15178        self.gateway_type = v.into();
15179        self
15180    }
15181}
15182
15183impl wkt::message::Message for Plugin {
15184    fn typename() -> &'static str {
15185        "type.googleapis.com/google.cloud.apihub.v1.Plugin"
15186    }
15187}
15188
15189/// Defines additional types related to [Plugin].
15190pub mod plugin {
15191    #[allow(unused_imports)]
15192    use super::*;
15193
15194    /// The information related to the service implemented by the plugin
15195    /// developer, used to invoke the plugin's functionality.
15196    #[derive(Clone, Default, PartialEq)]
15197    #[non_exhaustive]
15198    pub struct HostingService {
15199        /// Optional. The URI of the service implemented by the plugin developer,
15200        /// used to invoke the plugin's functionality. This information is only
15201        /// required for user defined plugins.
15202        pub service_uri: std::string::String,
15203
15204        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15205    }
15206
15207    impl HostingService {
15208        pub fn new() -> Self {
15209            std::default::Default::default()
15210        }
15211
15212        /// Sets the value of [service_uri][crate::model::plugin::HostingService::service_uri].
15213        pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15214            self.service_uri = v.into();
15215            self
15216        }
15217    }
15218
15219    impl wkt::message::Message for HostingService {
15220        fn typename() -> &'static str {
15221            "type.googleapis.com/google.cloud.apihub.v1.Plugin.HostingService"
15222        }
15223    }
15224
15225    /// ConfigTemplate represents the configuration template for a plugin.
15226    #[derive(Clone, Default, PartialEq)]
15227    #[non_exhaustive]
15228    pub struct ConfigTemplate {
15229        /// Optional. The authentication template for the plugin.
15230        pub auth_config_template:
15231            std::option::Option<crate::model::plugin::config_template::AuthConfigTemplate>,
15232
15233        /// Optional. The list of additional configuration variables for the plugin's
15234        /// configuration.
15235        pub additional_config_template: std::vec::Vec<crate::model::ConfigVariableTemplate>,
15236
15237        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15238    }
15239
15240    impl ConfigTemplate {
15241        pub fn new() -> Self {
15242            std::default::Default::default()
15243        }
15244
15245        /// Sets the value of [auth_config_template][crate::model::plugin::ConfigTemplate::auth_config_template].
15246        pub fn set_auth_config_template<T>(mut self, v: T) -> Self
15247        where
15248            T: std::convert::Into<crate::model::plugin::config_template::AuthConfigTemplate>,
15249        {
15250            self.auth_config_template = std::option::Option::Some(v.into());
15251            self
15252        }
15253
15254        /// Sets or clears the value of [auth_config_template][crate::model::plugin::ConfigTemplate::auth_config_template].
15255        pub fn set_or_clear_auth_config_template<T>(mut self, v: std::option::Option<T>) -> Self
15256        where
15257            T: std::convert::Into<crate::model::plugin::config_template::AuthConfigTemplate>,
15258        {
15259            self.auth_config_template = v.map(|x| x.into());
15260            self
15261        }
15262
15263        /// Sets the value of [additional_config_template][crate::model::plugin::ConfigTemplate::additional_config_template].
15264        pub fn set_additional_config_template<T, V>(mut self, v: T) -> Self
15265        where
15266            T: std::iter::IntoIterator<Item = V>,
15267            V: std::convert::Into<crate::model::ConfigVariableTemplate>,
15268        {
15269            use std::iter::Iterator;
15270            self.additional_config_template = v.into_iter().map(|i| i.into()).collect();
15271            self
15272        }
15273    }
15274
15275    impl wkt::message::Message for ConfigTemplate {
15276        fn typename() -> &'static str {
15277            "type.googleapis.com/google.cloud.apihub.v1.Plugin.ConfigTemplate"
15278        }
15279    }
15280
15281    /// Defines additional types related to [ConfigTemplate].
15282    pub mod config_template {
15283        #[allow(unused_imports)]
15284        use super::*;
15285
15286        /// AuthConfigTemplate represents the authentication template for a plugin.
15287        #[derive(Clone, Default, PartialEq)]
15288        #[non_exhaustive]
15289        pub struct AuthConfigTemplate {
15290            /// Required. The list of authentication types supported by the plugin.
15291            pub supported_auth_types: std::vec::Vec<crate::model::AuthType>,
15292
15293            /// Optional. The service account of the plugin hosting service.
15294            /// This service account should be granted the required permissions on the
15295            /// Auth Config parameters provided while creating the plugin instances
15296            /// corresponding to this plugin.
15297            ///
15298            /// For example, if the plugin instance auth config requires a secret
15299            /// manager secret, the service account should be granted the
15300            /// secretmanager.versions.access permission on the corresponding secret,
15301            /// if the plugin instance auth config contains a service account, the
15302            /// service account should be granted the
15303            /// iam.serviceAccounts.getAccessToken permission on the corresponding
15304            /// service account.
15305            pub service_account: std::option::Option<crate::model::GoogleServiceAccountConfig>,
15306
15307            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15308        }
15309
15310        impl AuthConfigTemplate {
15311            pub fn new() -> Self {
15312                std::default::Default::default()
15313            }
15314
15315            /// Sets the value of [supported_auth_types][crate::model::plugin::config_template::AuthConfigTemplate::supported_auth_types].
15316            pub fn set_supported_auth_types<T, V>(mut self, v: T) -> Self
15317            where
15318                T: std::iter::IntoIterator<Item = V>,
15319                V: std::convert::Into<crate::model::AuthType>,
15320            {
15321                use std::iter::Iterator;
15322                self.supported_auth_types = v.into_iter().map(|i| i.into()).collect();
15323                self
15324            }
15325
15326            /// Sets the value of [service_account][crate::model::plugin::config_template::AuthConfigTemplate::service_account].
15327            pub fn set_service_account<T>(mut self, v: T) -> Self
15328            where
15329                T: std::convert::Into<crate::model::GoogleServiceAccountConfig>,
15330            {
15331                self.service_account = std::option::Option::Some(v.into());
15332                self
15333            }
15334
15335            /// Sets or clears the value of [service_account][crate::model::plugin::config_template::AuthConfigTemplate::service_account].
15336            pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
15337            where
15338                T: std::convert::Into<crate::model::GoogleServiceAccountConfig>,
15339            {
15340                self.service_account = v.map(|x| x.into());
15341                self
15342            }
15343        }
15344
15345        impl wkt::message::Message for AuthConfigTemplate {
15346            fn typename() -> &'static str {
15347                "type.googleapis.com/google.cloud.apihub.v1.Plugin.ConfigTemplate.AuthConfigTemplate"
15348            }
15349        }
15350    }
15351
15352    /// Possible states a plugin can have. Note that this enum may receive new
15353    /// values in the future. Consumers are advised to always code against the
15354    /// enum values expecting new states can be added later on.
15355    ///
15356    /// # Working with unknown values
15357    ///
15358    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15359    /// additional enum variants at any time. Adding new variants is not considered
15360    /// a breaking change. Applications should write their code in anticipation of:
15361    ///
15362    /// - New values appearing in future releases of the client library, **and**
15363    /// - New values received dynamically, without application changes.
15364    ///
15365    /// Please consult the [Working with enums] section in the user guide for some
15366    /// guidelines.
15367    ///
15368    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15369    #[derive(Clone, Debug, PartialEq)]
15370    #[non_exhaustive]
15371    pub enum State {
15372        /// The default value. This value is used if the state is omitted.
15373        Unspecified,
15374        /// The plugin is enabled.
15375        Enabled,
15376        /// The plugin is disabled.
15377        Disabled,
15378        /// If set, the enum was initialized with an unknown value.
15379        ///
15380        /// Applications can examine the value using [State::value] or
15381        /// [State::name].
15382        UnknownValue(state::UnknownValue),
15383    }
15384
15385    #[doc(hidden)]
15386    pub mod state {
15387        #[allow(unused_imports)]
15388        use super::*;
15389        #[derive(Clone, Debug, PartialEq)]
15390        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15391    }
15392
15393    impl State {
15394        /// Gets the enum value.
15395        ///
15396        /// Returns `None` if the enum contains an unknown value deserialized from
15397        /// the string representation of enums.
15398        pub fn value(&self) -> std::option::Option<i32> {
15399            match self {
15400                Self::Unspecified => std::option::Option::Some(0),
15401                Self::Enabled => std::option::Option::Some(1),
15402                Self::Disabled => std::option::Option::Some(2),
15403                Self::UnknownValue(u) => u.0.value(),
15404            }
15405        }
15406
15407        /// Gets the enum value as a string.
15408        ///
15409        /// Returns `None` if the enum contains an unknown value deserialized from
15410        /// the integer representation of enums.
15411        pub fn name(&self) -> std::option::Option<&str> {
15412            match self {
15413                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15414                Self::Enabled => std::option::Option::Some("ENABLED"),
15415                Self::Disabled => std::option::Option::Some("DISABLED"),
15416                Self::UnknownValue(u) => u.0.name(),
15417            }
15418        }
15419    }
15420
15421    impl std::default::Default for State {
15422        fn default() -> Self {
15423            use std::convert::From;
15424            Self::from(0)
15425        }
15426    }
15427
15428    impl std::fmt::Display for State {
15429        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15430            wkt::internal::display_enum(f, self.name(), self.value())
15431        }
15432    }
15433
15434    impl std::convert::From<i32> for State {
15435        fn from(value: i32) -> Self {
15436            match value {
15437                0 => Self::Unspecified,
15438                1 => Self::Enabled,
15439                2 => Self::Disabled,
15440                _ => Self::UnknownValue(state::UnknownValue(
15441                    wkt::internal::UnknownEnumValue::Integer(value),
15442                )),
15443            }
15444        }
15445    }
15446
15447    impl std::convert::From<&str> for State {
15448        fn from(value: &str) -> Self {
15449            use std::string::ToString;
15450            match value {
15451                "STATE_UNSPECIFIED" => Self::Unspecified,
15452                "ENABLED" => Self::Enabled,
15453                "DISABLED" => Self::Disabled,
15454                _ => Self::UnknownValue(state::UnknownValue(
15455                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15456                )),
15457            }
15458        }
15459    }
15460
15461    impl serde::ser::Serialize for State {
15462        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15463        where
15464            S: serde::Serializer,
15465        {
15466            match self {
15467                Self::Unspecified => serializer.serialize_i32(0),
15468                Self::Enabled => serializer.serialize_i32(1),
15469                Self::Disabled => serializer.serialize_i32(2),
15470                Self::UnknownValue(u) => u.0.serialize(serializer),
15471            }
15472        }
15473    }
15474
15475    impl<'de> serde::de::Deserialize<'de> for State {
15476        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15477        where
15478            D: serde::Deserializer<'de>,
15479        {
15480            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15481                ".google.cloud.apihub.v1.Plugin.State",
15482            ))
15483        }
15484    }
15485
15486    /// Ownership type of the plugin.
15487    ///
15488    /// # Working with unknown values
15489    ///
15490    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15491    /// additional enum variants at any time. Adding new variants is not considered
15492    /// a breaking change. Applications should write their code in anticipation of:
15493    ///
15494    /// - New values appearing in future releases of the client library, **and**
15495    /// - New values received dynamically, without application changes.
15496    ///
15497    /// Please consult the [Working with enums] section in the user guide for some
15498    /// guidelines.
15499    ///
15500    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15501    #[derive(Clone, Debug, PartialEq)]
15502    #[non_exhaustive]
15503    pub enum OwnershipType {
15504        /// Default unspecified type.
15505        Unspecified,
15506        /// System owned plugins are defined by API hub and are available out of the
15507        /// box in API hub.
15508        SystemOwned,
15509        /// User owned plugins are defined by the user and need to be explicitly
15510        /// added to API hub via
15511        /// [CreatePlugin][google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin] method.
15512        ///
15513        /// [google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin]: crate::client::ApiHubPlugin::create_plugin
15514        UserOwned,
15515        /// If set, the enum was initialized with an unknown value.
15516        ///
15517        /// Applications can examine the value using [OwnershipType::value] or
15518        /// [OwnershipType::name].
15519        UnknownValue(ownership_type::UnknownValue),
15520    }
15521
15522    #[doc(hidden)]
15523    pub mod ownership_type {
15524        #[allow(unused_imports)]
15525        use super::*;
15526        #[derive(Clone, Debug, PartialEq)]
15527        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15528    }
15529
15530    impl OwnershipType {
15531        /// Gets the enum value.
15532        ///
15533        /// Returns `None` if the enum contains an unknown value deserialized from
15534        /// the string representation of enums.
15535        pub fn value(&self) -> std::option::Option<i32> {
15536            match self {
15537                Self::Unspecified => std::option::Option::Some(0),
15538                Self::SystemOwned => std::option::Option::Some(1),
15539                Self::UserOwned => std::option::Option::Some(2),
15540                Self::UnknownValue(u) => u.0.value(),
15541            }
15542        }
15543
15544        /// Gets the enum value as a string.
15545        ///
15546        /// Returns `None` if the enum contains an unknown value deserialized from
15547        /// the integer representation of enums.
15548        pub fn name(&self) -> std::option::Option<&str> {
15549            match self {
15550                Self::Unspecified => std::option::Option::Some("OWNERSHIP_TYPE_UNSPECIFIED"),
15551                Self::SystemOwned => std::option::Option::Some("SYSTEM_OWNED"),
15552                Self::UserOwned => std::option::Option::Some("USER_OWNED"),
15553                Self::UnknownValue(u) => u.0.name(),
15554            }
15555        }
15556    }
15557
15558    impl std::default::Default for OwnershipType {
15559        fn default() -> Self {
15560            use std::convert::From;
15561            Self::from(0)
15562        }
15563    }
15564
15565    impl std::fmt::Display for OwnershipType {
15566        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15567            wkt::internal::display_enum(f, self.name(), self.value())
15568        }
15569    }
15570
15571    impl std::convert::From<i32> for OwnershipType {
15572        fn from(value: i32) -> Self {
15573            match value {
15574                0 => Self::Unspecified,
15575                1 => Self::SystemOwned,
15576                2 => Self::UserOwned,
15577                _ => Self::UnknownValue(ownership_type::UnknownValue(
15578                    wkt::internal::UnknownEnumValue::Integer(value),
15579                )),
15580            }
15581        }
15582    }
15583
15584    impl std::convert::From<&str> for OwnershipType {
15585        fn from(value: &str) -> Self {
15586            use std::string::ToString;
15587            match value {
15588                "OWNERSHIP_TYPE_UNSPECIFIED" => Self::Unspecified,
15589                "SYSTEM_OWNED" => Self::SystemOwned,
15590                "USER_OWNED" => Self::UserOwned,
15591                _ => Self::UnknownValue(ownership_type::UnknownValue(
15592                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15593                )),
15594            }
15595        }
15596    }
15597
15598    impl serde::ser::Serialize for OwnershipType {
15599        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15600        where
15601            S: serde::Serializer,
15602        {
15603            match self {
15604                Self::Unspecified => serializer.serialize_i32(0),
15605                Self::SystemOwned => serializer.serialize_i32(1),
15606                Self::UserOwned => serializer.serialize_i32(2),
15607                Self::UnknownValue(u) => u.0.serialize(serializer),
15608            }
15609        }
15610    }
15611
15612    impl<'de> serde::de::Deserialize<'de> for OwnershipType {
15613        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15614        where
15615            D: serde::Deserializer<'de>,
15616        {
15617            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OwnershipType>::new(
15618                ".google.cloud.apihub.v1.Plugin.OwnershipType",
15619            ))
15620        }
15621    }
15622}
15623
15624/// PluginActionConfig represents the configuration of an action supported by a
15625/// plugin.
15626#[derive(Clone, Default, PartialEq)]
15627#[non_exhaustive]
15628pub struct PluginActionConfig {
15629    /// Required. The id of the action.
15630    pub id: std::string::String,
15631
15632    /// Required. The display name of the action.
15633    pub display_name: std::string::String,
15634
15635    /// Required. The description of the operation performed by the action.
15636    pub description: std::string::String,
15637
15638    /// Required. The trigger mode supported by the action.
15639    pub trigger_mode: crate::model::plugin_action_config::TriggerMode,
15640
15641    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15642}
15643
15644impl PluginActionConfig {
15645    pub fn new() -> Self {
15646        std::default::Default::default()
15647    }
15648
15649    /// Sets the value of [id][crate::model::PluginActionConfig::id].
15650    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15651        self.id = v.into();
15652        self
15653    }
15654
15655    /// Sets the value of [display_name][crate::model::PluginActionConfig::display_name].
15656    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15657        self.display_name = v.into();
15658        self
15659    }
15660
15661    /// Sets the value of [description][crate::model::PluginActionConfig::description].
15662    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15663        self.description = v.into();
15664        self
15665    }
15666
15667    /// Sets the value of [trigger_mode][crate::model::PluginActionConfig::trigger_mode].
15668    pub fn set_trigger_mode<
15669        T: std::convert::Into<crate::model::plugin_action_config::TriggerMode>,
15670    >(
15671        mut self,
15672        v: T,
15673    ) -> Self {
15674        self.trigger_mode = v.into();
15675        self
15676    }
15677}
15678
15679impl wkt::message::Message for PluginActionConfig {
15680    fn typename() -> &'static str {
15681        "type.googleapis.com/google.cloud.apihub.v1.PluginActionConfig"
15682    }
15683}
15684
15685/// Defines additional types related to [PluginActionConfig].
15686pub mod plugin_action_config {
15687    #[allow(unused_imports)]
15688    use super::*;
15689
15690    /// Execution mode of the action.
15691    ///
15692    /// # Working with unknown values
15693    ///
15694    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15695    /// additional enum variants at any time. Adding new variants is not considered
15696    /// a breaking change. Applications should write their code in anticipation of:
15697    ///
15698    /// - New values appearing in future releases of the client library, **and**
15699    /// - New values received dynamically, without application changes.
15700    ///
15701    /// Please consult the [Working with enums] section in the user guide for some
15702    /// guidelines.
15703    ///
15704    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15705    #[derive(Clone, Debug, PartialEq)]
15706    #[non_exhaustive]
15707    pub enum TriggerMode {
15708        /// Default unspecified mode.
15709        Unspecified,
15710        /// This action can be executed by invoking
15711        /// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
15712        /// API with the given action id. To support this, the plugin hosting service
15713        /// should handle this action id as part of execute call.
15714        ///
15715        /// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
15716        ApiHubOnDemandTrigger,
15717        /// This action will be executed on schedule by invoking
15718        /// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
15719        /// API with the given action id. To set the schedule, the user can provide
15720        /// the cron expression in the
15721        /// [PluginAction][PluginAction.schedule_cron_expression] field for a given
15722        /// plugin instance. To support this, the plugin hosting service should
15723        /// handle this action id as part of execute call.
15724        /// Note, on demand execution will be supported by default in this trigger
15725        /// mode.
15726        ///
15727        /// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
15728        ApiHubScheduleTrigger,
15729        /// The execution of this plugin is not handled by API hub. In this case,
15730        /// the plugin hosting service need not handle this action id as part of
15731        /// the execute call.
15732        NonApiHubManaged,
15733        /// If set, the enum was initialized with an unknown value.
15734        ///
15735        /// Applications can examine the value using [TriggerMode::value] or
15736        /// [TriggerMode::name].
15737        UnknownValue(trigger_mode::UnknownValue),
15738    }
15739
15740    #[doc(hidden)]
15741    pub mod trigger_mode {
15742        #[allow(unused_imports)]
15743        use super::*;
15744        #[derive(Clone, Debug, PartialEq)]
15745        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15746    }
15747
15748    impl TriggerMode {
15749        /// Gets the enum value.
15750        ///
15751        /// Returns `None` if the enum contains an unknown value deserialized from
15752        /// the string representation of enums.
15753        pub fn value(&self) -> std::option::Option<i32> {
15754            match self {
15755                Self::Unspecified => std::option::Option::Some(0),
15756                Self::ApiHubOnDemandTrigger => std::option::Option::Some(1),
15757                Self::ApiHubScheduleTrigger => std::option::Option::Some(2),
15758                Self::NonApiHubManaged => std::option::Option::Some(3),
15759                Self::UnknownValue(u) => u.0.value(),
15760            }
15761        }
15762
15763        /// Gets the enum value as a string.
15764        ///
15765        /// Returns `None` if the enum contains an unknown value deserialized from
15766        /// the integer representation of enums.
15767        pub fn name(&self) -> std::option::Option<&str> {
15768            match self {
15769                Self::Unspecified => std::option::Option::Some("TRIGGER_MODE_UNSPECIFIED"),
15770                Self::ApiHubOnDemandTrigger => {
15771                    std::option::Option::Some("API_HUB_ON_DEMAND_TRIGGER")
15772                }
15773                Self::ApiHubScheduleTrigger => {
15774                    std::option::Option::Some("API_HUB_SCHEDULE_TRIGGER")
15775                }
15776                Self::NonApiHubManaged => std::option::Option::Some("NON_API_HUB_MANAGED"),
15777                Self::UnknownValue(u) => u.0.name(),
15778            }
15779        }
15780    }
15781
15782    impl std::default::Default for TriggerMode {
15783        fn default() -> Self {
15784            use std::convert::From;
15785            Self::from(0)
15786        }
15787    }
15788
15789    impl std::fmt::Display for TriggerMode {
15790        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15791            wkt::internal::display_enum(f, self.name(), self.value())
15792        }
15793    }
15794
15795    impl std::convert::From<i32> for TriggerMode {
15796        fn from(value: i32) -> Self {
15797            match value {
15798                0 => Self::Unspecified,
15799                1 => Self::ApiHubOnDemandTrigger,
15800                2 => Self::ApiHubScheduleTrigger,
15801                3 => Self::NonApiHubManaged,
15802                _ => Self::UnknownValue(trigger_mode::UnknownValue(
15803                    wkt::internal::UnknownEnumValue::Integer(value),
15804                )),
15805            }
15806        }
15807    }
15808
15809    impl std::convert::From<&str> for TriggerMode {
15810        fn from(value: &str) -> Self {
15811            use std::string::ToString;
15812            match value {
15813                "TRIGGER_MODE_UNSPECIFIED" => Self::Unspecified,
15814                "API_HUB_ON_DEMAND_TRIGGER" => Self::ApiHubOnDemandTrigger,
15815                "API_HUB_SCHEDULE_TRIGGER" => Self::ApiHubScheduleTrigger,
15816                "NON_API_HUB_MANAGED" => Self::NonApiHubManaged,
15817                _ => Self::UnknownValue(trigger_mode::UnknownValue(
15818                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15819                )),
15820            }
15821        }
15822    }
15823
15824    impl serde::ser::Serialize for TriggerMode {
15825        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15826        where
15827            S: serde::Serializer,
15828        {
15829            match self {
15830                Self::Unspecified => serializer.serialize_i32(0),
15831                Self::ApiHubOnDemandTrigger => serializer.serialize_i32(1),
15832                Self::ApiHubScheduleTrigger => serializer.serialize_i32(2),
15833                Self::NonApiHubManaged => serializer.serialize_i32(3),
15834                Self::UnknownValue(u) => u.0.serialize(serializer),
15835            }
15836        }
15837    }
15838
15839    impl<'de> serde::de::Deserialize<'de> for TriggerMode {
15840        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15841        where
15842            D: serde::Deserializer<'de>,
15843        {
15844            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TriggerMode>::new(
15845                ".google.cloud.apihub.v1.PluginActionConfig.TriggerMode",
15846            ))
15847        }
15848    }
15849}
15850
15851/// The [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's
15852/// request.
15853///
15854/// [google.cloud.apihub.v1.ApiHubPlugin.GetPlugin]: crate::client::ApiHubPlugin::get_plugin
15855#[derive(Clone, Default, PartialEq)]
15856#[non_exhaustive]
15857pub struct GetPluginRequest {
15858    /// Required. The name of the plugin to retrieve.
15859    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
15860    pub name: std::string::String,
15861
15862    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15863}
15864
15865impl GetPluginRequest {
15866    pub fn new() -> Self {
15867        std::default::Default::default()
15868    }
15869
15870    /// Sets the value of [name][crate::model::GetPluginRequest::name].
15871    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15872        self.name = v.into();
15873        self
15874    }
15875}
15876
15877impl wkt::message::Message for GetPluginRequest {
15878    fn typename() -> &'static str {
15879        "type.googleapis.com/google.cloud.apihub.v1.GetPluginRequest"
15880    }
15881}
15882
15883/// The [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's
15884/// request.
15885///
15886/// [google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin]: crate::client::ApiHubPlugin::enable_plugin
15887#[derive(Clone, Default, PartialEq)]
15888#[non_exhaustive]
15889pub struct EnablePluginRequest {
15890    /// Required. The name of the plugin to enable.
15891    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
15892    pub name: std::string::String,
15893
15894    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15895}
15896
15897impl EnablePluginRequest {
15898    pub fn new() -> Self {
15899        std::default::Default::default()
15900    }
15901
15902    /// Sets the value of [name][crate::model::EnablePluginRequest::name].
15903    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15904        self.name = v.into();
15905        self
15906    }
15907}
15908
15909impl wkt::message::Message for EnablePluginRequest {
15910    fn typename() -> &'static str {
15911        "type.googleapis.com/google.cloud.apihub.v1.EnablePluginRequest"
15912    }
15913}
15914
15915/// The [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin]
15916/// method's request.
15917///
15918/// [google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin]: crate::client::ApiHubPlugin::disable_plugin
15919#[derive(Clone, Default, PartialEq)]
15920#[non_exhaustive]
15921pub struct DisablePluginRequest {
15922    /// Required. The name of the plugin to disable.
15923    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
15924    pub name: std::string::String,
15925
15926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15927}
15928
15929impl DisablePluginRequest {
15930    pub fn new() -> Self {
15931        std::default::Default::default()
15932    }
15933
15934    /// Sets the value of [name][crate::model::DisablePluginRequest::name].
15935    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15936        self.name = v.into();
15937        self
15938    }
15939}
15940
15941impl wkt::message::Message for DisablePluginRequest {
15942    fn typename() -> &'static str {
15943        "type.googleapis.com/google.cloud.apihub.v1.DisablePluginRequest"
15944    }
15945}
15946
15947/// PluginInstanceAction represents an action which can be executed in the plugin
15948/// instance.
15949#[derive(Clone, Default, PartialEq)]
15950#[non_exhaustive]
15951pub struct PluginInstanceAction {
15952    /// Required. This should map to one of the [action
15953    /// id][google.cloud.apihub.v1.PluginActionConfig.id] specified in
15954    /// [actions_config][google.cloud.apihub.v1.Plugin.actions_config] in the
15955    /// plugin.
15956    ///
15957    /// [google.cloud.apihub.v1.Plugin.actions_config]: crate::model::Plugin::actions_config
15958    /// [google.cloud.apihub.v1.PluginActionConfig.id]: crate::model::PluginActionConfig::id
15959    pub action_id: std::string::String,
15960
15961    /// Output only. The current state of the plugin action in the plugin instance.
15962    pub state: crate::model::plugin_instance_action::State,
15963
15964    /// Optional. The schedule for this plugin instance action. This can only be
15965    /// set if the plugin supports API_HUB_SCHEDULE_TRIGGER mode for this action.
15966    pub schedule_cron_expression: std::string::String,
15967
15968    /// Optional. This configuration should be provided if the plugin action is
15969    /// publishing data to API hub curate layer.
15970    pub curation_config: std::option::Option<crate::model::CurationConfig>,
15971
15972    /// Optional. The time zone for the schedule cron expression. If not provided,
15973    /// UTC will be used.
15974    pub schedule_time_zone: std::string::String,
15975
15976    /// Optional. The service account used to publish data. Note, the service
15977    /// account will only be accepted for non GCP plugins like OPDK.
15978    pub service_account: std::string::String,
15979
15980    /// Output only. The configuration of resources created for a given plugin
15981    /// instance action. Note these will be returned only in case of Non-GCP
15982    /// plugins like OPDK.
15983    pub resource_config: std::option::Option<crate::model::plugin_instance_action::ResourceConfig>,
15984
15985    /// The status of the plugin action.
15986    pub action_status: std::option::Option<crate::model::plugin_instance_action::ActionStatus>,
15987
15988    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15989}
15990
15991impl PluginInstanceAction {
15992    pub fn new() -> Self {
15993        std::default::Default::default()
15994    }
15995
15996    /// Sets the value of [action_id][crate::model::PluginInstanceAction::action_id].
15997    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15998        self.action_id = v.into();
15999        self
16000    }
16001
16002    /// Sets the value of [state][crate::model::PluginInstanceAction::state].
16003    pub fn set_state<T: std::convert::Into<crate::model::plugin_instance_action::State>>(
16004        mut self,
16005        v: T,
16006    ) -> Self {
16007        self.state = v.into();
16008        self
16009    }
16010
16011    /// Sets the value of [schedule_cron_expression][crate::model::PluginInstanceAction::schedule_cron_expression].
16012    pub fn set_schedule_cron_expression<T: std::convert::Into<std::string::String>>(
16013        mut self,
16014        v: T,
16015    ) -> Self {
16016        self.schedule_cron_expression = v.into();
16017        self
16018    }
16019
16020    /// Sets the value of [curation_config][crate::model::PluginInstanceAction::curation_config].
16021    pub fn set_curation_config<T>(mut self, v: T) -> Self
16022    where
16023        T: std::convert::Into<crate::model::CurationConfig>,
16024    {
16025        self.curation_config = std::option::Option::Some(v.into());
16026        self
16027    }
16028
16029    /// Sets or clears the value of [curation_config][crate::model::PluginInstanceAction::curation_config].
16030    pub fn set_or_clear_curation_config<T>(mut self, v: std::option::Option<T>) -> Self
16031    where
16032        T: std::convert::Into<crate::model::CurationConfig>,
16033    {
16034        self.curation_config = v.map(|x| x.into());
16035        self
16036    }
16037
16038    /// Sets the value of [schedule_time_zone][crate::model::PluginInstanceAction::schedule_time_zone].
16039    pub fn set_schedule_time_zone<T: std::convert::Into<std::string::String>>(
16040        mut self,
16041        v: T,
16042    ) -> Self {
16043        self.schedule_time_zone = v.into();
16044        self
16045    }
16046
16047    /// Sets the value of [service_account][crate::model::PluginInstanceAction::service_account].
16048    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16049        self.service_account = v.into();
16050        self
16051    }
16052
16053    /// Sets the value of [resource_config][crate::model::PluginInstanceAction::resource_config].
16054    pub fn set_resource_config<T>(mut self, v: T) -> Self
16055    where
16056        T: std::convert::Into<crate::model::plugin_instance_action::ResourceConfig>,
16057    {
16058        self.resource_config = std::option::Option::Some(v.into());
16059        self
16060    }
16061
16062    /// Sets or clears the value of [resource_config][crate::model::PluginInstanceAction::resource_config].
16063    pub fn set_or_clear_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
16064    where
16065        T: std::convert::Into<crate::model::plugin_instance_action::ResourceConfig>,
16066    {
16067        self.resource_config = v.map(|x| x.into());
16068        self
16069    }
16070
16071    /// Sets the value of [action_status][crate::model::PluginInstanceAction::action_status].
16072    ///
16073    /// Note that all the setters affecting `action_status` are mutually
16074    /// exclusive.
16075    pub fn set_action_status<
16076        T: std::convert::Into<std::option::Option<crate::model::plugin_instance_action::ActionStatus>>,
16077    >(
16078        mut self,
16079        v: T,
16080    ) -> Self {
16081        self.action_status = v.into();
16082        self
16083    }
16084
16085    /// The value of [action_status][crate::model::PluginInstanceAction::action_status]
16086    /// if it holds a `HubInstanceAction`, `None` if the field is not set or
16087    /// holds a different branch.
16088    pub fn hub_instance_action(
16089        &self,
16090    ) -> std::option::Option<&std::boxed::Box<crate::model::ExecutionStatus>> {
16091        #[allow(unreachable_patterns)]
16092        self.action_status.as_ref().and_then(|v| match v {
16093            crate::model::plugin_instance_action::ActionStatus::HubInstanceAction(v) => {
16094                std::option::Option::Some(v)
16095            }
16096            _ => std::option::Option::None,
16097        })
16098    }
16099
16100    /// Sets the value of [action_status][crate::model::PluginInstanceAction::action_status]
16101    /// to hold a `HubInstanceAction`.
16102    ///
16103    /// Note that all the setters affecting `action_status` are
16104    /// mutually exclusive.
16105    pub fn set_hub_instance_action<
16106        T: std::convert::Into<std::boxed::Box<crate::model::ExecutionStatus>>,
16107    >(
16108        mut self,
16109        v: T,
16110    ) -> Self {
16111        self.action_status = std::option::Option::Some(
16112            crate::model::plugin_instance_action::ActionStatus::HubInstanceAction(v.into()),
16113        );
16114        self
16115    }
16116}
16117
16118impl wkt::message::Message for PluginInstanceAction {
16119    fn typename() -> &'static str {
16120        "type.googleapis.com/google.cloud.apihub.v1.PluginInstanceAction"
16121    }
16122}
16123
16124/// Defines additional types related to [PluginInstanceAction].
16125pub mod plugin_instance_action {
16126    #[allow(unused_imports)]
16127    use super::*;
16128
16129    /// The configuration of resources created for a given plugin instance action.
16130    #[derive(Clone, Default, PartialEq)]
16131    #[non_exhaustive]
16132    pub struct ResourceConfig {
16133        /// Output only. The type of the action.
16134        pub action_type: crate::model::ActionType,
16135
16136        /// Output only. The pubsub topic to publish the data to. Format is
16137        /// projects/{project}/topics/{topic}
16138        pub pubsub_topic: std::string::String,
16139
16140        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16141    }
16142
16143    impl ResourceConfig {
16144        pub fn new() -> Self {
16145            std::default::Default::default()
16146        }
16147
16148        /// Sets the value of [action_type][crate::model::plugin_instance_action::ResourceConfig::action_type].
16149        pub fn set_action_type<T: std::convert::Into<crate::model::ActionType>>(
16150            mut self,
16151            v: T,
16152        ) -> Self {
16153            self.action_type = v.into();
16154            self
16155        }
16156
16157        /// Sets the value of [pubsub_topic][crate::model::plugin_instance_action::ResourceConfig::pubsub_topic].
16158        pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(
16159            mut self,
16160            v: T,
16161        ) -> Self {
16162            self.pubsub_topic = v.into();
16163            self
16164        }
16165    }
16166
16167    impl wkt::message::Message for ResourceConfig {
16168        fn typename() -> &'static str {
16169            "type.googleapis.com/google.cloud.apihub.v1.PluginInstanceAction.ResourceConfig"
16170        }
16171    }
16172
16173    /// State represents the state of the plugin instance action.
16174    ///
16175    /// # Working with unknown values
16176    ///
16177    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16178    /// additional enum variants at any time. Adding new variants is not considered
16179    /// a breaking change. Applications should write their code in anticipation of:
16180    ///
16181    /// - New values appearing in future releases of the client library, **and**
16182    /// - New values received dynamically, without application changes.
16183    ///
16184    /// Please consult the [Working with enums] section in the user guide for some
16185    /// guidelines.
16186    ///
16187    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16188    #[derive(Clone, Debug, PartialEq)]
16189    #[non_exhaustive]
16190    pub enum State {
16191        /// Default unspecified state.
16192        Unspecified,
16193        /// The action is enabled in the plugin instance i.e., executions can
16194        /// be triggered for this action.
16195        Enabled,
16196        /// The action is disabled in the plugin instance i.e., no executions
16197        /// can be triggered for this action. This state indicates that the user
16198        /// explicitly disabled the instance, and no further action is needed unless
16199        /// the user wants to re-enable it.
16200        Disabled,
16201        /// The action in the plugin instance is being enabled.
16202        Enabling,
16203        /// The action in the plugin instance is being disabled.
16204        Disabling,
16205        /// The ERROR state can come while enabling/disabling plugin instance action.
16206        /// Users can retrigger enable, disable via
16207        /// [EnablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]
16208        /// and
16209        /// [DisablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]
16210        /// to restore the action back to enabled/disabled state. Note enable/disable
16211        /// on actions can only be triggered if plugin instance is in Active state.
16212        ///
16213        /// [google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]: crate::client::ApiHubPlugin::disable_plugin_instance_action
16214        /// [google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]: crate::client::ApiHubPlugin::enable_plugin_instance_action
16215        Error,
16216        /// If set, the enum was initialized with an unknown value.
16217        ///
16218        /// Applications can examine the value using [State::value] or
16219        /// [State::name].
16220        UnknownValue(state::UnknownValue),
16221    }
16222
16223    #[doc(hidden)]
16224    pub mod state {
16225        #[allow(unused_imports)]
16226        use super::*;
16227        #[derive(Clone, Debug, PartialEq)]
16228        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16229    }
16230
16231    impl State {
16232        /// Gets the enum value.
16233        ///
16234        /// Returns `None` if the enum contains an unknown value deserialized from
16235        /// the string representation of enums.
16236        pub fn value(&self) -> std::option::Option<i32> {
16237            match self {
16238                Self::Unspecified => std::option::Option::Some(0),
16239                Self::Enabled => std::option::Option::Some(1),
16240                Self::Disabled => std::option::Option::Some(2),
16241                Self::Enabling => std::option::Option::Some(3),
16242                Self::Disabling => std::option::Option::Some(4),
16243                Self::Error => std::option::Option::Some(5),
16244                Self::UnknownValue(u) => u.0.value(),
16245            }
16246        }
16247
16248        /// Gets the enum value as a string.
16249        ///
16250        /// Returns `None` if the enum contains an unknown value deserialized from
16251        /// the integer representation of enums.
16252        pub fn name(&self) -> std::option::Option<&str> {
16253            match self {
16254                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16255                Self::Enabled => std::option::Option::Some("ENABLED"),
16256                Self::Disabled => std::option::Option::Some("DISABLED"),
16257                Self::Enabling => std::option::Option::Some("ENABLING"),
16258                Self::Disabling => std::option::Option::Some("DISABLING"),
16259                Self::Error => std::option::Option::Some("ERROR"),
16260                Self::UnknownValue(u) => u.0.name(),
16261            }
16262        }
16263    }
16264
16265    impl std::default::Default for State {
16266        fn default() -> Self {
16267            use std::convert::From;
16268            Self::from(0)
16269        }
16270    }
16271
16272    impl std::fmt::Display for State {
16273        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16274            wkt::internal::display_enum(f, self.name(), self.value())
16275        }
16276    }
16277
16278    impl std::convert::From<i32> for State {
16279        fn from(value: i32) -> Self {
16280            match value {
16281                0 => Self::Unspecified,
16282                1 => Self::Enabled,
16283                2 => Self::Disabled,
16284                3 => Self::Enabling,
16285                4 => Self::Disabling,
16286                5 => Self::Error,
16287                _ => Self::UnknownValue(state::UnknownValue(
16288                    wkt::internal::UnknownEnumValue::Integer(value),
16289                )),
16290            }
16291        }
16292    }
16293
16294    impl std::convert::From<&str> for State {
16295        fn from(value: &str) -> Self {
16296            use std::string::ToString;
16297            match value {
16298                "STATE_UNSPECIFIED" => Self::Unspecified,
16299                "ENABLED" => Self::Enabled,
16300                "DISABLED" => Self::Disabled,
16301                "ENABLING" => Self::Enabling,
16302                "DISABLING" => Self::Disabling,
16303                "ERROR" => Self::Error,
16304                _ => Self::UnknownValue(state::UnknownValue(
16305                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16306                )),
16307            }
16308        }
16309    }
16310
16311    impl serde::ser::Serialize for State {
16312        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16313        where
16314            S: serde::Serializer,
16315        {
16316            match self {
16317                Self::Unspecified => serializer.serialize_i32(0),
16318                Self::Enabled => serializer.serialize_i32(1),
16319                Self::Disabled => serializer.serialize_i32(2),
16320                Self::Enabling => serializer.serialize_i32(3),
16321                Self::Disabling => serializer.serialize_i32(4),
16322                Self::Error => serializer.serialize_i32(5),
16323                Self::UnknownValue(u) => u.0.serialize(serializer),
16324            }
16325        }
16326    }
16327
16328    impl<'de> serde::de::Deserialize<'de> for State {
16329        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16330        where
16331            D: serde::Deserializer<'de>,
16332        {
16333            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16334                ".google.cloud.apihub.v1.PluginInstanceAction.State",
16335            ))
16336        }
16337    }
16338
16339    /// The status of the plugin action.
16340    #[derive(Clone, Debug, PartialEq)]
16341    #[non_exhaustive]
16342    pub enum ActionStatus {
16343        /// Optional. The execution information for the plugin instance action done
16344        /// corresponding to an API hub instance.
16345        HubInstanceAction(std::boxed::Box<crate::model::ExecutionStatus>),
16346    }
16347}
16348
16349/// Represents a plugin instance resource in the API Hub.
16350/// A PluginInstance is a specific instance of a hub plugin with its own
16351/// configuration, state, and execution details.
16352#[derive(Clone, Default, PartialEq)]
16353#[non_exhaustive]
16354pub struct PluginInstance {
16355    /// Identifier. The unique name of the plugin instance resource.
16356    /// Format:
16357    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
16358    pub name: std::string::String,
16359
16360    /// Required. The display name for this plugin instance. Max length is 255
16361    /// characters.
16362    pub display_name: std::string::String,
16363
16364    /// Optional. The authentication information for this plugin instance.
16365    pub auth_config: std::option::Option<crate::model::AuthConfig>,
16366
16367    /// Optional. The additional information for this plugin instance corresponding
16368    /// to the additional config template of the plugin. This information will be
16369    /// sent to plugin hosting service on each call to plugin hosted service. The
16370    /// key will be the config_variable_template.display_name to uniquely identify
16371    /// the config variable.
16372    pub additional_config:
16373        std::collections::HashMap<std::string::String, crate::model::ConfigVariable>,
16374
16375    /// Output only. The current state of the plugin instance (e.g., enabled,
16376    /// disabled, provisioning).
16377    pub state: crate::model::plugin_instance::State,
16378
16379    /// Output only. Error message describing the failure, if any, during Create,
16380    /// Delete or ApplyConfig operation corresponding to the plugin instance.This
16381    /// field will only be populated if the plugin instance is in the ERROR or
16382    /// FAILED state.
16383    pub error_message: std::string::String,
16384
16385    /// Required. The action status for the plugin instance.
16386    pub actions: std::vec::Vec<crate::model::PluginInstanceAction>,
16387
16388    /// Output only. Timestamp indicating when the plugin instance was created.
16389    pub create_time: std::option::Option<wkt::Timestamp>,
16390
16391    /// Output only. Timestamp indicating when the plugin instance was last
16392    /// updated.
16393    pub update_time: std::option::Option<wkt::Timestamp>,
16394
16395    /// Optional. The source project id of the plugin instance. This will be the id
16396    /// of runtime project in case of gcp based plugins and org id in case of non
16397    /// gcp based plugins. This field will be a required field for Google provided
16398    /// on-ramp plugins.
16399    pub source_project_id: std::string::String,
16400
16401    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16402}
16403
16404impl PluginInstance {
16405    pub fn new() -> Self {
16406        std::default::Default::default()
16407    }
16408
16409    /// Sets the value of [name][crate::model::PluginInstance::name].
16410    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16411        self.name = v.into();
16412        self
16413    }
16414
16415    /// Sets the value of [display_name][crate::model::PluginInstance::display_name].
16416    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16417        self.display_name = v.into();
16418        self
16419    }
16420
16421    /// Sets the value of [auth_config][crate::model::PluginInstance::auth_config].
16422    pub fn set_auth_config<T>(mut self, v: T) -> Self
16423    where
16424        T: std::convert::Into<crate::model::AuthConfig>,
16425    {
16426        self.auth_config = std::option::Option::Some(v.into());
16427        self
16428    }
16429
16430    /// Sets or clears the value of [auth_config][crate::model::PluginInstance::auth_config].
16431    pub fn set_or_clear_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
16432    where
16433        T: std::convert::Into<crate::model::AuthConfig>,
16434    {
16435        self.auth_config = v.map(|x| x.into());
16436        self
16437    }
16438
16439    /// Sets the value of [additional_config][crate::model::PluginInstance::additional_config].
16440    pub fn set_additional_config<T, K, V>(mut self, v: T) -> Self
16441    where
16442        T: std::iter::IntoIterator<Item = (K, V)>,
16443        K: std::convert::Into<std::string::String>,
16444        V: std::convert::Into<crate::model::ConfigVariable>,
16445    {
16446        use std::iter::Iterator;
16447        self.additional_config = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16448        self
16449    }
16450
16451    /// Sets the value of [state][crate::model::PluginInstance::state].
16452    pub fn set_state<T: std::convert::Into<crate::model::plugin_instance::State>>(
16453        mut self,
16454        v: T,
16455    ) -> Self {
16456        self.state = v.into();
16457        self
16458    }
16459
16460    /// Sets the value of [error_message][crate::model::PluginInstance::error_message].
16461    pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16462        self.error_message = v.into();
16463        self
16464    }
16465
16466    /// Sets the value of [actions][crate::model::PluginInstance::actions].
16467    pub fn set_actions<T, V>(mut self, v: T) -> Self
16468    where
16469        T: std::iter::IntoIterator<Item = V>,
16470        V: std::convert::Into<crate::model::PluginInstanceAction>,
16471    {
16472        use std::iter::Iterator;
16473        self.actions = v.into_iter().map(|i| i.into()).collect();
16474        self
16475    }
16476
16477    /// Sets the value of [create_time][crate::model::PluginInstance::create_time].
16478    pub fn set_create_time<T>(mut self, v: T) -> Self
16479    where
16480        T: std::convert::Into<wkt::Timestamp>,
16481    {
16482        self.create_time = std::option::Option::Some(v.into());
16483        self
16484    }
16485
16486    /// Sets or clears the value of [create_time][crate::model::PluginInstance::create_time].
16487    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16488    where
16489        T: std::convert::Into<wkt::Timestamp>,
16490    {
16491        self.create_time = v.map(|x| x.into());
16492        self
16493    }
16494
16495    /// Sets the value of [update_time][crate::model::PluginInstance::update_time].
16496    pub fn set_update_time<T>(mut self, v: T) -> Self
16497    where
16498        T: std::convert::Into<wkt::Timestamp>,
16499    {
16500        self.update_time = std::option::Option::Some(v.into());
16501        self
16502    }
16503
16504    /// Sets or clears the value of [update_time][crate::model::PluginInstance::update_time].
16505    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16506    where
16507        T: std::convert::Into<wkt::Timestamp>,
16508    {
16509        self.update_time = v.map(|x| x.into());
16510        self
16511    }
16512
16513    /// Sets the value of [source_project_id][crate::model::PluginInstance::source_project_id].
16514    pub fn set_source_project_id<T: std::convert::Into<std::string::String>>(
16515        mut self,
16516        v: T,
16517    ) -> Self {
16518        self.source_project_id = v.into();
16519        self
16520    }
16521}
16522
16523impl wkt::message::Message for PluginInstance {
16524    fn typename() -> &'static str {
16525        "type.googleapis.com/google.cloud.apihub.v1.PluginInstance"
16526    }
16527}
16528
16529/// Defines additional types related to [PluginInstance].
16530pub mod plugin_instance {
16531    #[allow(unused_imports)]
16532    use super::*;
16533
16534    /// State represents the state of the plugin instance.
16535    ///
16536    /// # Working with unknown values
16537    ///
16538    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16539    /// additional enum variants at any time. Adding new variants is not considered
16540    /// a breaking change. Applications should write their code in anticipation of:
16541    ///
16542    /// - New values appearing in future releases of the client library, **and**
16543    /// - New values received dynamically, without application changes.
16544    ///
16545    /// Please consult the [Working with enums] section in the user guide for some
16546    /// guidelines.
16547    ///
16548    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16549    #[derive(Clone, Debug, PartialEq)]
16550    #[non_exhaustive]
16551    pub enum State {
16552        /// Default unspecified state.
16553        Unspecified,
16554        /// The plugin instance is being created.
16555        Creating,
16556        /// The plugin instance is active and ready for executions. This is the only
16557        /// state where executions can run on the plugin instance.
16558        Active,
16559        /// The updated config that contains
16560        /// [additional_config][google.cloud.apihub.v1.PluginInstance.additional_config]
16561        /// and [auth_config][google.cloud.apihub.v1.PluginInstance.auth_config] is
16562        /// being applied.
16563        ///
16564        /// [google.cloud.apihub.v1.PluginInstance.additional_config]: crate::model::PluginInstance::additional_config
16565        /// [google.cloud.apihub.v1.PluginInstance.auth_config]: crate::model::PluginInstance::auth_config
16566        ApplyingConfig,
16567        /// The ERROR state can come while applying config. Users
16568        /// can retrigger
16569        /// [ApplyPluginInstanceConfig][google.cloud.apihub.v1.ApiHubPlugin.ApplyPluginInstanceConfig]
16570        /// to restore the plugin instance back to active state. Note, In case the
16571        /// ERROR state happens while applying config (auth_config,
16572        /// additional_config), the plugin instance will reflect the config which was
16573        /// trying to be applied while error happened. In order to overwrite, trigger
16574        /// ApplyConfig with a new config.
16575        Error,
16576        /// The plugin instance is in a failed state. This indicates that an
16577        /// unrecoverable error occurred during a previous operation (Create,
16578        /// Delete).
16579        Failed,
16580        /// The plugin instance is being deleted. Delete is only possible if there is
16581        /// no other operation running on the plugin instance and plugin instance
16582        /// action.
16583        Deleting,
16584        /// If set, the enum was initialized with an unknown value.
16585        ///
16586        /// Applications can examine the value using [State::value] or
16587        /// [State::name].
16588        UnknownValue(state::UnknownValue),
16589    }
16590
16591    #[doc(hidden)]
16592    pub mod state {
16593        #[allow(unused_imports)]
16594        use super::*;
16595        #[derive(Clone, Debug, PartialEq)]
16596        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16597    }
16598
16599    impl State {
16600        /// Gets the enum value.
16601        ///
16602        /// Returns `None` if the enum contains an unknown value deserialized from
16603        /// the string representation of enums.
16604        pub fn value(&self) -> std::option::Option<i32> {
16605            match self {
16606                Self::Unspecified => std::option::Option::Some(0),
16607                Self::Creating => std::option::Option::Some(1),
16608                Self::Active => std::option::Option::Some(2),
16609                Self::ApplyingConfig => std::option::Option::Some(3),
16610                Self::Error => std::option::Option::Some(4),
16611                Self::Failed => std::option::Option::Some(5),
16612                Self::Deleting => std::option::Option::Some(6),
16613                Self::UnknownValue(u) => u.0.value(),
16614            }
16615        }
16616
16617        /// Gets the enum value as a string.
16618        ///
16619        /// Returns `None` if the enum contains an unknown value deserialized from
16620        /// the integer representation of enums.
16621        pub fn name(&self) -> std::option::Option<&str> {
16622            match self {
16623                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16624                Self::Creating => std::option::Option::Some("CREATING"),
16625                Self::Active => std::option::Option::Some("ACTIVE"),
16626                Self::ApplyingConfig => std::option::Option::Some("APPLYING_CONFIG"),
16627                Self::Error => std::option::Option::Some("ERROR"),
16628                Self::Failed => std::option::Option::Some("FAILED"),
16629                Self::Deleting => std::option::Option::Some("DELETING"),
16630                Self::UnknownValue(u) => u.0.name(),
16631            }
16632        }
16633    }
16634
16635    impl std::default::Default for State {
16636        fn default() -> Self {
16637            use std::convert::From;
16638            Self::from(0)
16639        }
16640    }
16641
16642    impl std::fmt::Display for State {
16643        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16644            wkt::internal::display_enum(f, self.name(), self.value())
16645        }
16646    }
16647
16648    impl std::convert::From<i32> for State {
16649        fn from(value: i32) -> Self {
16650            match value {
16651                0 => Self::Unspecified,
16652                1 => Self::Creating,
16653                2 => Self::Active,
16654                3 => Self::ApplyingConfig,
16655                4 => Self::Error,
16656                5 => Self::Failed,
16657                6 => Self::Deleting,
16658                _ => Self::UnknownValue(state::UnknownValue(
16659                    wkt::internal::UnknownEnumValue::Integer(value),
16660                )),
16661            }
16662        }
16663    }
16664
16665    impl std::convert::From<&str> for State {
16666        fn from(value: &str) -> Self {
16667            use std::string::ToString;
16668            match value {
16669                "STATE_UNSPECIFIED" => Self::Unspecified,
16670                "CREATING" => Self::Creating,
16671                "ACTIVE" => Self::Active,
16672                "APPLYING_CONFIG" => Self::ApplyingConfig,
16673                "ERROR" => Self::Error,
16674                "FAILED" => Self::Failed,
16675                "DELETING" => Self::Deleting,
16676                _ => Self::UnknownValue(state::UnknownValue(
16677                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16678                )),
16679            }
16680        }
16681    }
16682
16683    impl serde::ser::Serialize for State {
16684        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16685        where
16686            S: serde::Serializer,
16687        {
16688            match self {
16689                Self::Unspecified => serializer.serialize_i32(0),
16690                Self::Creating => serializer.serialize_i32(1),
16691                Self::Active => serializer.serialize_i32(2),
16692                Self::ApplyingConfig => serializer.serialize_i32(3),
16693                Self::Error => serializer.serialize_i32(4),
16694                Self::Failed => serializer.serialize_i32(5),
16695                Self::Deleting => serializer.serialize_i32(6),
16696                Self::UnknownValue(u) => u.0.serialize(serializer),
16697            }
16698        }
16699    }
16700
16701    impl<'de> serde::de::Deserialize<'de> for State {
16702        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16703        where
16704            D: serde::Deserializer<'de>,
16705        {
16706            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16707                ".google.cloud.apihub.v1.PluginInstance.State",
16708            ))
16709        }
16710    }
16711}
16712
16713/// The curation information for this plugin instance.
16714#[derive(Clone, Default, PartialEq)]
16715#[non_exhaustive]
16716pub struct CurationConfig {
16717    /// Required. The curation type for this plugin instance.
16718    pub curation_type: crate::model::CurationType,
16719
16720    /// The curation information for this plugin instance.
16721    pub curation_config: std::option::Option<crate::model::curation_config::CurationConfig>,
16722
16723    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16724}
16725
16726impl CurationConfig {
16727    pub fn new() -> Self {
16728        std::default::Default::default()
16729    }
16730
16731    /// Sets the value of [curation_type][crate::model::CurationConfig::curation_type].
16732    pub fn set_curation_type<T: std::convert::Into<crate::model::CurationType>>(
16733        mut self,
16734        v: T,
16735    ) -> Self {
16736        self.curation_type = v.into();
16737        self
16738    }
16739
16740    /// Sets the value of [curation_config][crate::model::CurationConfig::curation_config].
16741    ///
16742    /// Note that all the setters affecting `curation_config` are mutually
16743    /// exclusive.
16744    pub fn set_curation_config<
16745        T: std::convert::Into<std::option::Option<crate::model::curation_config::CurationConfig>>,
16746    >(
16747        mut self,
16748        v: T,
16749    ) -> Self {
16750        self.curation_config = v.into();
16751        self
16752    }
16753
16754    /// The value of [curation_config][crate::model::CurationConfig::curation_config]
16755    /// if it holds a `CustomCuration`, `None` if the field is not set or
16756    /// holds a different branch.
16757    pub fn custom_curation(
16758        &self,
16759    ) -> std::option::Option<&std::boxed::Box<crate::model::curation_config::CustomCuration>> {
16760        #[allow(unreachable_patterns)]
16761        self.curation_config.as_ref().and_then(|v| match v {
16762            crate::model::curation_config::CurationConfig::CustomCuration(v) => {
16763                std::option::Option::Some(v)
16764            }
16765            _ => std::option::Option::None,
16766        })
16767    }
16768
16769    /// Sets the value of [curation_config][crate::model::CurationConfig::curation_config]
16770    /// to hold a `CustomCuration`.
16771    ///
16772    /// Note that all the setters affecting `curation_config` are
16773    /// mutually exclusive.
16774    pub fn set_custom_curation<
16775        T: std::convert::Into<std::boxed::Box<crate::model::curation_config::CustomCuration>>,
16776    >(
16777        mut self,
16778        v: T,
16779    ) -> Self {
16780        self.curation_config = std::option::Option::Some(
16781            crate::model::curation_config::CurationConfig::CustomCuration(v.into()),
16782        );
16783        self
16784    }
16785}
16786
16787impl wkt::message::Message for CurationConfig {
16788    fn typename() -> &'static str {
16789        "type.googleapis.com/google.cloud.apihub.v1.CurationConfig"
16790    }
16791}
16792
16793/// Defines additional types related to [CurationConfig].
16794pub mod curation_config {
16795    #[allow(unused_imports)]
16796    use super::*;
16797
16798    /// Custom curation information for this plugin instance.
16799    #[derive(Clone, Default, PartialEq)]
16800    #[non_exhaustive]
16801    pub struct CustomCuration {
16802        /// Required. The unique name of the curation resource. This will be the name
16803        /// of the curation resource in the format:
16804        /// `projects/{project}/locations/{location}/curations/{curation}`
16805        pub curation: std::string::String,
16806
16807        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16808    }
16809
16810    impl CustomCuration {
16811        pub fn new() -> Self {
16812            std::default::Default::default()
16813        }
16814
16815        /// Sets the value of [curation][crate::model::curation_config::CustomCuration::curation].
16816        pub fn set_curation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16817            self.curation = v.into();
16818            self
16819        }
16820    }
16821
16822    impl wkt::message::Message for CustomCuration {
16823        fn typename() -> &'static str {
16824            "type.googleapis.com/google.cloud.apihub.v1.CurationConfig.CustomCuration"
16825        }
16826    }
16827
16828    /// The curation information for this plugin instance.
16829    #[derive(Clone, Debug, PartialEq)]
16830    #[non_exhaustive]
16831    pub enum CurationConfig {
16832        /// Optional. Custom curation information for this plugin instance.
16833        CustomCuration(std::boxed::Box<crate::model::curation_config::CustomCuration>),
16834    }
16835}
16836
16837/// The execution status for the plugin instance.
16838#[derive(Clone, Default, PartialEq)]
16839#[non_exhaustive]
16840pub struct ExecutionStatus {
16841    /// Output only. The current state of the execution.
16842    pub current_execution_state: crate::model::execution_status::CurrentExecutionState,
16843
16844    /// Output only. The last execution of the plugin instance.
16845    pub last_execution: std::option::Option<crate::model::execution_status::LastExecution>,
16846
16847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16848}
16849
16850impl ExecutionStatus {
16851    pub fn new() -> Self {
16852        std::default::Default::default()
16853    }
16854
16855    /// Sets the value of [current_execution_state][crate::model::ExecutionStatus::current_execution_state].
16856    pub fn set_current_execution_state<
16857        T: std::convert::Into<crate::model::execution_status::CurrentExecutionState>,
16858    >(
16859        mut self,
16860        v: T,
16861    ) -> Self {
16862        self.current_execution_state = v.into();
16863        self
16864    }
16865
16866    /// Sets the value of [last_execution][crate::model::ExecutionStatus::last_execution].
16867    pub fn set_last_execution<T>(mut self, v: T) -> Self
16868    where
16869        T: std::convert::Into<crate::model::execution_status::LastExecution>,
16870    {
16871        self.last_execution = std::option::Option::Some(v.into());
16872        self
16873    }
16874
16875    /// Sets or clears the value of [last_execution][crate::model::ExecutionStatus::last_execution].
16876    pub fn set_or_clear_last_execution<T>(mut self, v: std::option::Option<T>) -> Self
16877    where
16878        T: std::convert::Into<crate::model::execution_status::LastExecution>,
16879    {
16880        self.last_execution = v.map(|x| x.into());
16881        self
16882    }
16883}
16884
16885impl wkt::message::Message for ExecutionStatus {
16886    fn typename() -> &'static str {
16887        "type.googleapis.com/google.cloud.apihub.v1.ExecutionStatus"
16888    }
16889}
16890
16891/// Defines additional types related to [ExecutionStatus].
16892pub mod execution_status {
16893    #[allow(unused_imports)]
16894    use super::*;
16895
16896    /// The result of the last execution of the plugin instance.
16897    #[derive(Clone, Default, PartialEq)]
16898    #[non_exhaustive]
16899    pub struct LastExecution {
16900        /// Output only. The result of the last execution of the plugin instance.
16901        pub result: crate::model::execution_status::last_execution::Result,
16902
16903        /// Output only. Error message describing the failure, if any, during the
16904        /// last execution.
16905        pub error_message: std::string::String,
16906
16907        /// Output only. The last execution start time of the plugin instance.
16908        pub start_time: std::option::Option<wkt::Timestamp>,
16909
16910        /// Output only. The last execution end time of the plugin instance.
16911        pub end_time: std::option::Option<wkt::Timestamp>,
16912
16913        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16914    }
16915
16916    impl LastExecution {
16917        pub fn new() -> Self {
16918            std::default::Default::default()
16919        }
16920
16921        /// Sets the value of [result][crate::model::execution_status::LastExecution::result].
16922        pub fn set_result<
16923            T: std::convert::Into<crate::model::execution_status::last_execution::Result>,
16924        >(
16925            mut self,
16926            v: T,
16927        ) -> Self {
16928            self.result = v.into();
16929            self
16930        }
16931
16932        /// Sets the value of [error_message][crate::model::execution_status::LastExecution::error_message].
16933        pub fn set_error_message<T: std::convert::Into<std::string::String>>(
16934            mut self,
16935            v: T,
16936        ) -> Self {
16937            self.error_message = v.into();
16938            self
16939        }
16940
16941        /// Sets the value of [start_time][crate::model::execution_status::LastExecution::start_time].
16942        pub fn set_start_time<T>(mut self, v: T) -> Self
16943        where
16944            T: std::convert::Into<wkt::Timestamp>,
16945        {
16946            self.start_time = std::option::Option::Some(v.into());
16947            self
16948        }
16949
16950        /// Sets or clears the value of [start_time][crate::model::execution_status::LastExecution::start_time].
16951        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
16952        where
16953            T: std::convert::Into<wkt::Timestamp>,
16954        {
16955            self.start_time = v.map(|x| x.into());
16956            self
16957        }
16958
16959        /// Sets the value of [end_time][crate::model::execution_status::LastExecution::end_time].
16960        pub fn set_end_time<T>(mut self, v: T) -> Self
16961        where
16962            T: std::convert::Into<wkt::Timestamp>,
16963        {
16964            self.end_time = std::option::Option::Some(v.into());
16965            self
16966        }
16967
16968        /// Sets or clears the value of [end_time][crate::model::execution_status::LastExecution::end_time].
16969        pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16970        where
16971            T: std::convert::Into<wkt::Timestamp>,
16972        {
16973            self.end_time = v.map(|x| x.into());
16974            self
16975        }
16976    }
16977
16978    impl wkt::message::Message for LastExecution {
16979        fn typename() -> &'static str {
16980            "type.googleapis.com/google.cloud.apihub.v1.ExecutionStatus.LastExecution"
16981        }
16982    }
16983
16984    /// Defines additional types related to [LastExecution].
16985    pub mod last_execution {
16986        #[allow(unused_imports)]
16987        use super::*;
16988
16989        /// Enum for the result of the last execution of the plugin instance.
16990        ///
16991        /// # Working with unknown values
16992        ///
16993        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16994        /// additional enum variants at any time. Adding new variants is not considered
16995        /// a breaking change. Applications should write their code in anticipation of:
16996        ///
16997        /// - New values appearing in future releases of the client library, **and**
16998        /// - New values received dynamically, without application changes.
16999        ///
17000        /// Please consult the [Working with enums] section in the user guide for some
17001        /// guidelines.
17002        ///
17003        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17004        #[derive(Clone, Debug, PartialEq)]
17005        #[non_exhaustive]
17006        pub enum Result {
17007            /// Default unspecified execution result.
17008            Unspecified,
17009            /// The plugin instance executed successfully.
17010            Succeeded,
17011            /// The plugin instance execution failed.
17012            Failed,
17013            /// If set, the enum was initialized with an unknown value.
17014            ///
17015            /// Applications can examine the value using [Result::value] or
17016            /// [Result::name].
17017            UnknownValue(result::UnknownValue),
17018        }
17019
17020        #[doc(hidden)]
17021        pub mod result {
17022            #[allow(unused_imports)]
17023            use super::*;
17024            #[derive(Clone, Debug, PartialEq)]
17025            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17026        }
17027
17028        impl Result {
17029            /// Gets the enum value.
17030            ///
17031            /// Returns `None` if the enum contains an unknown value deserialized from
17032            /// the string representation of enums.
17033            pub fn value(&self) -> std::option::Option<i32> {
17034                match self {
17035                    Self::Unspecified => std::option::Option::Some(0),
17036                    Self::Succeeded => std::option::Option::Some(1),
17037                    Self::Failed => std::option::Option::Some(2),
17038                    Self::UnknownValue(u) => u.0.value(),
17039                }
17040            }
17041
17042            /// Gets the enum value as a string.
17043            ///
17044            /// Returns `None` if the enum contains an unknown value deserialized from
17045            /// the integer representation of enums.
17046            pub fn name(&self) -> std::option::Option<&str> {
17047                match self {
17048                    Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
17049                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
17050                    Self::Failed => std::option::Option::Some("FAILED"),
17051                    Self::UnknownValue(u) => u.0.name(),
17052                }
17053            }
17054        }
17055
17056        impl std::default::Default for Result {
17057            fn default() -> Self {
17058                use std::convert::From;
17059                Self::from(0)
17060            }
17061        }
17062
17063        impl std::fmt::Display for Result {
17064            fn fmt(
17065                &self,
17066                f: &mut std::fmt::Formatter<'_>,
17067            ) -> std::result::Result<(), std::fmt::Error> {
17068                wkt::internal::display_enum(f, self.name(), self.value())
17069            }
17070        }
17071
17072        impl std::convert::From<i32> for Result {
17073            fn from(value: i32) -> Self {
17074                match value {
17075                    0 => Self::Unspecified,
17076                    1 => Self::Succeeded,
17077                    2 => Self::Failed,
17078                    _ => Self::UnknownValue(result::UnknownValue(
17079                        wkt::internal::UnknownEnumValue::Integer(value),
17080                    )),
17081                }
17082            }
17083        }
17084
17085        impl std::convert::From<&str> for Result {
17086            fn from(value: &str) -> Self {
17087                use std::string::ToString;
17088                match value {
17089                    "RESULT_UNSPECIFIED" => Self::Unspecified,
17090                    "SUCCEEDED" => Self::Succeeded,
17091                    "FAILED" => Self::Failed,
17092                    _ => Self::UnknownValue(result::UnknownValue(
17093                        wkt::internal::UnknownEnumValue::String(value.to_string()),
17094                    )),
17095                }
17096            }
17097        }
17098
17099        impl serde::ser::Serialize for Result {
17100            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17101            where
17102                S: serde::Serializer,
17103            {
17104                match self {
17105                    Self::Unspecified => serializer.serialize_i32(0),
17106                    Self::Succeeded => serializer.serialize_i32(1),
17107                    Self::Failed => serializer.serialize_i32(2),
17108                    Self::UnknownValue(u) => u.0.serialize(serializer),
17109                }
17110            }
17111        }
17112
17113        impl<'de> serde::de::Deserialize<'de> for Result {
17114            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17115            where
17116                D: serde::Deserializer<'de>,
17117            {
17118                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
17119                    ".google.cloud.apihub.v1.ExecutionStatus.LastExecution.Result",
17120                ))
17121            }
17122        }
17123    }
17124
17125    /// Enum for the current state of the execution.
17126    ///
17127    /// # Working with unknown values
17128    ///
17129    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17130    /// additional enum variants at any time. Adding new variants is not considered
17131    /// a breaking change. Applications should write their code in anticipation of:
17132    ///
17133    /// - New values appearing in future releases of the client library, **and**
17134    /// - New values received dynamically, without application changes.
17135    ///
17136    /// Please consult the [Working with enums] section in the user guide for some
17137    /// guidelines.
17138    ///
17139    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17140    #[derive(Clone, Debug, PartialEq)]
17141    #[non_exhaustive]
17142    pub enum CurrentExecutionState {
17143        /// Default unspecified execution state.
17144        Unspecified,
17145        /// The plugin instance is executing.
17146        Running,
17147        /// The plugin instance is not running an execution.
17148        NotRunning,
17149        /// If set, the enum was initialized with an unknown value.
17150        ///
17151        /// Applications can examine the value using [CurrentExecutionState::value] or
17152        /// [CurrentExecutionState::name].
17153        UnknownValue(current_execution_state::UnknownValue),
17154    }
17155
17156    #[doc(hidden)]
17157    pub mod current_execution_state {
17158        #[allow(unused_imports)]
17159        use super::*;
17160        #[derive(Clone, Debug, PartialEq)]
17161        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17162    }
17163
17164    impl CurrentExecutionState {
17165        /// Gets the enum value.
17166        ///
17167        /// Returns `None` if the enum contains an unknown value deserialized from
17168        /// the string representation of enums.
17169        pub fn value(&self) -> std::option::Option<i32> {
17170            match self {
17171                Self::Unspecified => std::option::Option::Some(0),
17172                Self::Running => std::option::Option::Some(1),
17173                Self::NotRunning => std::option::Option::Some(2),
17174                Self::UnknownValue(u) => u.0.value(),
17175            }
17176        }
17177
17178        /// Gets the enum value as a string.
17179        ///
17180        /// Returns `None` if the enum contains an unknown value deserialized from
17181        /// the integer representation of enums.
17182        pub fn name(&self) -> std::option::Option<&str> {
17183            match self {
17184                Self::Unspecified => {
17185                    std::option::Option::Some("CURRENT_EXECUTION_STATE_UNSPECIFIED")
17186                }
17187                Self::Running => std::option::Option::Some("RUNNING"),
17188                Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
17189                Self::UnknownValue(u) => u.0.name(),
17190            }
17191        }
17192    }
17193
17194    impl std::default::Default for CurrentExecutionState {
17195        fn default() -> Self {
17196            use std::convert::From;
17197            Self::from(0)
17198        }
17199    }
17200
17201    impl std::fmt::Display for CurrentExecutionState {
17202        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17203            wkt::internal::display_enum(f, self.name(), self.value())
17204        }
17205    }
17206
17207    impl std::convert::From<i32> for CurrentExecutionState {
17208        fn from(value: i32) -> Self {
17209            match value {
17210                0 => Self::Unspecified,
17211                1 => Self::Running,
17212                2 => Self::NotRunning,
17213                _ => Self::UnknownValue(current_execution_state::UnknownValue(
17214                    wkt::internal::UnknownEnumValue::Integer(value),
17215                )),
17216            }
17217        }
17218    }
17219
17220    impl std::convert::From<&str> for CurrentExecutionState {
17221        fn from(value: &str) -> Self {
17222            use std::string::ToString;
17223            match value {
17224                "CURRENT_EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
17225                "RUNNING" => Self::Running,
17226                "NOT_RUNNING" => Self::NotRunning,
17227                _ => Self::UnknownValue(current_execution_state::UnknownValue(
17228                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17229                )),
17230            }
17231        }
17232    }
17233
17234    impl serde::ser::Serialize for CurrentExecutionState {
17235        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17236        where
17237            S: serde::Serializer,
17238        {
17239            match self {
17240                Self::Unspecified => serializer.serialize_i32(0),
17241                Self::Running => serializer.serialize_i32(1),
17242                Self::NotRunning => serializer.serialize_i32(2),
17243                Self::UnknownValue(u) => u.0.serialize(serializer),
17244            }
17245        }
17246    }
17247
17248    impl<'de> serde::de::Deserialize<'de> for CurrentExecutionState {
17249        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17250        where
17251            D: serde::Deserializer<'de>,
17252        {
17253            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurrentExecutionState>::new(
17254                ".google.cloud.apihub.v1.ExecutionStatus.CurrentExecutionState",
17255            ))
17256        }
17257    }
17258}
17259
17260/// The [CreatePlugin][google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin] method's
17261/// request.
17262///
17263/// [google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin]: crate::client::ApiHubPlugin::create_plugin
17264#[derive(Clone, Default, PartialEq)]
17265#[non_exhaustive]
17266pub struct CreatePluginRequest {
17267    /// Required. The parent resource where this plugin will be created.
17268    /// Format: `projects/{project}/locations/{location}`.
17269    pub parent: std::string::String,
17270
17271    /// Optional. The ID to use for the Plugin resource, which will become the
17272    /// final component of the Plugin's resource name. This field is optional.
17273    ///
17274    /// * If provided, the same will be used. The service will throw an error if
17275    ///   the specified id is already used by another Plugin resource in the API hub
17276    ///   instance.
17277    /// * If not provided, a system generated id will be used.
17278    ///
17279    /// This value should be 4-63 characters, overall resource name which will be
17280    /// of format
17281    /// `projects/{project}/locations/{location}/plugins/{plugin}`,
17282    /// its length is limited to 1000 characters and valid characters are
17283    /// /[a-z][A-Z][0-9]-_/.
17284    pub plugin_id: std::string::String,
17285
17286    /// Required. The plugin to create.
17287    pub plugin: std::option::Option<crate::model::Plugin>,
17288
17289    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17290}
17291
17292impl CreatePluginRequest {
17293    pub fn new() -> Self {
17294        std::default::Default::default()
17295    }
17296
17297    /// Sets the value of [parent][crate::model::CreatePluginRequest::parent].
17298    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17299        self.parent = v.into();
17300        self
17301    }
17302
17303    /// Sets the value of [plugin_id][crate::model::CreatePluginRequest::plugin_id].
17304    pub fn set_plugin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17305        self.plugin_id = v.into();
17306        self
17307    }
17308
17309    /// Sets the value of [plugin][crate::model::CreatePluginRequest::plugin].
17310    pub fn set_plugin<T>(mut self, v: T) -> Self
17311    where
17312        T: std::convert::Into<crate::model::Plugin>,
17313    {
17314        self.plugin = std::option::Option::Some(v.into());
17315        self
17316    }
17317
17318    /// Sets or clears the value of [plugin][crate::model::CreatePluginRequest::plugin].
17319    pub fn set_or_clear_plugin<T>(mut self, v: std::option::Option<T>) -> Self
17320    where
17321        T: std::convert::Into<crate::model::Plugin>,
17322    {
17323        self.plugin = v.map(|x| x.into());
17324        self
17325    }
17326}
17327
17328impl wkt::message::Message for CreatePluginRequest {
17329    fn typename() -> &'static str {
17330        "type.googleapis.com/google.cloud.apihub.v1.CreatePluginRequest"
17331    }
17332}
17333
17334/// The [DeletePlugin][ApiHub.DeletePlugin] method's request.
17335#[derive(Clone, Default, PartialEq)]
17336#[non_exhaustive]
17337pub struct DeletePluginRequest {
17338    /// Required. The name of the Plugin resource to delete.
17339    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`
17340    pub name: std::string::String,
17341
17342    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17343}
17344
17345impl DeletePluginRequest {
17346    pub fn new() -> Self {
17347        std::default::Default::default()
17348    }
17349
17350    /// Sets the value of [name][crate::model::DeletePluginRequest::name].
17351    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17352        self.name = v.into();
17353        self
17354    }
17355}
17356
17357impl wkt::message::Message for DeletePluginRequest {
17358    fn typename() -> &'static str {
17359        "type.googleapis.com/google.cloud.apihub.v1.DeletePluginRequest"
17360    }
17361}
17362
17363/// The [ListPlugins][google.cloud.apihub.v1.ApiHubPlugin.ListPlugins] method's
17364/// request.
17365///
17366/// [google.cloud.apihub.v1.ApiHubPlugin.ListPlugins]: crate::client::ApiHubPlugin::list_plugins
17367#[derive(Clone, Default, PartialEq)]
17368#[non_exhaustive]
17369pub struct ListPluginsRequest {
17370    /// Required. The parent resource where this plugin will be created.
17371    /// Format: `projects/{project}/locations/{location}`.
17372    pub parent: std::string::String,
17373
17374    /// Optional. An expression that filters the list of plugins.
17375    ///
17376    /// A filter expression consists of a field name, a comparison
17377    /// operator, and a value for filtering. The value must be a string. The
17378    /// comparison operator must be one of: `<`, `>` or
17379    /// `=`. Filters are not case sensitive.
17380    ///
17381    /// The following fields in the `Plugins` are eligible for filtering:
17382    ///
17383    /// * `plugin_category` - The category of the Plugin. Allowed
17384    ///   comparison operators: `=`.
17385    ///
17386    /// Expressions are combined with either `AND` logic operator or `OR` logical
17387    /// operator but not both of them together i.e. only one of the `AND` or `OR`
17388    /// operator can be used throughout the filter string and both the operators
17389    /// cannot be used together. No other logical operators are
17390    /// supported. At most three filter fields are allowed in the filter
17391    /// string and if provided more than that then `INVALID_ARGUMENT` error is
17392    /// returned by the API.
17393    /// Here are a few examples:
17394    ///
17395    /// * `plugin_category = ON_RAMP` - The plugin is of category
17396    ///   on ramp.
17397    pub filter: std::string::String,
17398
17399    /// Optional. The maximum number of hub plugins to return. The service may
17400    /// return fewer than this value. If unspecified, at most 50 hub plugins will
17401    /// be returned. The maximum value is 1000; values above 1000 will be coerced
17402    /// to 1000.
17403    pub page_size: i32,
17404
17405    /// Optional. A page token, received from a previous `ListPlugins` call.
17406    /// Provide this to retrieve the subsequent page.
17407    ///
17408    /// When paginating, all other parameters (except page_size) provided to
17409    /// `ListPlugins` must match the call that provided the page token.
17410    pub page_token: std::string::String,
17411
17412    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17413}
17414
17415impl ListPluginsRequest {
17416    pub fn new() -> Self {
17417        std::default::Default::default()
17418    }
17419
17420    /// Sets the value of [parent][crate::model::ListPluginsRequest::parent].
17421    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17422        self.parent = v.into();
17423        self
17424    }
17425
17426    /// Sets the value of [filter][crate::model::ListPluginsRequest::filter].
17427    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17428        self.filter = v.into();
17429        self
17430    }
17431
17432    /// Sets the value of [page_size][crate::model::ListPluginsRequest::page_size].
17433    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17434        self.page_size = v.into();
17435        self
17436    }
17437
17438    /// Sets the value of [page_token][crate::model::ListPluginsRequest::page_token].
17439    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17440        self.page_token = v.into();
17441        self
17442    }
17443}
17444
17445impl wkt::message::Message for ListPluginsRequest {
17446    fn typename() -> &'static str {
17447        "type.googleapis.com/google.cloud.apihub.v1.ListPluginsRequest"
17448    }
17449}
17450
17451/// The [ListPlugins][google.cloud.apihub.v1.ApiHubPlugin.ListPlugins] method's
17452/// response.
17453///
17454/// [google.cloud.apihub.v1.ApiHubPlugin.ListPlugins]: crate::client::ApiHubPlugin::list_plugins
17455#[derive(Clone, Default, PartialEq)]
17456#[non_exhaustive]
17457pub struct ListPluginsResponse {
17458    /// The plugins from the specified parent resource.
17459    pub plugins: std::vec::Vec<crate::model::Plugin>,
17460
17461    /// A token, which can be sent as `page_token` to retrieve the next page.
17462    /// If this field is omitted, there are no subsequent pages.
17463    pub next_page_token: std::string::String,
17464
17465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17466}
17467
17468impl ListPluginsResponse {
17469    pub fn new() -> Self {
17470        std::default::Default::default()
17471    }
17472
17473    /// Sets the value of [plugins][crate::model::ListPluginsResponse::plugins].
17474    pub fn set_plugins<T, V>(mut self, v: T) -> Self
17475    where
17476        T: std::iter::IntoIterator<Item = V>,
17477        V: std::convert::Into<crate::model::Plugin>,
17478    {
17479        use std::iter::Iterator;
17480        self.plugins = v.into_iter().map(|i| i.into()).collect();
17481        self
17482    }
17483
17484    /// Sets the value of [next_page_token][crate::model::ListPluginsResponse::next_page_token].
17485    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17486        self.next_page_token = v.into();
17487        self
17488    }
17489}
17490
17491impl wkt::message::Message for ListPluginsResponse {
17492    fn typename() -> &'static str {
17493        "type.googleapis.com/google.cloud.apihub.v1.ListPluginsResponse"
17494    }
17495}
17496
17497#[doc(hidden)]
17498impl gax::paginator::internal::PageableResponse for ListPluginsResponse {
17499    type PageItem = crate::model::Plugin;
17500
17501    fn items(self) -> std::vec::Vec<Self::PageItem> {
17502        self.plugins
17503    }
17504
17505    fn next_page_token(&self) -> std::string::String {
17506        use std::clone::Clone;
17507        self.next_page_token.clone()
17508    }
17509}
17510
17511/// The
17512/// [CreatePluginInstance][google.cloud.apihub.v1.ApiHubPlugin.CreatePluginInstance]
17513/// method's request.
17514///
17515/// [google.cloud.apihub.v1.ApiHubPlugin.CreatePluginInstance]: crate::client::ApiHubPlugin::create_plugin_instance
17516#[derive(Clone, Default, PartialEq)]
17517#[non_exhaustive]
17518pub struct CreatePluginInstanceRequest {
17519    /// Required. The parent of the plugin instance resource.
17520    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`
17521    pub parent: std::string::String,
17522
17523    /// Optional. The ID to use for the plugin instance, which will become the
17524    /// final component of the plugin instance's resource name. This field is
17525    /// optional.
17526    ///
17527    /// * If provided, the same will be used. The service will throw an error if
17528    ///   the specified id is already used by another plugin instance in the plugin
17529    ///   resource.
17530    /// * If not provided, a system generated id will be used.
17531    ///
17532    /// This value should be 4-63 characters, and valid characters
17533    /// are /[a-z][A-Z][0-9]-_/.
17534    pub plugin_instance_id: std::string::String,
17535
17536    /// Required. The plugin instance to create.
17537    pub plugin_instance: std::option::Option<crate::model::PluginInstance>,
17538
17539    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17540}
17541
17542impl CreatePluginInstanceRequest {
17543    pub fn new() -> Self {
17544        std::default::Default::default()
17545    }
17546
17547    /// Sets the value of [parent][crate::model::CreatePluginInstanceRequest::parent].
17548    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17549        self.parent = v.into();
17550        self
17551    }
17552
17553    /// Sets the value of [plugin_instance_id][crate::model::CreatePluginInstanceRequest::plugin_instance_id].
17554    pub fn set_plugin_instance_id<T: std::convert::Into<std::string::String>>(
17555        mut self,
17556        v: T,
17557    ) -> Self {
17558        self.plugin_instance_id = v.into();
17559        self
17560    }
17561
17562    /// Sets the value of [plugin_instance][crate::model::CreatePluginInstanceRequest::plugin_instance].
17563    pub fn set_plugin_instance<T>(mut self, v: T) -> Self
17564    where
17565        T: std::convert::Into<crate::model::PluginInstance>,
17566    {
17567        self.plugin_instance = std::option::Option::Some(v.into());
17568        self
17569    }
17570
17571    /// Sets or clears the value of [plugin_instance][crate::model::CreatePluginInstanceRequest::plugin_instance].
17572    pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
17573    where
17574        T: std::convert::Into<crate::model::PluginInstance>,
17575    {
17576        self.plugin_instance = v.map(|x| x.into());
17577        self
17578    }
17579}
17580
17581impl wkt::message::Message for CreatePluginInstanceRequest {
17582    fn typename() -> &'static str {
17583        "type.googleapis.com/google.cloud.apihub.v1.CreatePluginInstanceRequest"
17584    }
17585}
17586
17587/// The
17588/// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
17589/// method's request.
17590///
17591/// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
17592#[derive(Clone, Default, PartialEq)]
17593#[non_exhaustive]
17594pub struct ExecutePluginInstanceActionRequest {
17595    /// Required. The name of the plugin instance to execute.
17596    /// Format:
17597    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
17598    pub name: std::string::String,
17599
17600    /// Required. The execution details for the action to execute.
17601    pub action_execution_detail: std::option::Option<crate::model::ActionExecutionDetail>,
17602
17603    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17604}
17605
17606impl ExecutePluginInstanceActionRequest {
17607    pub fn new() -> Self {
17608        std::default::Default::default()
17609    }
17610
17611    /// Sets the value of [name][crate::model::ExecutePluginInstanceActionRequest::name].
17612    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17613        self.name = v.into();
17614        self
17615    }
17616
17617    /// Sets the value of [action_execution_detail][crate::model::ExecutePluginInstanceActionRequest::action_execution_detail].
17618    pub fn set_action_execution_detail<T>(mut self, v: T) -> Self
17619    where
17620        T: std::convert::Into<crate::model::ActionExecutionDetail>,
17621    {
17622        self.action_execution_detail = std::option::Option::Some(v.into());
17623        self
17624    }
17625
17626    /// Sets or clears the value of [action_execution_detail][crate::model::ExecutePluginInstanceActionRequest::action_execution_detail].
17627    pub fn set_or_clear_action_execution_detail<T>(mut self, v: std::option::Option<T>) -> Self
17628    where
17629        T: std::convert::Into<crate::model::ActionExecutionDetail>,
17630    {
17631        self.action_execution_detail = v.map(|x| x.into());
17632        self
17633    }
17634}
17635
17636impl wkt::message::Message for ExecutePluginInstanceActionRequest {
17637    fn typename() -> &'static str {
17638        "type.googleapis.com/google.cloud.apihub.v1.ExecutePluginInstanceActionRequest"
17639    }
17640}
17641
17642/// The details for the action to execute.
17643#[derive(Clone, Default, PartialEq)]
17644#[non_exhaustive]
17645pub struct ActionExecutionDetail {
17646    /// Required. The action id of the plugin to execute.
17647    pub action_id: std::string::String,
17648
17649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17650}
17651
17652impl ActionExecutionDetail {
17653    pub fn new() -> Self {
17654        std::default::Default::default()
17655    }
17656
17657    /// Sets the value of [action_id][crate::model::ActionExecutionDetail::action_id].
17658    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17659        self.action_id = v.into();
17660        self
17661    }
17662}
17663
17664impl wkt::message::Message for ActionExecutionDetail {
17665    fn typename() -> &'static str {
17666        "type.googleapis.com/google.cloud.apihub.v1.ActionExecutionDetail"
17667    }
17668}
17669
17670/// The
17671/// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
17672/// method's response.
17673///
17674/// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
17675#[derive(Clone, Default, PartialEq)]
17676#[non_exhaustive]
17677pub struct ExecutePluginInstanceActionResponse {
17678    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17679}
17680
17681impl ExecutePluginInstanceActionResponse {
17682    pub fn new() -> Self {
17683        std::default::Default::default()
17684    }
17685}
17686
17687impl wkt::message::Message for ExecutePluginInstanceActionResponse {
17688    fn typename() -> &'static str {
17689        "type.googleapis.com/google.cloud.apihub.v1.ExecutePluginInstanceActionResponse"
17690    }
17691}
17692
17693/// The
17694/// [GetPluginInstance][google.cloud.apihub.v1.ApiHubPlugin.GetPluginInstance]
17695/// method's request.
17696///
17697/// [google.cloud.apihub.v1.ApiHubPlugin.GetPluginInstance]: crate::client::ApiHubPlugin::get_plugin_instance
17698#[derive(Clone, Default, PartialEq)]
17699#[non_exhaustive]
17700pub struct GetPluginInstanceRequest {
17701    /// Required. The name of the plugin instance to retrieve.
17702    /// Format:
17703    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
17704    pub name: std::string::String,
17705
17706    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17707}
17708
17709impl GetPluginInstanceRequest {
17710    pub fn new() -> Self {
17711        std::default::Default::default()
17712    }
17713
17714    /// Sets the value of [name][crate::model::GetPluginInstanceRequest::name].
17715    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17716        self.name = v.into();
17717        self
17718    }
17719}
17720
17721impl wkt::message::Message for GetPluginInstanceRequest {
17722    fn typename() -> &'static str {
17723        "type.googleapis.com/google.cloud.apihub.v1.GetPluginInstanceRequest"
17724    }
17725}
17726
17727/// The
17728/// [ListPluginInstances][google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]
17729/// method's request.
17730///
17731/// [google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]: crate::client::ApiHubPlugin::list_plugin_instances
17732#[derive(Clone, Default, PartialEq)]
17733#[non_exhaustive]
17734pub struct ListPluginInstancesRequest {
17735    /// Required. The parent resource where this plugin will be created.
17736    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
17737    /// To list plugin instances for multiple plugins,
17738    /// use the - character instead of the plugin ID.
17739    pub parent: std::string::String,
17740
17741    /// Optional. An expression that filters the list of plugin instances.
17742    ///
17743    /// A filter expression consists of a field name, a comparison
17744    /// operator, and a value for filtering. The value must be a string. The
17745    /// comparison operator must be one of: `<`, `>` or
17746    /// `=`. Filters are not case sensitive.
17747    ///
17748    /// The following fields in the `PluginInstances` are eligible for filtering:
17749    ///
17750    /// * `state` - The state of the Plugin Instance. Allowed
17751    ///   comparison operators: `=`.
17752    ///
17753    /// A filter function is also supported in the filter string. The filter
17754    /// function is `id(name)`. The `id(name)` function returns the id of the
17755    /// resource name. For example, `id(name) = \"plugin-instance-1\"` is
17756    /// equivalent to `name =
17757    /// \"projects/test-project-id/locations/test-location-id/plugins/plugin-1/instances/plugin-instance-1\"`
17758    /// provided the parent is
17759    /// `projects/test-project-id/locations/test-location-id/plugins/plugin-1`.
17760    ///
17761    /// Expressions are combined with either `AND` logic operator or `OR` logical
17762    /// operator but not both of them together i.e. only one of the `AND` or `OR`
17763    /// operator can be used throughout the filter string and both the operators
17764    /// cannot be used together. No other logical operators are
17765    /// supported. At most three filter fields are allowed in the filter
17766    /// string and if provided more than that then `INVALID_ARGUMENT` error is
17767    /// returned by the API.
17768    /// Here are a few examples:
17769    ///
17770    /// * `state = ENABLED` - The plugin instance is in enabled state.
17771    pub filter: std::string::String,
17772
17773    /// Optional. The maximum number of hub plugins to return. The service may
17774    /// return fewer than this value. If unspecified, at most 50 hub plugins will
17775    /// be returned. The maximum value is 1000; values above 1000 will be coerced
17776    /// to 1000.
17777    pub page_size: i32,
17778
17779    /// Optional. A page token, received from a previous `ListPluginInstances`
17780    /// call. Provide this to retrieve the subsequent page.
17781    ///
17782    /// When paginating, all other parameters provided to `ListPluginInstances`
17783    /// must match the call that provided the page token.
17784    pub page_token: std::string::String,
17785
17786    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17787}
17788
17789impl ListPluginInstancesRequest {
17790    pub fn new() -> Self {
17791        std::default::Default::default()
17792    }
17793
17794    /// Sets the value of [parent][crate::model::ListPluginInstancesRequest::parent].
17795    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17796        self.parent = v.into();
17797        self
17798    }
17799
17800    /// Sets the value of [filter][crate::model::ListPluginInstancesRequest::filter].
17801    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17802        self.filter = v.into();
17803        self
17804    }
17805
17806    /// Sets the value of [page_size][crate::model::ListPluginInstancesRequest::page_size].
17807    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17808        self.page_size = v.into();
17809        self
17810    }
17811
17812    /// Sets the value of [page_token][crate::model::ListPluginInstancesRequest::page_token].
17813    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17814        self.page_token = v.into();
17815        self
17816    }
17817}
17818
17819impl wkt::message::Message for ListPluginInstancesRequest {
17820    fn typename() -> &'static str {
17821        "type.googleapis.com/google.cloud.apihub.v1.ListPluginInstancesRequest"
17822    }
17823}
17824
17825/// The
17826/// [ListPluginInstances][google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]
17827/// method's response.
17828///
17829/// [google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]: crate::client::ApiHubPlugin::list_plugin_instances
17830#[derive(Clone, Default, PartialEq)]
17831#[non_exhaustive]
17832pub struct ListPluginInstancesResponse {
17833    /// The plugin instances from the specified parent resource.
17834    pub plugin_instances: std::vec::Vec<crate::model::PluginInstance>,
17835
17836    /// A token, which can be sent as `page_token` to retrieve the next page.
17837    /// If this field is omitted, there are no subsequent pages.
17838    pub next_page_token: std::string::String,
17839
17840    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17841}
17842
17843impl ListPluginInstancesResponse {
17844    pub fn new() -> Self {
17845        std::default::Default::default()
17846    }
17847
17848    /// Sets the value of [plugin_instances][crate::model::ListPluginInstancesResponse::plugin_instances].
17849    pub fn set_plugin_instances<T, V>(mut self, v: T) -> Self
17850    where
17851        T: std::iter::IntoIterator<Item = V>,
17852        V: std::convert::Into<crate::model::PluginInstance>,
17853    {
17854        use std::iter::Iterator;
17855        self.plugin_instances = v.into_iter().map(|i| i.into()).collect();
17856        self
17857    }
17858
17859    /// Sets the value of [next_page_token][crate::model::ListPluginInstancesResponse::next_page_token].
17860    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17861        self.next_page_token = v.into();
17862        self
17863    }
17864}
17865
17866impl wkt::message::Message for ListPluginInstancesResponse {
17867    fn typename() -> &'static str {
17868        "type.googleapis.com/google.cloud.apihub.v1.ListPluginInstancesResponse"
17869    }
17870}
17871
17872#[doc(hidden)]
17873impl gax::paginator::internal::PageableResponse for ListPluginInstancesResponse {
17874    type PageItem = crate::model::PluginInstance;
17875
17876    fn items(self) -> std::vec::Vec<Self::PageItem> {
17877        self.plugin_instances
17878    }
17879
17880    fn next_page_token(&self) -> std::string::String {
17881        use std::clone::Clone;
17882        self.next_page_token.clone()
17883    }
17884}
17885
17886/// The
17887/// [EnablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]
17888/// method's request.
17889///
17890/// [google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]: crate::client::ApiHubPlugin::enable_plugin_instance_action
17891#[derive(Clone, Default, PartialEq)]
17892#[non_exhaustive]
17893pub struct EnablePluginInstanceActionRequest {
17894    /// Required. The name of the plugin instance to enable.
17895    /// Format:
17896    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
17897    pub name: std::string::String,
17898
17899    /// Required. The action id to enable.
17900    pub action_id: std::string::String,
17901
17902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17903}
17904
17905impl EnablePluginInstanceActionRequest {
17906    pub fn new() -> Self {
17907        std::default::Default::default()
17908    }
17909
17910    /// Sets the value of [name][crate::model::EnablePluginInstanceActionRequest::name].
17911    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17912        self.name = v.into();
17913        self
17914    }
17915
17916    /// Sets the value of [action_id][crate::model::EnablePluginInstanceActionRequest::action_id].
17917    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17918        self.action_id = v.into();
17919        self
17920    }
17921}
17922
17923impl wkt::message::Message for EnablePluginInstanceActionRequest {
17924    fn typename() -> &'static str {
17925        "type.googleapis.com/google.cloud.apihub.v1.EnablePluginInstanceActionRequest"
17926    }
17927}
17928
17929/// The
17930/// [EnablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]
17931/// method's response.
17932///
17933/// [google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]: crate::client::ApiHubPlugin::enable_plugin_instance_action
17934#[derive(Clone, Default, PartialEq)]
17935#[non_exhaustive]
17936pub struct EnablePluginInstanceActionResponse {
17937    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17938}
17939
17940impl EnablePluginInstanceActionResponse {
17941    pub fn new() -> Self {
17942        std::default::Default::default()
17943    }
17944}
17945
17946impl wkt::message::Message for EnablePluginInstanceActionResponse {
17947    fn typename() -> &'static str {
17948        "type.googleapis.com/google.cloud.apihub.v1.EnablePluginInstanceActionResponse"
17949    }
17950}
17951
17952/// The
17953/// [DisablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]
17954/// method's request.
17955///
17956/// [google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]: crate::client::ApiHubPlugin::disable_plugin_instance_action
17957#[derive(Clone, Default, PartialEq)]
17958#[non_exhaustive]
17959pub struct DisablePluginInstanceActionRequest {
17960    /// Required. The name of the plugin instance to disable.
17961    /// Format:
17962    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
17963    pub name: std::string::String,
17964
17965    /// Required. The action id to disable.
17966    pub action_id: std::string::String,
17967
17968    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17969}
17970
17971impl DisablePluginInstanceActionRequest {
17972    pub fn new() -> Self {
17973        std::default::Default::default()
17974    }
17975
17976    /// Sets the value of [name][crate::model::DisablePluginInstanceActionRequest::name].
17977    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17978        self.name = v.into();
17979        self
17980    }
17981
17982    /// Sets the value of [action_id][crate::model::DisablePluginInstanceActionRequest::action_id].
17983    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17984        self.action_id = v.into();
17985        self
17986    }
17987}
17988
17989impl wkt::message::Message for DisablePluginInstanceActionRequest {
17990    fn typename() -> &'static str {
17991        "type.googleapis.com/google.cloud.apihub.v1.DisablePluginInstanceActionRequest"
17992    }
17993}
17994
17995/// The
17996/// [DisablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]
17997/// method's response.
17998///
17999/// [google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]: crate::client::ApiHubPlugin::disable_plugin_instance_action
18000#[derive(Clone, Default, PartialEq)]
18001#[non_exhaustive]
18002pub struct DisablePluginInstanceActionResponse {
18003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18004}
18005
18006impl DisablePluginInstanceActionResponse {
18007    pub fn new() -> Self {
18008        std::default::Default::default()
18009    }
18010}
18011
18012impl wkt::message::Message for DisablePluginInstanceActionResponse {
18013    fn typename() -> &'static str {
18014        "type.googleapis.com/google.cloud.apihub.v1.DisablePluginInstanceActionResponse"
18015    }
18016}
18017
18018/// The
18019/// [UpdatePluginInstance][google.cloud.apihub.v1.ApiHubPlugin.UpdatePluginInstance]
18020/// method's request.
18021///
18022/// [google.cloud.apihub.v1.ApiHubPlugin.UpdatePluginInstance]: crate::client::ApiHubPlugin::update_plugin_instance
18023#[derive(Clone, Default, PartialEq)]
18024#[non_exhaustive]
18025pub struct UpdatePluginInstanceRequest {
18026    /// Required. The plugin instance to update.
18027    pub plugin_instance: std::option::Option<crate::model::PluginInstance>,
18028
18029    /// Optional. The list of fields to update.
18030    pub update_mask: std::option::Option<wkt::FieldMask>,
18031
18032    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18033}
18034
18035impl UpdatePluginInstanceRequest {
18036    pub fn new() -> Self {
18037        std::default::Default::default()
18038    }
18039
18040    /// Sets the value of [plugin_instance][crate::model::UpdatePluginInstanceRequest::plugin_instance].
18041    pub fn set_plugin_instance<T>(mut self, v: T) -> Self
18042    where
18043        T: std::convert::Into<crate::model::PluginInstance>,
18044    {
18045        self.plugin_instance = std::option::Option::Some(v.into());
18046        self
18047    }
18048
18049    /// Sets or clears the value of [plugin_instance][crate::model::UpdatePluginInstanceRequest::plugin_instance].
18050    pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
18051    where
18052        T: std::convert::Into<crate::model::PluginInstance>,
18053    {
18054        self.plugin_instance = v.map(|x| x.into());
18055        self
18056    }
18057
18058    /// Sets the value of [update_mask][crate::model::UpdatePluginInstanceRequest::update_mask].
18059    pub fn set_update_mask<T>(mut self, v: T) -> Self
18060    where
18061        T: std::convert::Into<wkt::FieldMask>,
18062    {
18063        self.update_mask = std::option::Option::Some(v.into());
18064        self
18065    }
18066
18067    /// Sets or clears the value of [update_mask][crate::model::UpdatePluginInstanceRequest::update_mask].
18068    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18069    where
18070        T: std::convert::Into<wkt::FieldMask>,
18071    {
18072        self.update_mask = v.map(|x| x.into());
18073        self
18074    }
18075}
18076
18077impl wkt::message::Message for UpdatePluginInstanceRequest {
18078    fn typename() -> &'static str {
18079        "type.googleapis.com/google.cloud.apihub.v1.UpdatePluginInstanceRequest"
18080    }
18081}
18082
18083/// The
18084/// [DeletePluginInstance][google.cloud.apihub.v1.ApiHubPlugin.DeletePluginInstance]
18085/// method's request.
18086///
18087/// [google.cloud.apihub.v1.ApiHubPlugin.DeletePluginInstance]: crate::client::ApiHubPlugin::delete_plugin_instance
18088#[derive(Clone, Default, PartialEq)]
18089#[non_exhaustive]
18090pub struct DeletePluginInstanceRequest {
18091    /// Required. The name of the plugin instance to delete.
18092    /// Format:
18093    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`.
18094    pub name: std::string::String,
18095
18096    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18097}
18098
18099impl DeletePluginInstanceRequest {
18100    pub fn new() -> Self {
18101        std::default::Default::default()
18102    }
18103
18104    /// Sets the value of [name][crate::model::DeletePluginInstanceRequest::name].
18105    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18106        self.name = v.into();
18107        self
18108    }
18109}
18110
18111impl wkt::message::Message for DeletePluginInstanceRequest {
18112    fn typename() -> &'static str {
18113        "type.googleapis.com/google.cloud.apihub.v1.DeletePluginInstanceRequest"
18114    }
18115}
18116
18117/// The
18118/// [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance]
18119/// method's request.
18120///
18121/// [google.cloud.apihub.v1.Provisioning.CreateApiHubInstance]: crate::client::Provisioning::create_api_hub_instance
18122#[derive(Clone, Default, PartialEq)]
18123#[non_exhaustive]
18124pub struct CreateApiHubInstanceRequest {
18125    /// Required. The parent resource for the Api Hub instance resource.
18126    /// Format: `projects/{project}/locations/{location}`
18127    pub parent: std::string::String,
18128
18129    /// Optional. Identifier to assign to the Api Hub instance. Must be unique
18130    /// within scope of the parent resource. If the field is not provided, system
18131    /// generated id will be used.
18132    ///
18133    /// This value should be 4-40 characters, and valid characters
18134    /// are `/[a-z][A-Z][0-9]-_/`.
18135    pub api_hub_instance_id: std::string::String,
18136
18137    /// Required. The ApiHub instance.
18138    pub api_hub_instance: std::option::Option<crate::model::ApiHubInstance>,
18139
18140    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18141}
18142
18143impl CreateApiHubInstanceRequest {
18144    pub fn new() -> Self {
18145        std::default::Default::default()
18146    }
18147
18148    /// Sets the value of [parent][crate::model::CreateApiHubInstanceRequest::parent].
18149    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18150        self.parent = v.into();
18151        self
18152    }
18153
18154    /// Sets the value of [api_hub_instance_id][crate::model::CreateApiHubInstanceRequest::api_hub_instance_id].
18155    pub fn set_api_hub_instance_id<T: std::convert::Into<std::string::String>>(
18156        mut self,
18157        v: T,
18158    ) -> Self {
18159        self.api_hub_instance_id = v.into();
18160        self
18161    }
18162
18163    /// Sets the value of [api_hub_instance][crate::model::CreateApiHubInstanceRequest::api_hub_instance].
18164    pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
18165    where
18166        T: std::convert::Into<crate::model::ApiHubInstance>,
18167    {
18168        self.api_hub_instance = std::option::Option::Some(v.into());
18169        self
18170    }
18171
18172    /// Sets or clears the value of [api_hub_instance][crate::model::CreateApiHubInstanceRequest::api_hub_instance].
18173    pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
18174    where
18175        T: std::convert::Into<crate::model::ApiHubInstance>,
18176    {
18177        self.api_hub_instance = v.map(|x| x.into());
18178        self
18179    }
18180}
18181
18182impl wkt::message::Message for CreateApiHubInstanceRequest {
18183    fn typename() -> &'static str {
18184        "type.googleapis.com/google.cloud.apihub.v1.CreateApiHubInstanceRequest"
18185    }
18186}
18187
18188/// The
18189/// [DeleteApiHubInstance][google.cloud.apihub.v1.Provisioning.DeleteApiHubInstance]
18190/// method's request.
18191///
18192/// [google.cloud.apihub.v1.Provisioning.DeleteApiHubInstance]: crate::client::Provisioning::delete_api_hub_instance
18193#[derive(Clone, Default, PartialEq)]
18194#[non_exhaustive]
18195pub struct DeleteApiHubInstanceRequest {
18196    /// Required. The name of the Api Hub instance to delete.
18197    /// Format:
18198    /// `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
18199    pub name: std::string::String,
18200
18201    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18202}
18203
18204impl DeleteApiHubInstanceRequest {
18205    pub fn new() -> Self {
18206        std::default::Default::default()
18207    }
18208
18209    /// Sets the value of [name][crate::model::DeleteApiHubInstanceRequest::name].
18210    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18211        self.name = v.into();
18212        self
18213    }
18214}
18215
18216impl wkt::message::Message for DeleteApiHubInstanceRequest {
18217    fn typename() -> &'static str {
18218        "type.googleapis.com/google.cloud.apihub.v1.DeleteApiHubInstanceRequest"
18219    }
18220}
18221
18222/// The
18223/// [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance]
18224/// method's request.
18225///
18226/// [google.cloud.apihub.v1.Provisioning.GetApiHubInstance]: crate::client::Provisioning::get_api_hub_instance
18227#[derive(Clone, Default, PartialEq)]
18228#[non_exhaustive]
18229pub struct GetApiHubInstanceRequest {
18230    /// Required. The name of the Api Hub instance to retrieve.
18231    /// Format:
18232    /// `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
18233    pub name: std::string::String,
18234
18235    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18236}
18237
18238impl GetApiHubInstanceRequest {
18239    pub fn new() -> Self {
18240        std::default::Default::default()
18241    }
18242
18243    /// Sets the value of [name][crate::model::GetApiHubInstanceRequest::name].
18244    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18245        self.name = v.into();
18246        self
18247    }
18248}
18249
18250impl wkt::message::Message for GetApiHubInstanceRequest {
18251    fn typename() -> &'static str {
18252        "type.googleapis.com/google.cloud.apihub.v1.GetApiHubInstanceRequest"
18253    }
18254}
18255
18256/// The
18257/// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
18258/// method's request.
18259///
18260/// [google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]: crate::client::Provisioning::lookup_api_hub_instance
18261#[derive(Clone, Default, PartialEq)]
18262#[non_exhaustive]
18263pub struct LookupApiHubInstanceRequest {
18264    /// Required. There will always be only one Api Hub instance for a GCP project
18265    /// across all locations.
18266    /// The parent resource for the Api Hub instance resource.
18267    /// Format: `projects/{project}/locations/{location}`
18268    pub parent: std::string::String,
18269
18270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18271}
18272
18273impl LookupApiHubInstanceRequest {
18274    pub fn new() -> Self {
18275        std::default::Default::default()
18276    }
18277
18278    /// Sets the value of [parent][crate::model::LookupApiHubInstanceRequest::parent].
18279    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18280        self.parent = v.into();
18281        self
18282    }
18283}
18284
18285impl wkt::message::Message for LookupApiHubInstanceRequest {
18286    fn typename() -> &'static str {
18287        "type.googleapis.com/google.cloud.apihub.v1.LookupApiHubInstanceRequest"
18288    }
18289}
18290
18291/// The
18292/// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
18293/// method's response.`
18294///
18295/// [google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]: crate::client::Provisioning::lookup_api_hub_instance
18296#[derive(Clone, Default, PartialEq)]
18297#[non_exhaustive]
18298pub struct LookupApiHubInstanceResponse {
18299    /// API Hub instance for a project if it exists, empty otherwise.
18300    pub api_hub_instance: std::option::Option<crate::model::ApiHubInstance>,
18301
18302    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18303}
18304
18305impl LookupApiHubInstanceResponse {
18306    pub fn new() -> Self {
18307        std::default::Default::default()
18308    }
18309
18310    /// Sets the value of [api_hub_instance][crate::model::LookupApiHubInstanceResponse::api_hub_instance].
18311    pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
18312    where
18313        T: std::convert::Into<crate::model::ApiHubInstance>,
18314    {
18315        self.api_hub_instance = std::option::Option::Some(v.into());
18316        self
18317    }
18318
18319    /// Sets or clears the value of [api_hub_instance][crate::model::LookupApiHubInstanceResponse::api_hub_instance].
18320    pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
18321    where
18322        T: std::convert::Into<crate::model::ApiHubInstance>,
18323    {
18324        self.api_hub_instance = v.map(|x| x.into());
18325        self
18326    }
18327}
18328
18329impl wkt::message::Message for LookupApiHubInstanceResponse {
18330    fn typename() -> &'static str {
18331        "type.googleapis.com/google.cloud.apihub.v1.LookupApiHubInstanceResponse"
18332    }
18333}
18334
18335/// The
18336/// [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment]
18337/// method's request.
18338///
18339/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::create_runtime_project_attachment
18340#[derive(Clone, Default, PartialEq)]
18341#[non_exhaustive]
18342pub struct CreateRuntimeProjectAttachmentRequest {
18343    /// Required. The parent resource for the Runtime Project Attachment.
18344    /// Format: `projects/{project}/locations/{location}`
18345    pub parent: std::string::String,
18346
18347    /// Required. The ID to use for the Runtime Project Attachment, which will
18348    /// become the final component of the Runtime Project Attachment's name. The ID
18349    /// must be the same as the project ID of the Google cloud project specified in
18350    /// the runtime_project_attachment.runtime_project field.
18351    pub runtime_project_attachment_id: std::string::String,
18352
18353    /// Required. The Runtime Project Attachment to create.
18354    pub runtime_project_attachment: std::option::Option<crate::model::RuntimeProjectAttachment>,
18355
18356    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18357}
18358
18359impl CreateRuntimeProjectAttachmentRequest {
18360    pub fn new() -> Self {
18361        std::default::Default::default()
18362    }
18363
18364    /// Sets the value of [parent][crate::model::CreateRuntimeProjectAttachmentRequest::parent].
18365    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18366        self.parent = v.into();
18367        self
18368    }
18369
18370    /// Sets the value of [runtime_project_attachment_id][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment_id].
18371    pub fn set_runtime_project_attachment_id<T: std::convert::Into<std::string::String>>(
18372        mut self,
18373        v: T,
18374    ) -> Self {
18375        self.runtime_project_attachment_id = v.into();
18376        self
18377    }
18378
18379    /// Sets the value of [runtime_project_attachment][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment].
18380    pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
18381    where
18382        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18383    {
18384        self.runtime_project_attachment = std::option::Option::Some(v.into());
18385        self
18386    }
18387
18388    /// Sets or clears the value of [runtime_project_attachment][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment].
18389    pub fn set_or_clear_runtime_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
18390    where
18391        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18392    {
18393        self.runtime_project_attachment = v.map(|x| x.into());
18394        self
18395    }
18396}
18397
18398impl wkt::message::Message for CreateRuntimeProjectAttachmentRequest {
18399    fn typename() -> &'static str {
18400        "type.googleapis.com/google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest"
18401    }
18402}
18403
18404/// The
18405/// [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment]
18406/// method's request.
18407///
18408/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::get_runtime_project_attachment
18409#[derive(Clone, Default, PartialEq)]
18410#[non_exhaustive]
18411pub struct GetRuntimeProjectAttachmentRequest {
18412    /// Required. The name of the API resource to retrieve.
18413    /// Format:
18414    /// `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
18415    pub name: std::string::String,
18416
18417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18418}
18419
18420impl GetRuntimeProjectAttachmentRequest {
18421    pub fn new() -> Self {
18422        std::default::Default::default()
18423    }
18424
18425    /// Sets the value of [name][crate::model::GetRuntimeProjectAttachmentRequest::name].
18426    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18427        self.name = v.into();
18428        self
18429    }
18430}
18431
18432impl wkt::message::Message for GetRuntimeProjectAttachmentRequest {
18433    fn typename() -> &'static str {
18434        "type.googleapis.com/google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest"
18435    }
18436}
18437
18438/// The
18439/// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
18440/// method's request.
18441///
18442/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]: crate::client::RuntimeProjectAttachmentService::list_runtime_project_attachments
18443#[derive(Clone, Default, PartialEq)]
18444#[non_exhaustive]
18445pub struct ListRuntimeProjectAttachmentsRequest {
18446    /// Required. The parent, which owns this collection of runtime project
18447    /// attachments. Format: `projects/{project}/locations/{location}`
18448    pub parent: std::string::String,
18449
18450    /// Optional. The maximum number of runtime project attachments to return. The
18451    /// service may return fewer than this value. If unspecified, at most 50
18452    /// runtime project attachments will be returned. The maximum value is 1000;
18453    /// values above 1000 will be coerced to 1000.
18454    pub page_size: i32,
18455
18456    /// Optional. A page token, received from a previous
18457    /// `ListRuntimeProjectAttachments` call. Provide this to retrieve the
18458    /// subsequent page.
18459    ///
18460    /// When paginating, all other parameters (except page_size) provided to
18461    /// `ListRuntimeProjectAttachments` must match the call that provided the page
18462    /// token.
18463    pub page_token: std::string::String,
18464
18465    /// Optional. An expression that filters the list of RuntimeProjectAttachments.
18466    ///
18467    /// A filter expression consists of a field name, a comparison
18468    /// operator, and a value for filtering. The value must be a string. All
18469    /// standard operators as documented at <https://google.aip.dev/160> are
18470    /// supported.
18471    ///
18472    /// The following fields in the `RuntimeProjectAttachment` are eligible for
18473    /// filtering:
18474    ///
18475    /// * `name` - The name of the RuntimeProjectAttachment.
18476    /// * `create_time` - The time at which the RuntimeProjectAttachment was
18477    ///   created. The value should be in the
18478    ///   (RFC3339)[<https://tools.ietf.org/html/rfc3339>] format.
18479    /// * `runtime_project` - The Google cloud project associated with the
18480    ///   RuntimeProjectAttachment.
18481    pub filter: std::string::String,
18482
18483    /// Optional. Hint for how to order the results.
18484    pub order_by: std::string::String,
18485
18486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18487}
18488
18489impl ListRuntimeProjectAttachmentsRequest {
18490    pub fn new() -> Self {
18491        std::default::Default::default()
18492    }
18493
18494    /// Sets the value of [parent][crate::model::ListRuntimeProjectAttachmentsRequest::parent].
18495    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18496        self.parent = v.into();
18497        self
18498    }
18499
18500    /// Sets the value of [page_size][crate::model::ListRuntimeProjectAttachmentsRequest::page_size].
18501    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18502        self.page_size = v.into();
18503        self
18504    }
18505
18506    /// Sets the value of [page_token][crate::model::ListRuntimeProjectAttachmentsRequest::page_token].
18507    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18508        self.page_token = v.into();
18509        self
18510    }
18511
18512    /// Sets the value of [filter][crate::model::ListRuntimeProjectAttachmentsRequest::filter].
18513    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18514        self.filter = v.into();
18515        self
18516    }
18517
18518    /// Sets the value of [order_by][crate::model::ListRuntimeProjectAttachmentsRequest::order_by].
18519    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18520        self.order_by = v.into();
18521        self
18522    }
18523}
18524
18525impl wkt::message::Message for ListRuntimeProjectAttachmentsRequest {
18526    fn typename() -> &'static str {
18527        "type.googleapis.com/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest"
18528    }
18529}
18530
18531/// The
18532/// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
18533/// method's response.
18534///
18535/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]: crate::client::RuntimeProjectAttachmentService::list_runtime_project_attachments
18536#[derive(Clone, Default, PartialEq)]
18537#[non_exhaustive]
18538pub struct ListRuntimeProjectAttachmentsResponse {
18539    /// List of runtime project attachments.
18540    pub runtime_project_attachments: std::vec::Vec<crate::model::RuntimeProjectAttachment>,
18541
18542    /// A token, which can be sent as `page_token` to retrieve the next page.
18543    /// If this field is omitted, there are no subsequent pages.
18544    pub next_page_token: std::string::String,
18545
18546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18547}
18548
18549impl ListRuntimeProjectAttachmentsResponse {
18550    pub fn new() -> Self {
18551        std::default::Default::default()
18552    }
18553
18554    /// Sets the value of [runtime_project_attachments][crate::model::ListRuntimeProjectAttachmentsResponse::runtime_project_attachments].
18555    pub fn set_runtime_project_attachments<T, V>(mut self, v: T) -> Self
18556    where
18557        T: std::iter::IntoIterator<Item = V>,
18558        V: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18559    {
18560        use std::iter::Iterator;
18561        self.runtime_project_attachments = v.into_iter().map(|i| i.into()).collect();
18562        self
18563    }
18564
18565    /// Sets the value of [next_page_token][crate::model::ListRuntimeProjectAttachmentsResponse::next_page_token].
18566    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18567        self.next_page_token = v.into();
18568        self
18569    }
18570}
18571
18572impl wkt::message::Message for ListRuntimeProjectAttachmentsResponse {
18573    fn typename() -> &'static str {
18574        "type.googleapis.com/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse"
18575    }
18576}
18577
18578#[doc(hidden)]
18579impl gax::paginator::internal::PageableResponse for ListRuntimeProjectAttachmentsResponse {
18580    type PageItem = crate::model::RuntimeProjectAttachment;
18581
18582    fn items(self) -> std::vec::Vec<Self::PageItem> {
18583        self.runtime_project_attachments
18584    }
18585
18586    fn next_page_token(&self) -> std::string::String {
18587        use std::clone::Clone;
18588        self.next_page_token.clone()
18589    }
18590}
18591
18592/// The
18593/// [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment]
18594/// method's request.
18595///
18596/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::delete_runtime_project_attachment
18597#[derive(Clone, Default, PartialEq)]
18598#[non_exhaustive]
18599pub struct DeleteRuntimeProjectAttachmentRequest {
18600    /// Required. The name of the Runtime Project Attachment to delete.
18601    /// Format:
18602    /// `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
18603    pub name: std::string::String,
18604
18605    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18606}
18607
18608impl DeleteRuntimeProjectAttachmentRequest {
18609    pub fn new() -> Self {
18610        std::default::Default::default()
18611    }
18612
18613    /// Sets the value of [name][crate::model::DeleteRuntimeProjectAttachmentRequest::name].
18614    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18615        self.name = v.into();
18616        self
18617    }
18618}
18619
18620impl wkt::message::Message for DeleteRuntimeProjectAttachmentRequest {
18621    fn typename() -> &'static str {
18622        "type.googleapis.com/google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest"
18623    }
18624}
18625
18626/// The
18627/// [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment]
18628/// method's request.
18629///
18630/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::lookup_runtime_project_attachment
18631#[derive(Clone, Default, PartialEq)]
18632#[non_exhaustive]
18633pub struct LookupRuntimeProjectAttachmentRequest {
18634    /// Required. Runtime project ID to look up runtime project attachment for.
18635    /// Lookup happens across all regions. Expected format:
18636    /// `projects/{project}/locations/{location}`.
18637    pub name: std::string::String,
18638
18639    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18640}
18641
18642impl LookupRuntimeProjectAttachmentRequest {
18643    pub fn new() -> Self {
18644        std::default::Default::default()
18645    }
18646
18647    /// Sets the value of [name][crate::model::LookupRuntimeProjectAttachmentRequest::name].
18648    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18649        self.name = v.into();
18650        self
18651    }
18652}
18653
18654impl wkt::message::Message for LookupRuntimeProjectAttachmentRequest {
18655    fn typename() -> &'static str {
18656        "type.googleapis.com/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest"
18657    }
18658}
18659
18660/// The
18661/// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
18662/// method's response.
18663///
18664/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]: crate::client::RuntimeProjectAttachmentService::list_runtime_project_attachments
18665#[derive(Clone, Default, PartialEq)]
18666#[non_exhaustive]
18667pub struct LookupRuntimeProjectAttachmentResponse {
18668    /// Runtime project attachment for a project if exists, empty otherwise.
18669    pub runtime_project_attachment: std::option::Option<crate::model::RuntimeProjectAttachment>,
18670
18671    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18672}
18673
18674impl LookupRuntimeProjectAttachmentResponse {
18675    pub fn new() -> Self {
18676        std::default::Default::default()
18677    }
18678
18679    /// Sets the value of [runtime_project_attachment][crate::model::LookupRuntimeProjectAttachmentResponse::runtime_project_attachment].
18680    pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
18681    where
18682        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18683    {
18684        self.runtime_project_attachment = std::option::Option::Some(v.into());
18685        self
18686    }
18687
18688    /// Sets or clears the value of [runtime_project_attachment][crate::model::LookupRuntimeProjectAttachmentResponse::runtime_project_attachment].
18689    pub fn set_or_clear_runtime_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
18690    where
18691        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18692    {
18693        self.runtime_project_attachment = v.map(|x| x.into());
18694        self
18695    }
18696}
18697
18698impl wkt::message::Message for LookupRuntimeProjectAttachmentResponse {
18699    fn typename() -> &'static str {
18700        "type.googleapis.com/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse"
18701    }
18702}
18703
18704/// Runtime project attachment represents an attachment from the runtime project
18705/// to the host project. Api Hub looks for deployments in the attached runtime
18706/// projects and creates corresponding resources in Api Hub for the discovered
18707/// deployments.
18708#[derive(Clone, Default, PartialEq)]
18709#[non_exhaustive]
18710pub struct RuntimeProjectAttachment {
18711    /// Identifier. The resource name of a runtime project attachment. Format:
18712    /// "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
18713    pub name: std::string::String,
18714
18715    /// Required. Immutable. Google cloud project name in the format:
18716    /// "projects/abc" or "projects/123". As input, project name with either
18717    /// project id or number are accepted. As output, this field will contain
18718    /// project number.
18719    pub runtime_project: std::string::String,
18720
18721    /// Output only. Create time.
18722    pub create_time: std::option::Option<wkt::Timestamp>,
18723
18724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18725}
18726
18727impl RuntimeProjectAttachment {
18728    pub fn new() -> Self {
18729        std::default::Default::default()
18730    }
18731
18732    /// Sets the value of [name][crate::model::RuntimeProjectAttachment::name].
18733    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18734        self.name = v.into();
18735        self
18736    }
18737
18738    /// Sets the value of [runtime_project][crate::model::RuntimeProjectAttachment::runtime_project].
18739    pub fn set_runtime_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18740        self.runtime_project = v.into();
18741        self
18742    }
18743
18744    /// Sets the value of [create_time][crate::model::RuntimeProjectAttachment::create_time].
18745    pub fn set_create_time<T>(mut self, v: T) -> Self
18746    where
18747        T: std::convert::Into<wkt::Timestamp>,
18748    {
18749        self.create_time = std::option::Option::Some(v.into());
18750        self
18751    }
18752
18753    /// Sets or clears the value of [create_time][crate::model::RuntimeProjectAttachment::create_time].
18754    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18755    where
18756        T: std::convert::Into<wkt::Timestamp>,
18757    {
18758        self.create_time = v.map(|x| x.into());
18759        self
18760    }
18761}
18762
18763impl wkt::message::Message for RuntimeProjectAttachment {
18764    fn typename() -> &'static str {
18765        "type.googleapis.com/google.cloud.apihub.v1.RuntimeProjectAttachment"
18766    }
18767}
18768
18769/// The type of the collect request.
18770///
18771/// # Working with unknown values
18772///
18773/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18774/// additional enum variants at any time. Adding new variants is not considered
18775/// a breaking change. Applications should write their code in anticipation of:
18776///
18777/// - New values appearing in future releases of the client library, **and**
18778/// - New values received dynamically, without application changes.
18779///
18780/// Please consult the [Working with enums] section in the user guide for some
18781/// guidelines.
18782///
18783/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18784#[derive(Clone, Debug, PartialEq)]
18785#[non_exhaustive]
18786pub enum CollectionType {
18787    /// The default value. This value is used if the collection type is omitted.
18788    Unspecified,
18789    /// The collection type is upsert. This should be used when an API is created
18790    /// or updated at the source.
18791    Upsert,
18792    /// The collection type is delete. This should be used when an API is deleted
18793    /// at the source.
18794    Delete,
18795    /// If set, the enum was initialized with an unknown value.
18796    ///
18797    /// Applications can examine the value using [CollectionType::value] or
18798    /// [CollectionType::name].
18799    UnknownValue(collection_type::UnknownValue),
18800}
18801
18802#[doc(hidden)]
18803pub mod collection_type {
18804    #[allow(unused_imports)]
18805    use super::*;
18806    #[derive(Clone, Debug, PartialEq)]
18807    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18808}
18809
18810impl CollectionType {
18811    /// Gets the enum value.
18812    ///
18813    /// Returns `None` if the enum contains an unknown value deserialized from
18814    /// the string representation of enums.
18815    pub fn value(&self) -> std::option::Option<i32> {
18816        match self {
18817            Self::Unspecified => std::option::Option::Some(0),
18818            Self::Upsert => std::option::Option::Some(1),
18819            Self::Delete => std::option::Option::Some(2),
18820            Self::UnknownValue(u) => u.0.value(),
18821        }
18822    }
18823
18824    /// Gets the enum value as a string.
18825    ///
18826    /// Returns `None` if the enum contains an unknown value deserialized from
18827    /// the integer representation of enums.
18828    pub fn name(&self) -> std::option::Option<&str> {
18829        match self {
18830            Self::Unspecified => std::option::Option::Some("COLLECTION_TYPE_UNSPECIFIED"),
18831            Self::Upsert => std::option::Option::Some("COLLECTION_TYPE_UPSERT"),
18832            Self::Delete => std::option::Option::Some("COLLECTION_TYPE_DELETE"),
18833            Self::UnknownValue(u) => u.0.name(),
18834        }
18835    }
18836}
18837
18838impl std::default::Default for CollectionType {
18839    fn default() -> Self {
18840        use std::convert::From;
18841        Self::from(0)
18842    }
18843}
18844
18845impl std::fmt::Display for CollectionType {
18846    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18847        wkt::internal::display_enum(f, self.name(), self.value())
18848    }
18849}
18850
18851impl std::convert::From<i32> for CollectionType {
18852    fn from(value: i32) -> Self {
18853        match value {
18854            0 => Self::Unspecified,
18855            1 => Self::Upsert,
18856            2 => Self::Delete,
18857            _ => Self::UnknownValue(collection_type::UnknownValue(
18858                wkt::internal::UnknownEnumValue::Integer(value),
18859            )),
18860        }
18861    }
18862}
18863
18864impl std::convert::From<&str> for CollectionType {
18865    fn from(value: &str) -> Self {
18866        use std::string::ToString;
18867        match value {
18868            "COLLECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
18869            "COLLECTION_TYPE_UPSERT" => Self::Upsert,
18870            "COLLECTION_TYPE_DELETE" => Self::Delete,
18871            _ => Self::UnknownValue(collection_type::UnknownValue(
18872                wkt::internal::UnknownEnumValue::String(value.to_string()),
18873            )),
18874        }
18875    }
18876}
18877
18878impl serde::ser::Serialize for CollectionType {
18879    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18880    where
18881        S: serde::Serializer,
18882    {
18883        match self {
18884            Self::Unspecified => serializer.serialize_i32(0),
18885            Self::Upsert => serializer.serialize_i32(1),
18886            Self::Delete => serializer.serialize_i32(2),
18887            Self::UnknownValue(u) => u.0.serialize(serializer),
18888        }
18889    }
18890}
18891
18892impl<'de> serde::de::Deserialize<'de> for CollectionType {
18893    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18894    where
18895        D: serde::Deserializer<'de>,
18896    {
18897        deserializer.deserialize_any(wkt::internal::EnumVisitor::<CollectionType>::new(
18898            ".google.cloud.apihub.v1.CollectionType",
18899        ))
18900    }
18901}
18902
18903/// Lint state represents success or failure for linting.
18904///
18905/// # Working with unknown values
18906///
18907/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18908/// additional enum variants at any time. Adding new variants is not considered
18909/// a breaking change. Applications should write their code in anticipation of:
18910///
18911/// - New values appearing in future releases of the client library, **and**
18912/// - New values received dynamically, without application changes.
18913///
18914/// Please consult the [Working with enums] section in the user guide for some
18915/// guidelines.
18916///
18917/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18918#[derive(Clone, Debug, PartialEq)]
18919#[non_exhaustive]
18920pub enum LintState {
18921    /// Lint state unspecified.
18922    Unspecified,
18923    /// Linting was completed successfully.
18924    Success,
18925    /// Linting encountered errors.
18926    Error,
18927    /// If set, the enum was initialized with an unknown value.
18928    ///
18929    /// Applications can examine the value using [LintState::value] or
18930    /// [LintState::name].
18931    UnknownValue(lint_state::UnknownValue),
18932}
18933
18934#[doc(hidden)]
18935pub mod lint_state {
18936    #[allow(unused_imports)]
18937    use super::*;
18938    #[derive(Clone, Debug, PartialEq)]
18939    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18940}
18941
18942impl LintState {
18943    /// Gets the enum value.
18944    ///
18945    /// Returns `None` if the enum contains an unknown value deserialized from
18946    /// the string representation of enums.
18947    pub fn value(&self) -> std::option::Option<i32> {
18948        match self {
18949            Self::Unspecified => std::option::Option::Some(0),
18950            Self::Success => std::option::Option::Some(1),
18951            Self::Error => std::option::Option::Some(2),
18952            Self::UnknownValue(u) => u.0.value(),
18953        }
18954    }
18955
18956    /// Gets the enum value as a string.
18957    ///
18958    /// Returns `None` if the enum contains an unknown value deserialized from
18959    /// the integer representation of enums.
18960    pub fn name(&self) -> std::option::Option<&str> {
18961        match self {
18962            Self::Unspecified => std::option::Option::Some("LINT_STATE_UNSPECIFIED"),
18963            Self::Success => std::option::Option::Some("LINT_STATE_SUCCESS"),
18964            Self::Error => std::option::Option::Some("LINT_STATE_ERROR"),
18965            Self::UnknownValue(u) => u.0.name(),
18966        }
18967    }
18968}
18969
18970impl std::default::Default for LintState {
18971    fn default() -> Self {
18972        use std::convert::From;
18973        Self::from(0)
18974    }
18975}
18976
18977impl std::fmt::Display for LintState {
18978    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18979        wkt::internal::display_enum(f, self.name(), self.value())
18980    }
18981}
18982
18983impl std::convert::From<i32> for LintState {
18984    fn from(value: i32) -> Self {
18985        match value {
18986            0 => Self::Unspecified,
18987            1 => Self::Success,
18988            2 => Self::Error,
18989            _ => Self::UnknownValue(lint_state::UnknownValue(
18990                wkt::internal::UnknownEnumValue::Integer(value),
18991            )),
18992        }
18993    }
18994}
18995
18996impl std::convert::From<&str> for LintState {
18997    fn from(value: &str) -> Self {
18998        use std::string::ToString;
18999        match value {
19000            "LINT_STATE_UNSPECIFIED" => Self::Unspecified,
19001            "LINT_STATE_SUCCESS" => Self::Success,
19002            "LINT_STATE_ERROR" => Self::Error,
19003            _ => Self::UnknownValue(lint_state::UnknownValue(
19004                wkt::internal::UnknownEnumValue::String(value.to_string()),
19005            )),
19006        }
19007    }
19008}
19009
19010impl serde::ser::Serialize for LintState {
19011    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19012    where
19013        S: serde::Serializer,
19014    {
19015        match self {
19016            Self::Unspecified => serializer.serialize_i32(0),
19017            Self::Success => serializer.serialize_i32(1),
19018            Self::Error => serializer.serialize_i32(2),
19019            Self::UnknownValue(u) => u.0.serialize(serializer),
19020        }
19021    }
19022}
19023
19024impl<'de> serde::de::Deserialize<'de> for LintState {
19025    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19026    where
19027        D: serde::Deserializer<'de>,
19028    {
19029        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LintState>::new(
19030            ".google.cloud.apihub.v1.LintState",
19031        ))
19032    }
19033}
19034
19035/// Enumeration of linter types.
19036///
19037/// # Working with unknown values
19038///
19039/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19040/// additional enum variants at any time. Adding new variants is not considered
19041/// a breaking change. Applications should write their code in anticipation of:
19042///
19043/// - New values appearing in future releases of the client library, **and**
19044/// - New values received dynamically, without application changes.
19045///
19046/// Please consult the [Working with enums] section in the user guide for some
19047/// guidelines.
19048///
19049/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19050#[derive(Clone, Debug, PartialEq)]
19051#[non_exhaustive]
19052pub enum Linter {
19053    /// Linter type unspecified.
19054    Unspecified,
19055    /// Linter type spectral.
19056    Spectral,
19057    /// Linter type other.
19058    Other,
19059    /// If set, the enum was initialized with an unknown value.
19060    ///
19061    /// Applications can examine the value using [Linter::value] or
19062    /// [Linter::name].
19063    UnknownValue(linter::UnknownValue),
19064}
19065
19066#[doc(hidden)]
19067pub mod linter {
19068    #[allow(unused_imports)]
19069    use super::*;
19070    #[derive(Clone, Debug, PartialEq)]
19071    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19072}
19073
19074impl Linter {
19075    /// Gets the enum value.
19076    ///
19077    /// Returns `None` if the enum contains an unknown value deserialized from
19078    /// the string representation of enums.
19079    pub fn value(&self) -> std::option::Option<i32> {
19080        match self {
19081            Self::Unspecified => std::option::Option::Some(0),
19082            Self::Spectral => std::option::Option::Some(1),
19083            Self::Other => std::option::Option::Some(2),
19084            Self::UnknownValue(u) => u.0.value(),
19085        }
19086    }
19087
19088    /// Gets the enum value as a string.
19089    ///
19090    /// Returns `None` if the enum contains an unknown value deserialized from
19091    /// the integer representation of enums.
19092    pub fn name(&self) -> std::option::Option<&str> {
19093        match self {
19094            Self::Unspecified => std::option::Option::Some("LINTER_UNSPECIFIED"),
19095            Self::Spectral => std::option::Option::Some("SPECTRAL"),
19096            Self::Other => std::option::Option::Some("OTHER"),
19097            Self::UnknownValue(u) => u.0.name(),
19098        }
19099    }
19100}
19101
19102impl std::default::Default for Linter {
19103    fn default() -> Self {
19104        use std::convert::From;
19105        Self::from(0)
19106    }
19107}
19108
19109impl std::fmt::Display for Linter {
19110    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19111        wkt::internal::display_enum(f, self.name(), self.value())
19112    }
19113}
19114
19115impl std::convert::From<i32> for Linter {
19116    fn from(value: i32) -> Self {
19117        match value {
19118            0 => Self::Unspecified,
19119            1 => Self::Spectral,
19120            2 => Self::Other,
19121            _ => Self::UnknownValue(linter::UnknownValue(
19122                wkt::internal::UnknownEnumValue::Integer(value),
19123            )),
19124        }
19125    }
19126}
19127
19128impl std::convert::From<&str> for Linter {
19129    fn from(value: &str) -> Self {
19130        use std::string::ToString;
19131        match value {
19132            "LINTER_UNSPECIFIED" => Self::Unspecified,
19133            "SPECTRAL" => Self::Spectral,
19134            "OTHER" => Self::Other,
19135            _ => Self::UnknownValue(linter::UnknownValue(
19136                wkt::internal::UnknownEnumValue::String(value.to_string()),
19137            )),
19138        }
19139    }
19140}
19141
19142impl serde::ser::Serialize for Linter {
19143    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19144    where
19145        S: serde::Serializer,
19146    {
19147        match self {
19148            Self::Unspecified => serializer.serialize_i32(0),
19149            Self::Spectral => serializer.serialize_i32(1),
19150            Self::Other => serializer.serialize_i32(2),
19151            Self::UnknownValue(u) => u.0.serialize(serializer),
19152        }
19153    }
19154}
19155
19156impl<'de> serde::de::Deserialize<'de> for Linter {
19157    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19158    where
19159        D: serde::Deserializer<'de>,
19160    {
19161        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Linter>::new(
19162            ".google.cloud.apihub.v1.Linter",
19163        ))
19164    }
19165}
19166
19167/// Severity of the issue.
19168///
19169/// # Working with unknown values
19170///
19171/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19172/// additional enum variants at any time. Adding new variants is not considered
19173/// a breaking change. Applications should write their code in anticipation of:
19174///
19175/// - New values appearing in future releases of the client library, **and**
19176/// - New values received dynamically, without application changes.
19177///
19178/// Please consult the [Working with enums] section in the user guide for some
19179/// guidelines.
19180///
19181/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19182#[derive(Clone, Debug, PartialEq)]
19183#[non_exhaustive]
19184pub enum Severity {
19185    /// Severity unspecified.
19186    Unspecified,
19187    /// Severity error.
19188    Error,
19189    /// Severity warning.
19190    Warning,
19191    /// Severity info.
19192    Info,
19193    /// Severity hint.
19194    Hint,
19195    /// If set, the enum was initialized with an unknown value.
19196    ///
19197    /// Applications can examine the value using [Severity::value] or
19198    /// [Severity::name].
19199    UnknownValue(severity::UnknownValue),
19200}
19201
19202#[doc(hidden)]
19203pub mod severity {
19204    #[allow(unused_imports)]
19205    use super::*;
19206    #[derive(Clone, Debug, PartialEq)]
19207    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19208}
19209
19210impl Severity {
19211    /// Gets the enum value.
19212    ///
19213    /// Returns `None` if the enum contains an unknown value deserialized from
19214    /// the string representation of enums.
19215    pub fn value(&self) -> std::option::Option<i32> {
19216        match self {
19217            Self::Unspecified => std::option::Option::Some(0),
19218            Self::Error => std::option::Option::Some(1),
19219            Self::Warning => std::option::Option::Some(2),
19220            Self::Info => std::option::Option::Some(3),
19221            Self::Hint => std::option::Option::Some(4),
19222            Self::UnknownValue(u) => u.0.value(),
19223        }
19224    }
19225
19226    /// Gets the enum value as a string.
19227    ///
19228    /// Returns `None` if the enum contains an unknown value deserialized from
19229    /// the integer representation of enums.
19230    pub fn name(&self) -> std::option::Option<&str> {
19231        match self {
19232            Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
19233            Self::Error => std::option::Option::Some("SEVERITY_ERROR"),
19234            Self::Warning => std::option::Option::Some("SEVERITY_WARNING"),
19235            Self::Info => std::option::Option::Some("SEVERITY_INFO"),
19236            Self::Hint => std::option::Option::Some("SEVERITY_HINT"),
19237            Self::UnknownValue(u) => u.0.name(),
19238        }
19239    }
19240}
19241
19242impl std::default::Default for Severity {
19243    fn default() -> Self {
19244        use std::convert::From;
19245        Self::from(0)
19246    }
19247}
19248
19249impl std::fmt::Display for Severity {
19250    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19251        wkt::internal::display_enum(f, self.name(), self.value())
19252    }
19253}
19254
19255impl std::convert::From<i32> for Severity {
19256    fn from(value: i32) -> Self {
19257        match value {
19258            0 => Self::Unspecified,
19259            1 => Self::Error,
19260            2 => Self::Warning,
19261            3 => Self::Info,
19262            4 => Self::Hint,
19263            _ => Self::UnknownValue(severity::UnknownValue(
19264                wkt::internal::UnknownEnumValue::Integer(value),
19265            )),
19266        }
19267    }
19268}
19269
19270impl std::convert::From<&str> for Severity {
19271    fn from(value: &str) -> Self {
19272        use std::string::ToString;
19273        match value {
19274            "SEVERITY_UNSPECIFIED" => Self::Unspecified,
19275            "SEVERITY_ERROR" => Self::Error,
19276            "SEVERITY_WARNING" => Self::Warning,
19277            "SEVERITY_INFO" => Self::Info,
19278            "SEVERITY_HINT" => Self::Hint,
19279            _ => Self::UnknownValue(severity::UnknownValue(
19280                wkt::internal::UnknownEnumValue::String(value.to_string()),
19281            )),
19282        }
19283    }
19284}
19285
19286impl serde::ser::Serialize for Severity {
19287    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19288    where
19289        S: serde::Serializer,
19290    {
19291        match self {
19292            Self::Unspecified => serializer.serialize_i32(0),
19293            Self::Error => serializer.serialize_i32(1),
19294            Self::Warning => serializer.serialize_i32(2),
19295            Self::Info => serializer.serialize_i32(3),
19296            Self::Hint => serializer.serialize_i32(4),
19297            Self::UnknownValue(u) => u.0.serialize(serializer),
19298        }
19299    }
19300}
19301
19302impl<'de> serde::de::Deserialize<'de> for Severity {
19303    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19304    where
19305        D: serde::Deserializer<'de>,
19306    {
19307        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
19308            ".google.cloud.apihub.v1.Severity",
19309        ))
19310    }
19311}
19312
19313/// AuthType represents the authentication type.
19314///
19315/// # Working with unknown values
19316///
19317/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19318/// additional enum variants at any time. Adding new variants is not considered
19319/// a breaking change. Applications should write their code in anticipation of:
19320///
19321/// - New values appearing in future releases of the client library, **and**
19322/// - New values received dynamically, without application changes.
19323///
19324/// Please consult the [Working with enums] section in the user guide for some
19325/// guidelines.
19326///
19327/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19328#[derive(Clone, Debug, PartialEq)]
19329#[non_exhaustive]
19330pub enum AuthType {
19331    /// Authentication type not specified.
19332    Unspecified,
19333    /// No authentication.
19334    NoAuth,
19335    /// Google service account authentication.
19336    GoogleServiceAccount,
19337    /// Username and password authentication.
19338    UserPassword,
19339    /// API Key authentication.
19340    ApiKey,
19341    /// Oauth 2.0 client credentials grant authentication.
19342    Oauth2ClientCredentials,
19343    /// If set, the enum was initialized with an unknown value.
19344    ///
19345    /// Applications can examine the value using [AuthType::value] or
19346    /// [AuthType::name].
19347    UnknownValue(auth_type::UnknownValue),
19348}
19349
19350#[doc(hidden)]
19351pub mod auth_type {
19352    #[allow(unused_imports)]
19353    use super::*;
19354    #[derive(Clone, Debug, PartialEq)]
19355    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19356}
19357
19358impl AuthType {
19359    /// Gets the enum value.
19360    ///
19361    /// Returns `None` if the enum contains an unknown value deserialized from
19362    /// the string representation of enums.
19363    pub fn value(&self) -> std::option::Option<i32> {
19364        match self {
19365            Self::Unspecified => std::option::Option::Some(0),
19366            Self::NoAuth => std::option::Option::Some(1),
19367            Self::GoogleServiceAccount => std::option::Option::Some(2),
19368            Self::UserPassword => std::option::Option::Some(3),
19369            Self::ApiKey => std::option::Option::Some(4),
19370            Self::Oauth2ClientCredentials => std::option::Option::Some(5),
19371            Self::UnknownValue(u) => u.0.value(),
19372        }
19373    }
19374
19375    /// Gets the enum value as a string.
19376    ///
19377    /// Returns `None` if the enum contains an unknown value deserialized from
19378    /// the integer representation of enums.
19379    pub fn name(&self) -> std::option::Option<&str> {
19380        match self {
19381            Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
19382            Self::NoAuth => std::option::Option::Some("NO_AUTH"),
19383            Self::GoogleServiceAccount => std::option::Option::Some("GOOGLE_SERVICE_ACCOUNT"),
19384            Self::UserPassword => std::option::Option::Some("USER_PASSWORD"),
19385            Self::ApiKey => std::option::Option::Some("API_KEY"),
19386            Self::Oauth2ClientCredentials => std::option::Option::Some("OAUTH2_CLIENT_CREDENTIALS"),
19387            Self::UnknownValue(u) => u.0.name(),
19388        }
19389    }
19390}
19391
19392impl std::default::Default for AuthType {
19393    fn default() -> Self {
19394        use std::convert::From;
19395        Self::from(0)
19396    }
19397}
19398
19399impl std::fmt::Display for AuthType {
19400    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19401        wkt::internal::display_enum(f, self.name(), self.value())
19402    }
19403}
19404
19405impl std::convert::From<i32> for AuthType {
19406    fn from(value: i32) -> Self {
19407        match value {
19408            0 => Self::Unspecified,
19409            1 => Self::NoAuth,
19410            2 => Self::GoogleServiceAccount,
19411            3 => Self::UserPassword,
19412            4 => Self::ApiKey,
19413            5 => Self::Oauth2ClientCredentials,
19414            _ => Self::UnknownValue(auth_type::UnknownValue(
19415                wkt::internal::UnknownEnumValue::Integer(value),
19416            )),
19417        }
19418    }
19419}
19420
19421impl std::convert::From<&str> for AuthType {
19422    fn from(value: &str) -> Self {
19423        use std::string::ToString;
19424        match value {
19425            "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
19426            "NO_AUTH" => Self::NoAuth,
19427            "GOOGLE_SERVICE_ACCOUNT" => Self::GoogleServiceAccount,
19428            "USER_PASSWORD" => Self::UserPassword,
19429            "API_KEY" => Self::ApiKey,
19430            "OAUTH2_CLIENT_CREDENTIALS" => Self::Oauth2ClientCredentials,
19431            _ => Self::UnknownValue(auth_type::UnknownValue(
19432                wkt::internal::UnknownEnumValue::String(value.to_string()),
19433            )),
19434        }
19435    }
19436}
19437
19438impl serde::ser::Serialize for AuthType {
19439    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19440    where
19441        S: serde::Serializer,
19442    {
19443        match self {
19444            Self::Unspecified => serializer.serialize_i32(0),
19445            Self::NoAuth => serializer.serialize_i32(1),
19446            Self::GoogleServiceAccount => serializer.serialize_i32(2),
19447            Self::UserPassword => serializer.serialize_i32(3),
19448            Self::ApiKey => serializer.serialize_i32(4),
19449            Self::Oauth2ClientCredentials => serializer.serialize_i32(5),
19450            Self::UnknownValue(u) => u.0.serialize(serializer),
19451        }
19452    }
19453}
19454
19455impl<'de> serde::de::Deserialize<'de> for AuthType {
19456    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19457    where
19458        D: serde::Deserializer<'de>,
19459    {
19460        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
19461            ".google.cloud.apihub.v1.AuthType",
19462        ))
19463    }
19464}
19465
19466/// Enum for the plugin category.
19467///
19468/// # Working with unknown values
19469///
19470/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19471/// additional enum variants at any time. Adding new variants is not considered
19472/// a breaking change. Applications should write their code in anticipation of:
19473///
19474/// - New values appearing in future releases of the client library, **and**
19475/// - New values received dynamically, without application changes.
19476///
19477/// Please consult the [Working with enums] section in the user guide for some
19478/// guidelines.
19479///
19480/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19481#[derive(Clone, Debug, PartialEq)]
19482#[non_exhaustive]
19483pub enum PluginCategory {
19484    /// Default unspecified plugin type.
19485    Unspecified,
19486    /// API_GATEWAY plugins represent plugins built for API Gateways like Apigee.
19487    ApiGateway,
19488    /// API_PRODUCER plugins represent plugins built for API Producers like
19489    /// Cloud Run, Application Integration etc.
19490    ApiProducer,
19491    /// If set, the enum was initialized with an unknown value.
19492    ///
19493    /// Applications can examine the value using [PluginCategory::value] or
19494    /// [PluginCategory::name].
19495    UnknownValue(plugin_category::UnknownValue),
19496}
19497
19498#[doc(hidden)]
19499pub mod plugin_category {
19500    #[allow(unused_imports)]
19501    use super::*;
19502    #[derive(Clone, Debug, PartialEq)]
19503    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19504}
19505
19506impl PluginCategory {
19507    /// Gets the enum value.
19508    ///
19509    /// Returns `None` if the enum contains an unknown value deserialized from
19510    /// the string representation of enums.
19511    pub fn value(&self) -> std::option::Option<i32> {
19512        match self {
19513            Self::Unspecified => std::option::Option::Some(0),
19514            Self::ApiGateway => std::option::Option::Some(1),
19515            Self::ApiProducer => std::option::Option::Some(2),
19516            Self::UnknownValue(u) => u.0.value(),
19517        }
19518    }
19519
19520    /// Gets the enum value as a string.
19521    ///
19522    /// Returns `None` if the enum contains an unknown value deserialized from
19523    /// the integer representation of enums.
19524    pub fn name(&self) -> std::option::Option<&str> {
19525        match self {
19526            Self::Unspecified => std::option::Option::Some("PLUGIN_CATEGORY_UNSPECIFIED"),
19527            Self::ApiGateway => std::option::Option::Some("API_GATEWAY"),
19528            Self::ApiProducer => std::option::Option::Some("API_PRODUCER"),
19529            Self::UnknownValue(u) => u.0.name(),
19530        }
19531    }
19532}
19533
19534impl std::default::Default for PluginCategory {
19535    fn default() -> Self {
19536        use std::convert::From;
19537        Self::from(0)
19538    }
19539}
19540
19541impl std::fmt::Display for PluginCategory {
19542    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19543        wkt::internal::display_enum(f, self.name(), self.value())
19544    }
19545}
19546
19547impl std::convert::From<i32> for PluginCategory {
19548    fn from(value: i32) -> Self {
19549        match value {
19550            0 => Self::Unspecified,
19551            1 => Self::ApiGateway,
19552            2 => Self::ApiProducer,
19553            _ => Self::UnknownValue(plugin_category::UnknownValue(
19554                wkt::internal::UnknownEnumValue::Integer(value),
19555            )),
19556        }
19557    }
19558}
19559
19560impl std::convert::From<&str> for PluginCategory {
19561    fn from(value: &str) -> Self {
19562        use std::string::ToString;
19563        match value {
19564            "PLUGIN_CATEGORY_UNSPECIFIED" => Self::Unspecified,
19565            "API_GATEWAY" => Self::ApiGateway,
19566            "API_PRODUCER" => Self::ApiProducer,
19567            _ => Self::UnknownValue(plugin_category::UnknownValue(
19568                wkt::internal::UnknownEnumValue::String(value.to_string()),
19569            )),
19570        }
19571    }
19572}
19573
19574impl serde::ser::Serialize for PluginCategory {
19575    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19576    where
19577        S: serde::Serializer,
19578    {
19579        match self {
19580            Self::Unspecified => serializer.serialize_i32(0),
19581            Self::ApiGateway => serializer.serialize_i32(1),
19582            Self::ApiProducer => serializer.serialize_i32(2),
19583            Self::UnknownValue(u) => u.0.serialize(serializer),
19584        }
19585    }
19586}
19587
19588impl<'de> serde::de::Deserialize<'de> for PluginCategory {
19589    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19590    where
19591        D: serde::Deserializer<'de>,
19592    {
19593        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PluginCategory>::new(
19594            ".google.cloud.apihub.v1.PluginCategory",
19595        ))
19596    }
19597}
19598
19599/// Enum for the action type.
19600///
19601/// # Working with unknown values
19602///
19603/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19604/// additional enum variants at any time. Adding new variants is not considered
19605/// a breaking change. Applications should write their code in anticipation of:
19606///
19607/// - New values appearing in future releases of the client library, **and**
19608/// - New values received dynamically, without application changes.
19609///
19610/// Please consult the [Working with enums] section in the user guide for some
19611/// guidelines.
19612///
19613/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19614#[derive(Clone, Debug, PartialEq)]
19615#[non_exhaustive]
19616pub enum ActionType {
19617    /// Default unspecified action type.
19618    Unspecified,
19619    /// Action type for sync metadata.
19620    SyncMetadata,
19621    /// Action type for sync runtime data.
19622    SyncRuntimeData,
19623    /// If set, the enum was initialized with an unknown value.
19624    ///
19625    /// Applications can examine the value using [ActionType::value] or
19626    /// [ActionType::name].
19627    UnknownValue(action_type::UnknownValue),
19628}
19629
19630#[doc(hidden)]
19631pub mod action_type {
19632    #[allow(unused_imports)]
19633    use super::*;
19634    #[derive(Clone, Debug, PartialEq)]
19635    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19636}
19637
19638impl ActionType {
19639    /// Gets the enum value.
19640    ///
19641    /// Returns `None` if the enum contains an unknown value deserialized from
19642    /// the string representation of enums.
19643    pub fn value(&self) -> std::option::Option<i32> {
19644        match self {
19645            Self::Unspecified => std::option::Option::Some(0),
19646            Self::SyncMetadata => std::option::Option::Some(1),
19647            Self::SyncRuntimeData => std::option::Option::Some(2),
19648            Self::UnknownValue(u) => u.0.value(),
19649        }
19650    }
19651
19652    /// Gets the enum value as a string.
19653    ///
19654    /// Returns `None` if the enum contains an unknown value deserialized from
19655    /// the integer representation of enums.
19656    pub fn name(&self) -> std::option::Option<&str> {
19657        match self {
19658            Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
19659            Self::SyncMetadata => std::option::Option::Some("SYNC_METADATA"),
19660            Self::SyncRuntimeData => std::option::Option::Some("SYNC_RUNTIME_DATA"),
19661            Self::UnknownValue(u) => u.0.name(),
19662        }
19663    }
19664}
19665
19666impl std::default::Default for ActionType {
19667    fn default() -> Self {
19668        use std::convert::From;
19669        Self::from(0)
19670    }
19671}
19672
19673impl std::fmt::Display for ActionType {
19674    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19675        wkt::internal::display_enum(f, self.name(), self.value())
19676    }
19677}
19678
19679impl std::convert::From<i32> for ActionType {
19680    fn from(value: i32) -> Self {
19681        match value {
19682            0 => Self::Unspecified,
19683            1 => Self::SyncMetadata,
19684            2 => Self::SyncRuntimeData,
19685            _ => Self::UnknownValue(action_type::UnknownValue(
19686                wkt::internal::UnknownEnumValue::Integer(value),
19687            )),
19688        }
19689    }
19690}
19691
19692impl std::convert::From<&str> for ActionType {
19693    fn from(value: &str) -> Self {
19694        use std::string::ToString;
19695        match value {
19696            "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
19697            "SYNC_METADATA" => Self::SyncMetadata,
19698            "SYNC_RUNTIME_DATA" => Self::SyncRuntimeData,
19699            _ => Self::UnknownValue(action_type::UnknownValue(
19700                wkt::internal::UnknownEnumValue::String(value.to_string()),
19701            )),
19702        }
19703    }
19704}
19705
19706impl serde::ser::Serialize for ActionType {
19707    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19708    where
19709        S: serde::Serializer,
19710    {
19711        match self {
19712            Self::Unspecified => serializer.serialize_i32(0),
19713            Self::SyncMetadata => serializer.serialize_i32(1),
19714            Self::SyncRuntimeData => serializer.serialize_i32(2),
19715            Self::UnknownValue(u) => u.0.serialize(serializer),
19716        }
19717    }
19718}
19719
19720impl<'de> serde::de::Deserialize<'de> for ActionType {
19721    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19722    where
19723        D: serde::Deserializer<'de>,
19724    {
19725        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
19726            ".google.cloud.apihub.v1.ActionType",
19727        ))
19728    }
19729}
19730
19731/// Enum for the gateway type.
19732///
19733/// # Working with unknown values
19734///
19735/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19736/// additional enum variants at any time. Adding new variants is not considered
19737/// a breaking change. Applications should write their code in anticipation of:
19738///
19739/// - New values appearing in future releases of the client library, **and**
19740/// - New values received dynamically, without application changes.
19741///
19742/// Please consult the [Working with enums] section in the user guide for some
19743/// guidelines.
19744///
19745/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19746#[derive(Clone, Debug, PartialEq)]
19747#[non_exhaustive]
19748pub enum GatewayType {
19749    /// The gateway type is not specified.
19750    Unspecified,
19751    /// The gateway type is Apigee X and Hybrid.
19752    ApigeeXAndHybrid,
19753    /// The gateway type is Apigee Edge Public Cloud.
19754    ApigeeEdgePublicCloud,
19755    /// The gateway type is Apigee Edge Private Cloud.
19756    ApigeeEdgePrivateCloud,
19757    /// The gateway type is Cloud API Gateway.
19758    CloudApiGateway,
19759    /// The gateway type is Cloud Endpoints.
19760    CloudEndpoints,
19761    /// The gateway type is API Discovery.
19762    ApiDiscovery,
19763    /// The gateway type for any other types of gateways.
19764    Others,
19765    /// If set, the enum was initialized with an unknown value.
19766    ///
19767    /// Applications can examine the value using [GatewayType::value] or
19768    /// [GatewayType::name].
19769    UnknownValue(gateway_type::UnknownValue),
19770}
19771
19772#[doc(hidden)]
19773pub mod gateway_type {
19774    #[allow(unused_imports)]
19775    use super::*;
19776    #[derive(Clone, Debug, PartialEq)]
19777    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19778}
19779
19780impl GatewayType {
19781    /// Gets the enum value.
19782    ///
19783    /// Returns `None` if the enum contains an unknown value deserialized from
19784    /// the string representation of enums.
19785    pub fn value(&self) -> std::option::Option<i32> {
19786        match self {
19787            Self::Unspecified => std::option::Option::Some(0),
19788            Self::ApigeeXAndHybrid => std::option::Option::Some(1),
19789            Self::ApigeeEdgePublicCloud => std::option::Option::Some(2),
19790            Self::ApigeeEdgePrivateCloud => std::option::Option::Some(3),
19791            Self::CloudApiGateway => std::option::Option::Some(4),
19792            Self::CloudEndpoints => std::option::Option::Some(5),
19793            Self::ApiDiscovery => std::option::Option::Some(6),
19794            Self::Others => std::option::Option::Some(7),
19795            Self::UnknownValue(u) => u.0.value(),
19796        }
19797    }
19798
19799    /// Gets the enum value as a string.
19800    ///
19801    /// Returns `None` if the enum contains an unknown value deserialized from
19802    /// the integer representation of enums.
19803    pub fn name(&self) -> std::option::Option<&str> {
19804        match self {
19805            Self::Unspecified => std::option::Option::Some("GATEWAY_TYPE_UNSPECIFIED"),
19806            Self::ApigeeXAndHybrid => std::option::Option::Some("APIGEE_X_AND_HYBRID"),
19807            Self::ApigeeEdgePublicCloud => std::option::Option::Some("APIGEE_EDGE_PUBLIC_CLOUD"),
19808            Self::ApigeeEdgePrivateCloud => std::option::Option::Some("APIGEE_EDGE_PRIVATE_CLOUD"),
19809            Self::CloudApiGateway => std::option::Option::Some("CLOUD_API_GATEWAY"),
19810            Self::CloudEndpoints => std::option::Option::Some("CLOUD_ENDPOINTS"),
19811            Self::ApiDiscovery => std::option::Option::Some("API_DISCOVERY"),
19812            Self::Others => std::option::Option::Some("OTHERS"),
19813            Self::UnknownValue(u) => u.0.name(),
19814        }
19815    }
19816}
19817
19818impl std::default::Default for GatewayType {
19819    fn default() -> Self {
19820        use std::convert::From;
19821        Self::from(0)
19822    }
19823}
19824
19825impl std::fmt::Display for GatewayType {
19826    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19827        wkt::internal::display_enum(f, self.name(), self.value())
19828    }
19829}
19830
19831impl std::convert::From<i32> for GatewayType {
19832    fn from(value: i32) -> Self {
19833        match value {
19834            0 => Self::Unspecified,
19835            1 => Self::ApigeeXAndHybrid,
19836            2 => Self::ApigeeEdgePublicCloud,
19837            3 => Self::ApigeeEdgePrivateCloud,
19838            4 => Self::CloudApiGateway,
19839            5 => Self::CloudEndpoints,
19840            6 => Self::ApiDiscovery,
19841            7 => Self::Others,
19842            _ => Self::UnknownValue(gateway_type::UnknownValue(
19843                wkt::internal::UnknownEnumValue::Integer(value),
19844            )),
19845        }
19846    }
19847}
19848
19849impl std::convert::From<&str> for GatewayType {
19850    fn from(value: &str) -> Self {
19851        use std::string::ToString;
19852        match value {
19853            "GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
19854            "APIGEE_X_AND_HYBRID" => Self::ApigeeXAndHybrid,
19855            "APIGEE_EDGE_PUBLIC_CLOUD" => Self::ApigeeEdgePublicCloud,
19856            "APIGEE_EDGE_PRIVATE_CLOUD" => Self::ApigeeEdgePrivateCloud,
19857            "CLOUD_API_GATEWAY" => Self::CloudApiGateway,
19858            "CLOUD_ENDPOINTS" => Self::CloudEndpoints,
19859            "API_DISCOVERY" => Self::ApiDiscovery,
19860            "OTHERS" => Self::Others,
19861            _ => Self::UnknownValue(gateway_type::UnknownValue(
19862                wkt::internal::UnknownEnumValue::String(value.to_string()),
19863            )),
19864        }
19865    }
19866}
19867
19868impl serde::ser::Serialize for GatewayType {
19869    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19870    where
19871        S: serde::Serializer,
19872    {
19873        match self {
19874            Self::Unspecified => serializer.serialize_i32(0),
19875            Self::ApigeeXAndHybrid => serializer.serialize_i32(1),
19876            Self::ApigeeEdgePublicCloud => serializer.serialize_i32(2),
19877            Self::ApigeeEdgePrivateCloud => serializer.serialize_i32(3),
19878            Self::CloudApiGateway => serializer.serialize_i32(4),
19879            Self::CloudEndpoints => serializer.serialize_i32(5),
19880            Self::ApiDiscovery => serializer.serialize_i32(6),
19881            Self::Others => serializer.serialize_i32(7),
19882            Self::UnknownValue(u) => u.0.serialize(serializer),
19883        }
19884    }
19885}
19886
19887impl<'de> serde::de::Deserialize<'de> for GatewayType {
19888    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19889    where
19890        D: serde::Deserializer<'de>,
19891    {
19892        deserializer.deserialize_any(wkt::internal::EnumVisitor::<GatewayType>::new(
19893            ".google.cloud.apihub.v1.GatewayType",
19894        ))
19895    }
19896}
19897
19898/// Enum for the curation type.
19899///
19900/// # Working with unknown values
19901///
19902/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19903/// additional enum variants at any time. Adding new variants is not considered
19904/// a breaking change. Applications should write their code in anticipation of:
19905///
19906/// - New values appearing in future releases of the client library, **and**
19907/// - New values received dynamically, without application changes.
19908///
19909/// Please consult the [Working with enums] section in the user guide for some
19910/// guidelines.
19911///
19912/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19913#[derive(Clone, Debug, PartialEq)]
19914#[non_exhaustive]
19915pub enum CurationType {
19916    /// Default unspecified curation type.
19917    Unspecified,
19918    /// Default curation for API metadata will be used.
19919    DefaultCurationForApiMetadata,
19920    /// Custom curation for API metadata will be used.
19921    CustomCurationForApiMetadata,
19922    /// If set, the enum was initialized with an unknown value.
19923    ///
19924    /// Applications can examine the value using [CurationType::value] or
19925    /// [CurationType::name].
19926    UnknownValue(curation_type::UnknownValue),
19927}
19928
19929#[doc(hidden)]
19930pub mod curation_type {
19931    #[allow(unused_imports)]
19932    use super::*;
19933    #[derive(Clone, Debug, PartialEq)]
19934    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19935}
19936
19937impl CurationType {
19938    /// Gets the enum value.
19939    ///
19940    /// Returns `None` if the enum contains an unknown value deserialized from
19941    /// the string representation of enums.
19942    pub fn value(&self) -> std::option::Option<i32> {
19943        match self {
19944            Self::Unspecified => std::option::Option::Some(0),
19945            Self::DefaultCurationForApiMetadata => std::option::Option::Some(1),
19946            Self::CustomCurationForApiMetadata => std::option::Option::Some(2),
19947            Self::UnknownValue(u) => u.0.value(),
19948        }
19949    }
19950
19951    /// Gets the enum value as a string.
19952    ///
19953    /// Returns `None` if the enum contains an unknown value deserialized from
19954    /// the integer representation of enums.
19955    pub fn name(&self) -> std::option::Option<&str> {
19956        match self {
19957            Self::Unspecified => std::option::Option::Some("CURATION_TYPE_UNSPECIFIED"),
19958            Self::DefaultCurationForApiMetadata => {
19959                std::option::Option::Some("DEFAULT_CURATION_FOR_API_METADATA")
19960            }
19961            Self::CustomCurationForApiMetadata => {
19962                std::option::Option::Some("CUSTOM_CURATION_FOR_API_METADATA")
19963            }
19964            Self::UnknownValue(u) => u.0.name(),
19965        }
19966    }
19967}
19968
19969impl std::default::Default for CurationType {
19970    fn default() -> Self {
19971        use std::convert::From;
19972        Self::from(0)
19973    }
19974}
19975
19976impl std::fmt::Display for CurationType {
19977    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19978        wkt::internal::display_enum(f, self.name(), self.value())
19979    }
19980}
19981
19982impl std::convert::From<i32> for CurationType {
19983    fn from(value: i32) -> Self {
19984        match value {
19985            0 => Self::Unspecified,
19986            1 => Self::DefaultCurationForApiMetadata,
19987            2 => Self::CustomCurationForApiMetadata,
19988            _ => Self::UnknownValue(curation_type::UnknownValue(
19989                wkt::internal::UnknownEnumValue::Integer(value),
19990            )),
19991        }
19992    }
19993}
19994
19995impl std::convert::From<&str> for CurationType {
19996    fn from(value: &str) -> Self {
19997        use std::string::ToString;
19998        match value {
19999            "CURATION_TYPE_UNSPECIFIED" => Self::Unspecified,
20000            "DEFAULT_CURATION_FOR_API_METADATA" => Self::DefaultCurationForApiMetadata,
20001            "CUSTOM_CURATION_FOR_API_METADATA" => Self::CustomCurationForApiMetadata,
20002            _ => Self::UnknownValue(curation_type::UnknownValue(
20003                wkt::internal::UnknownEnumValue::String(value.to_string()),
20004            )),
20005        }
20006    }
20007}
20008
20009impl serde::ser::Serialize for CurationType {
20010    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20011    where
20012        S: serde::Serializer,
20013    {
20014        match self {
20015            Self::Unspecified => serializer.serialize_i32(0),
20016            Self::DefaultCurationForApiMetadata => serializer.serialize_i32(1),
20017            Self::CustomCurationForApiMetadata => serializer.serialize_i32(2),
20018            Self::UnknownValue(u) => u.0.serialize(serializer),
20019        }
20020    }
20021}
20022
20023impl<'de> serde::de::Deserialize<'de> for CurationType {
20024    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20025    where
20026        D: serde::Deserializer<'de>,
20027    {
20028        deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurationType>::new(
20029            ".google.cloud.apihub.v1.CurationType",
20030        ))
20031    }
20032}