#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIapSettingsRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateIapSettingsRequest {
#[prost(message, optional, tag = "1")]
pub iap_settings: ::core::option::Option<IapSettings>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IapSettings {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub access_settings: ::core::option::Option<AccessSettings>,
#[prost(message, optional, tag = "6")]
pub application_settings: ::core::option::Option<ApplicationSettings>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccessSettings {
#[prost(message, optional, tag = "1")]
pub gcip_settings: ::core::option::Option<GcipSettings>,
#[prost(message, optional, tag = "2")]
pub cors_settings: ::core::option::Option<CorsSettings>,
#[prost(message, optional, tag = "3")]
pub oauth_settings: ::core::option::Option<OAuthSettings>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GcipSettings {
#[prost(string, repeated, tag = "1")]
pub tenant_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub login_page_uri: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CorsSettings {
#[prost(message, optional, tag = "1")]
pub allow_http_options: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OAuthSettings {
#[prost(message, optional, tag = "2")]
pub login_hint: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplicationSettings {
#[prost(message, optional, tag = "1")]
pub csm_settings: ::core::option::Option<CsmSettings>,
#[prost(message, optional, tag = "2")]
pub access_denied_page_settings: ::core::option::Option<AccessDeniedPageSettings>,
#[prost(message, optional, tag = "3")]
pub cookie_domain: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CsmSettings {
#[prost(message, optional, tag = "1")]
pub rctoken_aud: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccessDeniedPageSettings {
#[prost(message, optional, tag = "1")]
pub access_denied_page_uri: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub generate_troubleshooting_uri: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBrandsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBrandsResponse {
#[prost(message, repeated, tag = "1")]
pub brands: ::prost::alloc::vec::Vec<Brand>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateBrandRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub brand: ::core::option::Option<Brand>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBrandRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIdentityAwareProxyClientsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIdentityAwareProxyClientsResponse {
#[prost(message, repeated, tag = "1")]
pub identity_aware_proxy_clients: ::prost::alloc::vec::Vec<IdentityAwareProxyClient>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIdentityAwareProxyClientRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub identity_aware_proxy_client: ::core::option::Option<IdentityAwareProxyClient>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIdentityAwareProxyClientRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetIdentityAwareProxyClientSecretRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIdentityAwareProxyClientRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Brand {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub support_email: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub application_title: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub org_internal_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IdentityAwareProxyClient {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub secret: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub display_name: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod identity_aware_proxy_admin_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " APIs for Identity-Aware Proxy Admin configurations."]
#[derive(Debug, Clone)]
pub struct IdentityAwareProxyAdminServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> IdentityAwareProxyAdminServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> IdentityAwareProxyAdminServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
IdentityAwareProxyAdminServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Sets the access control policy for an Identity-Aware Proxy protected"]
#[doc = " resource. Replaces any existing policy."]
#[doc = " More information about managing access via IAP can be found at:"]
#[doc = " https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api"]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyAdminService/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the access control policy for an Identity-Aware Proxy protected"]
#[doc = " resource."]
#[doc = " More information about managing access via IAP can be found at:"]
#[doc = " https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api"]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyAdminService/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns permissions that a caller has on the Identity-Aware Proxy protected"]
#[doc = " resource."]
#[doc = " More information about managing access via IAP can be found at:"]
#[doc = " https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api"]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyAdminService/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the IAP settings on a particular IAP protected resource."]
pub async fn get_iap_settings(
&mut self,
request: impl tonic::IntoRequest<super::GetIapSettingsRequest>,
) -> Result<tonic::Response<super::IapSettings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyAdminService/GetIapSettings",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates the IAP settings on a particular IAP protected resource. It"]
#[doc = " replaces all fields unless the `update_mask` is set."]
pub async fn update_iap_settings(
&mut self,
request: impl tonic::IntoRequest<super::UpdateIapSettingsRequest>,
) -> Result<tonic::Response<super::IapSettings>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyAdminService/UpdateIapSettings",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[doc = r" Generated client implementations."]
pub mod identity_aware_proxy_o_auth_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " API to programmatically create, list and retrieve Identity Aware Proxy (IAP)"]
#[doc = " OAuth brands; and create, retrieve, delete and reset-secret of IAP OAuth"]
#[doc = " clients."]
#[derive(Debug, Clone)]
pub struct IdentityAwareProxyOAuthServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> IdentityAwareProxyOAuthServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> IdentityAwareProxyOAuthServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
IdentityAwareProxyOAuthServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Lists the existing brands for the project."]
pub async fn list_brands(
&mut self,
request: impl tonic::IntoRequest<super::ListBrandsRequest>,
) -> Result<tonic::Response<super::ListBrandsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyOAuthService/ListBrands",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Constructs a new OAuth brand for the project if one does not exist."]
#[doc = " The created brand is \"internal only\", meaning that OAuth clients created"]
#[doc = " under it only accept requests from users who belong to the same G Suite"]
#[doc = " organization as the project. The brand is created in an un-reviewed status."]
#[doc = " NOTE: The \"internal only\" status can be manually changed in the Google"]
#[doc = " Cloud console. Requires that a brand does not already exist for the"]
#[doc = " project, and that the specified support email is owned by the caller."]
pub async fn create_brand(
&mut self,
request: impl tonic::IntoRequest<super::CreateBrandRequest>,
) -> Result<tonic::Response<super::Brand>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyOAuthService/CreateBrand",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Retrieves the OAuth brand of the project."]
pub async fn get_brand(
&mut self,
request: impl tonic::IntoRequest<super::GetBrandRequest>,
) -> Result<tonic::Response<super::Brand>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyOAuthService/GetBrand",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates an Identity Aware Proxy (IAP) OAuth client. The client is owned"]
#[doc = " by IAP. Requires that the brand for the project exists and that it is"]
#[doc = " set for internal-only use."]
pub async fn create_identity_aware_proxy_client(
&mut self,
request: impl tonic::IntoRequest<super::CreateIdentityAwareProxyClientRequest>,
) -> Result<tonic::Response<super::IdentityAwareProxyClient>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.iap.v1.IdentityAwareProxyOAuthService/CreateIdentityAwareProxyClient") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists the existing clients for the brand."]
pub async fn list_identity_aware_proxy_clients(
&mut self,
request: impl tonic::IntoRequest<super::ListIdentityAwareProxyClientsRequest>,
) -> Result<tonic::Response<super::ListIdentityAwareProxyClientsResponse>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyOAuthService/ListIdentityAwareProxyClients",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Retrieves an Identity Aware Proxy (IAP) OAuth client."]
#[doc = " Requires that the client is owned by IAP."]
pub async fn get_identity_aware_proxy_client(
&mut self,
request: impl tonic::IntoRequest<super::GetIdentityAwareProxyClientRequest>,
) -> Result<tonic::Response<super::IdentityAwareProxyClient>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.iap.v1.IdentityAwareProxyOAuthService/GetIdentityAwareProxyClient",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the"]
#[doc = " secret was compromised. Requires that the client is owned by IAP."]
pub async fn reset_identity_aware_proxy_client_secret(
&mut self,
request: impl tonic::IntoRequest<super::ResetIdentityAwareProxyClientSecretRequest>,
) -> Result<tonic::Response<super::IdentityAwareProxyClient>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.iap.v1.IdentityAwareProxyOAuthService/ResetIdentityAwareProxyClientSecret") ;
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing"]
#[doc = " obsolete clients, managing the number of clients in a given project, and"]
#[doc = " cleaning up after tests. Requires that the client is owned by IAP."]
pub async fn delete_identity_aware_proxy_client(
&mut self,
request: impl tonic::IntoRequest<super::DeleteIdentityAwareProxyClientRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http :: uri :: PathAndQuery :: from_static ("/google.cloud.iap.v1.IdentityAwareProxyOAuthService/DeleteIdentityAwareProxyClient") ;
self.inner.unary(request.into_request(), path, codec).await
}
}
}