diff --git a/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.cs b/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.cs
index e24d55e4..0ddc4678 100644
--- a/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.cs
+++ b/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.cs
@@ -1,4 +1,4 @@
-// Copyright 2023 Google LLC
+// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -84420,7 +84420,7 @@ public class TrawlerFetchReplyDataPartialResponse : Google.Apis.Requests.IDirect
/// Any ETag seen in the headers
[Newtonsoft.Json.JsonPropertyAttribute("ETag")]
- public virtual string ETag { get; set; }
+ public virtual string ETag__ { get; set; }
/// ID which links all partial fetches for this url
[Newtonsoft.Json.JsonPropertyAttribute("FetchID")]
diff --git a/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.csproj b/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.csproj
index ab7c0058..0c09ff52 100644
--- a/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.csproj
+++ b/Google.Api.Generator.Rest.Tests/GoldenTestData/Google.Apis.Contentwarehouse.v1/Google.Apis.Contentwarehouse.v1.csproj
@@ -3,9 +3,9 @@
Google.Apis.Contentwarehouse.v1 Client Library
- 1.62.0.3165
+ 1.54.0.3165
Google LLC
- Copyright 2023 Google LLC
+ Copyright 2022 Google LLC
Google
https://github.com/google/google-api-dotnet-client
Apache-2.0
@@ -57,8 +57,8 @@
-
-
+
+
diff --git a/Google.Api.Generator.Rest/Models/DataPropertyModel.cs b/Google.Api.Generator.Rest/Models/DataPropertyModel.cs
index 0ce3c138..110b8c78 100644
--- a/Google.Api.Generator.Rest/Models/DataPropertyModel.cs
+++ b/Google.Api.Generator.Rest/Models/DataPropertyModel.cs
@@ -58,6 +58,15 @@ public DataPropertyModel(DataModel parent, string name, JsonSchema schema)
{
PropertyName += "Value";
}
+ // Avoid collisions with our own ETag property in data models.
+ // Note that the standard etag field is named with all lowercase.
+ // Other etag fields named with different casing do not represent the
+ // resource version, instead they are properties of the resource itself,
+ // for instance, if the resource represents a request or response.
+ if (name != "etag" && name.Equals("etag", StringComparison.OrdinalIgnoreCase))
+ {
+ PropertyName = "ETag__";
+ }
_schema = schema;
}