Skip to content

Commit

Permalink
feat: add schema evolution methods and fields
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 500819578

Source-Link: googleapis/googleapis@05a375f

Source-Link: googleapis/googleapis-gen@303c959
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuUHViU3ViLlYxLy5Pd2xCb3QueWFtbCIsImgiOiIzMDNjOTU5MmM0OThkYzAyNDMyZGFhMjlhY2I0NmQ2N2RlY2ZiMGMyIn0=
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Jan 10, 2023
1 parent f868bc8 commit 4003c4d
Show file tree
Hide file tree
Showing 32 changed files with 5,746 additions and 397 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_CommitSchema_async_flattened]
using Google.Cloud.PubSub.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for CommitSchemaAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task CommitSchemaAsync()
{
// Create client
SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/schemas/[SCHEMA]";
Schema schema = new Schema();
// Make the request
Schema response = await schemaServiceClient.CommitSchemaAsync(name, schema);
}
}
// [END pubsub_v1_generated_SchemaService_CommitSchema_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_CommitSchema_async]
using Google.Cloud.PubSub.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for CommitSchemaAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task CommitSchemaRequestObjectAsync()
{
// Create client
SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();
// Initialize request argument(s)
CommitSchemaRequest request = new CommitSchemaRequest
{
SchemaName = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"),
Schema = new Schema(),
};
// Make the request
Schema response = await schemaServiceClient.CommitSchemaAsync(request);
}
}
// [END pubsub_v1_generated_SchemaService_CommitSchema_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_CommitSchema_sync]
using Google.Cloud.PubSub.V1;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for CommitSchema</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void CommitSchemaRequestObject()
{
// Create client
SchemaServiceClient schemaServiceClient = SchemaServiceClient.Create();
// Initialize request argument(s)
CommitSchemaRequest request = new CommitSchemaRequest
{
SchemaName = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"),
Schema = new Schema(),
};
// Make the request
Schema response = schemaServiceClient.CommitSchema(request);
}
}
// [END pubsub_v1_generated_SchemaService_CommitSchema_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_CommitSchema_async_flattened_resourceNames]
using Google.Cloud.PubSub.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for CommitSchemaAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task CommitSchemaResourceNamesAsync()
{
// Create client
SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();
// Initialize request argument(s)
SchemaName name = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]");
Schema schema = new Schema();
// Make the request
Schema response = await schemaServiceClient.CommitSchemaAsync(name, schema);
}
}
// [END pubsub_v1_generated_SchemaService_CommitSchema_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_CommitSchema_sync_flattened_resourceNames]
using Google.Cloud.PubSub.V1;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for CommitSchema</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void CommitSchemaResourceNames()
{
// Create client
SchemaServiceClient schemaServiceClient = SchemaServiceClient.Create();
// Initialize request argument(s)
SchemaName name = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]");
Schema schema = new Schema();
// Make the request
Schema response = schemaServiceClient.CommitSchema(name, schema);
}
}
// [END pubsub_v1_generated_SchemaService_CommitSchema_sync_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_CommitSchema_sync_flattened]
using Google.Cloud.PubSub.V1;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for CommitSchema</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void CommitSchema()
{
// Create client
SchemaServiceClient schemaServiceClient = SchemaServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/schemas/[SCHEMA]";
Schema schema = new Schema();
// Make the request
Schema response = schemaServiceClient.CommitSchema(name, schema);
}
}
// [END pubsub_v1_generated_SchemaService_CommitSchema_sync_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_DeleteSchemaRevision_async_flattened]
using Google.Cloud.PubSub.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for DeleteSchemaRevisionAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task DeleteSchemaRevisionAsync()
{
// Create client
SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/schemas/[SCHEMA]";
string revisionId = "";
// Make the request
Schema response = await schemaServiceClient.DeleteSchemaRevisionAsync(name, revisionId);
}
}
// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace Google.Cloud.PubSub.V1.Snippets
{
// [START pubsub_v1_generated_SchemaService_DeleteSchemaRevision_async]
using Google.Cloud.PubSub.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSchemaServiceClientSnippets
{
/// <summary>Snippet for DeleteSchemaRevisionAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task DeleteSchemaRevisionRequestObjectAsync()
{
// Create client
SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSchemaRevisionRequest request = new DeleteSchemaRevisionRequest
{
SchemaName = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"),
RevisionId = "",
};
// Make the request
Schema response = await schemaServiceClient.DeleteSchemaRevisionAsync(request);
}
}
// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_async]
}

0 comments on commit 4003c4d

Please sign in to comment.