Skip to content

Commit

Permalink
feat: Add support for multi region encryption config
Browse files Browse the repository at this point in the history
docs: fix linting for several doc comments
PiperOrigin-RevId: 630422337

Source-Link: googleapis/googleapis@65db386

Source-Link: googleapis/googleapis-gen@b798ca9
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3Bhbm5lci5BZG1pbi5EYXRhYmFzZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiYjc5OGNhOWY1NmUyYWQzZTBkMTQ5ODJiNjhiNjcyNGQxYzNkNjJiNSJ9
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed May 3, 2024
1 parent 31261d4 commit bb95bbf
Show file tree
Hide file tree
Showing 8 changed files with 1,006 additions and 636 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,14 @@ public CryptoKeyName KmsKeyNameAsCryptoKeyName
get => string.IsNullOrEmpty(KmsKeyName) ? null : CryptoKeyName.Parse(KmsKeyName, allowUnparsed: true);
set => KmsKeyName = value?.ToString() ?? "";
}

/// <summary>
/// <see cref="CryptoKeyName"/>-typed view over the <see cref="KmsKeyNames"/> resource name property.
/// </summary>
public gax::ResourceNameList<CryptoKeyName> KmsKeyNamesAsCryptoKeyNames
{
get => new gax::ResourceNameList<CryptoKeyName>(KmsKeyNames, s => string.IsNullOrEmpty(s) ? null : CryptoKeyName.Parse(s, allowUnparsed: true));
}
}

public partial class CopyBackupEncryptionConfig
Expand All @@ -466,5 +474,13 @@ public CryptoKeyName KmsKeyNameAsCryptoKeyName
get => string.IsNullOrEmpty(KmsKeyName) ? null : CryptoKeyName.Parse(KmsKeyName, allowUnparsed: true);
set => KmsKeyName = value?.ToString() ?? "";
}

