Skip to content

Commit 04b5953

Browse files
feat: [orgpolicy] Add custom constraints CRUD APIs, proper etag support in Org Policy Update/Delete API (#10163)
* feat: Add custom constraints CRUD APIs, proper etag support in Org Policy Update/Delete API docs: updated comments PiperOrigin-RevId: 591301652 Source-Link: googleapis/googleapis@db5ce67 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3c133266edaaf81b14c2dd8fd4705127dcbce06b Copy-Tag: eyJwIjoiamF2YS1vcmdwb2xpY3kvLk93bEJvdC55YW1sIiwiaCI6IjNjMTMzMjY2ZWRhYWY4MWIxNGMyZGQ4ZmQ0NzA1MTI3ZGNiY2UwNmIifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent e1a95a3 commit 04b5953

File tree

79 files changed

+15406
-1113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+15406
-1113
lines changed

java-orgpolicy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
195195
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
196196
[stability-image]: https://img.shields.io/badge/stability-stable-green
197197
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-orgpolicy.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-orgpolicy/2.30.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-orgpolicy/2.32.0
199199
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
200200
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
201201
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-orgpolicy/google-cloud-orgpolicy/src/main/java/com/google/cloud/orgpolicy/v2/OrgPolicyClient.java

Lines changed: 882 additions & 115 deletions
Large diffs are not rendered by default.

java-orgpolicy/google-cloud-orgpolicy/src/main/java/com/google/cloud/orgpolicy/v2/OrgPolicySettings.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.orgpolicy.v2;
1818

1919
import static com.google.cloud.orgpolicy.v2.OrgPolicyClient.ListConstraintsPagedResponse;
20+
import static com.google.cloud.orgpolicy.v2.OrgPolicyClient.ListCustomConstraintsPagedResponse;
2021
import static com.google.cloud.orgpolicy.v2.OrgPolicyClient.ListPoliciesPagedResponse;
2122

2223
import com.google.api.core.ApiFunction;
@@ -114,6 +115,38 @@ public UnaryCallSettings<DeletePolicyRequest, Empty> deletePolicySettings() {
114115
return ((OrgPolicyStubSettings) getStubSettings()).deletePolicySettings();
115116
}
116117

118+
/** Returns the object with the settings used for calls to createCustomConstraint. */
119+
public UnaryCallSettings<CreateCustomConstraintRequest, CustomConstraint>
120+
createCustomConstraintSettings() {
121+
return ((OrgPolicyStubSettings) getStubSettings()).createCustomConstraintSettings();
122+
}
123+
124+
/** Returns the object with the settings used for calls to updateCustomConstraint. */
125+
public UnaryCallSettings<UpdateCustomConstraintRequest, CustomConstraint>
126+
updateCustomConstraintSettings() {
127+
return ((OrgPolicyStubSettings) getStubSettings()).updateCustomConstraintSettings();
128+
}
129+
130+
/** Returns the object with the settings used for calls to getCustomConstraint. */
131+
public UnaryCallSettings<GetCustomConstraintRequest, CustomConstraint>
132+
getCustomConstraintSettings() {
133+
return ((OrgPolicyStubSettings) getStubSettings()).getCustomConstraintSettings();
134+
}
135+
136+
/** Returns the object with the settings used for calls to listCustomConstraints. */
137+
public PagedCallSettings<
138+
ListCustomConstraintsRequest,
139+
ListCustomConstraintsResponse,
140+
ListCustomConstraintsPagedResponse>
141+
listCustomConstraintsSettings() {
142+
return ((OrgPolicyStubSettings) getStubSettings()).listCustomConstraintsSettings();
143+
}
144+
145+
/** Returns the object with the settings used for calls to deleteCustomConstraint. */
146+
public UnaryCallSettings<DeleteCustomConstraintRequest, Empty> deleteCustomConstraintSettings() {
147+
return ((OrgPolicyStubSettings) getStubSettings()).deleteCustomConstraintSettings();
148+
}
149+
117150
public static final OrgPolicySettings create(OrgPolicyStubSettings stub) throws IOException {
118151
return new OrgPolicySettings.Builder(stub.toBuilder()).build();
119152
}
@@ -268,6 +301,39 @@ public UnaryCallSettings.Builder<DeletePolicyRequest, Empty> deletePolicySetting
268301
return getStubSettingsBuilder().deletePolicySettings();
269302
}
270303

