forked from dabit3/polygon-ethereum-nextjs-marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPoll
35 lines (31 loc) · 1.22 KB
/
Poll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class UpdateInputSample
{
public async Task<Input> UpdateInputAsync(
string projectId, string locationId, string inputId)
{
// Create the client.
LivestreamServiceClient client = LivestreamServiceClient.Create();
UpdateInputRequest request = new UpdateInputRequest
{
Input = new Input
{
InputName = InputName.FromProjectLocationInput(projectId, locationId, inputId),
PreprocessingConfig = new PreprocessingConfig
{
Crop = new PreprocessingConfig.Types.Crop
{
TopPixels = 5,
BottomPixels = 5
}
}
},
UpdateMask = new FieldMask { Paths = { "preprocessing_config" } }
};
// Make the request.
Operation<Input, OperationMetadata> response = await client.UpdateInputAsync(request);
// Poll until the returned long-running operation is complete.
Operation<Input, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result.
return completedResponse.Result;
}
}