/// <summary>Snippet for DeleteCompanyAsync</summary> public async Task DeleteCompanyAsync() { // Snippet: DeleteCompanyAsync(CompanyNameOneof,CallSettings) // Additional: DeleteCompanyAsync(CompanyNameOneof,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) CompanyNameOneof name = CompanyNameOneof.From(new CompanyName("[PROJECT]", "[TENANT]", "[COMPANY]")); // Make the request await companyServiceClient.DeleteCompanyAsync(name); // End snippet }
/// <summary>Snippet for UpdateCompanyAsync</summary> public async Task UpdateCompanyAsync() { // Snippet: UpdateCompanyAsync(Company,CallSettings) // Additional: UpdateCompanyAsync(Company,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) Company company = new Company(); // Make the request Company response = await companyServiceClient.UpdateCompanyAsync(company); // End snippet }
/// <summary>Snippet for DeleteCompanyAsync</summary> public async Task DeleteCompanyAsync() { // Snippet: DeleteCompanyAsync(string, CallSettings) // Additional: DeleteCompanyAsync(string, CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) string name = "projects/[PROJECT]/tenants/[TENANT]/companies/[COMPANY]"; // Make the request await companyServiceClient.DeleteCompanyAsync(name); // End snippet }
/// <summary>Snippet for GetCompanyAsync</summary> public async Task GetCompanyResourceNamesAsync() { // Snippet: GetCompanyAsync(CompanyName, CallSettings) // Additional: GetCompanyAsync(CompanyName, CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) CompanyName name = CompanyName.FromProjectTenantCompany("[PROJECT]", "[TENANT]", "[COMPANY]"); // Make the request Company response = await companyServiceClient.GetCompanyAsync(name); // End snippet }
/// <summary>Snippet for DeleteCompanyAsync</summary> public async Task DeleteCompanyAsync() { // Snippet: DeleteCompanyAsync(string,CallSettings) // Additional: DeleteCompanyAsync(string,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) string formattedName = new CompanyName("[PROJECT]", "[COMPANY]").ToString(); // Make the request await companyServiceClient.DeleteCompanyAsync(formattedName); // End snippet }
/// <summary>Snippet for ListCompaniesAsync</summary> public async Task ListCompaniesRequestObjectAsync() { // Snippet: ListCompaniesAsync(ListCompaniesRequest, CallSettings) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) ListCompaniesRequest request = new ListCompaniesRequest { ParentAsTenantName = TenantName.FromProjectTenant("[PROJECT]", "[TENANT]"), RequireOpenJobs = false, }; // Make the request PagedAsyncEnumerable <ListCompaniesResponse, Company> response = companyServiceClient.ListCompaniesAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Company 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((ListCompaniesResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Company 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 <Company> 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 (Company 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 CreateCompanyAsync</summary> public async Task CreateCompanyAsync() { // Snippet: CreateCompanyAsync(TenantOrProjectNameOneof,Company,CallSettings) // Additional: CreateCompanyAsync(TenantOrProjectNameOneof,Company,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) TenantOrProjectNameOneof parent = TenantOrProjectNameOneof.From(new TenantName("[PROJECT]", "[TENANT]")); Company company = new Company(); // Make the request Company response = await companyServiceClient.CreateCompanyAsync(parent, company); // End snippet }
/// <summary>Snippet for CreateCompanyAsync</summary> public async Task CreateCompanyAsync() { // Snippet: CreateCompanyAsync(string, Company, CallSettings) // Additional: CreateCompanyAsync(string, Company, CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/tenants/[TENANT]"; Company company = new Company(); // Make the request Company response = await companyServiceClient.CreateCompanyAsync(parent, company); // End snippet }
/// <summary>Snippet for CreateCompanyAsync</summary> public async Task CreateCompanyResourceNames2Async() { // Snippet: CreateCompanyAsync(ProjectName, Company, CallSettings) // Additional: CreateCompanyAsync(ProjectName, Company, CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) ProjectName parent = ProjectName.FromProject("[PROJECT]"); Company company = new Company(); // Make the request Company response = await companyServiceClient.CreateCompanyAsync(parent, company); // End snippet }
/// <summary>Snippet for CreateCompanyAsync</summary> public async Task CreateCompanyAsync() { // Snippet: CreateCompanyAsync(string,Company,CallSettings) // Additional: CreateCompanyAsync(string,Company,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) string formattedParent = new ProjectName("[PROJECT]").ToString(); Company company = new Company(); // Make the request Company response = await companyServiceClient.CreateCompanyAsync(formattedParent, company); // End snippet }
/// <summary>Snippet for UpdateCompanyAsync</summary> public async Task UpdateCompanyAsync_RequestObject() { // Snippet: UpdateCompanyAsync(UpdateCompanyRequest,CallSettings) // Additional: UpdateCompanyAsync(UpdateCompanyRequest,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) UpdateCompanyRequest request = new UpdateCompanyRequest { Company = new Company(), }; // Make the request Company response = await companyServiceClient.UpdateCompanyAsync(request); // End snippet }
/// <summary>Snippet for GetCompanyAsync</summary> public async Task GetCompanyAsync_RequestObject() { // Snippet: GetCompanyAsync(GetCompanyRequest,CallSettings) // Additional: GetCompanyAsync(GetCompanyRequest,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) GetCompanyRequest request = new GetCompanyRequest { CompanyNameOneof = CompanyNameOneof.From(new CompanyName("[PROJECT]", "[TENANT]", "[COMPANY]")), }; // Make the request Company response = await companyServiceClient.GetCompanyAsync(request); // End snippet }
/// <summary>Snippet for DeleteCompanyAsync</summary> public async Task DeleteCompanyRequestObjectAsync() { // Snippet: DeleteCompanyAsync(DeleteCompanyRequest, CallSettings) // Additional: DeleteCompanyAsync(DeleteCompanyRequest, CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) DeleteCompanyRequest request = new DeleteCompanyRequest { CompanyName = CompanyName.FromProjectTenantCompany("[PROJECT]", "[TENANT]", "[COMPANY]"), }; // Make the request await companyServiceClient.DeleteCompanyAsync(request); // End snippet }
/// <summary>Snippet for CreateCompanyAsync</summary> public async Task CreateCompanyAsync_RequestObject() { // Snippet: CreateCompanyAsync(CreateCompanyRequest,CallSettings) // Additional: CreateCompanyAsync(CreateCompanyRequest,CancellationToken) // Create client CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync(); // Initialize request argument(s) CreateCompanyRequest request = new CreateCompanyRequest { ParentAsTenantOrProjectNameOneof = TenantOrProjectNameOneof.From(new TenantName("[PROJECT]", "[TENANT]")), Company = new Company(), }; // Make the request Company response = await companyServiceClient.CreateCompanyAsync(request); // End snippet }