Skip to content

Commit

Permalink
Regenerate IAM API, with new Options type
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Jul 2, 2019
1 parent e16f28d commit ab0fe73
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 22 deletions.
84 changes: 62 additions & 22 deletions apis/Google.Cloud.Iam.V1/Google.Cloud.Iam.V1/IamPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,33 @@ public static partial class IamPolicyReflection {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch5nb29nbGUvaWFtL3YxL2lhbV9wb2xpY3kucHJvdG8SDWdvb2dsZS5pYW0u",
"djEaGWdvb2dsZS9hcGkvcmVzb3VyY2UucHJvdG8aGmdvb2dsZS9pYW0vdjEv",
"cG9saWN5LnByb3RvGhxnb29nbGUvYXBpL2Fubm90YXRpb25zLnByb3RvIk4K",
"E1NldElhbVBvbGljeVJlcXVlc3QSEAoIcmVzb3VyY2UYASABKAkSJQoGcG9s",
"aWN5GAIgASgLMhUuZ29vZ2xlLmlhbS52MS5Qb2xpY3kiJwoTR2V0SWFtUG9s",
"aWN5UmVxdWVzdBIQCghyZXNvdXJjZRgBIAEoCSJCChlUZXN0SWFtUGVybWlz",
"c2lvbnNSZXF1ZXN0EhAKCHJlc291cmNlGAEgASgJEhMKC3Blcm1pc3Npb25z",
"GAIgAygJIjEKGlRlc3RJYW1QZXJtaXNzaW9uc1Jlc3BvbnNlEhMKC3Blcm1p",
"c3Npb25zGAEgAygJMpQDCglJQU1Qb2xpY3kSdAoMU2V0SWFtUG9saWN5EiIu",
"Z29vZ2xlLmlhbS52MS5TZXRJYW1Qb2xpY3lSZXF1ZXN0GhUuZ29vZ2xlLmlh",
"bS52MS5Qb2xpY3kiKYLT5JMCIyIeL3YxL3tyZXNvdXJjZT0qKn06c2V0SWFt",
"UG9saWN5OgEqEnQKDEdldElhbVBvbGljeRIiLmdvb2dsZS5pYW0udjEuR2V0",
"SWFtUG9saWN5UmVxdWVz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ASADKAky",
"tAMKCUlBTVBvbGljeRJ0CgxTZXRJYW1Qb2xpY3kSIi5nb29nbGUuaWFtLnYx",
"LlNldElhbVBvbGljeVJlcXVlc3QaFS5nb29nbGUuaWFtLnYxLlBvbGljeSIp",
"gtPkkwIjIh4vdjEve3Jlc291cmNlPSoqfTpzZXRJYW1Qb2xpY3k6ASoSdAoM",
"R2V0SWFtUG9saWN5EiIuZ29vZ2xlLmlhbS52MS5HZXRJYW1Qb2xpY3lSZXF1",
"ZXN0GhUuZ29vZ2xlLmlhbS52MS5Qb2xpY3kiKYLT5JMCIyIeL3YxL3tyZXNv",
"dXJjZT0qKn06Z2V0SWFtUG9saWN5OgEqEpoBChJUZXN0SWFtUGVybWlzc2lv",
"bnMSKC5nb29nbGUuaWFtLnYxLlRlc3RJYW1QZXJtaXNzaW9uc1JlcXVlc3Qa",
"KS5nb29nbGUuaWFtLnYxLlRlc3RJYW1QZXJtaXNzaW9uc1Jlc3BvbnNlIi+C",
"0+STAikiJC92MS97cmVzb3VyY2U9Kip9OnRlc3RJYW1QZXJtaXNzaW9uczoB",
"KhoeykEbaWFtLW1ldGEtYXBpLmdvb2dsZWFwaXMuY29tQoYBChFjb20uZ29v",
"Z2xlLmlhbS52MUIOSWFtUG9saWN5UHJvdG9QAVowZ29vZ2xlLmdvbGFuZy5v",
"cmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9pYW0vdjE7aWFt+AEBqgITR29vZ2xl",
"LkNsb3VkLklhbS5WMcoCE0dvb2dsZVxDbG91ZFxJYW1cVjFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.ResourceReflection.Descriptor, global::Google.Cloud.Iam.V1.PolicyReflection.Descriptor, global::Google.Api.AnnotationsReflection.Descriptor, },
new pbr::FileDescriptor[] { global::Google.Cloud.Iam.V1.OptionsReflection.Descriptor, global::Google.Cloud.Iam.V1.PolicyReflection.Descriptor, global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Iam.V1.SetIamPolicyRequest), global::Google.Cloud.Iam.V1.SetIamPolicyRequest.Parser, new[]{ "Resource", "Policy" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Iam.V1.GetIamPolicyRequest), global::Google.Cloud.Iam.V1.GetIamPolicyRequest.Parser, new[]{ "Resource" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Iam.V1.GetIamPolicyRequest), global::Google.Cloud.Iam.V1.GetIamPolicyRequest.Parser, new[]{ "Resource", "Options" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Iam.V1.TestIamPermissionsRequest), global::Google.Cloud.Iam.V1.TestIamPermissionsRequest.Parser, new[]{ "Resource", "Permissions" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Iam.V1.TestIamPermissionsResponse), global::Google.Cloud.Iam.V1.TestIamPermissionsResponse.Parser, new[]{ "Permissions" }, null, null, null)
}));
Expand Down Expand Up @@ -263,6 +265,7 @@ public sealed partial class GetIamPolicyRequest : pb::IMessage<GetIamPolicyReque
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetIamPolicyRequest(GetIamPolicyRequest other) : this() {
resource_ = other.resource_;
options_ = other.options_ != null ? other.options_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

Expand All @@ -286,6 +289,21 @@ public sealed partial class GetIamPolicyRequest : pb::IMessage<GetIamPolicyReque
}
}

