Class ArtifactRegistryClient (1.0.0)

public abstract class ArtifactRegistryClient

ArtifactRegistry client wrapper, for convenient use.

Inheritance

Object > ArtifactRegistryClient

Namespace

Google.Cloud.ArtifactRegistry.V1

Assembly

Google.Cloud.ArtifactRegistry.V1.dll

Remarks

The Artifact Registry API service.

Artifact Registry is an artifact management system for storing artifacts from different package management systems.

The resources managed by this API are:

  • Repositories, which group packages and their data.
  • Packages, which group versions and their tags.
  • Versions, which are specific forms of a package.
  • Tags, which represent alternative names for versions.
  • Files, which contain content and are optionally associated with a Package or Version.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ArtifactRegistry service, which is a host of "artifactregistry.googleapis.com" and a port of 443.

Property Value
Type Description
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ArtifactRegistry scopes.

Property Value
Type Description
IReadOnlyList<String>
Remarks

GrpcClient

public virtual ArtifactRegistry.ArtifactRegistryClient GrpcClient { get; }

The underlying gRPC ArtifactRegistry client

Property Value
Type Description
ArtifactRegistry.ArtifactRegistryClient

Methods

Create()

public static ArtifactRegistryClient Create()

Synchronously creates a ArtifactRegistryClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ArtifactRegistryClientBuilder.

Returns
Type Description
ArtifactRegistryClient

The created ArtifactRegistryClient.

CreateAsync(CancellationToken)

public static Task<ArtifactRegistryClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a ArtifactRegistryClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ArtifactRegistryClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<ArtifactRegistryClient>

The task representing the created ArtifactRegistryClient.

GetRepository(GetRepositoryRequest, CallSettings)

public virtual Repository GetRepository(GetRepositoryRequest request, CallSettings callSettings = null)

Gets a repository.

Parameters
Name Description
request GetRepositoryRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Repository

The RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
GetRepositoryRequest request = new GetRepositoryRequest
{
    RepositoryName = RepositoryName.FromProjectLocationRepository("[PROJECT]", "[LOCATION]", "[REPOSITORY]"),
};
// Make the request
Repository response = artifactRegistryClient.GetRepository(request);

GetRepository(RepositoryName, CallSettings)

public virtual Repository GetRepository(RepositoryName name, CallSettings callSettings = null)

Gets a repository.

Parameters
Name Description
name RepositoryName

Required. The name of the repository to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Repository

The RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
RepositoryName name = RepositoryName.FromProjectLocationRepository("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
// Make the request
Repository response = artifactRegistryClient.GetRepository(name);

GetRepository(String, CallSettings)

public virtual Repository GetRepository(string name, CallSettings callSettings = null)

Gets a repository.

Parameters
Name Description
name String

Required. The name of the repository to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Repository

The RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/repositories/[REPOSITORY]";
// Make the request
Repository response = artifactRegistryClient.GetRepository(name);

GetRepositoryAsync(GetRepositoryRequest, CallSettings)

public virtual Task<Repository> GetRepositoryAsync(GetRepositoryRequest request, CallSettings callSettings = null)

Gets a repository.

Parameters
Name Description
request GetRepositoryRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Repository>

A Task containing the RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
GetRepositoryRequest request = new GetRepositoryRequest
{
    RepositoryName = RepositoryName.FromProjectLocationRepository("[PROJECT]", "[LOCATION]", "[REPOSITORY]"),
};
// Make the request
Repository response = await artifactRegistryClient.GetRepositoryAsync(request);

GetRepositoryAsync(GetRepositoryRequest, CancellationToken)

public virtual Task<Repository> GetRepositoryAsync(GetRepositoryRequest request, CancellationToken cancellationToken)

Gets a repository.

Parameters
Name Description
request GetRepositoryRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Repository>

A Task containing the RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
GetRepositoryRequest request = new GetRepositoryRequest
{
    RepositoryName = RepositoryName.FromProjectLocationRepository("[PROJECT]", "[LOCATION]", "[REPOSITORY]"),
};
// Make the request
Repository response = await artifactRegistryClient.GetRepositoryAsync(request);

GetRepositoryAsync(RepositoryName, CallSettings)

public virtual Task<Repository> GetRepositoryAsync(RepositoryName name, CallSettings callSettings = null)

Gets a repository.

Parameters
Name Description
name RepositoryName

Required. The name of the repository to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Repository>

A Task containing the RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
RepositoryName name = RepositoryName.FromProjectLocationRepository("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
// Make the request
Repository response = await artifactRegistryClient.GetRepositoryAsync(name);

GetRepositoryAsync(RepositoryName, CancellationToken)

public virtual Task<Repository> GetRepositoryAsync(RepositoryName name, CancellationToken cancellationToken)

Gets a repository.

Parameters
Name Description
name RepositoryName

Required. The name of the repository to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Repository>

A Task containing the RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
RepositoryName name = RepositoryName.FromProjectLocationRepository("[PROJECT]", "[LOCATION]", "[REPOSITORY]");
// Make the request
Repository response = await artifactRegistryClient.GetRepositoryAsync(name);

GetRepositoryAsync(String, CallSettings)

public virtual Task<Repository> GetRepositoryAsync(string name, CallSettings callSettings = null)

Gets a repository.

Parameters
Name Description
name String

Required. The name of the repository to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Repository>

A Task containing the RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/repositories/[REPOSITORY]";
// Make the request
Repository response = await artifactRegistryClient.GetRepositoryAsync(name);

GetRepositoryAsync(String, CancellationToken)

public virtual Task<Repository> GetRepositoryAsync(string name, CancellationToken cancellationToken)

Gets a repository.

Parameters
Name Description
name String

Required. The name of the repository to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Repository>

A Task containing the RPC response.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/repositories/[REPOSITORY]";
// Make the request
Repository response = await artifactRegistryClient.GetRepositoryAsync(name);

ListDockerImages(ListDockerImagesRequest, CallSettings)

public virtual PagedEnumerable<ListDockerImagesResponse, DockerImage> ListDockerImages(ListDockerImagesRequest request, CallSettings callSettings = null)

Lists docker images.

Parameters
Name Description
request ListDockerImagesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListDockerImagesResponse, DockerImage>

A pageable sequence of DockerImage resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
ListDockerImagesRequest request = new ListDockerImagesRequest { Parent = "", };
// Make the request
PagedEnumerable<ListDockerImagesResponse, DockerImage> response = artifactRegistryClient.ListDockerImages(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (DockerImage 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 (ListDockerImagesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DockerImage 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<DockerImage> 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 (DockerImage 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;

ListDockerImages(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListDockerImagesResponse, DockerImage> ListDockerImages(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists docker images.

Parameters
Name Description
parent String

Required. The name of the parent resource whose docker images will be listed.

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListDockerImagesResponse, DockerImage>

A pageable sequence of DockerImage resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedEnumerable<ListDockerImagesResponse, DockerImage> response = artifactRegistryClient.ListDockerImages(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (DockerImage 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 (ListDockerImagesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DockerImage 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<DockerImage> 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 (DockerImage 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;

ListDockerImagesAsync(ListDockerImagesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListDockerImagesResponse, DockerImage> ListDockerImagesAsync(ListDockerImagesRequest request, CallSettings callSettings = null)

Lists docker images.

Parameters
Name Description
request ListDockerImagesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListDockerImagesResponse, DockerImage>

A pageable asynchronous sequence of DockerImage resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
ListDockerImagesRequest request = new ListDockerImagesRequest { Parent = "", };
// Make the request
PagedAsyncEnumerable<ListDockerImagesResponse, DockerImage> response = artifactRegistryClient.ListDockerImagesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DockerImage item) =>
{
    // 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((ListDockerImagesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DockerImage 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<DockerImage> 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 (DockerImage 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;

ListDockerImagesAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListDockerImagesResponse, DockerImage> ListDockerImagesAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists docker images.

Parameters
Name Description
parent String

Required. The name of the parent resource whose docker images will be listed.

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListDockerImagesResponse, DockerImage>

A pageable asynchronous sequence of DockerImage resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
string parent = "";
// Make the request
PagedAsyncEnumerable<ListDockerImagesResponse, DockerImage> response = artifactRegistryClient.ListDockerImagesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DockerImage item) =>
{
    // 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((ListDockerImagesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DockerImage 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<DockerImage> 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 (DockerImage 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;

ListRepositories(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListRepositoriesResponse, Repository> ListRepositories(LocationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists repositories.

Parameters
Name Description
parent LocationName

Required. The name of the parent resource whose repositories will be listed.

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListRepositoriesResponse, Repository>

A pageable sequence of Repository resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListRepositoriesResponse, Repository> response = artifactRegistryClient.ListRepositories(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Repository 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 (ListRepositoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Repository 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<Repository> 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 (Repository 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;

ListRepositories(ListRepositoriesRequest, CallSettings)

public virtual PagedEnumerable<ListRepositoriesResponse, Repository> ListRepositories(ListRepositoriesRequest request, CallSettings callSettings = null)

Lists repositories.

Parameters
Name Description
request ListRepositoriesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListRepositoriesResponse, Repository>

A pageable sequence of Repository resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
ListRepositoriesRequest request = new ListRepositoriesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListRepositoriesResponse, Repository> response = artifactRegistryClient.ListRepositories(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Repository 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 (ListRepositoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Repository 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<Repository> 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 (Repository 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;

ListRepositories(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListRepositoriesResponse, Repository> ListRepositories(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists repositories.

Parameters
Name Description
parent String

Required. The name of the parent resource whose repositories will be listed.

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListRepositoriesResponse, Repository>

A pageable sequence of Repository resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListRepositoriesResponse, Repository> response = artifactRegistryClient.ListRepositories(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Repository 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 (ListRepositoriesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Repository 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<Repository> 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 (Repository 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;

ListRepositoriesAsync(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListRepositoriesResponse, Repository> ListRepositoriesAsync(LocationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists repositories.

Parameters
Name Description
parent LocationName

Required. The name of the parent resource whose repositories will be listed.

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListRepositoriesResponse, Repository>

A pageable asynchronous sequence of Repository resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListRepositoriesResponse, Repository> response = artifactRegistryClient.ListRepositoriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Repository item) =>
{
    // 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((ListRepositoriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Repository 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<Repository> 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 (Repository 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;

ListRepositoriesAsync(ListRepositoriesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListRepositoriesResponse, Repository> ListRepositoriesAsync(ListRepositoriesRequest request, CallSettings callSettings = null)

Lists repositories.

Parameters
Name Description
request ListRepositoriesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListRepositoriesResponse, Repository>

A pageable asynchronous sequence of Repository resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
ListRepositoriesRequest request = new ListRepositoriesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListRepositoriesResponse, Repository> response = artifactRegistryClient.ListRepositoriesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Repository item) =>
{
    // 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((ListRepositoriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Repository 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<Repository> 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 (Repository 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;

ListRepositoriesAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListRepositoriesResponse, Repository> ListRepositoriesAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists repositories.

Parameters
Name Description
parent String

Required. The name of the parent resource whose repositories will be listed.

pageToken String

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize Nullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListRepositoriesResponse, Repository>

A pageable asynchronous sequence of Repository resources.

Example
// Create client
ArtifactRegistryClient artifactRegistryClient = await ArtifactRegistryClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListRepositoriesResponse, Repository> response = artifactRegistryClient.ListRepositoriesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Repository item) =>
{
    // 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((ListRepositoriesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Repository 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<Repository> 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 (Repository 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;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.