Required. The logical name of the OS policy assignment in the project with the following restrictions: * * Must contain only lowercase letters, numbers, and hyphens. * * Must start with a letter. * * Must be between 1-63 characters. * * Must end with a number or a letter. * * Must be unique within the project.
getParent
Required. The parent resource name in the form:
projects/{project}/locations/{location}
Returns
Type
Description
string
setParent
Required. The parent resource name in the form:
projects/{project}/locations/{location}
Required. The logical name of the OS policy assignment in the project
with the following restrictions:
Must contain only lowercase letters, numbers, and hyphens.
Must start with a letter.
Must be between 1-63 characters.
Must end with a number or a letter.
Must be unique within the project.
Returns
Type
Description
string
setOsPolicyAssignmentId
Required. The logical name of the OS policy assignment in the project
with the following restrictions:
Must contain only lowercase letters, numbers, and hyphens.
Must start with a letter.
Must be between 1-63 characters.
Must end with a number or a letter.
Must be unique within the project.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
static::build
Parameters
Name
Description
parent
string
Required. The parent resource name in the form:
projects/{project}/locations/{location}
Please seeOsConfigZonalServiceClient::locationName()for help formatting this field.
[[["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 OsConfig V1 Client - Class CreateOSPolicyAssignmentRequest (2.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.0 (latest)](/php/docs/reference/cloud-osconfig/latest/V1.CreateOSPolicyAssignmentRequest)\n- [2.0.5](/php/docs/reference/cloud-osconfig/2.0.5/V1.CreateOSPolicyAssignmentRequest)\n- [1.3.5](/php/docs/reference/cloud-osconfig/1.3.5/V1.CreateOSPolicyAssignmentRequest)\n- [1.2.2](/php/docs/reference/cloud-osconfig/1.2.2/V1.CreateOSPolicyAssignmentRequest)\n- [1.1.1](/php/docs/reference/cloud-osconfig/1.1.1/V1.CreateOSPolicyAssignmentRequest)\n- [1.0.5](/php/docs/reference/cloud-osconfig/1.0.5/V1.CreateOSPolicyAssignmentRequest) \nReference documentation and code samples for the Google Cloud OsConfig V1 Client class CreateOSPolicyAssignmentRequest.\n\nA request message to create an OS policy assignment\n\nGenerated from protobuf message `google.cloud.osconfig.v1.CreateOSPolicyAssignmentRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ OsConfig \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getParent\n\nRequired. The parent resource name in the form:\nprojects/{project}/locations/{location}\n\n### setParent\n\nRequired. The parent resource name in the form:\nprojects/{project}/locations/{location}\n\n### getOsPolicyAssignment\n\nRequired. The OS policy assignment to be created.\n\n### hasOsPolicyAssignment\n\n### clearOsPolicyAssignment\n\n### setOsPolicyAssignment\n\nRequired. The OS policy assignment to be created.\n\n### getOsPolicyAssignmentId\n\nRequired. The logical name of the OS policy assignment in the project\nwith the following restrictions:\n\n- Must contain only lowercase letters, numbers, and hyphens.\n\n- Must start with a letter.\n\n- Must be between 1-63 characters.\n- Must end with a number or a letter.\n- Must be unique within the project.\n\n### setOsPolicyAssignmentId\n\nRequired. The logical name of the OS policy assignment in the project\nwith the following restrictions:\n\n- Must contain only lowercase letters, numbers, and hyphens.\n\n- Must start with a letter.\n\n- Must be between 1-63 characters.\n- Must end with a number or a letter.\n- Must be unique within the project.\n\n### static::build"]]