/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 2;
private global::Google.Cloud.Iam.V1.GetPolicyOptions options_;
/// <summary>
/// OPTIONAL: A `GetPolicyOptions` object for specifying options to
/// `GetIamPolicy`. This field is only used by Cloud IAM.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Iam.V1.GetPolicyOptions Options {
get { return options_; }
set {
options_ = value;
}
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetIamPolicyRequest);
Expand All @@ -300,13 +318,15 @@ public sealed partial class GetIamPolicyRequest : pb::IMessage<GetIamPolicyReque
return true;
}
if (Resource != other.Resource) return false;
if (!object.Equals(Options, other.Options)) return false;
return Equals(_unknownFields, other._unknownFields);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Resource.Length != 0) hash ^= Resource.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
Expand All @@ -324,6 +344,10 @@ public sealed partial class GetIamPolicyRequest : pb::IMessage<GetIamPolicyReque
output.WriteRawTag(10);
output.WriteString(Resource);
}
if (options_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Options);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
Expand All @@ -335,6 +359,9 @@ public sealed partial class GetIamPolicyRequest : pb::IMessage<GetIamPolicyReque
if (Resource.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Resource);
}
if (options_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
Expand All @@ -349,6 +376,12 @@ public sealed partial class GetIamPolicyRequest : pb::IMessage<GetIamPolicyReque
if (other.Resource.Length != 0) {
Resource = other.Resource;
}
if (other.options_ != null) {
if (options_ == null) {
options_ = new global::Google.Cloud.Iam.V1.GetPolicyOptions();
}
Options.MergeFrom(other.Options);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

Expand All @@ -364,6 +397,13 @@ public sealed partial class GetIamPolicyRequest : pb::IMessage<GetIamPolicyReque
Resource = input.ReadString();
break;
}
case 18: {
if (options_ == null) {
options_ = new global::Google.Cloud.Iam.V1.GetPolicyOptions();
}
input.ReadMessage(options_);
break;
}
}
}
}
Expand Down
186 changes: 186 additions & 0 deletions apis/Google.Cloud.Iam.V1/Google.Cloud.Iam.V1/Options.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/iam/v1/options.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Cloud.Iam.V1 {

/// <summary>Holder for reflection information generated from google/iam/v1/options.proto</summary>
public static partial class OptionsReflection {

#region Descriptor
/// <summary>File descriptor for google/iam/v1/options.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;

static OptionsReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chtnb29nbGUvaWFtL3YxL29wdGlvbnMucHJvdG8SDWdvb2dsZS5pYW0udjEa",
"HGdvb2dsZS9hcGkvYW5ub3RhdGlvbnMucHJvdG8iNAoQR2V0UG9saWN5T3B0",
"aW9ucxIgChhyZXF1ZXN0ZWRfcG9saWN5X3ZlcnNpb24YASABKAVChAEKEWNv",
"bS5nb29nbGUuaWFtLnYxQgxPcHRpb25zUHJvdG9QAVowZ29vZ2xlLmdvbGFu",
"Zy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9pYW0vdjE7aWFt+AEBqgITR29v",
"Z2xlLkNsb3VkLklhbS5WMcoCE0dvb2dsZVxDbG91ZFxJYW1cVjFiBnByb3Rv",
"Mw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Iam.V1.GetPolicyOptions), global::Google.Cloud.Iam.V1.GetPolicyOptions.Parser, new[]{ "RequestedPolicyVersion" }, null, null, null)
}));
}
#endregion

}
#region Messages
/// <summary>
/// Encapsulates settings provided to GetIamPolicy.
/// </summary>
public sealed partial class GetPolicyOptions : pb::IMessage<GetPolicyOptions> {
private static readonly pb::MessageParser<GetPolicyOptions> _parser = new pb::MessageParser<GetPolicyOptions>(() => new GetPolicyOptions());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GetPolicyOptions> Parser { get { return _parser; } }

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Cloud.Iam.V1.OptionsReflection.Descriptor.MessageTypes[0]; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetPolicyOptions() {
OnConstruction();
}

partial void OnConstruction();

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetPolicyOptions(GetPolicyOptions other) : this() {
requestedPolicyVersion_ = other.requestedPolicyVersion_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetPolicyOptions Clone() {
return new GetPolicyOptions(this);
}

/// <summary>Field number for the "requested_policy_version" field.</summary>
public const int RequestedPolicyVersionFieldNumber = 1;
private int requestedPolicyVersion_;
/// <summary>
/// Optional. The policy format version to be returned.
/// Acceptable values are 0 and 1.
/// If the value is 0, or the field is omitted, policy format version 1 will be
/// returned.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int RequestedPolicyVersion {
get { return requestedPolicyVersion_; }
set {
requestedPolicyVersion_ = value;
}
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetPolicyOptions);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GetPolicyOptions other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (RequestedPolicyVersion != other.RequestedPolicyVersion) return false;
return Equals(_unknownFields, other._unknownFields);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (RequestedPolicyVersion != 0) hash ^= RequestedPolicyVersion.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (RequestedPolicyVersion != 0) {
output.WriteRawTag(8);
output.WriteInt32(RequestedPolicyVersion);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (RequestedPolicyVersion != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(RequestedPolicyVersion);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GetPolicyOptions other) {
if (other == null) {
return;
}
if (other.RequestedPolicyVersion != 0) {
RequestedPolicyVersion = other.RequestedPolicyVersion;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
RequestedPolicyVersion = input.ReadInt32();
break;
}
}
}
}

}

#endregion

}

#endregion Designer generated code

0 comments on commit ab0fe73

Please sign in to comment.