Skip to content

Commit 7ab5d0f

Browse files
Google APIscopybara-github
authored andcommitted
feat: Enable partners to create, update and delete their customers
feat: A new field `organization_domain` is added to message `Customer` docs: Mark the enum value `EkmSolution.VIRTRU` as deprecated PiperOrigin-RevId: 754144273
1 parent 079e530 commit 7ab5d0f

File tree

4 files changed

+81
-3
lines changed

4 files changed

+81
-3
lines changed

google/cloud/cloudcontrolspartner/v1/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ proto_library(
4141
"//google/api:field_behavior_proto",
4242
"//google/api:resource_proto",
4343
"//google/type:interval_proto",
44+
"@com_google_protobuf//:empty_proto",
45+
"@com_google_protobuf//:field_mask_proto",
4446
"@com_google_protobuf//:timestamp_proto",
4547
],
4648
)

google/cloud/cloudcontrolspartner/v1/core.proto

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import "google/cloud/cloudcontrolspartner/v1/customers.proto";
2626
import "google/cloud/cloudcontrolspartner/v1/ekm_connections.proto";
2727
import "google/cloud/cloudcontrolspartner/v1/partner_permissions.proto";
2828
import "google/cloud/cloudcontrolspartner/v1/partners.proto";
29+
import "google/protobuf/empty.proto";
2930
import "google/protobuf/timestamp.proto";
3031

3132
option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1";
@@ -113,6 +114,32 @@ service CloudControlsPartnerCore {
113114
};
114115
option (google.api.method_signature) = "name";
115116
}
117+
118+
// Creates a new customer.
119+
rpc CreateCustomer(CreateCustomerRequest) returns (Customer) {
120+
option (google.api.http) = {
121+
post: "/v1/{parent=organizations/*/locations/*}/customers"
122+
body: "customer"
123+
};
124+
option (google.api.method_signature) = "parent,customer,customer_id";
125+
}
126+
127+
// Update details of a single customer
128+
rpc UpdateCustomer(UpdateCustomerRequest) returns (Customer) {
129+
option (google.api.http) = {
130+
patch: "/v1/{customer.name=organizations/*/locations/*/customers/*}"
131+
body: "customer"
132+
};
133+
option (google.api.method_signature) = "customer,update_mask";
134+
}
135+
136+
// Delete details of a single customer
137+
rpc DeleteCustomer(DeleteCustomerRequest) returns (google.protobuf.Empty) {
138+
option (google.api.http) = {
139+
delete: "/v1/{name=organizations/*/locations/*/customers/*}"
140+
};
141+
option (google.api.method_signature) = "name";
142+
}
116143
}
117144

118145
// Represents the metadata of the long-running operation.
@@ -136,7 +163,7 @@ message OperationMetadata {
136163

137164
// Output only. Identifies whether the user has requested cancellation
138165
// of the operation. Operations that have been cancelled successfully
139-
// have [Operation.error][] value with a
166+
// have [Operation.error][google.longrunning.Operation.error] value with a
140167
// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
141168
// `Code.CANCELLED`.
142169
bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

google/cloud/cloudcontrolspartner/v1/customers.proto

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.cloud.cloudcontrolspartner.v1;
1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
2121
import "google/cloud/cloudcontrolspartner/v1/completion_state.proto";
22+
import "google/protobuf/field_mask.proto";
2223
import "google/protobuf/timestamp.proto";
2324

2425
option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1";
@@ -51,6 +52,10 @@ message Customer {
5152

5253
// Output only. Indicates whether a customer is fully onboarded
5354
bool is_onboarded = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
55+
56+
// Output only. The customer organization domain, extracted from
57+
// CRM Organization’s display_name field. e.g. "google.com"
58+
string organization_domain = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
5459
}
5560

5661
// Request to list customers
@@ -92,6 +97,26 @@ message ListCustomersResponse {
9297
repeated string unreachable = 3;
9398
}
9499

100+
// Request to create a customer
101+
message CreateCustomerRequest {
102+
// Required. Parent resource
103+
// Format: `organizations/{organization}/locations/{location}`
104+
string parent = 1 [
105+
(google.api.field_behavior) = REQUIRED,
106+
(google.api.resource_reference) = {
107+
child_type: "cloudcontrolspartner.googleapis.com/Customer"
108+
}
109+
];
110+
111+
// Required. The customer to create.
112+
Customer customer = 2 [(google.api.field_behavior) = REQUIRED];
113+
114+
// Required. The customer id to use for the customer, which will become the
115+
// final component of the customer's resource name. The specified value must
116+
// be a valid Google cloud organization id.
117+
string customer_id = 3 [(google.api.field_behavior) = REQUIRED];
118+
}
119+
95120
// Message for getting a customer
96121
message GetCustomerRequest {
97122
// Required. Format:
@@ -137,3 +162,27 @@ message CustomerOnboardingStep {
137162
CompletionState completion_state = 4
138163
[(google.api.field_behavior) = OUTPUT_ONLY];
139164
}
165+
166+
// Request to update a customer
167+
message UpdateCustomerRequest {
168+
// Required. The customer to update
169+
// Format:
170+
// `organizations/{organization}/locations/{location}/customers/{customer}`
171+
Customer customer = 1 [(google.api.field_behavior) = REQUIRED];
172+
173+
// Optional. The list of fields to update
174+
google.protobuf.FieldMask update_mask = 2
175+
[(google.api.field_behavior) = OPTIONAL];
176+
}
177+
178+
// Message for deleting customer
179+
message DeleteCustomerRequest {
180+
// Required. name of the resource to be deleted
181+
// format: name=organizations/*/locations/*/customers/*
182+
string name = 1 [
183+
(google.api.field_behavior) = REQUIRED,
184+
(google.api.resource_reference) = {
185+
type: "cloudcontrolspartner.googleapis.com/Customer"
186+
}
187+
];
188+
}

google/cloud/cloudcontrolspartner/v1/partners.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ message EkmMetadata {
108108
// EKM Partner Thales
109109
THALES = 3;
110110

111-
// EKM Partner Virtu
112-
VIRTRU = 4;
111+
// This enum value is never used.
112+
VIRTRU = 4 [deprecated = true];
113113
}
114114

115115
// The Cloud EKM partner.

0 commit comments

Comments
 (0)