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 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023
// This file is @generated by prost-build.
/// Request for creating a workload.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkloadRequest {
/// Required. The resource name of the new Workload's parent.
/// Must be of the form `organizations/{org_id}/locations/{location_id}`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. Assured Workload to create
#[prost(message, optional, tag = "2")]
pub workload: ::core::option::Option<Workload>,
/// Optional. A identifier associated with the workload and underlying projects which
/// allows for the break down of billing costs for a workload. The value
/// provided for the identifier will add a label to the workload and contained
/// projects with the identifier as the value.
#[prost(string, tag = "3")]
pub external_id: ::prost::alloc::string::String,
}
/// Request for Updating a workload.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkloadRequest {
/// Required. The workload to update.
/// The workload's `name` field is used to identify the workload to be updated.
/// Format:
/// organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
#[prost(message, optional, tag = "1")]
pub workload: ::core::option::Option<Workload>,
/// Required. The list of fields to be updated.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request for restricting list of available resources in Workload environment.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestrictAllowedResourcesRequest {
/// Required. The resource name of the Workload. This is the workloads's
/// relative path in the API, formatted as
/// "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
/// For example,
/// "organizations/123/locations/us-east1/workloads/assured-workload-1".
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. The type of restriction for using gcp products in the Workload environment.
#[prost(
enumeration = "restrict_allowed_resources_request::RestrictionType",
tag = "2"
)]
pub restriction_type: i32,
}
/// Nested message and enum types in `RestrictAllowedResourcesRequest`.
pub mod restrict_allowed_resources_request {
/// The type of restriction.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RestrictionType {
/// Unknown restriction type.
Unspecified = 0,
/// Allow the use all of all gcp products, irrespective of the compliance
/// posture. This effectively removes gcp.restrictServiceUsage OrgPolicy
/// on the AssuredWorkloads Folder.
AllowAllGcpResources = 1,
/// Based on Workload's compliance regime, allowed list changes.
/// See - <https://cloud.google.com/assured-workloads/docs/supported-products>
/// for the list of supported resources.
AllowCompliantResources = 2,
}
impl RestrictionType {
/// 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 {
RestrictionType::Unspecified => "RESTRICTION_TYPE_UNSPECIFIED",
RestrictionType::AllowAllGcpResources => "ALLOW_ALL_GCP_RESOURCES",
RestrictionType::AllowCompliantResources => "ALLOW_COMPLIANT_RESOURCES",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RESTRICTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ALLOW_ALL_GCP_RESOURCES" => Some(Self::AllowAllGcpResources),
"ALLOW_COMPLIANT_RESOURCES" => Some(Self::AllowCompliantResources),
_ => None,
}
}
}
}
/// Response for restricting the list of allowed resources.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RestrictAllowedResourcesResponse {}
/// Request for deleting a Workload.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteWorkloadRequest {
/// Required. The `name` field is used to identify the workload.
/// Format:
/// organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Optional. The etag of the workload.
/// If this is provided, it must match the server's etag.
#[prost(string, tag = "2")]
pub etag: ::prost::alloc::string::String,
}
/// Request for fetching a workload.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetWorkloadRequest {
/// Required. The resource name of the Workload to fetch. This is the workloads's
/// relative path in the API, formatted as
/// "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
/// For example,
/// "organizations/123/locations/us-east1/workloads/assured-workload-1".
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// A request to analyze a hypothetical move of a source project or project-based
/// workload to a target (destination) folder-based workload.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnalyzeWorkloadMoveRequest {
/// Required. The resource ID of the folder-based destination workload. This workload is
/// where the source project will hypothetically be moved to. Specify the
/// workload's relative resource name, formatted as:
/// "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}"
/// For example:
/// "organizations/123/locations/us-east1/workloads/assured-workload-2"
#[prost(string, tag = "2")]
pub target: ::prost::alloc::string::String,
/// The resource type to be moved to the destination workload. It can be either
/// an existing project or a project-based workload.
#[prost(
oneof = "analyze_workload_move_request::ProjectOrWorkloadResource",
tags = "1, 3"
)]
pub project_or_workload_resource: ::core::option::Option<
analyze_workload_move_request::ProjectOrWorkloadResource,
>,
}
/// Nested message and enum types in `AnalyzeWorkloadMoveRequest`.
pub mod analyze_workload_move_request {
/// The resource type to be moved to the destination workload. It can be either
/// an existing project or a project-based workload.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ProjectOrWorkloadResource {
/// The source type is a project-based workload. Specify the workloads's
/// relative resource name, formatted as:
/// "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}"
/// For example:
/// "organizations/123/locations/us-east1/workloads/assured-workload-1"
#[prost(string, tag = "1")]
Source(::prost::alloc::string::String),
/// The source type is a project. Specify the project's relative resource
/// name, formatted as either a project number or a project ID:
/// "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}"
/// For example:
/// "projects/951040570662" when specifying a project number, or
/// "projects/my-project-123" when specifying a project ID.
#[prost(string, tag = "3")]
Project(::prost::alloc::string::String),
}
}
/// A response that includes the analysis of the hypothetical resource move.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnalyzeWorkloadMoveResponse {
/// A list of blockers that should be addressed before moving the source
/// project or project-based workload to the destination folder-based workload.
#[prost(string, repeated, tag = "1")]
pub blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Request for fetching workloads in an organization.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadsRequest {
/// Required. Parent Resource to list workloads from.
/// Must be of the form `organizations/{org_id}/locations/{location}`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Page size.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// Page token returned from previous request. Page token contains context from
/// previous request. Page token needs to be passed in the second and following
/// requests.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// A custom filter for filtering by properties of a workload. At this time,
/// only filtering by labels is supported.
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
/// Response of ListWorkloads endpoint.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkloadsResponse {
/// List of Workloads under a given parent.
#[prost(message, repeated, tag = "1")]
pub workloads: ::prost::alloc::vec::Vec<Workload>,
/// The next page token. Return empty if reached the last page.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// An Workload object for managing highly regulated workloads of cloud
/// customers.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Workload {
/// Optional. The resource name of the workload.
/// Format:
/// organizations/{organization}/locations/{location}/workloads/{workload}
///
/// Read-only.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. The user-assigned display name of the Workload.
/// When present it must be between 4 to 30 characters.
/// Allowed characters are: lowercase and uppercase letters, numbers,
/// hyphen, and spaces.
///
/// Example: My Workload
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
/// Output only. The resources associated with this workload.
/// These resources will be created when creating the workload.
/// If any of the projects already exist, the workload creation will fail.
/// Always read only.
#[prost(message, repeated, tag = "3")]
pub resources: ::prost::alloc::vec::Vec<workload::ResourceInfo>,
/// Required. Immutable. Compliance Regime associated with this workload.
#[prost(enumeration = "workload::ComplianceRegime", tag = "4")]
pub compliance_regime: i32,
/// Output only. Immutable. The Workload creation timestamp.
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The billing account used for the resources which are
/// direct children of workload. This billing account is initially associated
/// with the resources created as part of Workload creation.
/// After the initial creation of these resources, the customer can change
/// the assigned billing account.
/// The resource name has the form
/// `billingAccounts/{billing_account_id}`. For example,
/// `billingAccounts/012345-567890-ABCDEF`.
#[prost(string, tag = "6")]
pub billing_account: ::prost::alloc::string::String,
/// Optional. ETag of the workload, it is calculated on the basis
/// of the Workload contents. It will be used in Update & Delete operations.
#[prost(string, tag = "9")]
pub etag: ::prost::alloc::string::String,
/// Optional. Labels applied to the workload.
#[prost(btree_map = "string, string", tag = "10")]
pub labels: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Input only. The parent resource for the resources managed by this Assured Workload. May
/// be either empty or a folder resource which is a child of the
/// Workload parent. If not specified all resources are created under the
/// parent organization.
/// Format:
/// folders/{folder_id}
#[prost(string, tag = "13")]
pub provisioned_resources_parent: ::prost::alloc::string::String,
/// Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
/// CMEK key is provisioned.
/// This field is deprecated as of Feb 28, 2022.
/// In order to create a Keyring, callers should specify,
/// ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
#[deprecated]
#[prost(message, optional, tag = "14")]
pub kms_settings: ::core::option::Option<workload::KmsSettings>,
/// Input only. Resource properties that are used to customize workload resources.
/// These properties (such as custom project id) will be used to create
/// workload resources if possible. This field is optional.
#[prost(message, repeated, tag = "15")]
pub resource_settings: ::prost::alloc::vec::Vec<workload::ResourceSettings>,
/// Output only. Represents the KAJ enrollment state of the given workload.
#[prost(enumeration = "workload::KajEnrollmentState", tag = "17")]
pub kaj_enrollment_state: i32,
/// Optional. Indicates the sovereignty status of the given workload.
/// Currently meant to be used by Europe/Canada customers.
#[prost(bool, tag = "18")]
pub enable_sovereign_controls: bool,
/// Output only. Represents the SAA enrollment response of the given workload.
/// SAA enrollment response is queried during GetWorkload call.
/// In failure cases, user friendly error message is shown in SAA details page.
#[prost(message, optional, tag = "20")]
pub saa_enrollment_response: ::core::option::Option<workload::SaaEnrollmentResponse>,
/// Output only. Urls for services which are compliant for this Assured Workload, but which
/// are currently disallowed by the ResourceUsageRestriction org policy.
/// Invoke RestrictAllowedResources endpoint to allow your project developers
/// to use these services in their environment."
#[prost(string, repeated, tag = "24")]
pub compliant_but_disallowed_services: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
/// Settings specific to the selected \[compliance_regime\]
#[prost(oneof = "workload::ComplianceRegimeSettings", tags = "7, 8, 11, 12")]
pub compliance_regime_settings: ::core::option::Option<
workload::ComplianceRegimeSettings,
>,
}
/// Nested message and enum types in `Workload`.
pub mod workload {
/// Represent the resources that are children of this Workload.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ResourceInfo {
/// Resource identifier.
/// For a project this represents project_number.
#[prost(int64, tag = "1")]
pub resource_id: i64,
/// Indicates the type of resource.
#[prost(enumeration = "resource_info::ResourceType", tag = "2")]
pub resource_type: i32,
}
/// Nested message and enum types in `ResourceInfo`.
pub mod resource_info {
/// The type of resource.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ResourceType {
/// Unknown resource type.
Unspecified = 0,
/// Deprecated. Existing workloads will continue to support this, but new
/// CreateWorkloadRequests should not specify this as an input value.
ConsumerProject = 1,
/// Consumer Folder.
ConsumerFolder = 4,
/// Consumer project containing encryption keys.
EncryptionKeysProject = 2,
/// Keyring resource that hosts encryption keys.
Keyring = 3,
}
impl ResourceType {
/// 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 {
ResourceType::Unspecified => "RESOURCE_TYPE_UNSPECIFIED",
ResourceType::ConsumerProject => "CONSUMER_PROJECT",
ResourceType::ConsumerFolder => "CONSUMER_FOLDER",
ResourceType::EncryptionKeysProject => "ENCRYPTION_KEYS_PROJECT",
ResourceType::Keyring => "KEYRING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RESOURCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"CONSUMER_PROJECT" => Some(Self::ConsumerProject),
"CONSUMER_FOLDER" => Some(Self::ConsumerFolder),
"ENCRYPTION_KEYS_PROJECT" => Some(Self::EncryptionKeysProject),
"KEYRING" => Some(Self::Keyring),
_ => None,
}
}
}
}
/// Settings specific to the Key Management Service.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct KmsSettings {
/// Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
/// new version of the crypto key and mark it as the primary.
#[prost(message, optional, tag = "1")]
pub next_rotation_time: ::core::option::Option<::prost_types::Timestamp>,
/// Required. Input only. Immutable. \[next_rotation_time\] will be advanced by this period when the Key
/// Management Service automatically rotates a key. Must be at least 24 hours
/// and at most 876,000 hours.
#[prost(message, optional, tag = "2")]
pub rotation_period: ::core::option::Option<::prost_types::Duration>,
}
/// Settings specific to resources needed for IL4.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Il4Settings {
/// Input only. Immutable. Settings used to create a CMEK crypto key.
#[prost(message, optional, tag = "1")]
pub kms_settings: ::core::option::Option<KmsSettings>,
}
/// Settings specific to resources needed for CJIS.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CjisSettings {
/// Input only. Immutable. Settings used to create a CMEK crypto key.
#[prost(message, optional, tag = "1")]
pub kms_settings: ::core::option::Option<KmsSettings>,
}
/// Settings specific to resources needed for FedRAMP High.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FedrampHighSettings {
/// Input only. Immutable. Settings used to create a CMEK crypto key.
#[prost(message, optional, tag = "1")]
pub kms_settings: ::core::option::Option<KmsSettings>,
}
/// Settings specific to resources needed for FedRAMP Moderate.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FedrampModerateSettings {
/// Input only. Immutable. Settings used to create a CMEK crypto key.
#[prost(message, optional, tag = "1")]
pub kms_settings: ::core::option::Option<KmsSettings>,
}
/// Represent the custom settings for the resources to be created.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceSettings {
/// Resource identifier.
/// For a project this represents project_id. If the project is already
/// taken, the workload creation will fail.
/// For KeyRing, this represents the keyring_id.
/// For a folder, don't set this value as folder_id is assigned by Google.
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
/// Indicates the type of resource. This field should be specified to
/// correspond the id to the right project type (CONSUMER_PROJECT or
/// ENCRYPTION_KEYS_PROJECT)
#[prost(enumeration = "resource_info::ResourceType", tag = "2")]
pub resource_type: i32,
/// User-assigned resource display name.
/// If not empty it will be used to create a resource with the specified
/// name.
#[prost(string, tag = "3")]
pub display_name: ::prost::alloc::string::String,
}
/// Signed Access Approvals (SAA) enrollment response.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SaaEnrollmentResponse {
/// Indicates SAA enrollment status of a given workload.
#[prost(
enumeration = "saa_enrollment_response::SetupState",
optional,
tag = "1"
)]
pub setup_status: ::core::option::Option<i32>,
/// Indicates SAA enrollment setup error if any.
#[prost(
enumeration = "saa_enrollment_response::SetupError",
repeated,
tag = "2"
)]
pub setup_errors: ::prost::alloc::vec::Vec<i32>,
}
/// Nested message and enum types in `SaaEnrollmentResponse`.
pub mod saa_enrollment_response {
/// Setup state of SAA enrollment.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SetupState {
/// Unspecified.
Unspecified = 0,
/// SAA enrollment pending.
StatusPending = 1,
/// SAA enrollment comopleted.
StatusComplete = 2,
}
impl SetupState {
/// 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 {
SetupState::Unspecified => "SETUP_STATE_UNSPECIFIED",
SetupState::StatusPending => "STATUS_PENDING",
SetupState::StatusComplete => "STATUS_COMPLETE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SETUP_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"STATUS_PENDING" => Some(Self::StatusPending),
"STATUS_COMPLETE" => Some(Self::StatusComplete),
_ => None,
}
}
}
/// Setup error of SAA enrollment.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SetupError {
/// Unspecified.
Unspecified = 0,
/// Invalid states for all customers, to be redirected to AA UI for
/// additional details.
ErrorInvalidBaseSetup = 1,
/// Returned when there is not an EKM key configured.
ErrorMissingExternalSigningKey = 2,
/// Returned when there are no enrolled services or the customer is
/// enrolled in CAA only for a subset of services.
ErrorNotAllServicesEnrolled = 3,
/// Returned when exception was encountered during evaluation of other
/// criteria.
ErrorSetupCheckFailed = 4,
}
impl SetupError {
/// 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 {
SetupError::Unspecified => "SETUP_ERROR_UNSPECIFIED",
SetupError::ErrorInvalidBaseSetup => "ERROR_INVALID_BASE_SETUP",
SetupError::ErrorMissingExternalSigningKey => {
"ERROR_MISSING_EXTERNAL_SIGNING_KEY"
}
SetupError::ErrorNotAllServicesEnrolled => {
"ERROR_NOT_ALL_SERVICES_ENROLLED"
}
SetupError::ErrorSetupCheckFailed => "ERROR_SETUP_CHECK_FAILED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SETUP_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
"ERROR_INVALID_BASE_SETUP" => Some(Self::ErrorInvalidBaseSetup),
"ERROR_MISSING_EXTERNAL_SIGNING_KEY" => {
Some(Self::ErrorMissingExternalSigningKey)
}
"ERROR_NOT_ALL_SERVICES_ENROLLED" => {
Some(Self::ErrorNotAllServicesEnrolled)
}
"ERROR_SETUP_CHECK_FAILED" => Some(Self::ErrorSetupCheckFailed),
_ => None,
}
}
}
}
/// Supported Compliance Regimes.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ComplianceRegime {
/// Unknown compliance regime.
Unspecified = 0,
/// Information protection as per DoD IL4 requirements.
Il4 = 1,
/// Criminal Justice Information Services (CJIS) Security policies.
Cjis = 2,
/// FedRAMP High data protection controls
FedrampHigh = 3,
/// FedRAMP Moderate data protection controls
FedrampModerate = 4,
/// Assured Workloads For US Regions data protection controls
UsRegionalAccess = 5,
/// Health Insurance Portability and Accountability Act controls
Hipaa = 6,
/// Health Information Trust Alliance controls
Hitrust = 7,
/// Assured Workloads For EU Regions and Support controls
EuRegionsAndSupport = 8,
/// Assured Workloads For Canada Regions and Support controls
CaRegionsAndSupport = 9,
/// International Traffic in Arms Regulations
Itar = 10,
/// Assured Workloads for Australia Regions and Support controls
AuRegionsAndUsSupport = 11,
}
impl ComplianceRegime {
/// 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 {
ComplianceRegime::Unspecified => "COMPLIANCE_REGIME_UNSPECIFIED",
ComplianceRegime::Il4 => "IL4",
ComplianceRegime::Cjis => "CJIS",
ComplianceRegime::FedrampHigh => "FEDRAMP_HIGH",
ComplianceRegime::FedrampModerate => "FEDRAMP_MODERATE",
ComplianceRegime::UsRegionalAccess => "US_REGIONAL_ACCESS",
ComplianceRegime::Hipaa => "HIPAA",
ComplianceRegime::Hitrust => "HITRUST",
ComplianceRegime::EuRegionsAndSupport => "EU_REGIONS_AND_SUPPORT",
ComplianceRegime::CaRegionsAndSupport => "CA_REGIONS_AND_SUPPORT",
ComplianceRegime::Itar => "ITAR",
ComplianceRegime::AuRegionsAndUsSupport => "AU_REGIONS_AND_US_SUPPORT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMPLIANCE_REGIME_UNSPECIFIED" => Some(Self::Unspecified),
"IL4" => Some(Self::Il4),
"CJIS" => Some(Self::Cjis),
"FEDRAMP_HIGH" => Some(Self::FedrampHigh),
"FEDRAMP_MODERATE" => Some(Self::FedrampModerate),
"US_REGIONAL_ACCESS" => Some(Self::UsRegionalAccess),
"HIPAA" => Some(Self::Hipaa),
"HITRUST" => Some(Self::Hitrust),
"EU_REGIONS_AND_SUPPORT" => Some(Self::EuRegionsAndSupport),
"CA_REGIONS_AND_SUPPORT" => Some(Self::CaRegionsAndSupport),
"ITAR" => Some(Self::Itar),
"AU_REGIONS_AND_US_SUPPORT" => Some(Self::AuRegionsAndUsSupport),
_ => None,
}
}
}
/// Key Access Justifications(KAJ) Enrollment State.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum KajEnrollmentState {
/// Default State for KAJ Enrollment.
Unspecified = 0,
/// Pending State for KAJ Enrollment.
Pending = 1,
/// Complete State for KAJ Enrollment.
Complete = 2,
}
impl KajEnrollmentState {
/// 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 {
KajEnrollmentState::Unspecified => "KAJ_ENROLLMENT_STATE_UNSPECIFIED",
KajEnrollmentState::Pending => "KAJ_ENROLLMENT_STATE_PENDING",
KajEnrollmentState::Complete => "KAJ_ENROLLMENT_STATE_COMPLETE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"KAJ_ENROLLMENT_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"KAJ_ENROLLMENT_STATE_PENDING" => Some(Self::Pending),
"KAJ_ENROLLMENT_STATE_COMPLETE" => Some(Self::Complete),
_ => None,
}
}
}
/// Settings specific to the selected \[compliance_regime\]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum ComplianceRegimeSettings {
/// Input only. Immutable. Settings specific to resources needed for IL4.
#[prost(message, tag = "7")]
Il4Settings(Il4Settings),
/// Input only. Immutable. Settings specific to resources needed for CJIS.
#[prost(message, tag = "8")]
CjisSettings(CjisSettings),
/// Input only. Immutable. Settings specific to resources needed for FedRAMP High.
#[prost(message, tag = "11")]
FedrampHighSettings(FedrampHighSettings),
/// Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate.
#[prost(message, tag = "12")]
FedrampModerateSettings(FedrampModerateSettings),
}
}
/// Operation metadata to give request details of CreateWorkload.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkloadOperationMetadata {
/// Optional. Time when the operation was created.
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Optional. The display name of the workload.
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
/// Optional. The parent of the workload.
#[prost(string, tag = "3")]
pub parent: ::prost::alloc::string::String,
/// Optional. Compliance controls that should be applied to the resources managed by
/// the workload.
#[prost(enumeration = "workload::ComplianceRegime", tag = "4")]
pub compliance_regime: i32,
/// Optional. Resource properties in the input that are used for creating/customizing
/// workload resources.
#[prost(message, repeated, tag = "5")]
pub resource_settings: ::prost::alloc::vec::Vec<workload::ResourceSettings>,
}
/// Generated client implementations.
pub mod assured_workloads_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service to manage AssuredWorkloads.
#[derive(Debug, Clone)]
pub struct AssuredWorkloadsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AssuredWorkloadsServiceClient<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,
) -> AssuredWorkloadsServiceClient<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,
{
AssuredWorkloadsServiceClient::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
}
/// Creates Assured Workload.
pub async fn create_workload(
&mut self,
request: impl tonic::IntoRequest<super::CreateWorkloadRequest>,
) -> std::result::Result<
tonic::Response<super::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.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/CreateWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"CreateWorkload",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates an existing workload.
/// Currently allows updating of workload display_name and labels.
/// For force updates don't set etag field in the Workload.
/// Only one update operation per workload can be in progress.
pub async fn update_workload(
&mut self,
request: impl tonic::IntoRequest<super::UpdateWorkloadRequest>,
) -> std::result::Result<tonic::Response<super::Workload>, 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.assuredworkloads.v1beta1.AssuredWorkloadsService/UpdateWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"UpdateWorkload",
),
);
self.inner.unary(req, path, codec).await
}
/// Restrict the list of resources allowed in the Workload environment.
/// The current list of allowed products can be found at
/// https://cloud.google.com/assured-workloads/docs/supported-products
/// In addition to assuredworkloads.workload.update permission, the user should
/// also have orgpolicy.policy.set permission on the folder resource
/// to use this functionality.
pub async fn restrict_allowed_resources(
&mut self,
request: impl tonic::IntoRequest<super::RestrictAllowedResourcesRequest>,
) -> std::result::Result<
tonic::Response<super::RestrictAllowedResourcesResponse>,
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.assuredworkloads.v1beta1.AssuredWorkloadsService/RestrictAllowedResources",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"RestrictAllowedResources",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes the workload. Make sure that workload's direct children are already
/// in a deleted state, otherwise the request will fail with a
/// FAILED_PRECONDITION error.
/// In addition to assuredworkloads.workload.delete permission, the user should
/// also have orgpolicy.policy.set permission on the deleted folder to remove
/// Assured Workloads OrgPolicies.
pub async fn delete_workload(
&mut self,
request: impl tonic::IntoRequest<super::DeleteWorkloadRequest>,
) -> std::result::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.assuredworkloads.v1beta1.AssuredWorkloadsService/DeleteWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"DeleteWorkload",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets Assured Workload associated with a CRM Node
pub async fn get_workload(
&mut self,
request: impl tonic::IntoRequest<super::GetWorkloadRequest>,
) -> std::result::Result<tonic::Response<super::Workload>, 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.assuredworkloads.v1beta1.AssuredWorkloadsService/GetWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"GetWorkload",
),
);
self.inner.unary(req, path, codec).await
}
/// Analyze if the source Assured Workloads can be moved to the target Assured
/// Workload
pub async fn analyze_workload_move(
&mut self,
request: impl tonic::IntoRequest<super::AnalyzeWorkloadMoveRequest>,
) -> std::result::Result<
tonic::Response<super::AnalyzeWorkloadMoveResponse>,
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.assuredworkloads.v1beta1.AssuredWorkloadsService/AnalyzeWorkloadMove",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"AnalyzeWorkloadMove",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists Assured Workloads under a CRM Node.
pub async fn list_workloads(
&mut self,
request: impl tonic::IntoRequest<super::ListWorkloadsRequest>,
) -> std::result::Result<
tonic::Response<super::ListWorkloadsResponse>,
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.assuredworkloads.v1beta1.AssuredWorkloadsService/ListWorkloads",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"ListWorkloads",
),
);
self.inner.unary(req, path, codec).await
}
}
}