Skip to content

Commit

Permalink
feat: [orgpolicy] Add custom constraints CRUD APIs, proper etag suppo…
Browse files Browse the repository at this point in the history
…rt 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: googleapis/googleapis-gen@3c13326
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jan 2, 2024
1 parent e1a95a3 commit 04b5953
Show file tree
Hide file tree
Showing 79 changed files with 15,406 additions and 1,113 deletions.
2 changes: 1 addition & 1 deletion java-orgpolicy/README.md
Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-orgpolicy.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-orgpolicy/2.30.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-orgpolicy/2.32.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -17,6 +17,7 @@
package com.google.cloud.orgpolicy.v2;

import static com.google.cloud.orgpolicy.v2.OrgPolicyClient.ListConstraintsPagedResponse;
import static com.google.cloud.orgpolicy.v2.OrgPolicyClient.ListCustomConstraintsPagedResponse;
import static com.google.cloud.orgpolicy.v2.OrgPolicyClient.ListPoliciesPagedResponse;

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

/** Returns the object with the settings used for calls to createCustomConstraint. */
public UnaryCallSettings<CreateCustomConstraintRequest, CustomConstraint>
createCustomConstraintSettings() {
return ((OrgPolicyStubSettings) getStubSettings()).createCustomConstraintSettings();
}

/** Returns the object with the settings used for calls to updateCustomConstraint. */
public UnaryCallSettings<UpdateCustomConstraintRequest, CustomConstraint>
updateCustomConstraintSettings() {
return ((OrgPolicyStubSettings) getStubSettings()).updateCustomConstraintSettings();
}

/** Returns the object with the settings used for calls to getCustomConstraint. */
public UnaryCallSettings<GetCustomConstraintRequest, CustomConstraint>
getCustomConstraintSettings() {
return ((OrgPolicyStubSettings) getStubSettings()).getCustomConstraintSettings();
}

/** Returns the object with the settings used for calls to listCustomConstraints. */
public PagedCallSettings<
ListCustomConstraintsRequest,
ListCustomConstraintsResponse,
ListCustomConstraintsPagedResponse>
listCustomConstraintsSettings() {
return ((OrgPolicyStubSettings) getStubSettings()).listCustomConstraintsSettings();
}

/** Returns the object with the settings used for calls to deleteCustomConstraint. */
public UnaryCallSettings<DeleteCustomConstraintRequest, Empty> deleteCustomConstraintSettings() {
return ((OrgPolicyStubSettings) getStubSettings()).deleteCustomConstraintSettings();
}

public static final OrgPolicySettings create(OrgPolicyStubSettings stub) throws IOException {
return new OrgPolicySettings.Builder(stub.toBuilder()).build();
}
Expand Down Expand Up @@ -268,6 +301,39 @@ public UnaryCallSettings.Builder<DeletePolicyRequest, Empty> deletePolicySetting
return getStubSettingsBuilder().deletePolicySettings();
}

/** Returns the builder for the settings used for calls to createCustomConstraint. */
public UnaryCallSettings.Builder<CreateCustomConstraintRequest, CustomConstraint>
createCustomConstraintSettings() {
return getStubSettingsBuilder().createCustomConstraintSettings();
}

/** Returns the builder for the settings used for calls to updateCustomConstraint. */
public UnaryCallSettings.Builder<UpdateCustomConstraintRequest, CustomConstraint>
updateCustomConstraintSettings() {
return getStubSettingsBuilder().updateCustomConstraintSettings();
}

/** Returns the builder for the settings used for calls to getCustomConstraint. */
public UnaryCallSettings.Builder<GetCustomConstraintRequest, CustomConstraint>
getCustomConstraintSettings() {
return getStubSettingsBuilder().getCustomConstraintSettings();
}

/** Returns the builder for the settings used for calls to listCustomConstraints. */
public PagedCallSettings.Builder<
ListCustomConstraintsRequest,
ListCustomConstraintsResponse,
ListCustomConstraintsPagedResponse>
listCustomConstraintsSettings() {
return getStubSettingsBuilder().listCustomConstraintsSettings();
}

