@@ -545,6 +545,10 @@ pub struct Publishing {
545
545
/// <https://cloud.google.com/pubsub/lite/docs/reference/rpc>
546
546
#[ prost( string, tag="110" ) ]
547
547
pub proto_reference_documentation_uri : :: prost:: alloc:: string:: String ,
548
+ /// Optional link to REST reference documentation. Example:
549
+ /// <https://cloud.google.com/pubsub/lite/docs/reference/rest>
550
+ #[ prost( string, tag="111" ) ]
551
+ pub rest_reference_documentation_uri : :: prost:: alloc:: string:: String ,
548
552
}
549
553
/// Settings for Java client libraries.
550
554
#[ allow( clippy:: derive_partial_eq_without_eq) ]
@@ -696,6 +700,19 @@ pub struct MethodSettings {
696
700
/// seconds: 54000 # 90 minutes
697
701
#[ prost( message, optional, tag="2" ) ]
698
702
pub long_running : :: core:: option:: Option < method_settings:: LongRunning > ,
703
+ /// List of top-level fields of the request message, that should be
704
+ /// automatically populated by the client libraries based on their
705
+ /// (google.api.field_info).format. Currently supported format: UUID4.
706
+ ///
707
+ /// Example of a YAML configuration:
708
+ ///
709
+ /// publishing:
710
+ /// method_settings:
711
+ /// - selector: google.example.v1.ExampleService.CreateExample
712
+ /// auto_populated_fields:
713
+ /// - request_id
714
+ #[ prost( string, repeated, tag="3" ) ]
715
+ pub auto_populated_fields : :: prost:: alloc:: vec:: Vec < :: prost:: alloc:: string:: String > ,
699
716
}
700
717
/// Nested message and enum types in `MethodSettings`.
701
718
pub mod method_settings {
@@ -857,6 +874,19 @@ pub enum FieldBehavior {
857
874
/// a non-empty value will be returned. The user will not be aware of what
858
875
/// non-empty value to expect.
859
876
NonEmptyDefault = 7 ,
877
+ /// Denotes that the field in a resource (a message annotated with
878
+ /// google.api.resource) is used in the resource name to uniquely identify the
879
+ /// resource. For AIP-compliant APIs, this should only be applied to the
880
+ /// `name` field on the resource.
881
+ ///
882
+ /// This behavior should not be applied to references to other resources within
883
+ /// the message.
884
+ ///
885
+ /// The identifier field of resources often have different field behavior
886
+ /// depending on the request it is embedded in (e.g. for Create methods name
887
+ /// is optional and unused, while for Update methods it is required). Instead
888
+ /// of method-specific annotations, only `IDENTIFIER` is required.
889
+ Identifier = 8 ,
860
890
}
861
891
impl FieldBehavior {
862
892
/// String value of the enum field names used in the ProtoBuf definition.
@@ -873,6 +903,7 @@ impl FieldBehavior {
873
903
FieldBehavior :: Immutable => "IMMUTABLE" ,
874
904
FieldBehavior :: UnorderedList => "UNORDERED_LIST" ,
875
905
FieldBehavior :: NonEmptyDefault => "NON_EMPTY_DEFAULT" ,
906
+ FieldBehavior :: Identifier => "IDENTIFIER" ,
876
907
}
877
908
}
878
909
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -886,10 +917,79 @@ impl FieldBehavior {
886
917
"IMMUTABLE" => Some ( Self :: Immutable ) ,
887
918
"UNORDERED_LIST" => Some ( Self :: UnorderedList ) ,
888
919
"NON_EMPTY_DEFAULT" => Some ( Self :: NonEmptyDefault ) ,
920
+ "IDENTIFIER" => Some ( Self :: Identifier ) ,
889
921
_ => None ,
890
922
}
891
923
}
892
924
}
925
+ /// Rich semantic information of an API field beyond basic typing.
926
+ #[ allow( clippy:: derive_partial_eq_without_eq) ]
927
+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
928
+ pub struct FieldInfo {
929
+ /// The standard format of a field value. This does not explicitly configure
930
+ /// any API consumer, just documents the API's format for the field it is
931
+ /// applied to.
932
+ #[ prost( enumeration="field_info::Format" , tag="1" ) ]
933
+ pub format : i32 ,
934
+ }
935
+ /// Nested message and enum types in `FieldInfo`.
936
+ pub mod field_info {
937
+ /// The standard format of a field value. The supported formats are all backed
938
+ /// by either an RFC defined by the IETF or a Google-defined AIP.
939
+ #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
940
+ #[ repr( i32 ) ]
941
+ pub enum Format {
942
+ /// Default, unspecified value.
943
+ Unspecified = 0 ,
944
+ /// Universally Unique Identifier, version 4, value as defined by
945
+ /// <https://datatracker.ietf.org/doc/html/rfc4122.> The value may be
946
+ /// normalized to entirely lowercase letters. For example, the value
947
+ /// `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
948
+ /// `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
949
+ Uuid4 = 1 ,
950
+ /// Internet Protocol v4 value as defined by [RFC
951
+ /// 791](<https://datatracker.ietf.org/doc/html/rfc791>). The value may be
952
+ /// condensed, with leading zeros in each octet stripped. For example,
953
+ /// `001.022.233.040` would be condensed to `1.22.233.40`.
954
+ Ipv4 = 2 ,
955
+ /// Internet Protocol v6 value as defined by [RFC
956
+ /// 2460](<https://datatracker.ietf.org/doc/html/rfc2460>). The value may be
957
+ /// normalized to entirely lowercase letters with zeros compressed, following
958
+ /// [RFC 5952](<https://datatracker.ietf.org/doc/html/rfc5952>). For example,
959
+ /// the value `2001:0DB8:0::0` would be normalized to `2001:db8::`.
960
+ Ipv6 = 3 ,
961
+ /// An IP address in either v4 or v6 format as described by the individual
962
+ /// values defined herein. See the comments on the IPV4 and IPV6 types for
963
+ /// allowed normalizations of each.
964
+ Ipv4OrIpv6 = 4 ,
965
+ }
966
+ impl Format {
967
+ /// String value of the enum field names used in the ProtoBuf definition.
968
+ ///
969
+ /// The values are not transformed in any way and thus are considered stable
970
+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
971
+ pub fn as_str_name ( & self ) -> & ' static str {
972
+ match self {
973
+ Format :: Unspecified => "FORMAT_UNSPECIFIED" ,
974
+ Format :: Uuid4 => "UUID4" ,
975
+ Format :: Ipv4 => "IPV4" ,
976
+ Format :: Ipv6 => "IPV6" ,
977
+ Format :: Ipv4OrIpv6 => "IPV4_OR_IPV6" ,
978
+ }
979
+ }
980
+ /// Creates an enum from field names used in the ProtoBuf definition.
981
+ pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
982
+ match value {
983
+ "FORMAT_UNSPECIFIED" => Some ( Self :: Unspecified ) ,
984
+ "UUID4" => Some ( Self :: Uuid4 ) ,
985
+ "IPV4" => Some ( Self :: Ipv4 ) ,
986
+ "IPV6" => Some ( Self :: Ipv6 ) ,
987
+ "IPV4_OR_IPV6" => Some ( Self :: Ipv4OrIpv6 ) ,
988
+ _ => None ,
989
+ }
990
+ }
991
+ }
992
+ }
893
993
/// Message that represents an arbitrary HTTP body. It should only be used for
894
994
/// payload formats that can't be represented as JSON, such as raw binary or
895
995
/// an HTML page.
0 commit comments