Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright 2026 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 chat_v1_generated_ChatService_FindGroupChats_async]
using Google.Api.Gax;
using Google.Apps.Chat.V1;
using System;
using System.Threading.Tasks;

public sealed partial class GeneratedChatServiceClientSnippets
{
/// <summary>Snippet for FindGroupChatsAsync</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 FindGroupChatsRequestObjectAsync()
{
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
FindGroupChatsRequest request = new FindGroupChatsRequest
{
SpaceView = SpaceView.Unspecified,
Users = { "", },
};
// Make the request
PagedAsyncEnumerable<FindGroupChatsResponse, Space> response = chatServiceClient.FindGroupChatsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (Space item in response)
{
// Do something with each item
Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (FindGroupChatsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Space item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
}
}
// [END chat_v1_generated_ChatService_FindGroupChats_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Copyright 2026 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 chat_v1_generated_ChatService_FindGroupChats_sync]
using Google.Api.Gax;
using Google.Apps.Chat.V1;
using System;

public sealed partial class GeneratedChatServiceClientSnippets
{
/// <summary>Snippet for FindGroupChats</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 FindGroupChatsRequestObject()
{
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
FindGroupChatsRequest request = new FindGroupChatsRequest
{
SpaceView = SpaceView.Unspecified,
Users = { "", },
};
// Make the request
PagedEnumerable<FindGroupChatsResponse, Space> response = chatServiceClient.FindGroupChats(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Space item in response)
{
// Do something with each item
Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (FindGroupChatsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Space item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
}
}
// [END chat_v1_generated_ChatService_FindGroupChats_sync]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4063,6 +4063,103 @@
}
]
},
{
"regionTag": "chat_v1_generated_ChatService_FindGroupChats_sync",
"title": "FindGroupChatsRequestObject",
"description": "Snippet for FindGroupChats",
"file": "ChatServiceClient.FindGroupChatsRequestObjectSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "FindGroupChats",
"fullName": "Google.Apps.Chat.V1.ChatServiceClient.FindGroupChats",
"parameters": [
{
"type": "Google.Apps.Chat.V1.FindGroupChatsRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "Google.Api.Gax.PagedEnumerable<Google.Apps.Chat.V1.FindGroupChatsResponse, Google.Apps.Chat.V1.Space>",
"client": {
"shortName": "ChatServiceClient",
"fullName": "Google.Apps.Chat.V1.ChatServiceClient"
},
"method": {
"shortName": "FindGroupChats",
"fullName": "google.chat.v1.ChatService.FindGroupChats",
"service": {
"shortName": "ChatService",
"fullName": "google.chat.v1.ChatService"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 79,
"type": "FULL"
},
{
"start": 36,
"end": 77,
"type": "SHORT"
}
]
},
{
"regionTag": "chat_v1_generated_ChatService_FindGroupChats_async",
"title": "FindGroupChatsRequestObjectAsync",
"description": "Snippet for FindGroupChatsAsync",
"file": "ChatServiceClient.FindGroupChatsRequestObjectAsyncSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "FindGroupChatsAsync",
"fullName": "Google.Apps.Chat.V1.ChatServiceClient.FindGroupChatsAsync",
"async": true,
"parameters": [
{
"type": "Google.Apps.Chat.V1.FindGroupChatsRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "Google.Api.Gax.PagedAsyncEnumerable<Google.Apps.Chat.V1.FindGroupChatsResponse, Google.Apps.Chat.V1.Space>",
"client": {
"shortName": "ChatServiceClient",
"fullName": "Google.Apps.Chat.V1.ChatServiceClient"
},
"method": {
"shortName": "FindGroupChats",
"fullName": "google.chat.v1.ChatService.FindGroupChats",
"service": {
"shortName": "ChatService",
"fullName": "google.chat.v1.ChatService"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 80,
"type": "FULL"
},
{
"start": 37,
"end": 78,
"type": "SHORT"
}
]
},
{
"regionTag": "chat_v1_generated_ChatService_CreateMembership_sync",
"title": "CreateMembershipRequestObject",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,104 @@ public async Task FindDirectMessageRequestObjectAsync()
// End snippet
}

/// <summary>Snippet for FindGroupChats</summary>
public void FindGroupChatsRequestObject()
{
// Snippet: FindGroupChats(FindGroupChatsRequest, CallSettings)
// Create client
ChatServiceClient chatServiceClient = ChatServiceClient.Create();
// Initialize request argument(s)
FindGroupChatsRequest request = new FindGroupChatsRequest
{
SpaceView = SpaceView.Unspecified,
Users = { "", },
};
// Make the request
PagedEnumerable<FindGroupChatsResponse, Space> response = chatServiceClient.FindGroupChats(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Space item in response)
{
// Do something with each item
Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (FindGroupChatsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Space item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
// End snippet
}

/// <summary>Snippet for FindGroupChatsAsync</summary>
public async Task FindGroupChatsRequestObjectAsync()
{
// Snippet: FindGroupChatsAsync(FindGroupChatsRequest, CallSettings)
// Create client
ChatServiceClient chatServiceClient = await ChatServiceClient.CreateAsync();
// Initialize request argument(s)
FindGroupChatsRequest request = new FindGroupChatsRequest
{
SpaceView = SpaceView.Unspecified,
Users = { "", },
};
// Make the request
PagedAsyncEnumerable<FindGroupChatsResponse, Space> response = chatServiceClient.FindGroupChatsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (Space item in response)
{
// Do something with each item
Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (FindGroupChatsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Space item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Space> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Space item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
// End snippet
}

/// <summary>Snippet for CreateMembership</summary>
public void CreateMembershipRequestObject()
{
Expand Down
Loading
Loading