/// <summary>
/// <see cref="CryptoKeyName"/>-typed view over the <see cref="KmsKeyNames"/> resource name property.
/// </summary>
public gax::ResourceNameList<CryptoKeyName> KmsKeyNamesAsCryptoKeyNames
{
get => new gax::ResourceNameList<CryptoKeyName>(KmsKeyNames, s => string.IsNullOrEmpty(s) ? null : CryptoKeyName.Parse(s, allowUnparsed: true));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,37 @@ public static partial class CommonReflection {
"bGUvcnBjL3N0YXR1cy5wcm90byKLAQoRT3BlcmF0aW9uUHJvZ3Jlc3MSGAoQ",
"cHJvZ3Jlc3NfcGVyY2VudBgBIAEoBRIuCgpzdGFydF90aW1lGAIgASgLMhou",
"Z29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIsCghlbmRfdGltZRgDIAEoCzIa",
"Lmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiUAoQRW5jcnlwdGlvbkNvbmZp",
"ZxI8CgxrbXNfa2V5X25hbWUYAiABKAlCJvpBIwohY2xvdWRrbXMuZ29vZ2xl",
"YXBpcy5jb20vQ3J5cHRvS2V5IsICCg5FbmNyeXB0aW9uSW5mbxJTCg9lbmNy",
"eXB0aW9uX3R5cGUYAyABKA4yNS5nb29nbGUuc3Bhbm5lci5hZG1pbi5kYXRh",
"YmFzZS52MS5FbmNyeXB0aW9uSW5mby5UeXBlQgPgQQMSMgoRZW5jcnlwdGlv",
"bl9zdGF0dXMYBCABKAsyEi5nb29nbGUucnBjLlN0YXR1c0ID4EEDEkkKD2tt",
"c19rZXlfdmVyc2lvbhgCIAEoCUIw4EED+kEqCihjbG91ZGttcy5nb29nbGVh",
"cGlzLmNvbS9DcnlwdG9LZXlWZXJzaW9uIlwKBFR5cGUSFAoQVFlQRV9VTlNQ",
"RUNJRklFRBAAEh0KGUdPT0dMRV9ERUZBVUxUX0VOQ1JZUFRJT04QARIfChtD",
"VVNUT01FUl9NQU5BR0VEX0VOQ1JZUFRJT04QAipcCg9EYXRhYmFzZURpYWxl",
"Y3QSIAocREFUQUJBU0VfRElBTEVDVF9VTlNQRUNJRklFRBAAEhcKE0dPT0dM",
"RV9TVEFOREFSRF9TUUwQARIOCgpQT1NUR1JFU1FMEAJCogQKJGNvbS5nb29n",
"bGUuc3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V5fepBpgEKKGNsb3Vka21zLmdvb2ds",
"ZWFwaXMuY29tL0NyeXB0b0tleVZlcnNpb24SenByb2plY3RzL3twcm9qZWN0",
"fS9sb2NhdGlvbnMve2xvY2F0aW9ufS9rZXlSaW5ncy97a2V5X3Jpbmd9L2Ny",
"eXB0b0tleXMve2NyeXB0b19rZXl9L2NyeXB0b0tleVZlcnNpb25zL3tjcnlw",
"dG9fa2V5X3ZlcnNpb259YgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Rpc.StatusReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Cloud.Spanner.Admin.Database.V1.DatabaseDialect), }, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Spanner.Admin.Database.V1.OperationProgress), global::Google.Cloud.Spanner.Admin.Database.V1.OperationProgress.Parser, new[]{ "ProgressPercent", "StartTime", "EndTime" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Spanner.Admin.Database.V1.EncryptionConfig), global::Google.Cloud.Spanner.Admin.Database.V1.EncryptionConfig.Parser, new[]{ "KmsKeyName" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Spanner.Admin.Database.V1.EncryptionConfig), global::Google.Cloud.Spanner.Admin.Database.V1.EncryptionConfig.Parser, new[]{ "KmsKeyName", "KmsKeyNames" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Spanner.Admin.Database.V1.EncryptionInfo), global::Google.Cloud.Spanner.Admin.Database.V1.EncryptionInfo.Parser, new[]{ "EncryptionType", "EncryptionStatus", "KmsKeyVersion" }, null, new[]{ typeof(global::Google.Cloud.Spanner.Admin.Database.V1.EncryptionInfo.Types.Type) }, null, null)
}));
}
Expand All @@ -78,7 +79,7 @@ public enum DatabaseDialect {
/// </summary>
[pbr::OriginalName("DATABASE_DIALECT_UNSPECIFIED")] Unspecified = 0,
/// <summary>
/// Google standard SQL.
/// GoogleSQL supported SQL.
/// </summary>
[pbr::OriginalName("GOOGLE_STANDARD_SQL")] GoogleStandardSql = 1,
/// <summary>
Expand Down Expand Up @@ -426,6 +427,7 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public EncryptionConfig(EncryptionConfig other) : this() {
kmsKeyName_ = other.kmsKeyName_;
kmsKeyNames_ = other.kmsKeyNames_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

Expand All @@ -452,6 +454,34 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
}
}

/// <summary>Field number for the "kms_key_names" field.</summary>
public const int KmsKeyNamesFieldNumber = 3;
private static readonly pb::FieldCodec<string> _repeated_kmsKeyNames_codec
= pb::FieldCodec.ForString(26);
private readonly pbc::RepeatedField<string> kmsKeyNames_ = new pbc::RepeatedField<string>();
/// <summary>
/// Specifies the KMS configuration for the one or more keys used to encrypt
/// the database. Values are of the form
/// `projects/&lt;project>/locations/&lt;location>/keyRings/&lt;key_ring>/cryptoKeys/&lt;kms_key_name>`.
///
/// The keys referenced by kms_key_names must fully cover all
/// regions of the database instance configuration. Some examples:
/// * For single region database instance configs, specify a single regional
/// location KMS key.
/// * For multi-regional database instance configs of type GOOGLE_MANAGED,
/// either specify a multi-regional location KMS key or multiple regional
/// location KMS keys that cover all regions in the instance config.
/// * For a database instance config of type USER_MANAGED, please specify only
/// regional location KMS keys to cover each region in the instance config.
/// Multi-regional location KMS keys are not supported for USER_MANAGED
/// instance configs.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<string> KmsKeyNames {
get { return kmsKeyNames_; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
Expand All @@ -468,6 +498,7 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
return true;
}
if (KmsKeyName != other.KmsKeyName) return false;
if(!kmsKeyNames_.Equals(other.kmsKeyNames_)) return false;
return Equals(_unknownFields, other._unknownFields);
}

