Skip to content

Commit

Permalink
feat: released securitycenter/v1 SHA custom modules cloud libraries: …
Browse files Browse the repository at this point in the history
…Create, Get, List, Update, Delete

The Security Health Analytics (SHA) custom modules API is now released for general availability track. Create, Get, GetEffective, List, ListEffective, ListDescendant, Update, and Delete are available in the cloud client library.

PiperOrigin-RevId: 523462834

Source-Link: googleapis/googleapis@b7b3dfd

Source-Link: googleapis/googleapis-gen@9b679ec
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU2VjdXJpdHlDZW50ZXIuVjEvLk93bEJvdC55YW1sIiwiaCI6IjliNjc5ZWMwMmE3ZTE2ZGY5ZjBlN2Y2NmUwNzdlMzc5ZWZkMjVhZDQifQ==
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Apr 12, 2023
1 parent b723508 commit 96e3a2e
Show file tree
Hide file tree
Showing 69 changed files with 17,774 additions and 2,888 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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async_flattened]
using Google.Cloud.SecurityCenter.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for CreateSecurityHealthAnalyticsCustomModuleAsync</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 CreateSecurityHealthAnalyticsCustomModuleAsync()
{
// Create client
SecurityCenterClient securityCenterClient = await SecurityCenterClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/securityHealthAnalyticsSettings";
SecurityHealthAnalyticsCustomModule securityHealthAnalyticsCustomModule = new SecurityHealthAnalyticsCustomModule();
// Make the request
SecurityHealthAnalyticsCustomModule response = await securityCenterClient.CreateSecurityHealthAnalyticsCustomModuleAsync(parent, securityHealthAnalyticsCustomModule);
}
}
// [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async]
using Google.Cloud.SecurityCenter.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for CreateSecurityHealthAnalyticsCustomModuleAsync</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 CreateSecurityHealthAnalyticsCustomModuleRequestObjectAsync()
{
// Create client
SecurityCenterClient securityCenterClient = await SecurityCenterClient.CreateAsync();
// Initialize request argument(s)
CreateSecurityHealthAnalyticsCustomModuleRequest request = new CreateSecurityHealthAnalyticsCustomModuleRequest
{
ParentAsSecurityHealthAnalyticsSettingsName = SecurityHealthAnalyticsSettingsName.FromOrganization("[ORGANIZATION]"),
SecurityHealthAnalyticsCustomModule = new SecurityHealthAnalyticsCustomModule(),
};
// Make the request
SecurityHealthAnalyticsCustomModule response = await securityCenterClient.CreateSecurityHealthAnalyticsCustomModuleAsync(request);
}
}
// [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync]
using Google.Cloud.SecurityCenter.V1;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for CreateSecurityHealthAnalyticsCustomModule</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 CreateSecurityHealthAnalyticsCustomModuleRequestObject()
{
// Create client
SecurityCenterClient securityCenterClient = SecurityCenterClient.Create();
// Initialize request argument(s)
CreateSecurityHealthAnalyticsCustomModuleRequest request = new CreateSecurityHealthAnalyticsCustomModuleRequest
{
ParentAsSecurityHealthAnalyticsSettingsName = SecurityHealthAnalyticsSettingsName.FromOrganization("[ORGANIZATION]"),
SecurityHealthAnalyticsCustomModule = new SecurityHealthAnalyticsCustomModule(),
};
// Make the request
SecurityHealthAnalyticsCustomModule response = securityCenterClient.CreateSecurityHealthAnalyticsCustomModule(request);
}
}
// [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_async_flattened_resourceNames]
using Google.Cloud.SecurityCenter.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for CreateSecurityHealthAnalyticsCustomModuleAsync</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 CreateSecurityHealthAnalyticsCustomModuleResourceNamesAsync()
{
// Create client
SecurityCenterClient securityCenterClient = await SecurityCenterClient.CreateAsync();
// Initialize request argument(s)
SecurityHealthAnalyticsSettingsName parent = SecurityHealthAnalyticsSettingsName.FromOrganization("[ORGANIZATION]");
SecurityHealthAnalyticsCustomModule securityHealthAnalyticsCustomModule = new SecurityHealthAnalyticsCustomModule();
// Make the request
SecurityHealthAnalyticsCustomModule response = await securityCenterClient.CreateSecurityHealthAnalyticsCustomModuleAsync(parent, securityHealthAnalyticsCustomModule);
}
}
// [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync_flattened_resourceNames]
using Google.Cloud.SecurityCenter.V1;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for CreateSecurityHealthAnalyticsCustomModule</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 CreateSecurityHealthAnalyticsCustomModuleResourceNames()
{
// Create client
SecurityCenterClient securityCenterClient = SecurityCenterClient.Create();
// Initialize request argument(s)
SecurityHealthAnalyticsSettingsName parent = SecurityHealthAnalyticsSettingsName.FromOrganization("[ORGANIZATION]");
SecurityHealthAnalyticsCustomModule securityHealthAnalyticsCustomModule = new SecurityHealthAnalyticsCustomModule();
// Make the request
SecurityHealthAnalyticsCustomModule response = securityCenterClient.CreateSecurityHealthAnalyticsCustomModule(parent, securityHealthAnalyticsCustomModule);
}
}
// [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync_flattened]
using Google.Cloud.SecurityCenter.V1;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for CreateSecurityHealthAnalyticsCustomModule</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 CreateSecurityHealthAnalyticsCustomModule()
{
// Create client
SecurityCenterClient securityCenterClient = SecurityCenterClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/securityHealthAnalyticsSettings";
SecurityHealthAnalyticsCustomModule securityHealthAnalyticsCustomModule = new SecurityHealthAnalyticsCustomModule();
// Make the request
SecurityHealthAnalyticsCustomModule response = securityCenterClient.CreateSecurityHealthAnalyticsCustomModule(parent, securityHealthAnalyticsCustomModule);
}
}
// [END securitycenter_v1_generated_SecurityCenter_CreateSecurityHealthAnalyticsCustomModule_sync_flattened]
}
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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async_flattened]
using Google.Cloud.SecurityCenter.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for DeleteSecurityHealthAnalyticsCustomModuleAsync</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 DeleteSecurityHealthAnalyticsCustomModuleAsync()
{
// Create client
SecurityCenterClient securityCenterClient = await SecurityCenterClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/securityHealthAnalyticsSettings/customModules/[CUSTOM_MODULE]";
// Make the request
await securityCenterClient.DeleteSecurityHealthAnalyticsCustomModuleAsync(name);
}
}
// [END securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async_flattened]
}
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.SecurityCenter.V1.Snippets
{
// [START securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async]
using Google.Cloud.SecurityCenter.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedSecurityCenterClientSnippets
{
/// <summary>Snippet for DeleteSecurityHealthAnalyticsCustomModuleAsync</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 DeleteSecurityHealthAnalyticsCustomModuleRequestObjectAsync()
{
// Create client
SecurityCenterClient securityCenterClient = await SecurityCenterClient.CreateAsync();
// Initialize request argument(s)
DeleteSecurityHealthAnalyticsCustomModuleRequest request = new DeleteSecurityHealthAnalyticsCustomModuleRequest
{
SecurityHealthAnalyticsCustomModuleName = SecurityHealthAnalyticsCustomModuleName.FromOrganizationCustomModule("[ORGANIZATION]", "[CUSTOM_MODULE]"),
};
// Make the request
await securityCenterClient.DeleteSecurityHealthAnalyticsCustomModuleAsync(request);
}
}
// [END securitycenter_v1_generated_SecurityCenter_DeleteSecurityHealthAnalyticsCustomModule_async]
}
Loading

0 comments on commit 96e3a2e

Please sign in to comment.