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 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730
// This file is @generated by prost-build.
/// A reservation is a mechanism used to guarantee slots to users.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Reservation {
/// The resource name of the reservation, e.g.,
/// `projects/*/locations/*/reservations/team1-prod`.
/// The reservation_id must only contain lower case alphanumeric characters or
/// dashes. It must start with a letter and must not end with a dash. Its
/// maximum length is 64 characters.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Minimum slots available to this reservation. A slot is a unit of
/// computational power in BigQuery, and serves as the unit of parallelism.
///
/// Queries using this reservation might use more slots during runtime if
/// ignore_idle_slots is set to false.
///
/// If total slot_capacity of the reservation and its siblings
/// exceeds the total slot_count of all capacity commitments, the request will
/// fail with `google.rpc.Code.RESOURCE_EXHAUSTED`.
///
///
/// NOTE: for reservations in US or EU multi-regions, slot capacity constraints
/// are checked separately for default and auxiliary regions. See
/// multi_region_auxiliary flag for more details.
#[prost(int64, tag = "2")]
pub slot_capacity: i64,
/// If false, any query or pipeline job using this reservation will use idle
/// slots from other reservations within the same admin project. If true, a
/// query or pipeline job using this reservation will execute with the slot
/// capacity specified in the slot_capacity field at most.
#[prost(bool, tag = "4")]
pub ignore_idle_slots: bool,
/// The configuration parameters for the auto scaling feature. Note this is an
/// alpha feature.
#[prost(message, optional, tag = "7")]
pub autoscale: ::core::option::Option<reservation::Autoscale>,
/// Job concurrency target which sets a soft upper bound on the number of jobs
/// that can run concurrently in this reservation. This is a soft target due to
/// asynchronous nature of the system and various optimizations for small
/// queries.
/// Default value is 0 which means that concurrency target will be
/// automatically computed by the system.
/// NOTE: this field is exposed as `target_job_concurrency` in the Information
/// Schema, DDL and BQ CLI.
#[prost(int64, tag = "16")]
pub concurrency: i64,
/// Output only. Creation time of the reservation.
#[prost(message, optional, tag = "8")]
pub creation_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Last update time of the reservation.
#[prost(message, optional, tag = "9")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Applicable only for reservations located within one of the BigQuery
/// multi-regions (US or EU).
///
/// If set to true, this reservation is placed in the organization's
/// secondary region which is designated for disaster recovery purposes.
/// If false, this reservation is placed in the organization's default region.
///
/// NOTE: this is a preview feature. Project must be allow-listed in order to
/// set this field.
#[prost(bool, tag = "14")]
pub multi_region_auxiliary: bool,
/// Edition of the reservation.
#[prost(enumeration = "Edition", tag = "17")]
pub edition: i32,
}
/// Nested message and enum types in `Reservation`.
pub mod reservation {
/// Auto scaling settings.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Autoscale {
/// Output only. The slot capacity added to this reservation when autoscale
/// happens. Will be between \[0, max_slots\].
#[prost(int64, tag = "1")]
pub current_slots: i64,
/// Number of slots to be scaled when needed.
#[prost(int64, tag = "2")]
pub max_slots: i64,
}
}
/// Capacity commitment is a way to purchase compute capacity for BigQuery jobs
/// (in the form of slots) with some committed period of usage. Annual
/// commitments renew by default. Commitments can be removed after their
/// commitment end time passes.
///
/// In order to remove annual commitment, its plan needs to be changed
/// to monthly or flex first.
///
/// A capacity commitment resource exists as a child resource of the admin
/// project.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CapacityCommitment {
/// Output only. The resource name of the capacity commitment, e.g.,
/// `projects/myproject/locations/US/capacityCommitments/123`
/// The commitment_id must only contain lower case alphanumeric characters or
/// dashes. It must start with a letter and must not end
/// with a dash. Its maximum length is 64 characters.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Number of slots in this commitment.
#[prost(int64, tag = "2")]
pub slot_count: i64,
/// Capacity commitment commitment plan.
#[prost(enumeration = "capacity_commitment::CommitmentPlan", tag = "3")]
pub plan: i32,
/// Output only. State of the commitment.
#[prost(enumeration = "capacity_commitment::State", tag = "4")]
pub state: i32,
/// Output only. The start of the current commitment period. It is applicable
/// only for ACTIVE capacity commitments.
#[prost(message, optional, tag = "9")]
pub commitment_start_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The end of the current commitment period. It is applicable
/// only for ACTIVE capacity commitments.
#[prost(message, optional, tag = "5")]
pub commitment_end_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For FAILED commitment plan, provides the reason of failure.
#[prost(message, optional, tag = "7")]
pub failure_status: ::core::option::Option<super::super::super::super::rpc::Status>,
/// The plan this capacity commitment is converted to after commitment_end_time
/// passes. Once the plan is changed, committed period is extended according to
/// commitment plan. Only applicable for ANNUAL and TRIAL commitments.
#[prost(enumeration = "capacity_commitment::CommitmentPlan", tag = "8")]
pub renewal_plan: i32,
/// Applicable only for commitments located within one of the BigQuery
/// multi-regions (US or EU).
///
/// If set to true, this commitment is placed in the organization's
/// secondary region which is designated for disaster recovery purposes.
/// If false, this commitment is placed in the organization's default region.
///
/// NOTE: this is a preview feature. Project must be allow-listed in order to
/// set this field.
#[prost(bool, tag = "10")]
pub multi_region_auxiliary: bool,
/// Edition of the capacity commitment.
#[prost(enumeration = "Edition", tag = "12")]
pub edition: i32,
}
/// Nested message and enum types in `CapacityCommitment`.
pub mod capacity_commitment {
/// Commitment plan defines the current committed period. Capacity commitment
/// cannot be deleted during it's committed period.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CommitmentPlan {
/// Invalid plan value. Requests with this value will be rejected with
/// error code `google.rpc.Code.INVALID_ARGUMENT`.
Unspecified = 0,
/// Flex commitments have committed period of 1 minute after becoming ACTIVE.
/// After that, they are not in a committed period anymore and can be removed
/// any time.
Flex = 3,
/// Same as FLEX, should only be used if flat-rate commitments are still
/// available.
FlexFlatRate = 7,
/// Trial commitments have a committed period of 182 days after becoming
/// ACTIVE. After that, they are converted to a new commitment based on the
/// `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so
/// that it can be deleted right after committed period ends.
Trial = 5,
/// Monthly commitments have a committed period of 30 days after becoming
/// ACTIVE. After that, they are not in a committed period anymore and can be
/// removed any time.
Monthly = 2,
/// Same as MONTHLY, should only be used if flat-rate commitments are still
/// available.
MonthlyFlatRate = 8,
/// Annual commitments have a committed period of 365 days after becoming
/// ACTIVE. After that they are converted to a new commitment based on the
/// renewal_plan.
Annual = 4,
/// Same as ANNUAL, should only be used if flat-rate commitments are still
/// available.
AnnualFlatRate = 9,
/// 3-year commitments have a committed period of 1095(3 * 365) days after
/// becoming ACTIVE. After that they are converted to a new commitment based
/// on the renewal_plan.
ThreeYear = 10,
/// Should only be used for `renewal_plan` and is only meaningful if
/// edition is specified to values other than EDITION_UNSPECIFIED. Otherwise
/// CreateCapacityCommitmentRequest or UpdateCapacityCommitmentRequest will
/// be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`. If the
/// renewal_plan is NONE, capacity commitment will be removed at the end of
/// its commitment period.
None = 6,
}
impl CommitmentPlan {
/// 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 {
CommitmentPlan::Unspecified => "COMMITMENT_PLAN_UNSPECIFIED",
CommitmentPlan::Flex => "FLEX",
CommitmentPlan::FlexFlatRate => "FLEX_FLAT_RATE",
CommitmentPlan::Trial => "TRIAL",
CommitmentPlan::Monthly => "MONTHLY",
CommitmentPlan::MonthlyFlatRate => "MONTHLY_FLAT_RATE",
CommitmentPlan::Annual => "ANNUAL",
CommitmentPlan::AnnualFlatRate => "ANNUAL_FLAT_RATE",
CommitmentPlan::ThreeYear => "THREE_YEAR",
CommitmentPlan::None => "NONE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMMITMENT_PLAN_UNSPECIFIED" => Some(Self::Unspecified),
"FLEX" => Some(Self::Flex),
"FLEX_FLAT_RATE" => Some(Self::FlexFlatRate),
"TRIAL" => Some(Self::Trial),
"MONTHLY" => Some(Self::Monthly),
"MONTHLY_FLAT_RATE" => Some(Self::MonthlyFlatRate),
"ANNUAL" => Some(Self::Annual),
"ANNUAL_FLAT_RATE" => Some(Self::AnnualFlatRate),
"THREE_YEAR" => Some(Self::ThreeYear),
"NONE" => Some(Self::None),
_ => None,
}
}
}
/// Capacity commitment can either become ACTIVE right away or transition
/// from PENDING to ACTIVE or FAILED.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// Invalid state value.
Unspecified = 0,
/// Capacity commitment is pending provisioning. Pending capacity commitment
/// does not contribute to the project's slot_capacity.
Pending = 1,
/// Once slots are provisioned, capacity commitment becomes active.
/// slot_count is added to the project's slot_capacity.
Active = 2,
/// Capacity commitment is failed to be activated by the backend.
Failed = 3,
}
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::Pending => "PENDING",
State::Active => "ACTIVE",
State::Failed => "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 {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"PENDING" => Some(Self::Pending),
"ACTIVE" => Some(Self::Active),
"FAILED" => Some(Self::Failed),
_ => None,
}
}
}
}
/// The request for
/// [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateReservationRequest {
/// Required. Project, location. E.g.,
/// `projects/myproject/locations/US`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The reservation ID. It must only contain lower case alphanumeric
/// characters or dashes. It must start with a letter and must not end
/// with a dash. Its maximum length is 64 characters.
#[prost(string, tag = "2")]
pub reservation_id: ::prost::alloc::string::String,
/// Definition of the new reservation to create.
#[prost(message, optional, tag = "3")]
pub reservation: ::core::option::Option<Reservation>,
}
/// The request for
/// [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListReservationsRequest {
/// Required. The parent resource name containing project and location, e.g.:
/// `projects/myproject/locations/US`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return per page.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
/// The response for
/// [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListReservationsResponse {
/// List of reservations visible to the user.
#[prost(message, repeated, tag = "1")]
pub reservations: ::prost::alloc::vec::Vec<Reservation>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetReservationRequest {
/// Required. Resource name of the reservation to retrieve. E.g.,
/// `projects/myproject/locations/US/reservations/team1-prod`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteReservationRequest {
/// Required. Resource name of the reservation to retrieve. E.g.,
/// `projects/myproject/locations/US/reservations/team1-prod`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateReservationRequest {
/// Content of the reservation to update.
#[prost(message, optional, tag = "1")]
pub reservation: ::core::option::Option<Reservation>,
/// Standard field mask for the set of fields to be updated.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request for
/// [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCapacityCommitmentRequest {
/// Required. Resource name of the parent reservation. E.g.,
/// `projects/myproject/locations/US`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Content of the capacity commitment to create.
#[prost(message, optional, tag = "2")]
pub capacity_commitment: ::core::option::Option<CapacityCommitment>,
/// If true, fail the request if another project in the organization has a
/// capacity commitment.
#[prost(bool, tag = "4")]
pub enforce_single_admin_project_per_org: bool,
/// The optional capacity commitment ID. Capacity commitment name will be
/// generated automatically if this field is empty.
/// This field must only contain lower case alphanumeric characters or dashes.
/// The first and last character cannot be a dash. Max length is 64 characters.
/// NOTE: this ID won't be kept if the capacity commitment is split or merged.
#[prost(string, tag = "5")]
pub capacity_commitment_id: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCapacityCommitmentsRequest {
/// Required. Resource name of the parent reservation. E.g.,
/// `projects/myproject/locations/US`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
/// The response for
/// [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCapacityCommitmentsResponse {
/// List of capacity commitments visible to the user.
#[prost(message, repeated, tag = "1")]
pub capacity_commitments: ::prost::alloc::vec::Vec<CapacityCommitment>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCapacityCommitmentRequest {
/// Required. Resource name of the capacity commitment to retrieve. E.g.,
/// `projects/myproject/locations/US/capacityCommitments/123`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteCapacityCommitmentRequest {
/// Required. Resource name of the capacity commitment to delete. E.g.,
/// `projects/myproject/locations/US/capacityCommitments/123`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Can be used to force delete commitments even if assignments exist. Deleting
/// commitments with assignments may cause queries to fail if they no longer
/// have access to slots.
#[prost(bool, tag = "3")]
pub force: bool,
}
/// The request for
/// [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateCapacityCommitmentRequest {
/// Content of the capacity commitment to update.
#[prost(message, optional, tag = "1")]
pub capacity_commitment: ::core::option::Option<CapacityCommitment>,
/// Standard field mask for the set of fields to be updated.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request for
/// [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SplitCapacityCommitmentRequest {
/// Required. The resource name e.g.,:
/// `projects/myproject/locations/US/capacityCommitments/123`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Number of slots in the capacity commitment after the split.
#[prost(int64, tag = "2")]
pub slot_count: i64,
}
/// The response for
/// [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SplitCapacityCommitmentResponse {
/// First capacity commitment, result of a split.
#[prost(message, optional, tag = "1")]
pub first: ::core::option::Option<CapacityCommitment>,
/// Second capacity commitment, result of a split.
#[prost(message, optional, tag = "2")]
pub second: ::core::option::Option<CapacityCommitment>,
}
/// The request for
/// [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MergeCapacityCommitmentsRequest {
/// Parent resource that identifies admin project and location e.g.,
/// `projects/myproject/locations/us`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Ids of capacity commitments to merge.
/// These capacity commitments must exist under admin project and location
/// specified in the parent.
/// ID is the last portion of capacity commitment name e.g., 'abc' for
/// projects/myproject/locations/US/capacityCommitments/abc
#[prost(string, repeated, tag = "2")]
pub capacity_commitment_ids: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
}
/// An assignment allows a project to submit jobs
/// of a certain type using slots from the specified reservation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Assignment {
/// Output only. Name of the resource. E.g.:
/// `projects/myproject/locations/US/reservations/team1-prod/assignments/123`.
/// The assignment_id must only contain lower case alphanumeric characters or
/// dashes and the max length is 64 characters.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The resource which will use the reservation. E.g.
/// `projects/myproject`, `folders/123`, or `organizations/456`.
#[prost(string, tag = "4")]
pub assignee: ::prost::alloc::string::String,
/// Which type of jobs will use the reservation.
#[prost(enumeration = "assignment::JobType", tag = "3")]
pub job_type: i32,
/// Output only. State of the assignment.
#[prost(enumeration = "assignment::State", tag = "6")]
pub state: i32,
}
/// Nested message and enum types in `Assignment`.
pub mod assignment {
/// Types of job, which could be specified when using the reservation.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum JobType {
/// Invalid type. Requests with this value will be rejected with
/// error code `google.rpc.Code.INVALID_ARGUMENT`.
Unspecified = 0,
/// Pipeline (load/export) jobs from the project will use the reservation.
Pipeline = 1,
/// Query jobs from the project will use the reservation.
Query = 2,
/// BigQuery ML jobs that use services external to BigQuery for model
/// training. These jobs will not utilize idle slots from other reservations.
MlExternal = 3,
/// Background jobs that BigQuery runs for the customers in the background.
Background = 4,
}
impl JobType {
/// 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 {
JobType::Unspecified => "JOB_TYPE_UNSPECIFIED",
JobType::Pipeline => "PIPELINE",
JobType::Query => "QUERY",
JobType::MlExternal => "ML_EXTERNAL",
JobType::Background => "BACKGROUND",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"JOB_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"PIPELINE" => Some(Self::Pipeline),
"QUERY" => Some(Self::Query),
"ML_EXTERNAL" => Some(Self::MlExternal),
"BACKGROUND" => Some(Self::Background),
_ => None,
}
}
}
/// Assignment will remain in PENDING state if no active capacity commitment is
/// present. It will become ACTIVE when some capacity commitment becomes
/// active.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// Invalid state value.
Unspecified = 0,
/// Queries from assignee will be executed as on-demand, if related
/// assignment is pending.
Pending = 1,
/// Assignment is ready.
Active = 2,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Pending => "PENDING",
State::Active => "ACTIVE",
}
}
/// 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),
"PENDING" => Some(Self::Pending),
"ACTIVE" => Some(Self::Active),
_ => None,
}
}
}
}
/// The request for
/// [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment].
/// Note: "bigquery.reservationAssignments.create" permission is required on the
/// related assignee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAssignmentRequest {
/// Required. The parent resource name of the assignment
/// E.g. `projects/myproject/locations/US/reservations/team1-prod`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Assignment resource to create.
#[prost(message, optional, tag = "2")]
pub assignment: ::core::option::Option<Assignment>,
/// The optional assignment ID. Assignment name will be generated automatically
/// if this field is empty.
/// This field must only contain lower case alphanumeric characters or dashes.
/// Max length is 64 characters.
#[prost(string, tag = "4")]
pub assignment_id: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAssignmentsRequest {
/// Required. The parent resource name e.g.:
///
/// `projects/myproject/locations/US/reservations/team1-prod`
///
/// Or:
///
/// `projects/myproject/locations/US/reservations/-`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return per page.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
/// The response for
/// [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAssignmentsResponse {
/// List of assignments visible to the user.
#[prost(message, repeated, tag = "1")]
pub assignments: ::prost::alloc::vec::Vec<Assignment>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment].
/// Note: "bigquery.reservationAssignments.delete" permission is required on the
/// related assignee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAssignmentRequest {
/// Required. Name of the resource, e.g.
/// `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
/// Note: "bigquery.reservationAssignments.search" permission is required on the
/// related assignee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAssignmentsRequest {
/// Required. The resource name of the admin project(containing project and
/// location), e.g.:
/// `projects/myproject/locations/US`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Please specify resource name as assignee in the query.
///
/// Examples:
///
/// * `assignee=projects/myproject`
/// * `assignee=folders/123`
/// * `assignee=organizations/456`
#[prost(string, tag = "2")]
pub query: ::prost::alloc::string::String,
/// The maximum number of items to return per page.
#[prost(int32, tag = "3")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
/// Note: "bigquery.reservationAssignments.search" permission is required on the
/// related assignee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAllAssignmentsRequest {
/// Required. The resource name with location (project name could be the
/// wildcard '-'), e.g.:
/// `projects/-/locations/US`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Please specify resource name as assignee in the query.
///
/// Examples:
///
/// * `assignee=projects/myproject`
/// * `assignee=folders/123`
/// * `assignee=organizations/456`
#[prost(string, tag = "2")]
pub query: ::prost::alloc::string::String,
/// The maximum number of items to return per page.
#[prost(int32, tag = "3")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
/// The response for
/// [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAssignmentsResponse {
/// List of assignments visible to the user.
#[prost(message, repeated, tag = "1")]
pub assignments: ::prost::alloc::vec::Vec<Assignment>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The response for
/// [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAllAssignmentsResponse {
/// List of assignments visible to the user.
#[prost(message, repeated, tag = "1")]
pub assignments: ::prost::alloc::vec::Vec<Assignment>,
/// Token to retrieve the next page of results, or empty if there are no
/// more results in the list.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment].
///
/// **Note**: "bigquery.reservationAssignments.create" permission is required on
/// the destination_id.
///
/// **Note**: "bigquery.reservationAssignments.create" and
/// "bigquery.reservationAssignments.delete" permission are required on the
/// related assignee.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveAssignmentRequest {
/// Required. The resource name of the assignment,
/// e.g.
/// `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The new reservation ID, e.g.:
/// `projects/myotherproject/locations/US/reservations/team2-prod`
#[prost(string, tag = "3")]
pub destination_id: ::prost::alloc::string::String,
/// The optional assignment ID. A new assignment name is generated if this
/// field is empty.
///
/// This field can contain only lowercase alphanumeric characters or dashes.
/// Max length is 64 characters.
#[prost(string, tag = "5")]
pub assignment_id: ::prost::alloc::string::String,
}
/// The request for
/// [ReservationService.UpdateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateAssignmentRequest {
/// Content of the assignment to update.
#[prost(message, optional, tag = "1")]
pub assignment: ::core::option::Option<Assignment>,
/// Standard field mask for the set of fields to be updated.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Fully qualified reference to BigQuery table.
/// Internally stored as google.cloud.bi.v1.BqTableReference.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableReference {
/// The assigned project ID of the project.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// The ID of the dataset in the above project.
#[prost(string, tag = "2")]
pub dataset_id: ::prost::alloc::string::String,
/// The ID of the table in the above dataset.
#[prost(string, tag = "3")]
pub table_id: ::prost::alloc::string::String,
}
/// Represents a BI Reservation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BiReservation {
/// The resource name of the singleton BI reservation.
/// Reservation names have the form
/// `projects/{project_id}/locations/{location_id}/biReservation`.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. The last update timestamp of a reservation.
#[prost(message, optional, tag = "3")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Size of a reservation, in bytes.
#[prost(int64, tag = "4")]
pub size: i64,
/// Preferred tables to use BI capacity for.
#[prost(message, repeated, tag = "5")]
pub preferred_tables: ::prost::alloc::vec::Vec<TableReference>,
}
/// A request to get a singleton BI reservation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBiReservationRequest {
/// Required. Name of the requested reservation, for example:
/// `projects/{project_id}/locations/{location_id}/biReservation`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// A request to update a BI reservation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBiReservationRequest {
/// A reservation to update.
#[prost(message, optional, tag = "1")]
pub bi_reservation: ::core::option::Option<BiReservation>,
/// A list of fields to be updated in this request.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The type of editions.
/// Different features and behaviors are provided to different editions
/// Capacity commitments and reservations are linked to editions.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Edition {
/// Default value, which will be treated as ENTERPRISE.
Unspecified = 0,
/// Standard edition.
Standard = 1,
/// Enterprise edition.
Enterprise = 2,
/// Enterprise plus edition.
EnterprisePlus = 3,
}
impl Edition {
/// 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 {
Edition::Unspecified => "EDITION_UNSPECIFIED",
Edition::Standard => "STANDARD",
Edition::Enterprise => "ENTERPRISE",
Edition::EnterprisePlus => "ENTERPRISE_PLUS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EDITION_UNSPECIFIED" => Some(Self::Unspecified),
"STANDARD" => Some(Self::Standard),
"ENTERPRISE" => Some(Self::Enterprise),
"ENTERPRISE_PLUS" => Some(Self::EnterprisePlus),
_ => None,
}
}
}
/// Generated client implementations.
pub mod reservation_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// This API allows users to manage their BigQuery reservations.
///
/// A reservation provides computational resource guarantees, in the form of
/// [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
/// unit of computational power in BigQuery, and serves as the basic unit of
/// parallelism. In a scan of a multi-partitioned table, a single slot operates
/// on a single partition of the table. A reservation resource exists as a child
/// resource of the admin project and location, e.g.:
/// `projects/myproject/locations/US/reservations/reservationName`.
///
/// A capacity commitment is a way to purchase compute capacity for BigQuery jobs
/// (in the form of slots) with some committed period of usage. A capacity
/// commitment resource exists as a child resource of the admin project and
/// location, e.g.:
/// `projects/myproject/locations/US/capacityCommitments/id`.
#[derive(Debug, Clone)]
pub struct ReservationServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ReservationServiceClient<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,
) -> ReservationServiceClient<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,
{
ReservationServiceClient::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 a new reservation resource.
pub async fn create_reservation(
&mut self,
request: impl tonic::IntoRequest<super::CreateReservationRequest>,
) -> std::result::Result<tonic::Response<super::Reservation>, 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.bigquery.reservation.v1.ReservationService/CreateReservation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"CreateReservation",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists all the reservations for the project in the specified location.
pub async fn list_reservations(
&mut self,
request: impl tonic::IntoRequest<super::ListReservationsRequest>,
) -> std::result::Result<
tonic::Response<super::ListReservationsResponse>,
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.bigquery.reservation.v1.ReservationService/ListReservations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"ListReservations",
),
);
self.inner.unary(req, path, codec).await
}
/// Returns information about the reservation.
pub async fn get_reservation(
&mut self,
request: impl tonic::IntoRequest<super::GetReservationRequest>,
) -> std::result::Result<tonic::Response<super::Reservation>, 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.bigquery.reservation.v1.ReservationService/GetReservation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"GetReservation",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a reservation.
/// Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
/// assignments.
pub async fn delete_reservation(
&mut self,
request: impl tonic::IntoRequest<super::DeleteReservationRequest>,
) -> 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.bigquery.reservation.v1.ReservationService/DeleteReservation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"DeleteReservation",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates an existing reservation resource.
pub async fn update_reservation(
&mut self,
request: impl tonic::IntoRequest<super::UpdateReservationRequest>,
) -> std::result::Result<tonic::Response<super::Reservation>, 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.bigquery.reservation.v1.ReservationService/UpdateReservation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"UpdateReservation",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates a new capacity commitment resource.
pub async fn create_capacity_commitment(
&mut self,
request: impl tonic::IntoRequest<super::CreateCapacityCommitmentRequest>,
) -> std::result::Result<
tonic::Response<super::CapacityCommitment>,
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.bigquery.reservation.v1.ReservationService/CreateCapacityCommitment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"CreateCapacityCommitment",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists all the capacity commitments for the admin project.
pub async fn list_capacity_commitments(
&mut self,
request: impl tonic::IntoRequest<super::ListCapacityCommitmentsRequest>,
) -> std::result::Result<
tonic::Response<super::ListCapacityCommitmentsResponse>,
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.bigquery.reservation.v1.ReservationService/ListCapacityCommitments",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"ListCapacityCommitments",
),
);
self.inner.unary(req, path, codec).await
}
/// Returns information about the capacity commitment.
pub async fn get_capacity_commitment(
&mut self,
request: impl tonic::IntoRequest<super::GetCapacityCommitmentRequest>,
) -> std::result::Result<
tonic::Response<super::CapacityCommitment>,
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.bigquery.reservation.v1.ReservationService/GetCapacityCommitment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"GetCapacityCommitment",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a capacity commitment. Attempting to delete capacity commitment
/// before its commitment_end_time will fail with the error code
/// `google.rpc.Code.FAILED_PRECONDITION`.
pub async fn delete_capacity_commitment(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCapacityCommitmentRequest>,
) -> 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.bigquery.reservation.v1.ReservationService/DeleteCapacityCommitment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"DeleteCapacityCommitment",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates an existing capacity commitment.
///
/// Only `plan` and `renewal_plan` fields can be updated.
///
/// Plan can only be changed to a plan of a longer commitment period.
/// Attempting to change to a plan with shorter commitment period will fail
/// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
pub async fn update_capacity_commitment(
&mut self,
request: impl tonic::IntoRequest<super::UpdateCapacityCommitmentRequest>,
) -> std::result::Result<
tonic::Response<super::CapacityCommitment>,
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.bigquery.reservation.v1.ReservationService/UpdateCapacityCommitment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"UpdateCapacityCommitment",
),
);
self.inner.unary(req, path, codec).await
}
/// Splits capacity commitment to two commitments of the same plan and
/// `commitment_end_time`.
///
/// A common use case is to enable downgrading commitments.
///
/// For example, in order to downgrade from 10000 slots to 8000, you might
/// split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
/// you delete the first one after the commitment end time passes.
pub async fn split_capacity_commitment(
&mut self,
request: impl tonic::IntoRequest<super::SplitCapacityCommitmentRequest>,
) -> std::result::Result<
tonic::Response<super::SplitCapacityCommitmentResponse>,
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.bigquery.reservation.v1.ReservationService/SplitCapacityCommitment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"SplitCapacityCommitment",
),
);
self.inner.unary(req, path, codec).await
}
/// Merges capacity commitments of the same plan into a single commitment.
///
/// The resulting capacity commitment has the greater commitment_end_time
/// out of the to-be-merged capacity commitments.
///
/// Attempting to merge capacity commitments of different plan will fail
/// with the error code `google.rpc.Code.FAILED_PRECONDITION`.
pub async fn merge_capacity_commitments(
&mut self,
request: impl tonic::IntoRequest<super::MergeCapacityCommitmentsRequest>,
) -> std::result::Result<
tonic::Response<super::CapacityCommitment>,
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.bigquery.reservation.v1.ReservationService/MergeCapacityCommitments",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"MergeCapacityCommitments",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates an assignment object which allows the given project to submit jobs
/// of a certain type using slots from the specified reservation.
///
/// Currently a
/// resource (project, folder, organization) can only have one assignment per
/// each (job_type, location) combination, and that reservation will be used
/// for all jobs of the matching type.
///
/// Different assignments can be created on different levels of the
/// projects, folders or organization hierarchy. During query execution,
/// the assignment is looked up at the project, folder and organization levels
/// in that order. The first assignment found is applied to the query.
///
/// When creating assignments, it does not matter if other assignments exist at
/// higher levels.
///
/// Example:
///
/// * The organization `organizationA` contains two projects, `project1`
/// and `project2`.
/// * Assignments for all three entities (`organizationA`, `project1`, and
/// `project2`) could all be created and mapped to the same or different
/// reservations.
///
/// "None" assignments represent an absence of the assignment. Projects
/// assigned to None use on-demand pricing. To create a "None" assignment, use
/// "none" as a reservation_id in the parent. Example parent:
/// `projects/myproject/locations/US/reservations/none`.
///
/// Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
/// 'bigquery.admin' permissions on the project using the reservation
/// and the project that owns this reservation.
///
/// Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
/// does not match location of the reservation.
pub async fn create_assignment(
&mut self,
request: impl tonic::IntoRequest<super::CreateAssignmentRequest>,
) -> std::result::Result<tonic::Response<super::Assignment>, 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.bigquery.reservation.v1.ReservationService/CreateAssignment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"CreateAssignment",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists assignments.
///
/// Only explicitly created assignments will be returned.
///
/// Example:
///
/// * Organization `organizationA` contains two projects, `project1` and
/// `project2`.
/// * Reservation `res1` exists and was created previously.
/// * CreateAssignment was used previously to define the following
/// associations between entities and reservations: `<organizationA, res1>`
/// and `<project1, res1>`
///
/// In this example, ListAssignments will just return the above two assignments
/// for reservation `res1`, and no expansion/merge will happen.
///
/// The wildcard "-" can be used for
/// reservations in the request. In that case all assignments belongs to the
/// specified project and location will be listed.
///
/// **Note** "-" cannot be used for projects nor locations.
pub async fn list_assignments(
&mut self,
request: impl tonic::IntoRequest<super::ListAssignmentsRequest>,
) -> std::result::Result<
tonic::Response<super::ListAssignmentsResponse>,
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.bigquery.reservation.v1.ReservationService/ListAssignments",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"ListAssignments",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a assignment. No expansion will happen.
///
/// Example:
///
/// * Organization `organizationA` contains two projects, `project1` and
/// `project2`.
/// * Reservation `res1` exists and was created previously.
/// * CreateAssignment was used previously to define the following
/// associations between entities and reservations: `<organizationA, res1>`
/// and `<project1, res1>`
///
/// In this example, deletion of the `<organizationA, res1>` assignment won't
/// affect the other assignment `<project1, res1>`. After said deletion,
/// queries from `project1` will still use `res1` while queries from
/// `project2` will switch to use on-demand mode.
pub async fn delete_assignment(
&mut self,
request: impl tonic::IntoRequest<super::DeleteAssignmentRequest>,
) -> 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.bigquery.reservation.v1.ReservationService/DeleteAssignment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"DeleteAssignment",
),
);
self.inner.unary(req, path, codec).await
}
/// Deprecated: Looks up assignments for a specified resource for a particular
/// region. If the request is about a project:
///
/// 1. Assignments created on the project will be returned if they exist.
/// 2. Otherwise assignments created on the closest ancestor will be
/// returned.
/// 3. Assignments for different JobTypes will all be returned.
///
/// The same logic applies if the request is about a folder.
///
/// If the request is about an organization, then assignments created on the
/// organization will be returned (organization doesn't have ancestors).
///
/// Comparing to ListAssignments, there are some behavior
/// differences:
///
/// 1. permission on the assignee will be verified in this API.
/// 2. Hierarchy lookup (project->folder->organization) happens in this API.
/// 3. Parent here is `projects/*/locations/*`, instead of
/// `projects/*/locations/*reservations/*`.
///
/// **Note** "-" cannot be used for projects
/// nor locations.
pub async fn search_assignments(
&mut self,
request: impl tonic::IntoRequest<super::SearchAssignmentsRequest>,
) -> std::result::Result<
tonic::Response<super::SearchAssignmentsResponse>,
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.bigquery.reservation.v1.ReservationService/SearchAssignments",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"SearchAssignments",
),
);
self.inner.unary(req, path, codec).await
}
/// Looks up assignments for a specified resource for a particular region.
/// If the request is about a project:
///
/// 1. Assignments created on the project will be returned if they exist.
/// 2. Otherwise assignments created on the closest ancestor will be
/// returned.
/// 3. Assignments for different JobTypes will all be returned.
///
/// The same logic applies if the request is about a folder.
///
/// If the request is about an organization, then assignments created on the
/// organization will be returned (organization doesn't have ancestors).
///
/// Comparing to ListAssignments, there are some behavior
/// differences:
///
/// 1. permission on the assignee will be verified in this API.
/// 2. Hierarchy lookup (project->folder->organization) happens in this API.
/// 3. Parent here is `projects/*/locations/*`, instead of
/// `projects/*/locations/*reservations/*`.
pub async fn search_all_assignments(
&mut self,
request: impl tonic::IntoRequest<super::SearchAllAssignmentsRequest>,
) -> std::result::Result<
tonic::Response<super::SearchAllAssignmentsResponse>,
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.bigquery.reservation.v1.ReservationService/SearchAllAssignments",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"SearchAllAssignments",
),
);
self.inner.unary(req, path, codec).await
}
/// Moves an assignment under a new reservation.
///
/// This differs from removing an existing assignment and recreating a new one
/// by providing a transactional change that ensures an assignee always has an
/// associated reservation.
pub async fn move_assignment(
&mut self,
request: impl tonic::IntoRequest<super::MoveAssignmentRequest>,
) -> std::result::Result<tonic::Response<super::Assignment>, 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.bigquery.reservation.v1.ReservationService/MoveAssignment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"MoveAssignment",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates an existing assignment.
///
/// Only the `priority` field can be updated.
pub async fn update_assignment(
&mut self,
request: impl tonic::IntoRequest<super::UpdateAssignmentRequest>,
) -> std::result::Result<tonic::Response<super::Assignment>, 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.bigquery.reservation.v1.ReservationService/UpdateAssignment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"UpdateAssignment",
),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves a BI reservation.
pub async fn get_bi_reservation(
&mut self,
request: impl tonic::IntoRequest<super::GetBiReservationRequest>,
) -> std::result::Result<tonic::Response<super::BiReservation>, 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.bigquery.reservation.v1.ReservationService/GetBiReservation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"GetBiReservation",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates a BI reservation.
///
/// Only fields specified in the `field_mask` are updated.
///
/// A singleton BI reservation always exists with default size 0.
/// In order to reserve BI capacity it needs to be updated to an amount
/// greater than 0. In order to release BI capacity reservation size
/// must be set to 0.
pub async fn update_bi_reservation(
&mut self,
request: impl tonic::IntoRequest<super::UpdateBiReservationRequest>,
) -> std::result::Result<tonic::Response<super::BiReservation>, 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.bigquery.reservation.v1.ReservationService/UpdateBiReservation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.bigquery.reservation.v1.ReservationService",
"UpdateBiReservation",
),
);
self.inner.unary(req, path, codec).await
}
}
}