google_cloud_binaryauthorization_v1/
stubs.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//! Traits to mock the clients in this library.
18//!
19//! Application developers may need to mock the clients in this library to test
20//! how their application works with different (and sometimes hard to trigger)
21//! client and service behavior. Such test can define mocks implementing the
22//! trait(s) defined in this module, initialize the client with an instance of
23//! this mock in their tests, and verify their application responds as expected.
24
25#![allow(rustdoc::broken_intra_doc_links)]
26
27use gax::error::Error;
28
29pub(crate) mod dynamic;
30
31/// Defines the trait used to implement [crate::client::BinauthzManagementServiceV1].
32///
33/// Application developers may need to implement this trait to mock
34/// `client::BinauthzManagementServiceV1`.  In other use-cases, application developers only
35/// use `client::BinauthzManagementServiceV1` and need not be concerned with this trait or
36/// its implementations.
37///
38/// Services gain new RPCs routinely. Consequently, this trait gains new methods
39/// too. To avoid breaking applications the trait provides a default
40/// implementation of each method. Most of these implementations just return an
41/// error.
42pub trait BinauthzManagementServiceV1: std::fmt::Debug + Send + Sync {
43    /// Implements [crate::client::BinauthzManagementServiceV1::get_policy].
44    fn get_policy(
45        &self,
46        _req: crate::model::GetPolicyRequest,
47        _options: gax::options::RequestOptions,
48    ) -> impl std::future::Future<Output = crate::Result<crate::model::Policy>> + Send {
49        std::future::ready::<crate::Result<crate::model::Policy>>(Err(Error::other(
50            "unimplemented",
51        )))
52    }
53
54    /// Implements [crate::client::BinauthzManagementServiceV1::update_policy].
55    fn update_policy(
56        &self,
57        _req: crate::model::UpdatePolicyRequest,
58        _options: gax::options::RequestOptions,
59    ) -> impl std::future::Future<Output = crate::Result<crate::model::Policy>> + Send {
60        std::future::ready::<crate::Result<crate::model::Policy>>(Err(Error::other(
61            "unimplemented",
62        )))
63    }
64
65    /// Implements [crate::client::BinauthzManagementServiceV1::create_attestor].
66    fn create_attestor(
67        &self,
68        _req: crate::model::CreateAttestorRequest,
69        _options: gax::options::RequestOptions,
70    ) -> impl std::future::Future<Output = crate::Result<crate::model::Attestor>> + Send {
71        std::future::ready::<crate::Result<crate::model::Attestor>>(Err(Error::other(
72            "unimplemented",
73        )))
74    }
75
76    /// Implements [crate::client::BinauthzManagementServiceV1::get_attestor].
77    fn get_attestor(
78        &self,
79        _req: crate::model::GetAttestorRequest,
80        _options: gax::options::RequestOptions,
81    ) -> impl std::future::Future<Output = crate::Result<crate::model::Attestor>> + Send {
82        std::future::ready::<crate::Result<crate::model::Attestor>>(Err(Error::other(
83            "unimplemented",
84        )))
85    }
86
87    /// Implements [crate::client::BinauthzManagementServiceV1::update_attestor].
88    fn update_attestor(
89        &self,
90        _req: crate::model::UpdateAttestorRequest,
91        _options: gax::options::RequestOptions,
92    ) -> impl std::future::Future<Output = crate::Result<crate::model::Attestor>> + Send {
93        std::future::ready::<crate::Result<crate::model::Attestor>>(Err(Error::other(
94            "unimplemented",
95        )))
96    }
97
98    /// Implements [crate::client::BinauthzManagementServiceV1::list_attestors].
99    fn list_attestors(
100        &self,
101        _req: crate::model::ListAttestorsRequest,
102        _options: gax::options::RequestOptions,
103    ) -> impl std::future::Future<Output = crate::Result<crate::model::ListAttestorsResponse>> + Send
104    {
105        std::future::ready::<crate::Result<crate::model::ListAttestorsResponse>>(Err(Error::other(
106            "unimplemented",
107        )))
108    }
109
110    /// Implements [crate::client::BinauthzManagementServiceV1::delete_attestor].
111    fn delete_attestor(
112        &self,
113        _req: crate::model::DeleteAttestorRequest,
114        _options: gax::options::RequestOptions,
115    ) -> impl std::future::Future<Output = crate::Result<wkt::Empty>> + Send {
116        std::future::ready::<crate::Result<wkt::Empty>>(Err(Error::other("unimplemented")))
117    }
118}
119
120/// Defines the trait used to implement [crate::client::SystemPolicyV1].
121///
122/// Application developers may need to implement this trait to mock
123/// `client::SystemPolicyV1`.  In other use-cases, application developers only
124/// use `client::SystemPolicyV1` and need not be concerned with this trait or
125/// its implementations.
126///
127/// Services gain new RPCs routinely. Consequently, this trait gains new methods
128/// too. To avoid breaking applications the trait provides a default
129/// implementation of each method. Most of these implementations just return an
130/// error.
131pub trait SystemPolicyV1: std::fmt::Debug + Send + Sync {
132    /// Implements [crate::client::SystemPolicyV1::get_system_policy].
133    fn get_system_policy(
134        &self,
135        _req: crate::model::GetSystemPolicyRequest,
136        _options: gax::options::RequestOptions,
137    ) -> impl std::future::Future<Output = crate::Result<crate::model::Policy>> + Send {
138        std::future::ready::<crate::Result<crate::model::Policy>>(Err(Error::other(
139            "unimplemented",
140        )))
141    }
142}
143
144/// Defines the trait used to implement [crate::client::ValidationHelperV1].
145///
146/// Application developers may need to implement this trait to mock
147/// `client::ValidationHelperV1`.  In other use-cases, application developers only
148/// use `client::ValidationHelperV1` and need not be concerned with this trait or
149/// its implementations.
150///
151/// Services gain new RPCs routinely. Consequently, this trait gains new methods
152/// too. To avoid breaking applications the trait provides a default
153/// implementation of each method. Most of these implementations just return an
154/// error.
155pub trait ValidationHelperV1: std::fmt::Debug + Send + Sync {
156    /// Implements [crate::client::ValidationHelperV1::validate_attestation_occurrence].
157    fn validate_attestation_occurrence(
158        &self,
159        _req: crate::model::ValidateAttestationOccurrenceRequest,
160        _options: gax::options::RequestOptions,
161    ) -> impl std::future::Future<
162        Output = crate::Result<crate::model::ValidateAttestationOccurrenceResponse>,
163    > + Send {
164        std::future::ready::<crate::Result<crate::model::ValidateAttestationOccurrenceResponse>>(
165            Err(Error::other("unimplemented")),
166        )
167    }
168}