Skip to content

Commit

Permalink
feat: add client library for KMS Autokey service, which enables autom…
Browse files Browse the repository at this point in the history
…ated KMS key provision and management

PiperOrigin-RevId: 631565226

Source-Link: googleapis/googleapis@e5b8ffa

Source-Link: googleapis/googleapis-gen@cae62d4
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuS21zLlYxLy5Pd2xCb3QueWFtbCIsImgiOiJjYWU2MmQ0ZmIxYjZiN2Q2OTVmZTVmNmRlNjcxMWM4NWRkZjBhYmQ4In0=
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed May 8, 2024
1 parent 1d7f067 commit 5ff96b3
Show file tree
Hide file tree
Showing 48 changed files with 9,978 additions and 0 deletions.
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 cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_async_flattened]
using Google.Cloud.Kms.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for GetAutokeyConfigAsync</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 GetAutokeyConfigAsync()
{
// Create client
AutokeyAdminClient autokeyAdminClient = await AutokeyAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]/autokeyConfig";
// Make the request
AutokeyConfig response = await autokeyAdminClient.GetAutokeyConfigAsync(name);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// 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 cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_async]
using Google.Cloud.Kms.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for GetAutokeyConfigAsync</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 GetAutokeyConfigRequestObjectAsync()
{
// Create client
AutokeyAdminClient autokeyAdminClient = await AutokeyAdminClient.CreateAsync();
// Initialize request argument(s)
GetAutokeyConfigRequest request = new GetAutokeyConfigRequest
{
AutokeyConfigName = AutokeyConfigName.FromFolder("[FOLDER]"),
};
// Make the request
AutokeyConfig response = await autokeyAdminClient.GetAutokeyConfigAsync(request);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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 cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync]
using Google.Cloud.Kms.V1;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for GetAutokeyConfig</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 GetAutokeyConfigRequestObject()
{
// Create client
AutokeyAdminClient autokeyAdminClient = AutokeyAdminClient.Create();
// Initialize request argument(s)
GetAutokeyConfigRequest request = new GetAutokeyConfigRequest
{
AutokeyConfigName = AutokeyConfigName.FromFolder("[FOLDER]"),
};
// Make the request
AutokeyConfig response = autokeyAdminClient.GetAutokeyConfig(request);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync]
}
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 cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_async_flattened_resourceNames]
using Google.Cloud.Kms.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for GetAutokeyConfigAsync</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 GetAutokeyConfigResourceNamesAsync()
{
// Create client
AutokeyAdminClient autokeyAdminClient = await AutokeyAdminClient.CreateAsync();
// Initialize request argument(s)
AutokeyConfigName name = AutokeyConfigName.FromFolder("[FOLDER]");
// Make the request
AutokeyConfig response = await autokeyAdminClient.GetAutokeyConfigAsync(name);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// 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 cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync_flattened_resourceNames]
using Google.Cloud.Kms.V1;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for GetAutokeyConfig</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 GetAutokeyConfigResourceNames()
{
// Create client
AutokeyAdminClient autokeyAdminClient = AutokeyAdminClient.Create();
// Initialize request argument(s)
AutokeyConfigName name = AutokeyConfigName.FromFolder("[FOLDER]");
// Make the request
AutokeyConfig response = autokeyAdminClient.GetAutokeyConfig(name);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// 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 cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync_flattened]
using Google.Cloud.Kms.V1;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for GetAutokeyConfig</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 GetAutokeyConfig()
{
// Create client
AutokeyAdminClient autokeyAdminClient = AutokeyAdminClient.Create();
// Initialize request argument(s)
string name = "folders/[FOLDER]/autokeyConfig";
// Make the request
AutokeyConfig response = autokeyAdminClient.GetAutokeyConfig(name);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_GetAutokeyConfig_sync_flattened]
}
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 cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_async_flattened]
using Google.Cloud.Kms.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for ShowEffectiveAutokeyConfigAsync</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 ShowEffectiveAutokeyConfigAsync()
{
// Create client
AutokeyAdminClient autokeyAdminClient = await AutokeyAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
ShowEffectiveAutokeyConfigResponse response = await autokeyAdminClient.ShowEffectiveAutokeyConfigAsync(parent);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_async_flattened]
}
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 cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_async]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Kms.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedAutokeyAdminClientSnippets
{
/// <summary>Snippet for ShowEffectiveAutokeyConfigAsync</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 ShowEffectiveAutokeyConfigRequestObjectAsync()
{
// Create client
AutokeyAdminClient autokeyAdminClient = await AutokeyAdminClient.CreateAsync();
// Initialize request argument(s)
ShowEffectiveAutokeyConfigRequest request = new ShowEffectiveAutokeyConfigRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
ShowEffectiveAutokeyConfigResponse response = await autokeyAdminClient.ShowEffectiveAutokeyConfigAsync(request);
}
}
// [END cloudkms_v1_generated_AutokeyAdmin_ShowEffectiveAutokeyConfig_async]
}
Loading

0 comments on commit 5ff96b3

Please sign in to comment.