Skip to content

Commit

Permalink
feat: Update Logging API with latest changes
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 429289471

Source-Link: googleapis/googleapis@acd5f89

Source-Link: googleapis/googleapis-gen@8a12622
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuTG9nZ2luZy5WMi8uT3dsQm90LnlhbWwiLCJoIjoiOGExMjYyMjUzNmFlMmU5YTg5NzgxOThhMTUxZTg5MjM0YjgzOWIyMCJ9
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Feb 17, 2022
1 parent b29bee2 commit 644279c
Show file tree
Hide file tree
Showing 31 changed files with 7,230 additions and 1,551 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_async]
using Google.Cloud.Logging.V2;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for CopyLogEntriesAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task CopyLogEntriesRequestObjectAsync()
{
// Create client
ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync();
// Initialize request argument(s)
CopyLogEntriesRequest request = new CopyLogEntriesRequest
{
Name = "",
Filter = "",
Destination = "",
};
// Make the request
Operation<CopyLogEntriesResponse, CopyLogEntriesMetadata> response = await configServiceV2Client.CopyLogEntriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<CopyLogEntriesResponse, CopyLogEntriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CopyLogEntriesResponse 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<CopyLogEntriesResponse, CopyLogEntriesMetadata> retrievedResponse = await configServiceV2Client.PollOnceCopyLogEntriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
CopyLogEntriesResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync]
using Google.Cloud.Logging.V2;
using Google.LongRunning;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for CopyLogEntries</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void CopyLogEntriesRequestObject()
{
// Create client
ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create();
// Initialize request argument(s)
CopyLogEntriesRequest request = new CopyLogEntriesRequest
{
Name = "",
Filter = "",
Destination = "",
};
// Make the request
Operation<CopyLogEntriesResponse, CopyLogEntriesMetadata> response = configServiceV2Client.CopyLogEntries(request);

// Poll until the returned long-running operation is complete
Operation<CopyLogEntriesResponse, CopyLogEntriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
CopyLogEntriesResponse 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<CopyLogEntriesResponse, CopyLogEntriesMetadata> retrievedResponse = configServiceV2Client.PollOnceCopyLogEntries(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
CopyLogEntriesResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_GetSettings_async_flattened]
using Google.Cloud.Logging.V2;
using System.Threading.Tasks;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for GetSettingsAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task GetSettingsAsync()
{
// Create client
ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/settings";
// Make the request
Settings response = await configServiceV2Client.GetSettingsAsync(name);
}
}
// [END logging_v2_generated_ConfigServiceV2_GetSettings_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_GetSettings_async]
using Google.Cloud.Logging.V2;
using System.Threading.Tasks;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for GetSettingsAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task GetSettingsRequestObjectAsync()
{
// Create client
ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync();
// Initialize request argument(s)
GetSettingsRequest request = new GetSettingsRequest
{
SettingsName = SettingsName.FromProject("[PROJECT]"),
};
// Make the request
Settings response = await configServiceV2Client.GetSettingsAsync(request);
}
}
// [END logging_v2_generated_ConfigServiceV2_GetSettings_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_GetSettings_sync]
using Google.Cloud.Logging.V2;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for GetSettings</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void GetSettingsRequestObject()
{
// Create client
ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create();
// Initialize request argument(s)
GetSettingsRequest request = new GetSettingsRequest
{
SettingsName = SettingsName.FromProject("[PROJECT]"),
};
// Make the request
Settings response = configServiceV2Client.GetSettings(request);
}
}
// [END logging_v2_generated_ConfigServiceV2_GetSettings_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_GetSettings_async_flattened_resourceNames]
using Google.Cloud.Logging.V2;
using System.Threading.Tasks;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for GetSettingsAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task GetSettingsResourceNamesAsync()
{
// Create client
ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync();
// Initialize request argument(s)
SettingsName name = SettingsName.FromProject("[PROJECT]");
// Make the request
Settings response = await configServiceV2Client.GetSettingsAsync(name);
}
}
// [END logging_v2_generated_ConfigServiceV2_GetSettings_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_GetSettings_sync_flattened_resourceNames]
using Google.Cloud.Logging.V2;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for GetSettings</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void GetSettingsResourceNames()
{
// Create client
ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create();
// Initialize request argument(s)
SettingsName name = SettingsName.FromProject("[PROJECT]");
// Make the request
Settings response = configServiceV2Client.GetSettings(name);
}
}
// [END logging_v2_generated_ConfigServiceV2_GetSettings_sync_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2022 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.Logging.V2.Snippets
{
// [START logging_v2_generated_ConfigServiceV2_GetSettings_sync_flattened]
using Google.Cloud.Logging.V2;

public sealed partial class GeneratedConfigServiceV2ClientSnippets
{
/// <summary>Snippet for GetSettings</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void GetSettings()
{
// Create client
ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/settings";
// Make the request
Settings response = configServiceV2Client.GetSettings(name);
}
}
// [END logging_v2_generated_ConfigServiceV2_GetSettings_sync_flattened]
}
Loading

0 comments on commit 644279c

Please sign in to comment.