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 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366
// 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 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 workload'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,
}
/// 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,
}
/// A 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>,
/// Optional. 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,
>,
/// Optional. Compliance Regime associated with this workload.
#[prost(enumeration = "workload::Partner", tag = "25")]
pub partner: i32,
}
/// 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,
/// Consumer project.
/// AssuredWorkloads Projects are no longer supported. This field will be
/// ignored only in CreateWorkload requests. ListWorkloads and GetWorkload
/// will continue to provide projects information.
/// Use CONSUMER_FOLDER instead.
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.
/// This message is deprecated.
/// In order to create a Keyring, callers should specify,
/// ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
#[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>,
}
/// 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 resource type (CONSUMER_FOLDER 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
/// Available for public preview consumption.
/// Don't create production workloads.
AuRegionsAndUsSupport = 11,
/// Assured Workloads for Partners
AssuredWorkloadsForPartners = 12,
}
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",
ComplianceRegime::AssuredWorkloadsForPartners => {
"ASSURED_WORKLOADS_FOR_PARTNERS"
}
}
}
/// 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),
"ASSURED_WORKLOADS_FOR_PARTNERS" => {
Some(Self::AssuredWorkloadsForPartners)
}
_ => 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,
}
}
}
/// Supported Assured Workloads Partners.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Partner {
/// Unknown partner regime/controls.
Unspecified = 0,
/// S3NS regime/controls.
LocalControlsByS3ns = 1,
}
impl Partner {
/// 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 {
Partner::Unspecified => "PARTNER_UNSPECIFIED",
Partner::LocalControlsByS3ns => "LOCAL_CONTROLS_BY_S3NS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PARTNER_UNSPECIFIED" => Some(Self::Unspecified),
"LOCAL_CONTROLS_BY_S3NS" => Some(Self::LocalControlsByS3ns),
_ => None,
}
}
}
}
/// 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,
}
/// 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 acknowledging the violation
/// Next Id: 4
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AcknowledgeViolationRequest {
/// Required. The resource name of the Violation to acknowledge.
/// Format:
/// organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. Business justification explaining the need for violation acknowledgement
#[prost(string, tag = "2")]
pub comment: ::prost::alloc::string::String,
/// Optional. This field is deprecated and will be removed in future version of the API.
/// Name of the OrgPolicy which was modified with non-compliant change and
/// resulted in this violation.
/// Format:
/// projects/{project_number}/policies/{constraint_name}
/// folders/{folder_id}/policies/{constraint_name}
/// organizations/{organization_id}/policies/{constraint_name}
#[deprecated]
#[prost(string, tag = "3")]
pub non_compliant_org_policy: ::prost::alloc::string::String,
}
/// Response for violation acknowledgement
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AcknowledgeViolationResponse {}
/// Interval defining a time window.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TimeWindow {
/// The start of the time window.
#[prost(message, optional, tag = "1")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
/// The end of the time window.
#[prost(message, optional, tag = "2")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Request for fetching violations in an organization.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListViolationsRequest {
/// Required. The Workload name.
/// Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Optional. Specifies the time window for retrieving active Violations.
/// When specified, retrieves Violations that were active between start_time
/// and end_time.
#[prost(message, optional, tag = "2")]
pub interval: ::core::option::Option<TimeWindow>,
/// Optional. Page size.
#[prost(int32, tag = "3")]
pub page_size: i32,
/// Optional. Page token returned from previous request.
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
/// Optional. A custom filter for filtering by the Violations properties.
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
}
/// Response of ListViolations endpoint.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListViolationsResponse {
/// List of Violations under a Workload.
#[prost(message, repeated, tag = "1")]
pub violations: ::prost::alloc::vec::Vec<Violation>,
/// The next page token. Returns empty if reached the last page.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for fetching a Workload Violation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetViolationRequest {
/// Required. The resource name of the Violation to fetch (ie. Violation.name).
/// Format:
/// organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Workload monitoring Violation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Violation {
/// Output only. Immutable. Name of the Violation.
/// Format:
/// organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. Description for the Violation.
/// e.g. OrgPolicy gcp.resourceLocations has non compliant value.
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Output only. Time of the event which triggered the Violation.
#[prost(message, optional, tag = "3")]
pub begin_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last time when the Violation record was updated.
#[prost(message, optional, tag = "4")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Time of the event which fixed the Violation.
/// If the violation is ACTIVE this will be empty.
#[prost(message, optional, tag = "5")]
pub resolve_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Category under which this violation is mapped.
/// e.g. Location, Service Usage, Access, Encryption, etc.
#[prost(string, tag = "6")]
pub category: ::prost::alloc::string::String,
/// Output only. State of the violation
#[prost(enumeration = "violation::State", tag = "7")]
pub state: i32,
/// Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
/// this violation.
#[prost(string, tag = "8")]
pub org_policy_constraint: ::prost::alloc::string::String,
/// Output only. Immutable. Audit Log Link for violated resource
/// Format:
/// <https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}>
#[prost(string, tag = "11")]
pub audit_log_link: ::prost::alloc::string::String,
/// Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
/// resulted this violation.
/// Format:
/// projects/{project_number}/policies/{constraint_name}
/// folders/{folder_id}/policies/{constraint_name}
/// organizations/{organization_id}/policies/{constraint_name}
#[prost(string, tag = "12")]
pub non_compliant_org_policy: ::prost::alloc::string::String,
/// Output only. Compliance violation remediation
#[prost(message, optional, tag = "13")]
pub remediation: ::core::option::Option<violation::Remediation>,
/// Output only. A boolean that indicates if the violation is acknowledged
#[prost(bool, tag = "14")]
pub acknowledged: bool,
/// Optional. Timestamp when this violation was acknowledged last.
/// This will be absent when acknowledged field is marked as false.
#[prost(message, optional, tag = "15")]
pub acknowledgement_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Immutable. Audit Log link to find business justification provided for violation
/// exception. Format:
/// <https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}>
#[prost(string, tag = "16")]
pub exception_audit_log_link: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Violation`.
pub mod violation {
/// Represents remediation guidance to resolve compliance violation for
/// AssuredWorkload
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Remediation {
/// Required. Remediation instructions to resolve violations
#[prost(message, optional, tag = "1")]
pub instructions: ::core::option::Option<remediation::Instructions>,
/// Values that can resolve the violation
/// For example: for list org policy violations, this will either be the list
/// of allowed or denied values
#[prost(string, repeated, tag = "2")]
pub compliant_values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Output only. Reemediation type based on the type of org policy values violated
#[prost(enumeration = "remediation::RemediationType", tag = "3")]
pub remediation_type: i32,
}
/// Nested message and enum types in `Remediation`.
pub mod remediation {
/// Instructions to remediate violation
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instructions {
/// Remediation instructions to resolve violation via gcloud cli
#[prost(message, optional, tag = "1")]
pub gcloud_instructions: ::core::option::Option<instructions::Gcloud>,
/// Remediation instructions to resolve violation via cloud console
#[prost(message, optional, tag = "2")]
pub console_instructions: ::core::option::Option<instructions::Console>,
}
/// Nested message and enum types in `Instructions`.
pub mod instructions {
/// Remediation instructions to resolve violation via gcloud cli
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Gcloud {
/// Gcloud command to resolve violation
#[prost(string, repeated, tag = "1")]
pub gcloud_commands: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
/// Steps to resolve violation via gcloud cli
#[prost(string, repeated, tag = "2")]
pub steps: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Additional urls for more information about steps
#[prost(string, repeated, tag = "3")]
pub additional_links: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
}
/// Remediation instructions to resolve violation via cloud console
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Console {
/// Link to console page where violations can be resolved
#[prost(string, repeated, tag = "1")]
pub console_uris: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
/// Steps to resolve violation via cloud console
#[prost(string, repeated, tag = "2")]
pub steps: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Additional urls for more information about steps
#[prost(string, repeated, tag = "3")]
pub additional_links: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
}
}
/// Classifying remediation into various types based on the kind of
/// violation. For example, violations caused due to changes in boolean org
/// policy requires different remediation instructions compared to violation
/// caused due to changes in allowed values of list org policy.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RemediationType {
/// Unspecified remediation type
Unspecified = 0,
/// Remediation type for boolean org policy
RemediationBooleanOrgPolicyViolation = 1,
/// Remediation type for list org policy which have allowed values in the
/// monitoring rule
RemediationListAllowedValuesOrgPolicyViolation = 2,
/// Remediation type for list org policy which have denied values in the
/// monitoring rule
RemediationListDeniedValuesOrgPolicyViolation = 3,
/// Remediation type for gcp.restrictCmekCryptoKeyProjects
RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation = 4,
}
impl RemediationType {
/// 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 {
RemediationType::Unspecified => "REMEDIATION_TYPE_UNSPECIFIED",
RemediationType::RemediationBooleanOrgPolicyViolation => {
"REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION"
}
RemediationType::RemediationListAllowedValuesOrgPolicyViolation => {
"REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION"
}
RemediationType::RemediationListDeniedValuesOrgPolicyViolation => {
"REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION"
}
RemediationType::RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation => {
"REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"REMEDIATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION" => {
Some(Self::RemediationBooleanOrgPolicyViolation)
}
"REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION" => {
Some(Self::RemediationListAllowedValuesOrgPolicyViolation)
}
"REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION" => {
Some(Self::RemediationListDeniedValuesOrgPolicyViolation)
}
"REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION" => {
Some(
Self::RemediationRestrictCmekCryptoKeyProjectsOrgPolicyViolation,
)
}
_ => None,
}
}
}
}
/// Violation State Values
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// Unspecified state.
Unspecified = 0,
/// Violation is resolved.
Resolved = 2,
/// Violation is Unresolved
Unresolved = 3,
/// Violation is Exception
Exception = 4,
}
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::Resolved => "RESOLVED",
State::Unresolved => "UNRESOLVED",
State::Exception => "EXCEPTION",
}
}
/// 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),
"RESOLVED" => Some(Self::Resolved),
"UNRESOLVED" => Some(Self::Unresolved),
"EXCEPTION" => Some(Self::Exception),
_ => None,
}
}
}
}
/// 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.v1.AssuredWorkloadsService/CreateWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.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.v1.AssuredWorkloadsService/UpdateWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.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.v1.AssuredWorkloadsService/RestrictAllowedResources",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.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.
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.v1.AssuredWorkloadsService/DeleteWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.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.v1.AssuredWorkloadsService/GetWorkload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.AssuredWorkloadsService",
"GetWorkload",
),
);
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.v1.AssuredWorkloadsService/ListWorkloads",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.AssuredWorkloadsService",
"ListWorkloads",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists the Violations in the AssuredWorkload Environment.
/// Callers may also choose to read across multiple Workloads as per
/// [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
/// character) as a wildcard character instead of workload-id in the parent.
/// Format `organizations/{org_id}/locations/{location}/workloads/-`
pub async fn list_violations(
&mut self,
request: impl tonic::IntoRequest<super::ListViolationsRequest>,
) -> std::result::Result<
tonic::Response<super::ListViolationsResponse>,
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.v1.AssuredWorkloadsService/ListViolations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.AssuredWorkloadsService",
"ListViolations",
),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves Assured Workload Violation based on ID.
pub async fn get_violation(
&mut self,
request: impl tonic::IntoRequest<super::GetViolationRequest>,
) -> std::result::Result<tonic::Response<super::Violation>, 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.v1.AssuredWorkloadsService/GetViolation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.AssuredWorkloadsService",
"GetViolation",
),
);
self.inner.unary(req, path, codec).await
}
/// Acknowledges an existing violation. By acknowledging a violation, users
/// acknowledge the existence of a compliance violation in their workload and
/// decide to ignore it due to a valid business justification. Acknowledgement
/// is a permanent operation and it cannot be reverted.
pub async fn acknowledge_violation(
&mut self,
request: impl tonic::IntoRequest<super::AcknowledgeViolationRequest>,
) -> std::result::Result<
tonic::Response<super::AcknowledgeViolationResponse>,
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.v1.AssuredWorkloadsService/AcknowledgeViolation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.assuredworkloads.v1.AssuredWorkloadsService",
"AcknowledgeViolation",
),
);
self.inner.unary(req, path, codec).await
}
}
}