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
// This file is @generated by prost-build.
/// A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig
/// service. A RuntimeConfig resource consists of metadata and a hierarchy of
/// variables.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuntimeConfig {
/// The resource name of a runtime config. The name must have the format:
///
/// projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]
///
/// The `\[PROJECT_ID\]` must be a valid project ID, and `\[CONFIG_NAME\]` is an
/// arbitrary name that matches RFC 1035 segment specification. The length of
/// `\[CONFIG_NAME\]` must be less than 64 bytes.
///
/// You pick the RuntimeConfig resource name, but the server will validate that
/// the name adheres to this format. After you create the resource, you cannot
/// change the resource's name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// An optional description of the RuntimeConfig object.
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
}
/// Describes a single variable within a RuntimeConfig resource.
/// The name denotes the hierarchical variable name. For example,
/// `ports/serving_port` is a valid variable name. The variable value is an
/// opaque string and only leaf variables can have values (that is, variables
/// that do not have any child variables).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Variable {
/// The name of the variable resource, in the format:
///
/// projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/variables/\[VARIABLE_NAME\]
///
/// The `\[PROJECT_ID\]` must be a valid project ID, `\[CONFIG_NAME\]` must be a
/// valid RuntimeConfig reource and `\[VARIABLE_NAME\]` follows Unix file system
/// file path naming.
///
/// The `\[VARIABLE_NAME\]` can contain ASCII letters, numbers, slashes and
/// dashes. Slashes are used as path element separators and are not part of the
/// `\[VARIABLE_NAME\]` itself, so `\[VARIABLE_NAME\]` must contain at least one
/// non-slash character. Multiple slashes are coalesced into single slash
/// character. Each path segment should follow RFC 1035 segment specification.
/// The length of a `\[VARIABLE_NAME\]` must be less than 256 bytes.
///
/// Once you create a variable, you cannot change the variable name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// \[Output Only\] The time of the last variable update.
#[prost(message, optional, tag = "3")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// \[Ouput only\] The current state of the variable. The variable state
/// indicates the outcome of the `variables().watch` call and is visible
/// through the `get` and `list` calls.
#[prost(enumeration = "VariableState", tag = "4")]
pub state: i32,
/// The value of the variable. It can be either a binary or a string
/// value. You must specify one of either `value` or `text`. Specifying both
/// will cause the server to return an error.
#[prost(oneof = "variable::Contents", tags = "2, 5")]
pub contents: ::core::option::Option<variable::Contents>,
}
/// Nested message and enum types in `Variable`.
pub mod variable {
/// The value of the variable. It can be either a binary or a string
/// value. You must specify one of either `value` or `text`. Specifying both
/// will cause the server to return an error.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Contents {
/// The binary value of the variable. The length of the value must be less
/// than 4096 bytes. Empty values are also accepted. The value must be
/// base64 encoded. Only one of `value` or `text` can be set.
#[prost(bytes, tag = "2")]
Value(::prost::bytes::Bytes),
/// The string value of the variable. The length of the value must be less
/// than 4096 bytes. Empty values are also accepted. For example,
/// `text: "my text value"`. The string must be valid UTF-8.
#[prost(string, tag = "5")]
Text(::prost::alloc::string::String),
}
}
/// The condition that a Waiter resource is waiting for.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndCondition {
/// The condition oneof holds the available condition types for this
/// EndCondition. Currently, the only available type is Cardinality.
#[prost(oneof = "end_condition::Condition", tags = "1")]
pub condition: ::core::option::Option<end_condition::Condition>,
}
/// Nested message and enum types in `EndCondition`.
pub mod end_condition {
/// A Cardinality condition for the Waiter resource. A cardinality condition is
/// met when the number of variables under a specified path prefix reaches a
/// predefined number. For example, if you set a Cardinality condition where
/// the `path` is set to `/foo` and the number of paths is set to 2, the
/// following variables would meet the condition in a RuntimeConfig resource:
///
/// + `/foo/variable1 = "value1"`
/// + `/foo/variable2 = "value2"`
/// + `/bar/variable3 = "value3"`
///
/// It would not would not satisify the same condition with the `number` set to
/// 3, however, because there is only 2 paths that start with `/foo`.
/// Cardinality conditions are recursive; all subtrees under the specific
/// path prefix are counted.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cardinality {
/// The root of the variable subtree to monitor. For example, `/foo`.
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
/// The number variables under the `path` that must exist to meet this
/// condition. Defaults to 1 if not specified.
#[prost(int32, tag = "2")]
pub number: i32,
}
/// The condition oneof holds the available condition types for this
/// EndCondition. Currently, the only available type is Cardinality.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Condition {
/// The cardinality of the `EndCondition`.
#[prost(message, tag = "1")]
Cardinality(Cardinality),
}
}
/// A Waiter resource waits for some end condition within a RuntimeConfig
/// resource to be met before it returns. For example, assume you have a
/// distributed system where each node writes to a Variable resource indidicating
/// the node's readiness as part of the startup process.
///
/// You then configure a Waiter resource with the success condition set to wait
/// until some number of nodes have checked in. Afterwards, your application
/// runs some arbitrary code after the condition has been met and the waiter
/// returns successfully.
///
/// Once created, a Waiter resource is immutable.
///
/// To learn more about using waiters, read the
/// [Creating a
/// Waiter](/deployment-manager/runtime-configurator/creating-a-waiter)
/// documentation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Waiter {
/// The name of the Waiter resource, in the format:
///
/// projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/waiters/\[WAITER_NAME\]
///
/// The `\[PROJECT_ID\]` must be a valid Google Cloud project ID,
/// the `\[CONFIG_NAME\]` must be a valid RuntimeConfig resource, the
/// `\[WAITER_NAME\]` must match RFC 1035 segment specification, and the length
/// of `\[WAITER_NAME\]` must be less than 64 bytes.
///
/// After you create a Waiter resource, you cannot change the resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// \[Required\] Specifies the timeout of the waiter in seconds, beginning from
/// the instant that `waiters().create` method is called. If this time elapses
/// before the success or failure conditions are met, the waiter fails and sets
/// the `error` code to `DEADLINE_EXCEEDED`.
#[prost(message, optional, tag = "2")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
/// \[Optional\] The failure condition of this waiter. If this condition is met,
/// `done` will be set to `true` and the `error` code will be set to `ABORTED`.
/// The failure condition takes precedence over the success condition. If both
/// conditions are met, a failure will be indicated. This value is optional; if
/// no failure condition is set, the only failure scenario will be a timeout.
#[prost(message, optional, tag = "3")]
pub failure: ::core::option::Option<EndCondition>,
/// \[Required\] The success condition. If this condition is met, `done` will be
/// set to `true` and the `error` value will remain unset. The failure
/// condition takes precedence over the success condition. If both conditions
/// are met, a failure will be indicated.
#[prost(message, optional, tag = "4")]
pub success: ::core::option::Option<EndCondition>,
/// \[Output Only\] The instant at which this Waiter resource was created. Adding
/// the value of `timeout` to this instant yields the timeout deadline for the
/// waiter.
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// \[Output Only\] If the value is `false`, it means the waiter is still waiting
/// for one of its conditions to be met.
///
/// If true, the waiter has finished. If the waiter finished due to a timeout
/// or failure, `error` will be set.
#[prost(bool, tag = "6")]
pub done: bool,
/// \[Output Only\] If the waiter ended due to a failure or timeout, this value
/// will be set.
#[prost(message, optional, tag = "7")]
pub error: ::core::option::Option<super::super::super::rpc::Status>,
}
/// The `VariableState` describes the last known state of the variable and is
/// used during a `variables().watch` call to distinguish the state of the
/// variable.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VariableState {
/// Default variable state.
Unspecified = 0,
/// The variable was updated, while `variables().watch` was executing.
Updated = 1,
/// The variable was deleted, while `variables().watch` was executing.
Deleted = 2,
}
impl VariableState {
/// 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 {
VariableState::Unspecified => "VARIABLE_STATE_UNSPECIFIED",
VariableState::Updated => "UPDATED",
VariableState::Deleted => "DELETED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VARIABLE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"UPDATED" => Some(Self::Updated),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
/// Request for the `ListConfigs()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListConfigsRequest {
/// The [project
/// ID](<https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848>)
/// for this request, in the format `projects/\[PROJECT_ID\]`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Specifies the number of results to return per page. If there are fewer
/// elements than the specified number, returns all elements.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// Specifies a page token to use. Set `pageToken` to a `nextPageToken`
/// returned by a previous list request to get the next page of results.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
/// `ListConfigs()` returns the following response. The order of returned
/// objects is arbitrary; that is, it is not ordered in any particular way.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListConfigsResponse {
/// A list of the configurations in the project. The order of returned
/// objects is arbitrary; that is, it is not ordered in any particular way.
#[prost(message, repeated, tag = "1")]
pub configs: ::prost::alloc::vec::Vec<RuntimeConfig>,
/// This token allows you to get the next page of results for list requests.
/// If the number of results is larger than `pageSize`, use the `nextPageToken`
/// as a value for the query parameter `pageToken` in the next list request.
/// Subsequent list requests will have their own `nextPageToken` to continue
/// paging through the results
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Gets a RuntimeConfig resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetConfigRequest {
/// The name of the RuntimeConfig resource to retrieve, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
/// Creates a RuntimeConfig resource.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateConfigRequest {
/// The [project
/// ID](<https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848>)
/// for this request, in the format `projects/\[PROJECT_ID\]`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The RuntimeConfig to create.
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<RuntimeConfig>,
/// An optional but recommended unique `request_id`. If the server
/// receives two `create()` requests with the same
/// `request_id`, then the second request will be ignored and the
/// first resource created and stored in the backend is returned.
/// Empty `request_id` fields are ignored.
///
/// It is responsibility of the client to ensure uniqueness of the
/// `request_id` strings.
///
/// `request_id` strings are limited to 64 characters.
#[prost(string, tag = "3")]
pub request_id: ::prost::alloc::string::String,
}
/// Request message for `UpdateConfig()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateConfigRequest {
/// The name of the RuntimeConfig resource to update, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The config resource to update.
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<RuntimeConfig>,
}
/// Request for the `DeleteConfig()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteConfigRequest {
/// The RuntimeConfig resource to delete, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `ListVariables()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListVariablesRequest {
/// The path to the RuntimeConfig resource for which you want to list
/// variables. The configuration must exist beforehand; the path must by in the
/// format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Filters variables by matching the specified filter. For example:
///
/// `projects/example-project/config/\[CONFIG_NAME\]/variables/example-variable`.
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
/// Specifies the number of results to return per page. If there are fewer
/// elements than the specified number, returns all elements.
#[prost(int32, tag = "3")]
pub page_size: i32,
/// Specifies a page token to use. Set `pageToken` to a `nextPageToken`
/// returned by a previous list request to get the next page of results.
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
/// The flag indicates whether the user wants to return values of variables.
/// If true, then only those variables that user has IAM GetVariable permission
/// will be returned along with their values.
#[prost(bool, tag = "5")]
pub return_values: bool,
}
/// Response for the `ListVariables()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListVariablesResponse {
/// A list of variables and their values. The order of returned variable
/// objects is arbitrary.
#[prost(message, repeated, tag = "1")]
pub variables: ::prost::alloc::vec::Vec<Variable>,
/// This token allows you to get the next page of results for list requests.
/// If the number of results is larger than `pageSize`, use the `nextPageToken`
/// as a value for the query parameter `pageToken` in the next list request.
/// Subsequent list requests will have their own `nextPageToken` to continue
/// paging through the results
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `WatchVariable()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchVariableRequest {
/// The name of the variable to watch, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// If specified, checks the current timestamp of the variable and if the
/// current timestamp is newer than `newerThan` timestamp, the method returns
/// immediately.
///
/// If not specified or the variable has an older timestamp, the watcher waits
/// for a the value to change before returning.
#[prost(message, optional, tag = "4")]
pub newer_than: ::core::option::Option<::prost_types::Timestamp>,
}
/// Request for the `GetVariable()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVariableRequest {
/// The name of the variable to return, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/variables/\[VARIBLE_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for the `CreateVariable()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateVariableRequest {
/// The path to the RutimeConfig resource that this variable should belong to.
/// The configuration must exist beforehand; the path must by in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The variable to create.
#[prost(message, optional, tag = "2")]
pub variable: ::core::option::Option<Variable>,
/// An optional but recommended unique `request_id`. If the server
/// receives two `create()` requests with the same
/// `request_id`, then the second request will be ignored and the
/// first resource created and stored in the backend is returned.
/// Empty `request_id` fields are ignored.
///
/// It is responsibility of the client to ensure uniqueness of the
/// `request_id` strings.
///
/// `request_id` strings are limited to 64 characters.
#[prost(string, tag = "3")]
pub request_id: ::prost::alloc::string::String,
}
/// Request for the `UpdateVariable()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateVariableRequest {
/// The name of the variable to update, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/variables/\[VARIABLE_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The variable to update.
#[prost(message, optional, tag = "2")]
pub variable: ::core::option::Option<Variable>,
}
/// Request for the `DeleteVariable()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteVariableRequest {
/// The name of the variable to delete, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/variables/\[VARIABLE_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Set to `true` to recursively delete multiple variables with the same
/// prefix.
#[prost(bool, tag = "2")]
pub recursive: bool,
}
/// Request for the `ListWaiters()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWaitersRequest {
/// The path to the configuration for which you want to get a list of waiters.
/// The configuration must exist beforehand; the path must by in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Specifies the number of results to return per page. If there are fewer
/// elements than the specified number, returns all elements.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// Specifies a page token to use. Set `pageToken` to a `nextPageToken`
/// returned by a previous list request to get the next page of results.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
/// Response for the `ListWaiters()` method.
/// Order of returned waiter objects is arbitrary.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWaitersResponse {
/// Found waiters in the project.
#[prost(message, repeated, tag = "1")]
pub waiters: ::prost::alloc::vec::Vec<Waiter>,
/// This token allows you to get the next page of results for list requests.
/// If the number of results is larger than `pageSize`, use the `nextPageToken`
/// as a value for the query parameter `pageToken` in the next list request.
/// Subsequent list requests will have their own `nextPageToken` to continue
/// paging through the results
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request for the `GetWaiter()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetWaiterRequest {
/// The fully-qualified name of the Waiter resource object to retrieve, in the
/// format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/waiters/\[WAITER_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for `CreateWaiter()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWaiterRequest {
/// The path to the configuration that will own the waiter.
/// The configuration must exist beforehand; the path must by in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]`.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The Waiter resource to create.
#[prost(message, optional, tag = "2")]
pub waiter: ::core::option::Option<Waiter>,
/// An optional but recommended unique `request_id`. If the server
/// receives two `create()` requests with the same
/// `request_id`, then the second request will be ignored and the
/// first resource created and stored in the backend is returned.
/// Empty `request_id` fields are ignored.
///
/// It is responsibility of the client to ensure uniqueness of the
/// `request_id` strings.
///
/// `request_id` strings are limited to 64 characters.
#[prost(string, tag = "3")]
pub request_id: ::prost::alloc::string::String,
}
/// Request for the `DeleteWaiter()` method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteWaiterRequest {
/// The Waiter resource to delete, in the format:
///
/// `projects/\[PROJECT_ID\]/configs/\[CONFIG_NAME\]/waiters/\[WAITER_NAME\]`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod runtime_config_manager_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// RuntimeConfig API represents configuration objects and operations on those
/// configuration objects.
/// RuntimeConfig objects consist of Variables logically grouped in the those
/// objects.
/// Variables are simple key-value pairs. Variables can be watched for changes or
/// deletions. Variable key can be hieararchical, e.g. ports/serving_port,
/// ports/monitoring_port, etc. Variable names can be hierarchical. No variable
/// name can be prefix of another.
/// Config objects represent logical containers for variables, e.g. flags,
/// passwords, etc.
#[derive(Debug, Clone)]
pub struct RuntimeConfigManagerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> RuntimeConfigManagerClient<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,
) -> RuntimeConfigManagerClient<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,
{
RuntimeConfigManagerClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Lists all the RuntimeConfig resources within project.
pub async fn list_configs(
&mut self,
request: impl tonic::IntoRequest<super::ListConfigsRequest>,
) -> std::result::Result<
tonic::Response<super::ListConfigsResponse>,
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.runtimeconfig.v1beta1.RuntimeConfigManager/ListConfigs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"ListConfigs",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets information about a RuntimeConfig resource.
pub async fn get_config(
&mut self,
request: impl tonic::IntoRequest<super::GetConfigRequest>,
) -> std::result::Result<tonic::Response<super::RuntimeConfig>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/GetConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"GetConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates a new RuntimeConfig resource. The configuration name must be
/// unique within project.
pub async fn create_config(
&mut self,
request: impl tonic::IntoRequest<super::CreateConfigRequest>,
) -> std::result::Result<tonic::Response<super::RuntimeConfig>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/CreateConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"CreateConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates a RuntimeConfig resource. The configuration must exist beforehand.
pub async fn update_config(
&mut self,
request: impl tonic::IntoRequest<super::UpdateConfigRequest>,
) -> std::result::Result<tonic::Response<super::RuntimeConfig>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"UpdateConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a RuntimeConfig resource.
pub async fn delete_config(
&mut self,
request: impl tonic::IntoRequest<super::DeleteConfigRequest>,
) -> 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.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"DeleteConfig",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists variables within given a configuration, matching any provided
/// filters. This only lists variable names, not the values, unless
/// `return_values` is true, in which case only variables that user has IAM
/// permission to GetVariable will be returned.
pub async fn list_variables(
&mut self,
request: impl tonic::IntoRequest<super::ListVariablesRequest>,
) -> std::result::Result<
tonic::Response<super::ListVariablesResponse>,
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.runtimeconfig.v1beta1.RuntimeConfigManager/ListVariables",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"ListVariables",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets information about a single variable.
pub async fn get_variable(
&mut self,
request: impl tonic::IntoRequest<super::GetVariableRequest>,
) -> std::result::Result<tonic::Response<super::Variable>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/GetVariable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"GetVariable",
),
);
self.inner.unary(req, path, codec).await
}
/// Watches a specific variable and waits for a change in the variable's value.
/// When there is a change, this method returns the new value or times out.
///
/// If a variable is deleted while being watched, the `variableState` state is
/// set to `DELETED` and the method returns the last known variable `value`.
///
/// If you set the deadline for watching to a larger value than internal
/// timeout (60 seconds), the current variable value is returned and the
/// `variableState` will be `VARIABLE_STATE_UNSPECIFIED`.
///
/// To learn more about creating a watcher, read the
/// [Watching a Variable for
/// Changes](/deployment-manager/runtime-configurator/watching-a-variable)
/// documentation.
pub async fn watch_variable(
&mut self,
request: impl tonic::IntoRequest<super::WatchVariableRequest>,
) -> std::result::Result<tonic::Response<super::Variable>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/WatchVariable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"WatchVariable",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates a variable within the given configuration. You cannot create
/// a variable with a name that is a prefix of an existing variable name, or a
/// name that has an existing variable name as a prefix.
///
/// To learn more about creating a variable, read the
/// [Setting and Getting
/// Data](/deployment-manager/runtime-configurator/set-and-get-variables)
/// documentation.
pub async fn create_variable(
&mut self,
request: impl tonic::IntoRequest<super::CreateVariableRequest>,
) -> std::result::Result<tonic::Response<super::Variable>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/CreateVariable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"CreateVariable",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates an existing variable with a new value.
pub async fn update_variable(
&mut self,
request: impl tonic::IntoRequest<super::UpdateVariableRequest>,
) -> std::result::Result<tonic::Response<super::Variable>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateVariable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"UpdateVariable",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a variable or multiple variables.
///
/// If you specify a variable name, then that variable is deleted. If you
/// specify a prefix and `recursive` is true, then all variables with that
/// prefix are deleted. You must set a `recursive` to true if you delete
/// variables by prefix.
pub async fn delete_variable(
&mut self,
request: impl tonic::IntoRequest<super::DeleteVariableRequest>,
) -> 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.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteVariable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"DeleteVariable",
),
);
self.inner.unary(req, path, codec).await
}
/// List waiters within the given configuration.
pub async fn list_waiters(
&mut self,
request: impl tonic::IntoRequest<super::ListWaitersRequest>,
) -> std::result::Result<
tonic::Response<super::ListWaitersResponse>,
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.runtimeconfig.v1beta1.RuntimeConfigManager/ListWaiters",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"ListWaiters",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets information about a single waiter.
pub async fn get_waiter(
&mut self,
request: impl tonic::IntoRequest<super::GetWaiterRequest>,
) -> std::result::Result<tonic::Response<super::Waiter>, 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.runtimeconfig.v1beta1.RuntimeConfigManager/GetWaiter",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"GetWaiter",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates a Waiter resource. This operation returns a long-running Operation
/// resource which can be polled for completion. However, a waiter with the
/// given name will exist (and can be retrieved) prior to the operation
/// completing. If the operation fails, the failed Waiter resource will
/// still exist and must be deleted prior to subsequent creation attempts.
pub async fn create_waiter(
&mut self,
request: impl tonic::IntoRequest<super::CreateWaiterRequest>,
) -> 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.runtimeconfig.v1beta1.RuntimeConfigManager/CreateWaiter",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"CreateWaiter",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes the waiter with the specified name.
pub async fn delete_waiter(
&mut self,
request: impl tonic::IntoRequest<super::DeleteWaiterRequest>,
) -> 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.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteWaiter",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager",
"DeleteWaiter",
),
);
self.inner.unary(req, path, codec).await
}
}
}