/** Returns the builder for the settings used for calls to deleteCustomConstraint. */
public UnaryCallSettings.Builder<DeleteCustomConstraintRequest, Empty>
deleteCustomConstraintSettings() {
return getStubSettingsBuilder().deleteCustomConstraintSettings();
}

@Override
public OrgPolicySettings build() throws IOException {
return new OrgPolicySettings(this);
Expand Down
Expand Up @@ -10,12 +10,21 @@
"grpc": {
"libraryClient": "OrgPolicyClient",
"rpcs": {
"CreateCustomConstraint": {
"methods": ["createCustomConstraint", "createCustomConstraint", "createCustomConstraint", "createCustomConstraintCallable"]
},
"CreatePolicy": {
"methods": ["createPolicy", "createPolicy", "createPolicy", "createPolicy", "createPolicy", "createPolicyCallable"]
},
"DeleteCustomConstraint": {
"methods": ["deleteCustomConstraint", "deleteCustomConstraint", "deleteCustomConstraint", "deleteCustomConstraintCallable"]
},
"DeletePolicy": {
"methods": ["deletePolicy", "deletePolicy", "deletePolicy", "deletePolicyCallable"]
},
"GetCustomConstraint": {
"methods": ["getCustomConstraint", "getCustomConstraint", "getCustomConstraint", "getCustomConstraintCallable"]
},
"GetEffectivePolicy": {
"methods": ["getEffectivePolicy", "getEffectivePolicy", "getEffectivePolicy", "getEffectivePolicyCallable"]
},
Expand All @@ -25,9 +34,15 @@
"ListConstraints": {
"methods": ["listConstraints", "listConstraints", "listConstraints", "listConstraints", "listConstraints", "listConstraintsPagedCallable", "listConstraintsCallable"]
},
"ListCustomConstraints": {
"methods": ["listCustomConstraints", "listCustomConstraints", "listCustomConstraints", "listCustomConstraintsPagedCallable", "listCustomConstraintsCallable"]
},
"ListPolicies": {
"methods": ["listPolicies", "listPolicies", "listPolicies", "listPolicies", "listPolicies", "listPoliciesPagedCallable", "listPoliciesCallable"]
},
"UpdateCustomConstraint": {
"methods": ["updateCustomConstraint", "updateCustomConstraint", "updateCustomConstraintCallable"]
},
"UpdatePolicy": {
"methods": ["updatePolicy", "updatePolicy", "updatePolicyCallable"]
}
Expand Down
Expand Up @@ -23,21 +23,20 @@
*
* <p>Service Description: An interface for managing organization policies.
*
* <p>The Cloud Org Policy service provides a simple mechanism for organizations to restrict the
* allowed configurations across their entire Cloud Resource hierarchy.
* <p>The Organization Policy Service provides a simple mechanism for organizations to restrict the
* allowed configurations across their entire resource hierarchy.
*
* <p>You can use a `policy` to configure restrictions in Cloud resources. For example, you can
* enforce a `policy` that restricts which Google Cloud Platform APIs can be activated in a certain
* part of your resource hierarchy, or prevents serial port access to VM instances in a particular
* folder.
* <p>You can use a policy to configure restrictions on resources. For example, you can enforce a
* policy that restricts which Google Cloud APIs can be activated in a certain part of your resource
* hierarchy, or prevents serial port access to VM instances in a particular folder.
*
* <p>`Policies` are inherited down through the resource hierarchy. A `policy` applied to a parent
* resource automatically applies to all its child resources unless overridden with a `policy` lower
* <p>Policies are inherited down through the resource hierarchy. A policy applied to a parent
* resource automatically applies to all its child resources unless overridden with a policy lower
* in the hierarchy.
*
* <p>A `constraint` defines an aspect of a resource's configuration that can be controlled by an
* organization's policy administrator. `Policies` are a collection of `constraints` that defines
* their allowable configuration on a particular resource and its child resources.
* <p>A constraint defines an aspect of a resource's configuration that can be controlled by an
* organization's policy administrator. Policies are a collection of constraints that defines their
* allowable configuration on a particular resource and its child resources.
*
* <p>Sample for OrgPolicyClient:
*
Expand Down

0 comments on commit 04b5953

Please sign in to comment.