Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Google.Cloud.Memorystore.V1 and Google.Cloud.Memorystore.V1Beta #14130

Merged
merged 6 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
"apis/Google.Cloud.MediaTranslation.V1Beta1/Google.Cloud.MediaTranslation.V1Beta1/**",
"apis/Google.Cloud.Memcache.V1/Google.Cloud.Memcache.V1/**",
"apis/Google.Cloud.Memcache.V1Beta2/Google.Cloud.Memcache.V1Beta2/**",
"apis/Google.Cloud.Memorystore.V1/Google.Cloud.Memorystore.V1/**",
"apis/Google.Cloud.Memorystore.V1Beta/Google.Cloud.Memorystore.V1Beta/**",
"apis/Google.Cloud.Metastore.V1/Google.Cloud.Metastore.V1/**",
"apis/Google.Cloud.Metastore.V1Alpha/Google.Cloud.Metastore.V1Alpha/**",
"apis/Google.Cloud.Metastore.V1Beta/Google.Cloud.Metastore.V1Beta/**",
Expand Down
31 changes: 31 additions & 0 deletions apis/Google.Cloud.Memorystore.V1/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# Copyright 2025 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
#
# http://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.

squash: true

deep-remove-regex:
- /owl-bot-staging

deep-copy-regex:
- source: /google/cloud/memorystore/v1/.*-csharp/Google.Cloud.Memorystore.V1
dest: /owl-bot-staging/Google.Cloud.Memorystore.V1/Google.Cloud.Memorystore.V1
- source: /google/cloud/memorystore/v1/.*-csharp/Google.Cloud.Memorystore.V1.Snippets
dest: /owl-bot-staging/Google.Cloud.Memorystore.V1/Google.Cloud.Memorystore.V1.Snippets
- source: /google/cloud/memorystore/v1/.*-csharp/Google.Cloud.Memorystore.V1.GeneratedSnippets
dest: /owl-bot-staging/Google.Cloud.Memorystore.V1/Google.Cloud.Memorystore.V1.GeneratedSnippets
- source: /google/cloud/memorystore/v1/.*-csharp/gapic_metadata.json
dest: /owl-bot-staging/Google.Cloud.Memorystore.V1/gapic_metadata.json

api-name: Google.Cloud.Memorystore.V1
8 changes: 8 additions & 0 deletions apis/Google.Cloud.Memorystore.V1/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"distribution_name": "Google.Cloud.Memorystore.V1",
"release_level": "unreleased",
"client_documentation": "https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Memorystore.V1/latest",
"library_type": "GAPIC_AUTO",
"language": "dotnet",
"api_shortname": "memorystore"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>1701;1702;1705;xUnit2004;xUnit2013</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\tools\Google.Cloud.ClientTesting\Google.Cloud.ClientTesting.csproj" />
<ProjectReference Include="..\Google.Cloud.Memorystore.V1\Google.Cloud.Memorystore.V1.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NSubstitute" />
<PackageReference Include="System.Linq.Async" />
<PackageReference Include="Xunit.SkippableFact" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2025 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 memorystore_v1_generated_Memorystore_CreateInstance_async_flattened]
using Google.Cloud.Memorystore.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedMemorystoreClientSnippets
{
/// <summary>Snippet for CreateInstanceAsync</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 CreateInstanceAsync()
{
// Create client
MemorystoreClient memorystoreClient = await MemorystoreClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = await memorystoreClient.CreateInstanceAsync(parent, instance, instanceId);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, OperationMetadata> retrievedResponse = await memorystoreClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
}
}
// [END memorystore_v1_generated_Memorystore_CreateInstance_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright 2025 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 memorystore_v1_generated_Memorystore_CreateInstance_async]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Memorystore.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedMemorystoreClientSnippets
{
/// <summary>Snippet for CreateInstanceAsync</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 CreateInstanceRequestObjectAsync()
{
// Create client
MemorystoreClient memorystoreClient = await MemorystoreClient.CreateAsync();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
InstanceId = "",
Instance = new Instance(),
RequestId = "",
};
// Make the request
Operation<Instance, OperationMetadata> response = await memorystoreClient.CreateInstanceAsync(request);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, OperationMetadata> retrievedResponse = await memorystoreClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
}
}
// [END memorystore_v1_generated_Memorystore_CreateInstance_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2025 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 memorystore_v1_generated_Memorystore_CreateInstance_sync]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Memorystore.V1;
using Google.LongRunning;

public sealed partial class GeneratedMemorystoreClientSnippets
{
/// <summary>Snippet for CreateInstance</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 CreateInstanceRequestObject()
{
// Create client
MemorystoreClient memorystoreClient = MemorystoreClient.Create();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
InstanceId = "",
Instance = new Instance(),
RequestId = "",
};
// Make the request
Operation<Instance, OperationMetadata> response = memorystoreClient.CreateInstance(request);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Instance result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, OperationMetadata> retrievedResponse = memorystoreClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
}
}
// [END memorystore_v1_generated_Memorystore_CreateInstance_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2025 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 memorystore_v1_generated_Memorystore_CreateInstance_async_flattened_resourceNames]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Memorystore.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedMemorystoreClientSnippets
{
/// <summary>Snippet for CreateInstanceAsync</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 CreateInstanceResourceNamesAsync()
{
// Create client
MemorystoreClient memorystoreClient = await MemorystoreClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = await memorystoreClient.CreateInstanceAsync(parent, instance, instanceId);

// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Instance result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Instance, OperationMetadata> retrievedResponse = await memorystoreClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
}
}
// [END memorystore_v1_generated_Memorystore_CreateInstance_async_flattened_resourceNames]
}
Loading
Loading