Skip to content

Commit

Permalink
feat: Regenerate common protos
Browse files Browse the repository at this point in the history
- New policy-related messages (and reference in Control)
- New field behavior of IDENTIFIER
  • Loading branch information
jskeet committed Sep 15, 2023
1 parent a1db77c commit 1af2b4e
Show file tree
Hide file tree
Showing 3 changed files with 659 additions and 14 deletions.
44 changes: 37 additions & 7 deletions Google.Api.CommonProtos/Api/Control.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ public static partial class ControlReflection {
static ControlReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chhnb29nbGUvYXBpL2NvbnRyb2wucHJvdG8SCmdvb2dsZS5hcGkiHgoHQ29u",
"dHJvbBITCgtlbnZpcm9ubWVudBgBIAEoCUJuCg5jb20uZ29vZ2xlLmFwaUIM",
"Q29udHJvbFByb3RvUAFaRWdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dv",
"b2dsZWFwaXMvYXBpL3NlcnZpY2Vjb25maWc7c2VydmljZWNvbmZpZ6ICBEdB",
"UEliBnByb3RvMw=="));
"Chhnb29nbGUvYXBpL2NvbnRyb2wucHJvdG8SCmdvb2dsZS5hcGkaF2dvb2ds",
"ZS9hcGkvcG9saWN5LnByb3RvIlEKB0NvbnRyb2wSEwoLZW52aXJvbm1lbnQY",
"ASABKAkSMQoPbWV0aG9kX3BvbGljaWVzGAQgAygLMhguZ29vZ2xlLmFwaS5N",
"ZXRob2RQb2xpY3lCbgoOY29tLmdvb2dsZS5hcGlCDENvbnRyb2xQcm90b1AB",
"WkVnb29nbGUuZ29sYW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2FwaS9z",
"ZXJ2aWNlY29uZmlnO3NlcnZpY2Vjb25maWeiAgRHQVBJYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::FileDescriptor[] { global::Google.Api.PolicyReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Api.Control), global::Google.Api.Control.Parser, new[]{ "Environment" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Api.Control), global::Google.Api.Control.Parser, new[]{ "Environment", "MethodPolicies" }, null, null, null, null)
}));
}
#endregion
Expand Down Expand Up @@ -89,6 +90,7 @@ public Control() {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public Control(Control other) : this() {
environment_ = other.environment_;
methodPolicies_ = other.methodPolicies_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

Expand All @@ -115,6 +117,20 @@ public string Environment {
}
}

/// <summary>Field number for the "method_policies" field.</summary>
public const int MethodPoliciesFieldNumber = 4;
private static readonly pb::FieldCodec<global::Google.Api.MethodPolicy> _repeated_methodPolicies_codec
= pb::FieldCodec.ForMessage(34, global::Google.Api.MethodPolicy.Parser);
private readonly pbc::RepeatedField<global::Google.Api.MethodPolicy> methodPolicies_ = new pbc::RepeatedField<global::Google.Api.MethodPolicy>();
/// <summary>
/// Defines policies applying to the API methods of the service.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<global::Google.Api.MethodPolicy> MethodPolicies {
get { return methodPolicies_; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
Expand All @@ -131,6 +147,7 @@ public bool Equals(Control other) {
return true;
}
if (Environment != other.Environment) return false;
if(!methodPolicies_.Equals(other.methodPolicies_)) return false;
return Equals(_unknownFields, other._unknownFields);
}

Expand All @@ -139,6 +156,7 @@ public bool Equals(Control other) {
public override int GetHashCode() {
int hash = 1;
if (Environment.Length != 0) hash ^= Environment.GetHashCode();
hash ^= methodPolicies_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
Expand All @@ -161,6 +179,7 @@ public void WriteTo(pb::CodedOutputStream output) {
output.WriteRawTag(10);
output.WriteString(Environment);
}
methodPolicies_.WriteTo(output, _repeated_methodPolicies_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
Expand All @@ -175,6 +194,7 @@ public void WriteTo(pb::CodedOutputStream output) {
output.WriteRawTag(10);
output.WriteString(Environment);
}
methodPolicies_.WriteTo(ref output, _repeated_methodPolicies_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
Expand All @@ -188,6 +208,7 @@ public int CalculateSize() {
if (Environment.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Environment);
}
size += methodPolicies_.CalculateSize(_repeated_methodPolicies_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
Expand All @@ -203,6 +224,7 @@ public void MergeFrom(Control other) {
if (other.Environment.Length != 0) {
Environment = other.Environment;
}
methodPolicies_.Add(other.methodPolicies_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

Expand All @@ -222,6 +244,10 @@ public void MergeFrom(pb::CodedInputStream input) {
Environment = input.ReadString();
break;
}
case 34: {
methodPolicies_.AddEntriesFrom(input, _repeated_methodPolicies_codec);
break;
}
}
}
#endif
Expand All @@ -241,6 +267,10 @@ public void MergeFrom(pb::CodedInputStream input) {
Environment = input.ReadString();
break;
}
case 34: {
methodPolicies_.AddEntriesFrom(ref input, _repeated_methodPolicies_codec);
break;
}
}
}
}
Expand Down
29 changes: 22 additions & 7 deletions Google.Api.CommonProtos/Api/FieldBehavior.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ static FieldBehaviorReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch9nb29nbGUvYXBpL2ZpZWxkX2JlaGF2aW9yLnByb3RvEgpnb29nbGUuYXBp",
"GiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90byqmAQoNRmllbGRC",
"GiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90byq2AQoNRmllbGRC",
"ZWhhdmlvchIeChpGSUVMRF9CRUhBVklPUl9VTlNQRUNJRklFRBAAEgwKCE9Q",
"VElPTkFMEAESDAoIUkVRVUlSRUQQAhIPCgtPVVRQVVRfT05MWRADEg4KCklO",
"UFVUX09OTFkQBBINCglJTU1VVEFCTEUQBRISCg5VTk9SREVSRURfTElTVBAG",
"EhUKEU5PTl9FTVBUWV9ERUZBVUxUEAc6UQoOZmllbGRfYmVoYXZpb3ISHS5n",
"b29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGJwIIAMoDjIZLmdvb2dsZS5h",
"cGkuRmllbGRCZWhhdmlvckJwCg5jb20uZ29vZ2xlLmFwaUISRmllbGRCZWhh",
"dmlvclByb3RvUAFaQWdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2ds",
"ZWFwaXMvYXBpL2Fubm90YXRpb25zO2Fubm90YXRpb25zogIER0FQSWIGcHJv",
"dG8z"));
"EhUKEU5PTl9FTVBUWV9ERUZBVUxUEAcSDgoKSURFTlRJRklFUhAIOlEKDmZp",
"ZWxkX2JlaGF2aW9yEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxic",
"CCADKA4yGS5nb29nbGUuYXBpLkZpZWxkQmVoYXZpb3JCcAoOY29tLmdvb2ds",
"ZS5hcGlCEkZpZWxkQmVoYXZpb3JQcm90b1ABWkFnb29nbGUuZ29sYW5nLm9y",
"Zy9nZW5wcm90by9nb29nbGVhcGlzL2FwaS9hbm5vdGF0aW9uczthbm5vdGF0",
"aW9uc6ICBEdBUEliBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Api.FieldBehavior), }, new pb::Extension[] { FieldBehaviorExtensions.FieldBehavior }, null));
Expand Down Expand Up @@ -128,6 +128,21 @@ public enum FieldBehavior {
/// non-empty value to expect.
/// </summary>
[pbr::OriginalName("NON_EMPTY_DEFAULT")] NonEmptyDefault = 7,
/// <summary>
/// Denotes that the field in a resource (a message annotated with
/// google.api.resource) is used in the resource name to uniquely identify the
/// resource. For AIP-compliant APIs, this should only be applied to the
/// `name` field on the resource.
///
/// This behavior should not be applied to references to other resources within
/// the message.
///
/// The identifier field of resources often have different field behavior
/// depending on the request it is embedded in (e.g. for Create methods name
/// is optional and unused, while for Update methods it is required). Instead
/// of method-specific annotations, only `IDENTIFIER` is required.
/// </summary>
[pbr::OriginalName("IDENTIFIER")] Identifier = 8,
}

#endregion
Expand Down
Loading

0 comments on commit 1af2b4e

Please sign in to comment.