title: Update Org Policy constraints with Python
body: <p>I am working on a small project, to update an org policy constraints by using python.
  I want to use python because I have set up Secret Manager and Impersonation.
  Right now I am at this final stage, of modifying the org policy constraint</p>
  <p>I have found the repo <a href="https://github.com/googleapis/python-org-policy/tree/40faa07298b3baa9a4d0ca26927b28fdd80aa03b/samples/generated_samples" rel="nofollow noreferrer">https://github.com/googleapis/python-org-policy/tree/40faa07298b3baa9a4d0ca26927b28fdd80aa03b/samples/generated_samples</a></p>
  <p>With a code sample for creating a constraint.</p>
  <p>I would like to modify this: &quot;projects/project-id-from-gcp/policies/compute.skipDefaultNetworkCreation&quot; to Enforced.</p>
  <p>The code I have so far, is this:</p>
  <pre><code>from google.cloud import orgpolicy_v2
  
  
  def sample_update_policy():
      # Create a client
      client = orgpolicy_v2.OrgPolicyClient()
  
      # Initialize request argument(s)
      request = orgpolicy_v2.UpdatePolicyRequest(
          policy=&quot;&quot;&quot;
          name: &quot;projects/project-id-from-gcp/policies/compute.skipDefaultNetworkCreation&quot;
          spec {
            rules {
              enforce: true
              }
            }
          &quot;&quot;&quot;
          
      )
  
      # Make the request
      response = client.update_policy(request=request)
      #
      # Handle the response
      print(response)
      
  sample_update_policy()
  </code></pre>
  <p>But I get the error google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument.
  I do not understand what to write exactly in &quot;CreatePolicyRequest&quot;.
  I also found this, <a href="https://googleapis.dev/python/orgpolicy/1.0.2/orgpolicy_v2/types.html#google.cloud.orgpolicy_v2.types.Policy" rel="nofollow noreferrer">https://googleapis.dev/python/orgpolicy/1.0.2/orgpolicy_v2/types.html#google.cloud.orgpolicy_v2.types.Policy</a> but it is not exactly clear to me.</p>
  <p>I was looking at this <a href="https://cloud.google.com/python/docs/reference/orgpolicy/latest/google.cloud.orgpolicy_v2.services.org_policy.OrgPolicyClient#google_cloud_orgpolicy_v2_services_org_policy_OrgPolicyClient_update_policy" rel="nofollow noreferrer">https://cloud.google.com/python/docs/reference/orgpolicy/latest/google.cloud.orgpolicy_v2.services.org_policy.OrgPolicyClient#google_cloud_orgpolicy_v2_services_org_policy_OrgPolicyClient_update_policy</a>
  But i honestly do not understand how to do it.</p>
  <p>(I do not think what I modified it is even correct. )</p>
  <p>Could you, please, point me in the right direction?</p>
  <p>Thank you</p>