public sealed class CreateOSPolicyAssignmentRequest : IMessage<CreateOSPolicyAssignmentRequest>, IEquatable<CreateOSPolicyAssignmentRequest>, IDeepCloneable<CreateOSPolicyAssignmentRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud OS Config v1 API class CreateOSPolicyAssignmentRequest.
A request message to create an OS policy assignment
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-12 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eCreateOSPolicyAssignmentRequest\u003c/code\u003e class within the Google Cloud OS Config v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCreateOSPolicyAssignmentRequest\u003c/code\u003e class is used to send a request for creating a new OS policy assignment.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the API documented is 2.4.0, with several prior versions also listed, ranging down to version 1.3.0.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits from and implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eCreateOSPolicyAssignmentRequest\u003c/code\u003e include \u003ccode\u003eOsPolicyAssignment\u003c/code\u003e, \u003ccode\u003eOsPolicyAssignmentId\u003c/code\u003e, \u003ccode\u003eParent\u003c/code\u003e, and \u003ccode\u003eParentAsLocationName\u003c/code\u003e, which define the OS policy to be assigned and its associated identifiers.\u003c/p\u003e\n"]]],[],null,["# Google Cloud OS Config v1 API - Class CreateOSPolicyAssignmentRequest (2.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.5.0 (latest)](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/latest/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/2.4.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/2.3.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/2.2.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/2.1.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/2.0.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/1.8.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/1.7.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/1.6.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/1.5.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/1.4.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/1.3.0/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest) \n\n public sealed class CreateOSPolicyAssignmentRequest : IMessage\u003cCreateOSPolicyAssignmentRequest\u003e, IEquatable\u003cCreateOSPolicyAssignmentRequest\u003e, IDeepCloneable\u003cCreateOSPolicyAssignmentRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud OS Config v1 API class CreateOSPolicyAssignmentRequest.\n\nA request message to create an OS policy assignment \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CreateOSPolicyAssignmentRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CreateOSPolicyAssignmentRequest](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/latest/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CreateOSPolicyAssignmentRequest](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/latest/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CreateOSPolicyAssignmentRequest](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/latest/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.OsConfig.V1](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/latest/Google.Cloud.OsConfig.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.OsConfig.V1.dll\n\nConstructors\n------------\n\n### CreateOSPolicyAssignmentRequest()\n\n public CreateOSPolicyAssignmentRequest()\n\n### CreateOSPolicyAssignmentRequest(CreateOSPolicyAssignmentRequest)\n\n public CreateOSPolicyAssignmentRequest(CreateOSPolicyAssignmentRequest other)\n\nProperties\n----------\n\n### OsPolicyAssignment\n\n public OSPolicyAssignment OsPolicyAssignment { get; set; }\n\nRequired. The OS policy assignment to be created.\n\n### OsPolicyAssignmentId\n\n public string OsPolicyAssignmentId { get; set; }\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- Must start with a letter.\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### Parent\n\n public string Parent { get; set; }\n\nRequired. The parent resource name in the form:\nprojects/{project}/locations/{location}\n\n### ParentAsLocationName\n\n public LocationName ParentAsLocationName { get; set; }\n\n[LocationName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.OsConfig.V1/latest/Google.Cloud.OsConfig.V1.CreateOSPolicyAssignmentRequest#Google_Cloud_OsConfig_V1_CreateOSPolicyAssignmentRequest_Parent) resource name property."]]