-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Order modification RPCs and License Management Service
docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_PENDING_APPROVAL` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_APPROVED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_COMPLETED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_REJECTED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_ABANDONED` in enum `LineItemChangeState` is changed docs: A comment for enum value `LINE_ITEM_CHANGE_STATE_ACTIVATING` in enum `LineItemChangeState` is changed docs: A comment for field `request_id` in message `.google.cloud.commerce.consumer.procurement.v1.PlaceOrderRequest` is changed docs: A comment for field `filter` in message `.google.cloud.commerce.consumer.procurement.v1.ListOrdersRequest` is changed PiperOrigin-RevId: 682457622 Source-Link: googleapis/googleapis@1f8352c Source-Link: googleapis/googleapis-gen@1727200 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQ29tbWVyY2UuQ29uc3VtZXIuUHJvY3VyZW1lbnQuVjEvLk93bEJvdC55YW1sIiwiaCI6IjE3MjcyMDA2OGYyMjU5YjM2NWE1NmEyMmEwYzdjMmE2ZDQ0NmM3MzIifQ==
- Loading branch information
1 parent
04b8d8a
commit 79a1fc7
Showing
38 changed files
with
9,812 additions
and
39 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
...eratedSnippets/ConsumerProcurementServiceClient.CancelOrderRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_CancelOrder_async] | ||
using Google.Cloud.Commerce.Consumer.Procurement.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedConsumerProcurementServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelOrderAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task CancelOrderRequestObjectAsync() | ||
{ | ||
// Create client | ||
ConsumerProcurementServiceClient consumerProcurementServiceClient = await ConsumerProcurementServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CancelOrderRequest request = new CancelOrderRequest | ||
{ | ||
Name = "", | ||
Etag = "", | ||
CancellationPolicy = CancelOrderRequest.Types.CancellationPolicy.Unspecified, | ||
}; | ||
// Make the request | ||
Operation<Order, CancelOrderMetadata> response = await consumerProcurementServiceClient.CancelOrderAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Order, CancelOrderMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Order result = completedResponse.Result; | ||
|
||
// 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<Order, CancelOrderMetadata> retrievedResponse = await consumerProcurementServiceClient.PollOnceCancelOrderAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Order retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_CancelOrder_async] | ||
} |
65 changes: 65 additions & 0 deletions
65
...1.GeneratedSnippets/ConsumerProcurementServiceClient.CancelOrderRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_CancelOrder_sync] | ||
using Google.Cloud.Commerce.Consumer.Procurement.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedConsumerProcurementServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CancelOrder</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void CancelOrderRequestObject() | ||
{ | ||
// Create client | ||
ConsumerProcurementServiceClient consumerProcurementServiceClient = ConsumerProcurementServiceClient.Create(); | ||
// Initialize request argument(s) | ||
CancelOrderRequest request = new CancelOrderRequest | ||
{ | ||
Name = "", | ||
Etag = "", | ||
CancellationPolicy = CancelOrderRequest.Types.CancellationPolicy.Unspecified, | ||
}; | ||
// Make the request | ||
Operation<Order, CancelOrderMetadata> response = consumerProcurementServiceClient.CancelOrder(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Order, CancelOrderMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Order result = completedResponse.Result; | ||
|
||
// 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<Order, CancelOrderMetadata> retrievedResponse = consumerProcurementServiceClient.PollOnceCancelOrder(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Order retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_CancelOrder_sync] | ||
} |
70 changes: 70 additions & 0 deletions
70
...eratedSnippets/ConsumerProcurementServiceClient.ModifyOrderRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_ModifyOrder_async] | ||
using Google.Cloud.Commerce.Consumer.Procurement.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedConsumerProcurementServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for ModifyOrderAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task ModifyOrderRequestObjectAsync() | ||
{ | ||
// Create client | ||
ConsumerProcurementServiceClient consumerProcurementServiceClient = await ConsumerProcurementServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
ModifyOrderRequest request = new ModifyOrderRequest | ||
{ | ||
Name = "", | ||
Etag = "", | ||
DisplayName = "", | ||
Modifications = | ||
{ | ||
new ModifyOrderRequest.Types.Modification(), | ||
}, | ||
}; | ||
// Make the request | ||
Operation<Order, ModifyOrderMetadata> response = await consumerProcurementServiceClient.ModifyOrderAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Order, ModifyOrderMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Order result = completedResponse.Result; | ||
|
||
// 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<Order, ModifyOrderMetadata> retrievedResponse = await consumerProcurementServiceClient.PollOnceModifyOrderAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Order retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_ModifyOrder_async] | ||
} |
69 changes: 69 additions & 0 deletions
69
...1.GeneratedSnippets/ConsumerProcurementServiceClient.ModifyOrderRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_ModifyOrder_sync] | ||
using Google.Cloud.Commerce.Consumer.Procurement.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedConsumerProcurementServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for ModifyOrder</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void ModifyOrderRequestObject() | ||
{ | ||
// Create client | ||
ConsumerProcurementServiceClient consumerProcurementServiceClient = ConsumerProcurementServiceClient.Create(); | ||
// Initialize request argument(s) | ||
ModifyOrderRequest request = new ModifyOrderRequest | ||
{ | ||
Name = "", | ||
Etag = "", | ||
DisplayName = "", | ||
Modifications = | ||
{ | ||
new ModifyOrderRequest.Types.Modification(), | ||
}, | ||
}; | ||
// Make the request | ||
Operation<Order, ModifyOrderMetadata> response = consumerProcurementServiceClient.ModifyOrder(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Order, ModifyOrderMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Order result = completedResponse.Result; | ||
|
||
// 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<Order, ModifyOrderMetadata> retrievedResponse = consumerProcurementServiceClient.PollOnceModifyOrder(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Order retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END cloudcommerceconsumerprocurement_v1_generated_ConsumerProcurementService_ModifyOrder_sync] | ||
} |
46 changes: 46 additions & 0 deletions
46
...r.Procurement.V1.GeneratedSnippets/LicenseManagementServiceClient.AssignAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_Assign_async_flattened] | ||
using Google.Cloud.Commerce.Consumer.Procurement.V1; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedLicenseManagementServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for AssignAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task AssignAsync() | ||
{ | ||
// Create client | ||
LicenseManagementServiceClient licenseManagementServiceClient = await LicenseManagementServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = ""; | ||
IEnumerable<string> usernames = new string[] { "", }; | ||
// Make the request | ||
AssignResponse response = await licenseManagementServiceClient.AssignAsync(parent, usernames); | ||
} | ||
} | ||
// [END cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_Assign_async_flattened] | ||
} |
48 changes: 48 additions & 0 deletions
48
....V1.GeneratedSnippets/LicenseManagementServiceClient.AssignRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_Assign_async] | ||
using Google.Cloud.Commerce.Consumer.Procurement.V1; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedLicenseManagementServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for AssignAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task AssignRequestObjectAsync() | ||
{ | ||
// Create client | ||
LicenseManagementServiceClient licenseManagementServiceClient = await LicenseManagementServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
AssignRequest request = new AssignRequest | ||
{ | ||
Parent = "", | ||
Usernames = { "", }, | ||
}; | ||
// Make the request | ||
AssignResponse response = await licenseManagementServiceClient.AssignAsync(request); | ||
} | ||
} | ||
// [END cloudcommerceconsumerprocurement_v1_generated_LicenseManagementService_Assign_async] | ||
} |
Oops, something went wrong.