304+
/** Returns the builder for the settings used for calls to createCustomConstraint. */
305+
public UnaryCallSettings.Builder<CreateCustomConstraintRequest, CustomConstraint>
306+
createCustomConstraintSettings() {
307+
return getStubSettingsBuilder().createCustomConstraintSettings();
308+
}
309+
310+
/** Returns the builder for the settings used for calls to updateCustomConstraint. */
311+
public UnaryCallSettings.Builder<UpdateCustomConstraintRequest, CustomConstraint>
312+
updateCustomConstraintSettings() {
313+
return getStubSettingsBuilder().updateCustomConstraintSettings();
314+
}
315+
316+
/** Returns the builder for the settings used for calls to getCustomConstraint. */
317+
public UnaryCallSettings.Builder<GetCustomConstraintRequest, CustomConstraint>
318+
getCustomConstraintSettings() {
319+
return getStubSettingsBuilder().getCustomConstraintSettings();
320+
}
321+
322+
/** Returns the builder for the settings used for calls to listCustomConstraints. */
323+
public PagedCallSettings.Builder<
324+
ListCustomConstraintsRequest,
325+
ListCustomConstraintsResponse,
326+
ListCustomConstraintsPagedResponse>
327+
listCustomConstraintsSettings() {
328+
return getStubSettingsBuilder().listCustomConstraintsSettings();
329+
}
330+
331+
/** Returns the builder for the settings used for calls to deleteCustomConstraint. */
332+
public UnaryCallSettings.Builder<DeleteCustomConstraintRequest, Empty>
333+
deleteCustomConstraintSettings() {
334+
return getStubSettingsBuilder().deleteCustomConstraintSettings();
335+
}
336+
271337
@Override
272338
public OrgPolicySettings build() throws IOException {
273339
return new OrgPolicySettings(this);

java-orgpolicy/google-cloud-orgpolicy/src/main/java/com/google/cloud/orgpolicy/v2/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,21 @@
1010
"grpc": {
1111
"libraryClient": "OrgPolicyClient",
1212
"rpcs": {
13+
"CreateCustomConstraint": {
14+
"methods": ["createCustomConstraint", "createCustomConstraint", "createCustomConstraint", "createCustomConstraintCallable"]
15+
},
1316
"CreatePolicy": {
1417
"methods": ["createPolicy", "createPolicy", "createPolicy", "createPolicy", "createPolicy", "createPolicyCallable"]
1518
},
19+
"DeleteCustomConstraint": {
20+
"methods": ["deleteCustomConstraint", "deleteCustomConstraint", "deleteCustomConstraint", "deleteCustomConstraintCallable"]
21+
},
1622
"DeletePolicy": {
1723
"methods": ["deletePolicy", "deletePolicy", "deletePolicy", "deletePolicyCallable"]
1824
},
25+
"GetCustomConstraint": {
26+
"methods": ["getCustomConstraint", "getCustomConstraint", "getCustomConstraint", "getCustomConstraintCallable"]
27+
},
1928
"GetEffectivePolicy": {
2029
"methods": ["getEffectivePolicy", "getEffectivePolicy", "getEffectivePolicy", "getEffectivePolicyCallable"]
2130
},
@@ -25,9 +34,15 @@
2534
"ListConstraints": {
2635
"methods": ["listConstraints", "listConstraints", "listConstraints", "listConstraints", "listConstraints", "listConstraintsPagedCallable", "listConstraintsCallable"]
2736
},
37+
"ListCustomConstraints": {
38+
"methods": ["listCustomConstraints", "listCustomConstraints", "listCustomConstraints", "listCustomConstraintsPagedCallable", "listCustomConstraintsCallable"]
39+
},
2840
"ListPolicies": {
2941
"methods": ["listPolicies", "listPolicies", "listPolicies", "listPolicies", "listPolicies", "listPoliciesPagedCallable", "listPoliciesCallable"]
3042
},
43+
"UpdateCustomConstraint": {
44+
"methods": ["updateCustomConstraint", "updateCustomConstraint", "updateCustomConstraintCallable"]
45+
},
3146
"UpdatePolicy": {
3247
"methods": ["updatePolicy", "updatePolicy", "updatePolicyCallable"]
3348
}

java-orgpolicy/google-cloud-orgpolicy/src/main/java/com/google/cloud/orgpolicy/v2/package-info.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,20 @@
2323
*
2424
* <p>Service Description: An interface for managing organization policies.
2525
*
26-
* <p>The Cloud Org Policy service provides a simple mechanism for organizations to restrict the
27-
* allowed configurations across their entire Cloud Resource hierarchy.
26+
* <p>The Organization Policy Service provides a simple mechanism for organizations to restrict the
27+
* allowed configurations across their entire resource hierarchy.
2828
*
29-
* <p>You can use a `policy` to configure restrictions in Cloud resources. For example, you can
30-
* enforce a `policy` that restricts which Google Cloud Platform APIs can be activated in a certain
31-
* part of your resource hierarchy, or prevents serial port access to VM instances in a particular
32-
* folder.
29+
* <p>You can use a policy to configure restrictions on resources. For example, you can enforce a
30+
* policy that restricts which Google Cloud APIs can be activated in a certain part of your resource
31+
* hierarchy, or prevents serial port access to VM instances in a particular folder.
3332
*
34-
* <p>`Policies` are inherited down through the resource hierarchy. A `policy` applied to a parent
35-
* resource automatically applies to all its child resources unless overridden with a `policy` lower
33+
* <p>Policies are inherited down through the resource hierarchy. A policy applied to a parent
34+
* resource automatically applies to all its child resources unless overridden with a policy lower
3635
* in the hierarchy.
3736
*
38-
* <p>A `constraint` defines an aspect of a resource's configuration that can be controlled by an
39-
* organization's policy administrator. `Policies` are a collection of `constraints` that defines
40-
* their allowable configuration on a particular resource and its child resources.
37+
* <p>A constraint defines an aspect of a resource's configuration that can be controlled by an
38+
* organization's policy administrator. Policies are a collection of constraints that defines their
39+
* allowable configuration on a particular resource and its child resources.
4140
*
4241
* <p>Sample for OrgPolicyClient:
4342
*

0 commit comments

Comments
 (0)