1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974
// This file is @generated by prost-build.
/// Represents a collection of external workload identities. You can define IAM
/// policies to grant these identities access to Google Cloud resources.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkloadIdentityPool {
/// Output only. The resource name of the pool.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// A display name for the pool. Cannot exceed 32 characters.
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
/// A description of the pool. Cannot exceed 256 characters.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// Output only. The state of the pool.
#[prost(enumeration = "workload_identity_pool::State", tag = "4")]
pub state: i32,
/// Whether the pool is disabled. You cannot use a disabled pool to exchange
/// tokens, or use existing tokens to access resources. If
/// the pool is re-enabled, existing tokens grant access again.
#[prost(bool, tag = "5")]
pub disabled: bool,
}
/// Nested message and enum types in `WorkloadIdentityPool`.
pub mod workload_identity_pool {
/// The current state of the pool.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// State unspecified.
Unspecified = 0,
/// The pool is active, and may be used in Google Cloud policies.
Active = 1,
/// The pool is soft-deleted. Soft-deleted pools are permanently deleted
/// after approximately 30 days. You can restore a soft-deleted pool using
/// [UndeleteWorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPools.UndeleteWorkloadIdentityPool].
///
/// You cannot reuse the ID of a soft-deleted pool until it is permanently
/// deleted.
///
/// While a pool is deleted, you cannot use it to exchange tokens, or use
/// existing tokens to access resources. If the pool is undeleted, existing
/// tokens grant access again.
Deleted = 2,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Active => "ACTIVE",
State::Deleted => "DELETED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"ACTIVE" => Some(Self::Active),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
}
/// A configuration for an external identity provider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkloadIdentityPoolProvider {
/// Output only. The resource name of the provider.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// A display name for the provider. Cannot exceed 32 characters.
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
/// A description for the provider. Cannot exceed 256 characters.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// Output only. The state of the provider.
#[prost(enumeration = "workload_identity_pool_provider::State", tag = "4")]
pub state: i32,
/// Whether the provider is disabled. You cannot use a disabled provider to
/// exchange tokens. However, existing tokens still grant access.
#[prost(bool, tag = "5")]
pub disabled: bool,
/// Maps attributes from authentication credentials issued by an external
/// identity provider to Google Cloud attributes, such as `subject` and
/// `segment`.
///
/// Each key must be a string specifying the Google Cloud IAM attribute to
/// map to.
///
/// The following keys are supported:
///
/// * `google.subject`: The principal IAM is authenticating. You can reference
/// this value in IAM bindings. This is also the
/// subject that appears in Cloud Logging logs.
/// Cannot exceed 127 characters.
///
/// * `google.groups`: Groups the external identity belongs to. You can grant
/// groups access to resources using an IAM `principalSet`
/// binding; access applies to all members of the group.
///
/// You can also provide custom attributes by specifying
/// `attribute.{custom_attribute}`, where `{custom_attribute}` is the name of
/// the custom attribute to be mapped. You can define a maximum of 50 custom
/// attributes. The maximum length of a mapped attribute key is
/// 100 characters, and the key may only contain the characters \[a-z0-9_\].
///
/// You can reference these attributes in IAM policies to define fine-grained
/// access for a workload to Google Cloud resources. For example:
///
/// * `google.subject`:
/// `principal://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/subject/{value}`
///
/// * `google.groups`:
/// `principalSet://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/group/{value}`
///
/// * `attribute.{custom_attribute}`:
/// `principalSet://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/attribute.{custom_attribute}/{value}`
///
/// Each value must be a \[Common Expression Language\]
/// (<https://opensource.google/projects/cel>) function that maps an
/// identity provider credential to the normalized attribute specified by the
/// corresponding map key.
///
/// You can use the `assertion` keyword in the expression to access a JSON
/// representation of the authentication credential issued by the provider.
///
/// The maximum length of an attribute mapping expression is 2048 characters.
/// When evaluated, the total size of all mapped attributes must not exceed
/// 8KB.
///
/// For AWS providers, the following rules apply:
///
/// - If no attribute mapping is defined, the following default mapping
/// applies:
///
/// ```
/// {
/// "google.subject":"assertion.arn",
/// "attribute.aws_role":
/// "assertion.arn.contains('assumed-role')"
/// " ? assertion.arn.extract('{account_arn}assumed-role/')"
/// " + 'assumed-role/'"
/// " + assertion.arn.extract('assumed-role/{role_name}/')"
/// " : assertion.arn",
/// }
/// ```
///
/// - If any custom attribute mappings are defined, they must include a mapping
/// to the `google.subject` attribute.
///
///
/// For OIDC providers, the following rules apply:
///
/// - Custom attribute mappings must be defined, and must include a mapping to
/// the `google.subject` attribute. For example, the following maps the
/// `sub` claim of the incoming credential to the `subject` attribute on
/// a Google token.
///
/// ```
/// {"google.subject": "assertion.sub"}
/// ```
#[prost(btree_map = "string, string", tag = "6")]
pub attribute_mapping: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// [A Common Expression Language](<https://opensource.google/projects/cel>)
/// expression, in plain text, to restrict what otherwise valid authentication
/// credentials issued by the provider should not be accepted.
///
/// The expression must output a boolean representing whether to allow the
/// federation.
///
/// The following keywords may be referenced in the expressions:
///
/// * `assertion`: JSON representing the authentication credential issued by
/// the provider.
/// * `google`: The Google attributes mapped from the assertion in the
/// `attribute_mappings`.
/// * `attribute`: The custom attributes mapped from the assertion in the
/// `attribute_mappings`.
///
/// The maximum length of the attribute condition expression is 4096
/// characters. If unspecified, all valid authentication credential are
/// accepted.
///
/// The following example shows how to only allow credentials with a mapped
/// `google.groups` value of `admins`:
///
/// ```
/// "'admins' in google.groups"
/// ```
#[prost(string, tag = "7")]
pub attribute_condition: ::prost::alloc::string::String,
/// Identity provider configuration types.
#[prost(oneof = "workload_identity_pool_provider::ProviderConfig", tags = "8, 9")]
pub provider_config: ::core::option::Option<
workload_identity_pool_provider::ProviderConfig,
>,
}
/// Nested message and enum types in `WorkloadIdentityPoolProvider`.
pub mod workload_identity_pool_provider {
/// Represents an Amazon Web Services identity provider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Aws {
/// Required. The AWS account ID.
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
}
/// Represents an OpenId Connect 1.0 identity provider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Oidc {
/// Required. The OIDC issuer URL.
#[prost(string, tag = "1")]
pub issuer_uri: ::prost::alloc::string::String,
/// Acceptable values for the `aud` field (audience) in the OIDC token. Token
/// exchange requests are rejected if the token audience does not match one
/// of the configured values. Each audience may be at most 256 characters. A
/// maximum of 10 audiences may be configured.
///
/// If this list is empty, the OIDC token audience must be equal to
/// the full canonical resource name of the WorkloadIdentityPoolProvider,
/// with or without the HTTPS prefix. For example:
///
/// ```
/// //iam.googleapis.com/projects/<project-number>/locations/<location>/workloadIdentityPools/<pool-id>/providers/<provider-id>
/// <https://iam.googleapis.com/projects/<project-number>/locations/<location>/workloadIdentityPools/<pool-id>/providers/<provider-id>>
/// ```
#[prost(string, repeated, tag = "2")]
pub allowed_audiences: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The current state of the provider.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// State unspecified.
Unspecified = 0,
/// The provider is active, and may be used to validate authentication
/// credentials.
Active = 1,
/// The provider is soft-deleted. Soft-deleted providers are permanently
/// deleted after approximately 30 days. You can restore a soft-deleted
/// provider using
/// [UndeleteWorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityPools.UndeleteWorkloadIdentityPoolProvider].
///
/// You cannot reuse the ID of a soft-deleted provider until it is
/// permanently deleted.
Deleted = 2,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Active => "ACTIVE",
State::Deleted => "DELETED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"ACTIVE" => Some(Self::Active),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
/// Identity provider configuration types.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ProviderConfig {
/// An Amazon Web Services identity provider.
#[prost(message, tag = "8")]
Aws(Aws),
/// An OpenId Connect 1.0 identity provider.
#[prost(message, tag = "9")]
Oidc(Oidc),
}
}
/// Request message for ListWorkloadIdentityPools.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadIdentityPoolsRequest {
/// Required. The parent resource to list pools for.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of pools to return.
/// If unspecified, at most 50 pools are returned.
/// The maximum value is 1000; values above are 1000 truncated to 1000.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token, received from a previous `ListWorkloadIdentityPools`
/// call. Provide this to retrieve the subsequent page.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// Whether to return soft-deleted pools.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message for ListWorkloadIdentityPools.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadIdentityPoolsResponse {
/// A list of pools.
#[prost(message, repeated, tag = "1")]
pub workload_identity_pools: ::prost::alloc::vec::Vec<WorkloadIdentityPool>,
/// A token, which can be sent as `page_token` to retrieve the next page.
/// If this field is omitted, there are no subsequent pages.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for GetWorkloadIdentityPool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetWorkloadIdentityPoolRequest {
/// Required. The name of the pool to retrieve.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for CreateWorkloadIdentityPool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkloadIdentityPoolRequest {
/// Required. The parent resource to create the pool in. The only supported
/// location is `global`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The pool to create.
#[prost(message, optional, tag = "2")]
pub workload_identity_pool: ::core::option::Option<WorkloadIdentityPool>,
/// Required. The ID to use for the pool, which becomes the
/// final component of the resource name. This value should be 4-32 characters,
/// and may contain the characters \[a-z0-9-\]. The prefix `gcp-` is
/// reserved for use by Google, and may not be specified.
#[prost(string, tag = "3")]
pub workload_identity_pool_id: ::prost::alloc::string::String,
}
/// Request message for UpdateWorkloadIdentityPool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkloadIdentityPoolRequest {
/// Required. The pool to update. The `name` field is used to identify the pool.
#[prost(message, optional, tag = "1")]
pub workload_identity_pool: ::core::option::Option<WorkloadIdentityPool>,
/// Required. The list of fields update.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request message for DeleteWorkloadIdentityPool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteWorkloadIdentityPoolRequest {
/// Required. The name of the pool to delete.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for UndeleteWorkloadIdentityPool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteWorkloadIdentityPoolRequest {
/// Required. The name of the pool to undelete.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for ListWorkloadIdentityPoolProviders.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadIdentityPoolProvidersRequest {
/// Required. The pool to list providers for.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of providers to return.
/// If unspecified, at most 50 providers are returned.
/// The maximum value is 100; values above 100 are truncated to 100.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token, received from a previous
/// `ListWorkloadIdentityPoolProviders` call. Provide this to retrieve the
/// subsequent page.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// Whether to return soft-deleted providers.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message for ListWorkloadIdentityPoolProviders.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadIdentityPoolProvidersResponse {
/// A list of providers.
#[prost(message, repeated, tag = "1")]
pub workload_identity_pool_providers: ::prost::alloc::vec::Vec<
WorkloadIdentityPoolProvider,
>,
/// A token, which can be sent as `page_token` to retrieve the next page.
/// If this field is omitted, there are no subsequent pages.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for GetWorkloadIdentityPoolProvider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetWorkloadIdentityPoolProviderRequest {
/// Required. The name of the provider to retrieve.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for CreateWorkloadIdentityPoolProvider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkloadIdentityPoolProviderRequest {
/// Required. The pool to create this provider in.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The provider to create.
#[prost(message, optional, tag = "2")]
pub workload_identity_pool_provider: ::core::option::Option<
WorkloadIdentityPoolProvider,
>,
/// Required. The ID for the provider, which becomes the
/// final component of the resource name. This value must be 4-32 characters,
/// and may contain the characters \[a-z0-9-\]. The prefix `gcp-` is
/// reserved for use by Google, and may not be specified.
#[prost(string, tag = "3")]
pub workload_identity_pool_provider_id: ::prost::alloc::string::String,
}
/// Request message for UpdateWorkloadIdentityPoolProvider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkloadIdentityPoolProviderRequest {
/// Required. The provider to update.
#[prost(message, optional, tag = "1")]
pub workload_identity_pool_provider: ::core::option::Option<
WorkloadIdentityPoolProvider,
>,
/// Required. The list of fields to update.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request message for DeleteWorkloadIdentityPoolProvider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteWorkloadIdentityPoolProviderRequest {
/// Required. The name of the provider to delete.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for UndeleteWorkloadIdentityPoolProvider.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteWorkloadIdentityPoolProviderRequest {
/// Required. The name of the provider to undelete.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Metadata for long-running WorkloadIdentityPool operations.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WorkloadIdentityPoolOperationMetadata {}
/// Metadata for long-running WorkloadIdentityPoolProvider operations.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WorkloadIdentityPoolProviderOperationMetadata {}
/// Generated client implementations.
pub mod workload_identity_pools_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Manages WorkloadIdentityPools.
#[derive(Debug, Clone)]
pub struct WorkloadIdentityPoolsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> WorkloadIdentityPoolsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> WorkloadIdentityPoolsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
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> + std::marker::Send + std::marker::Sync,
{
WorkloadIdentityPoolsClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Lists all non-deleted
/// [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]s in a
/// project. If `show_deleted` is set to `true`, then deleted pools are also
/// listed.
pub async fn list_workload_identity_pools(
&mut self,
request: impl tonic::IntoRequest<super::ListWorkloadIdentityPoolsRequest>,
) -> std::result::Result<
tonic::Response<super::ListWorkloadIdentityPoolsResponse>,
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.iam.v1beta.WorkloadIdentityPools/ListWorkloadIdentityPools",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"ListWorkloadIdentityPools",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets an individual
/// [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool].
pub async fn get_workload_identity_pool(
&mut self,
request: impl tonic::IntoRequest<super::GetWorkloadIdentityPoolRequest>,
) -> std::result::Result<
tonic::Response<super::WorkloadIdentityPool>,
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.iam.v1beta.WorkloadIdentityPools/GetWorkloadIdentityPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"GetWorkloadIdentityPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates a new
/// [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool].
///
/// You cannot reuse the name of a deleted pool until 30 days after deletion.
pub async fn create_workload_identity_pool(
&mut self,
request: impl tonic::IntoRequest<super::CreateWorkloadIdentityPoolRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/CreateWorkloadIdentityPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"CreateWorkloadIdentityPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates an existing
/// [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool].
pub async fn update_workload_identity_pool(
&mut self,
request: impl tonic::IntoRequest<super::UpdateWorkloadIdentityPoolRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/UpdateWorkloadIdentityPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"UpdateWorkloadIdentityPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a
/// [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool].
///
/// You cannot use a deleted pool to exchange external
/// credentials for Google Cloud credentials. However, deletion does
/// not revoke credentials that have already been issued.
/// Credentials issued for a deleted pool do not grant access to resources.
/// If the pool is undeleted, and the credentials are not expired, they
/// grant access again.
/// You can undelete a pool for 30 days. After 30 days, deletion is
/// permanent.
/// You cannot update deleted pools. However, you can view and list them.
pub async fn delete_workload_identity_pool(
&mut self,
request: impl tonic::IntoRequest<super::DeleteWorkloadIdentityPoolRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/DeleteWorkloadIdentityPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"DeleteWorkloadIdentityPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Undeletes a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool],
/// as long as it was deleted fewer than 30 days ago.
pub async fn undelete_workload_identity_pool(
&mut self,
request: impl tonic::IntoRequest<super::UndeleteWorkloadIdentityPoolRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/UndeleteWorkloadIdentityPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"UndeleteWorkloadIdentityPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists all non-deleted
/// [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityPoolProvider]s
/// in a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool].
/// If `show_deleted` is set to `true`, then deleted providers are also listed.
pub async fn list_workload_identity_pool_providers(
&mut self,
request: impl tonic::IntoRequest<
super::ListWorkloadIdentityPoolProvidersRequest,
>,
) -> std::result::Result<
tonic::Response<super::ListWorkloadIdentityPoolProvidersResponse>,
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.iam.v1beta.WorkloadIdentityPools/ListWorkloadIdentityPoolProviders",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"ListWorkloadIdentityPoolProviders",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets an individual
/// [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityPoolProvider].
pub async fn get_workload_identity_pool_provider(
&mut self,
request: impl tonic::IntoRequest<
super::GetWorkloadIdentityPoolProviderRequest,
>,
) -> std::result::Result<
tonic::Response<super::WorkloadIdentityPoolProvider>,
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.iam.v1beta.WorkloadIdentityPools/GetWorkloadIdentityPoolProvider",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"GetWorkloadIdentityPoolProvider",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates a new
/// [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]
/// in a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool].
///
/// You cannot reuse the name of a deleted provider until 30 days after
/// deletion.
pub async fn create_workload_identity_pool_provider(
&mut self,
request: impl tonic::IntoRequest<
super::CreateWorkloadIdentityPoolProviderRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/CreateWorkloadIdentityPoolProvider",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"CreateWorkloadIdentityPoolProvider",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates an existing
/// [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider].
pub async fn update_workload_identity_pool_provider(
&mut self,
request: impl tonic::IntoRequest<
super::UpdateWorkloadIdentityPoolProviderRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/UpdateWorkloadIdentityPoolProvider",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"UpdateWorkloadIdentityPoolProvider",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a
/// [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider].
/// Deleting a provider does not revoke credentials that have already been
/// issued; they continue to grant access.
/// You can undelete a provider for 30 days. After 30 days, deletion is
/// permanent.
/// You cannot update deleted providers. However, you can view and list them.
pub async fn delete_workload_identity_pool_provider(
&mut self,
request: impl tonic::IntoRequest<
super::DeleteWorkloadIdentityPoolProviderRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/DeleteWorkloadIdentityPoolProvider",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"DeleteWorkloadIdentityPoolProvider",
),
);
self.inner.unary(req, path, codec).await
}
/// Undeletes a
/// [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider],
/// as long as it was deleted fewer than 30 days ago.
pub async fn undelete_workload_identity_pool_provider(
&mut self,
request: impl tonic::IntoRequest<
super::UndeleteWorkloadIdentityPoolProviderRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::longrunning::Operation>,
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.iam.v1beta.WorkloadIdentityPools/UndeleteWorkloadIdentityPoolProvider",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.iam.v1beta.WorkloadIdentityPools",
"UndeleteWorkloadIdentityPoolProvider",
),
);
self.inner.unary(req, path, codec).await
}
}
}