Skip to content

Commit

Permalink
Regenerate Google.Cloud.Vision.V1 (#3347)
Browse files Browse the repository at this point in the history
- New error field on responses
- PurgeProducts long-running RPC
- Object annotations in products
  • Loading branch information
yoshi-automation authored and jskeet committed Aug 8, 2019
1 parent 8982029 commit 3028526
Show file tree
Hide file tree
Showing 10 changed files with 2,323 additions and 552 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1711,5 +1711,132 @@ public void ImportProductSets_RequestObject()
// End snippet
}

/// <summary>Snippet for PurgeProductsAsync</summary>
public async Task PurgeProductsAsync()
{
// Snippet: PurgeProductsAsync(LocationName,CallSettings)
// Additional: PurgeProductsAsync(LocationName,CancellationToken)
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = new LocationName("[PROJECT]", "[LOCATION]");
// Make the request
Operation<Empty, BatchOperationMetadata> response =
await productSearchClient.PurgeProductsAsync(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse =
await response.PollUntilCompletedAsync();
// The long-running operation is now complete.

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse =
await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// The long-running operation is now complete.
}
// End snippet
}

/// <summary>Snippet for PurgeProducts</summary>
public void PurgeProducts()
{
// Snippet: PurgeProducts(LocationName,CallSettings)
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
LocationName parent = new LocationName("[PROJECT]", "[LOCATION]");
// Make the request
Operation<Empty, BatchOperationMetadata> response =
productSearchClient.PurgeProducts(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse =
response.PollUntilCompleted();
// The long-running operation is now complete.

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse =
productSearchClient.PollOncePurgeProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// The long-running operation is now complete.
}
// End snippet
}

/// <summary>Snippet for PurgeProductsAsync</summary>
public async Task PurgeProductsAsync_RequestObject()
{
// Snippet: PurgeProductsAsync(PurgeProductsRequest,CallSettings)
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
ParentAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"),
};
// Make the request
Operation<Empty, BatchOperationMetadata> response =
await productSearchClient.PurgeProductsAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse =
await response.PollUntilCompletedAsync();
// The long-running operation is now complete.

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse =
await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// The long-running operation is now complete.
}
// End snippet
}

/// <summary>Snippet for PurgeProducts</summary>
public void PurgeProducts_RequestObject()
{
// Snippet: PurgeProducts(PurgeProductsRequest,CallSettings)
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
ParentAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"),
};
// Make the request
Operation<Empty, BatchOperationMetadata> response =
productSearchClient.PurgeProducts(request);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse =
response.PollUntilCompleted();
// The long-running operation is now complete.

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse =
productSearchClient.PollOncePurgeProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// The long-running operation is now complete.
}
// End snippet
}

}
}
Loading

0 comments on commit 3028526

Please sign in to comment.