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
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.11" />
<PackageVersion Include="System.Collections.Immutable" Version="9.0.11" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.0" />

<!-- Other third party packages -->
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Linq.AsyncEnumerable" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

<ItemGroup>
<ProjectReference Include="../Testing.Basic.V1/Testing.Basic.V1.csproj" />
<PackageReference Include="System.Linq.Async" Version="6.0.3" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

<ItemGroup>
<ProjectReference Include="../Testing.Basic.V1/Testing.Basic.V1.csproj" />
<PackageReference Include="System.Linq.Async" Version="6.0.3" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_ResourcedMethod_async_flattened1]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand All @@ -43,14 +42,14 @@ public async Task ResourcedMethod1Async()
PagedAsyncEnumerable<ResourceResponse, string> response = paginatedClient.ResourcedMethodAsync(name);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((string item) =>
await foreach (string 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 response.AsRawResponses().ForEachAsync((ResourceResponse page) =>
await foreach (ResourceResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -59,7 +58,7 @@ await response.AsRawResponses().ForEachAsync((ResourceResponse 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_ResourcedMethod_async_flattened1_resourceNames]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand All @@ -43,14 +42,14 @@ public async Task ResourcedMethod1ResourceNamesAsync()
PagedAsyncEnumerable<ResourceResponse, string> response = paginatedClient.ResourcedMethodAsync(name);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((string item) =>
await foreach (string 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 response.AsRawResponses().ForEachAsync((ResourceResponse page) =>
await foreach (ResourceResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -59,7 +58,7 @@ await response.AsRawResponses().ForEachAsync((ResourceResponse 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_ResourcedMethod_async_flattened2]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand All @@ -44,14 +43,14 @@ public async Task ResourcedMethod2Async()
PagedAsyncEnumerable<ResourceResponse, string> response = paginatedClient.ResourcedMethodAsync(name, extraString: extraString);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((string item) =>
await foreach (string 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 response.AsRawResponses().ForEachAsync((ResourceResponse page) =>
await foreach (ResourceResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -60,7 +59,7 @@ await response.AsRawResponses().ForEachAsync((ResourceResponse 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_ResourcedMethod_async_flattened2_resourceNames]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand All @@ -44,14 +43,14 @@ public async Task ResourcedMethod2ResourceNamesAsync()
PagedAsyncEnumerable<ResourceResponse, string> response = paginatedClient.ResourcedMethodAsync(name, extraString: extraString);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((string item) =>
await foreach (string 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 response.AsRawResponses().ForEachAsync((ResourceResponse page) =>
await foreach (ResourceResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -60,7 +59,7 @@ await response.AsRawResponses().ForEachAsync((ResourceResponse 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_ResourcedMethod_async]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand Down Expand Up @@ -47,14 +46,14 @@ public async Task ResourcedMethodRequestObjectAsync()
PagedAsyncEnumerable<ResourceResponse, string> response = paginatedClient.ResourcedMethodAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((string item) =>
await foreach (string 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 response.AsRawResponses().ForEachAsync((ResourceResponse page) =>
await foreach (ResourceResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -63,7 +62,7 @@ await response.AsRawResponses().ForEachAsync((ResourceResponse 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_SignatureMethod_async_flattened1]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand All @@ -44,14 +43,14 @@ public async Task SignatureMethod1Async()
PagedAsyncEnumerable<Response, Response.Types.NestedResult> response = paginatedClient.SignatureMethodAsync(aString, aNumber);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Response.Types.NestedResult item) =>
await foreach (Response.Types.NestedResult 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 response.AsRawResponses().ForEachAsync((Response page) =>
await foreach (Response page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -60,7 +59,7 @@ await response.AsRawResponses().ForEachAsync((Response 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_SignatureMethod_async_flattened2]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand All @@ -43,14 +42,14 @@ public async Task SignatureMethod2Async()
PagedAsyncEnumerable<Response, Response.Types.NestedResult> response = paginatedClient.SignatureMethodAsync(aString: aString);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Response.Types.NestedResult item) =>
await foreach (Response.Types.NestedResult 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 response.AsRawResponses().ForEachAsync((Response page) =>
await foreach (Response page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -59,7 +58,7 @@ await response.AsRawResponses().ForEachAsync((Response 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,6 @@ namespace GoogleCSharpSnippets
// [START paginated_generated_Paginated_SignatureMethod2_async]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using Testing.Paginated;

Expand Down Expand Up @@ -47,14 +46,14 @@ public async Task SignatureMethod2RequestObjectAsync()
PagedAsyncEnumerable<Response, Response.Types.NestedResult> response = paginatedClient.SignatureMethod2Async(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Response.Types.NestedResult item) =>
await foreach (Response.Types.NestedResult 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 response.AsRawResponses().ForEachAsync((Response page) =>
await foreach (Response page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
Expand All @@ -63,7 +62,7 @@ await response.AsRawResponses().ForEachAsync((Response 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;
Expand Down
Loading