Reference documentation and code samples for the Google Cloud Org Policy V2 Client class MethodType.
The operation for which this constraint will be applied. To apply this
constraint only when creating new resources, the method_types should be
CREATE only. To apply this constraint when creating or deleting
resources, the method_types should be CREATE and DELETE.
UPDATE-only custom constraints are not supported. Use CREATE or
CREATE, UPDATE.
Protobuf type google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Org Policy V2 Client - Class MethodType (1.2.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.2 (latest)](/php/docs/reference/cloud-org-policy/latest/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [1.2.1](/php/docs/reference/cloud-org-policy/1.2.1/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [1.1.3](/php/docs/reference/cloud-org-policy/1.1.3/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [1.0.0](/php/docs/reference/cloud-org-policy/1.0.0/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [0.7.0](/php/docs/reference/cloud-org-policy/0.7.0/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [0.6.5](/php/docs/reference/cloud-org-policy/0.6.5/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [0.5.3](/php/docs/reference/cloud-org-policy/0.5.3/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [0.4.2](/php/docs/reference/cloud-org-policy/0.4.2/V2.Constraint.CustomConstraintDefinition.MethodType)\n- [0.3.7](/php/docs/reference/cloud-org-policy/0.3.7/V2.Constraint.CustomConstraintDefinition.MethodType) \nReference documentation and code samples for the Google Cloud Org Policy V2 Client class MethodType.\n\nThe operation for which this constraint will be applied. To apply this\nconstraint only when creating new resources, the `method_types` should be\n`CREATE` only. To apply this constraint when creating or deleting\nresources, the `method_types` should be `CREATE` and `DELETE`.\n\n`UPDATE`-only custom constraints are not supported. Use `CREATE` or\n`CREATE, UPDATE`.\n\nProtobuf type `google.cloud.orgpolicy.v2.Constraint.CustomConstraintDefinition.MethodType`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ OrgPolicy \\\\ V2 \\\\ Constraint \\\\ CustomConstraintDefinition\n\nMethods\n-------\n\n### static::name\n\n### static::value\n\nConstants\n---------\n\n### METHOD_TYPE_UNSPECIFIED\n\n Value: 0\n\nThis is only used for distinguishing unset values and should never be\nused. Results in an error.\n\nGenerated from protobuf enum `METHOD_TYPE_UNSPECIFIED = 0;`\n\n### CREATE\n\n Value: 1\n\nConstraint applied when creating the resource.\n\nGenerated from protobuf enum `CREATE = 1;`\n\n### UPDATE\n\n Value: 2\n\nConstraint applied when updating the resource.\n\nGenerated from protobuf enum `UPDATE = 2;`\n\n### DELETE\n\n Value: 3\n\nConstraint applied when deleting the resource.\n\nNot currently supported.\n\nGenerated from protobuf enum `DELETE = 3;`\n\n### REMOVE_GRANT\n\n Value: 4\n\nConstraint applied when removing an IAM grant.\n\nGenerated from protobuf enum `REMOVE_GRANT = 4;`\n\n### GOVERN_TAGS\n\n Value: 5\n\nConstraint applied when enforcing forced tagging.\n\nGenerated from protobuf enum `GOVERN_TAGS = 5;`"]]