Stay organized with collections
Save and categorize content based on your preferences.
Updates the specified Policy on the resource. Creates a new Policy
for that Constraint on the resource if one does not exist. Not
supplying an etag on the request Policy results in an unconditional
write of the Policy.
Arguments
Parameters
resource
string
Required. Resource name of the resource to attach the Policy.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Method: googleapis.cloudresourcemanager.v1.folders.setOrgPolicy\n\nUpdates the specified `Policy` on the resource. Creates a new `Policy`\nfor that `Constraint` on the resource if one does not exist. Not\nsupplying an `etag` on the request `Policy` results in an unconditional\nwrite of the `Policy`.\n\nArguments\n---------\n\nRaised exceptions\n-----------------\n\nResponse\n--------\n\nIf successful, the response contains an instance of [`OrgPolicy`](https://cloud.google.com/workflows/docs/reference/googleapis/cloudresourcemanager/v1/Overview#OrgPolicy).\n\nSubworkflow snippet\n-------------------\n\nSome fields might be optional or required.\nTo identify required fields, refer to the [API documentation](https://cloud.google.com/resource-manager/reference/rest/v1/folders/setOrgPolicy). \n\n### YAML\n\n```yaml\n- setOrgPolicy:\n call: googleapis.cloudresourcemanager.v1.folders.setOrgPolicy\n args:\n resource: ...\n body:\n policy:\n booleanPolicy:\n enforced: ...\n constraint: ...\n etag: ...\n listPolicy:\n allValues: ...\n allowedValues: ...\n deniedValues: ...\n inheritFromParent: ...\n suggestedValue: ...\n restoreDefault: ...\n updateTime: ...\n version: ...\n result: setOrgPolicyResult\n```\n\n### JSON\n\n```json\n[\n {\n \"setOrgPolicy\": {\n \"call\": \"googleapis.cloudresourcemanager.v1.folders.setOrgPolicy\",\n \"args\": {\n \"resource\": \"...\",\n \"body\": {\n \"policy\": {\n \"booleanPolicy\": {\n \"enforced\": \"...\"\n },\n \"constraint\": \"...\",\n \"etag\": \"...\",\n \"listPolicy\": {\n \"allValues\": \"...\",\n \"allowedValues\": \"...\",\n \"deniedValues\": \"...\",\n \"inheritFromParent\": \"...\",\n \"suggestedValue\": \"...\"\n },\n \"restoreDefault\": \"...\",\n \"updateTime\": \"...\",\n \"version\": \"...\"\n }\n }\n },\n \"result\": \"setOrgPolicyResult\"\n }\n }\n]\n```"]]