/// <summary>Snippet for ListTenants</summary>
        public void ListTenantsRequestObject()
        {
            // Snippet: ListTenants(ListTenantsRequest, CallSettings)
            // Create client
            TenantServiceClient tenantServiceClient = TenantServiceClient.Create();
            // Initialize request argument(s)
            ListTenantsRequest request = new ListTenantsRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
            };
            // Make the request
            PagedEnumerable <ListTenantsResponse, Tenant> response = tenantServiceClient.ListTenants(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Tenant 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 (ListTenantsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Tenant 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 <Tenant> 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 (Tenant 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
        }
        // [START job_search_list_tenants_beta]
        public static object ListTenants(string projectId)
        {
            TenantServiceClient tenantServiceClient = TenantServiceClient.Create();
            ProjectName         parent  = new ProjectName(projectId);
            ListTenantsRequest  request = new ListTenantsRequest
            {
                ParentAsProjectName = parent
            };
            var tenants = tenantServiceClient.ListTenants(request);

            foreach (var tenant in tenants)
            {
                Console.WriteLine($"Tenant Name: {tenant.Name}");
                Console.WriteLine($"External ID: {tenant.ExternalId}");
            }
            return(0);
        }