Skip to content

Commit

Permalink
docs: update comment for PROFILE QueryMode
Browse files Browse the repository at this point in the history
feat: add new QueryMode enum values (WITH_STATS, WITH_PLAN_AND_STATS)

PiperOrigin-RevId: 680628448

Source-Link: googleapis/googleapis@72a5151

Source-Link: googleapis/googleapis-gen@146c3e8
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3Bhbm5lci5WMS8uT3dsQm90LnlhbWwiLCJoIjoiMTQ2YzNlOGRhODc3Mzg4MDQ3MDliN2YzZDI2NGE4ZTMzYWUzOGQ3MSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Sep 30, 2024
1 parent 963221d commit c244a4e
Show file tree
Hide file tree
Showing 86 changed files with 33,570 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../Google.Cloud.Spanner.V1/Google.Cloud.Spanner.V1.csproj" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2024 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 GoogleCSharpSnippets
{
// [START spanner_v1_generated_Spanner_BatchCreateSessions_async_flattened]
using Google.Cloud.Spanner.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSpannerClientSnippets
{
/// <summary>Snippet for BatchCreateSessionsAsync</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 BatchCreateSessionsAsync()
{
// Create client
SpannerClient spannerClient = await SpannerClient.CreateAsync();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
int sessionCount = 0;
// Make the request
BatchCreateSessionsResponse response = await spannerClient.BatchCreateSessionsAsync(database, sessionCount);
}
}
// [END spanner_v1_generated_Spanner_BatchCreateSessions_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2024 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 GoogleCSharpSnippets
{
// [START spanner_v1_generated_Spanner_BatchCreateSessions_async]
using Google.Cloud.Spanner.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSpannerClientSnippets
{
/// <summary>Snippet for BatchCreateSessionsAsync</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 BatchCreateSessionsRequestObjectAsync()
{
// Create client
SpannerClient spannerClient = await SpannerClient.CreateAsync();
// Initialize request argument(s)
BatchCreateSessionsRequest request = new BatchCreateSessionsRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
SessionTemplate = new Session(),
SessionCount = 0,
};
// Make the request
BatchCreateSessionsResponse response = await spannerClient.BatchCreateSessionsAsync(request);
}
}
// [END spanner_v1_generated_Spanner_BatchCreateSessions_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright 2024 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 GoogleCSharpSnippets
{
// [START spanner_v1_generated_Spanner_BatchCreateSessions_sync]
using Google.Cloud.Spanner.V1;

public sealed partial class GeneratedSpannerClientSnippets
{
/// <summary>Snippet for BatchCreateSessions</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 BatchCreateSessionsRequestObject()
{
// Create client
SpannerClient spannerClient = SpannerClient.Create();
// Initialize request argument(s)
BatchCreateSessionsRequest request = new BatchCreateSessionsRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
SessionTemplate = new Session(),
SessionCount = 0,
};
// Make the request
BatchCreateSessionsResponse response = spannerClient.BatchCreateSessions(request);
}
}
// [END spanner_v1_generated_Spanner_BatchCreateSessions_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2024 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 GoogleCSharpSnippets
{
// [START spanner_v1_generated_Spanner_BatchCreateSessions_async_flattened_resourceNames]
using Google.Cloud.Spanner.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSpannerClientSnippets
{
/// <summary>Snippet for BatchCreateSessionsAsync</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 BatchCreateSessionsResourceNamesAsync()
{
// Create client
SpannerClient spannerClient = await SpannerClient.CreateAsync();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
int sessionCount = 0;
// Make the request
BatchCreateSessionsResponse response = await spannerClient.BatchCreateSessionsAsync(database, sessionCount);
}
}
// [END spanner_v1_generated_Spanner_BatchCreateSessions_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2024 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 GoogleCSharpSnippets
{
// [START spanner_v1_generated_Spanner_BatchCreateSessions_sync_flattened_resourceNames]
using Google.Cloud.Spanner.V1;

public sealed partial class GeneratedSpannerClientSnippets
{
/// <summary>Snippet for BatchCreateSessions</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 BatchCreateSessionsResourceNames()
{
// Create client
SpannerClient spannerClient = SpannerClient.Create();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
int sessionCount = 0;
// Make the request
BatchCreateSessionsResponse response = spannerClient.BatchCreateSessions(database, sessionCount);
}
}
// [END spanner_v1_generated_Spanner_BatchCreateSessions_sync_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2024 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 GoogleCSharpSnippets
{
// [START spanner_v1_generated_Spanner_BatchCreateSessions_sync_flattened]
using Google.Cloud.Spanner.V1;

public sealed partial class GeneratedSpannerClientSnippets
{
/// <summary>Snippet for BatchCreateSessions</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 BatchCreateSessions()
{
// Create client
SpannerClient spannerClient = SpannerClient.Create();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
int sessionCount = 0;
// Make the request
BatchCreateSessionsResponse response = spannerClient.BatchCreateSessions(database, sessionCount);
}
}
// [END spanner_v1_generated_Spanner_BatchCreateSessions_sync_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2024 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 GoogleCSharpSnippets
{
// [START spanner_v1_generated_Spanner_BatchWrite_sync]
using Google.Api.Gax.Grpc;
using Google.Cloud.Spanner.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSpannerClientSnippets
{
/// <summary>Snippet for BatchWrite</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 BatchWriteRequestObject()
{
// Create client
SpannerClient spannerClient = SpannerClient.Create();
// Initialize request argument(s)
BatchWriteRequest request = new BatchWriteRequest
{
SessionAsSessionName = SessionName.FromProjectInstanceDatabaseSession("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]"),
RequestOptions = new RequestOptions(),
MutationGroups =
{
new BatchWriteRequest.Types.MutationGroup(),
},
ExcludeTxnFromChangeStreams = false,
};
// Make the request, returning a streaming response
using SpannerClient.BatchWriteStream response = spannerClient.BatchWrite(request);

// Read streaming responses from server until complete
// Note that C# 8 code can use await foreach
AsyncResponseStream<BatchWriteResponse> responseStream = response.GetResponseStream();
while (await responseStream.MoveNextAsync())
{
BatchWriteResponse responseItem = responseStream.Current;
// Do something with streamed response
}
// The response stream has completed
}
}
// [END spanner_v1_generated_Spanner_BatchWrite_sync]
}
Loading

0 comments on commit c244a4e

Please sign in to comment.