Expand All @@ -476,6 +507,7 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
public override int GetHashCode() {
int hash = 1;
if (KmsKeyName.Length != 0) hash ^= KmsKeyName.GetHashCode();
hash ^= kmsKeyNames_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
Expand All @@ -498,6 +530,7 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
output.WriteRawTag(18);
output.WriteString(KmsKeyName);
}
kmsKeyNames_.WriteTo(output, _repeated_kmsKeyNames_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
Expand All @@ -512,6 +545,7 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
output.WriteRawTag(18);
output.WriteString(KmsKeyName);
}
kmsKeyNames_.WriteTo(ref output, _repeated_kmsKeyNames_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
Expand All @@ -525,6 +559,7 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
if (KmsKeyName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(KmsKeyName);
}
size += kmsKeyNames_.CalculateSize(_repeated_kmsKeyNames_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
Expand All @@ -540,6 +575,7 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
if (other.KmsKeyName.Length != 0) {
KmsKeyName = other.KmsKeyName;
}
kmsKeyNames_.Add(other.kmsKeyNames_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

Expand All @@ -559,6 +595,10 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
KmsKeyName = input.ReadString();
break;
}
case 26: {
kmsKeyNames_.AddEntriesFrom(input, _repeated_kmsKeyNames_codec);
break;
}
}
}
#endif
Expand All @@ -578,6 +618,10 @@ public sealed partial class EncryptionConfig : pb::IMessage<EncryptionConfig>
KmsKeyName = input.ReadString();
break;
}
case 26: {
kmsKeyNames_.AddEntriesFrom(ref input, _repeated_kmsKeyNames_codec);
break;
}
}
}
}
Expand Down Expand Up @@ -654,9 +698,9 @@ public sealed partial class EncryptionInfo : pb::IMessage<EncryptionInfo>
public const int EncryptionStatusFieldNumber = 4;
private global::Google.Rpc.Status encryptionStatus_;
/// <summary>
/// Output only. If present, the status of a recent encrypt/decrypt call on underlying data
/// for this database or backup. Regardless of status, data is always encrypted
/// at rest.
/// Output only. If present, the status of a recent encrypt/decrypt call on
/// underlying data for this database or backup. Regardless of status, data is
/// always encrypted at rest.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand All @@ -671,8 +715,8 @@ public sealed partial class EncryptionInfo : pb::IMessage<EncryptionInfo>
public const int KmsKeyVersionFieldNumber = 2;
private string kmsKeyVersion_ = "";
/// <summary>
/// Output only. A Cloud KMS key version that is being used to protect the database or
/// backup.
/// Output only. A Cloud KMS key version that is being used to protect the
/// database or backup.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,14 @@ public CryptoKeyName KmsKeyNameAsCryptoKeyName
get => string.IsNullOrEmpty(KmsKeyName) ? null : CryptoKeyName.Parse(KmsKeyName, allowUnparsed: true);
set => KmsKeyName = value?.ToString() ?? "";
}

/// <summary>
/// <see cref="CryptoKeyName"/>-typed view over the <see cref="KmsKeyNames"/> resource name property.
/// </summary>
public gax::ResourceNameList<CryptoKeyName> KmsKeyNamesAsCryptoKeyNames
{
get => new gax::ResourceNameList<CryptoKeyName>(KmsKeyNames, s => string.IsNullOrEmpty(s) ? null : CryptoKeyName.Parse(s, allowUnparsed: true));
}
}

public partial class EncryptionInfo
Expand Down

0 comments on commit bb95bbf

Please sign in to comment.