# Google Cloud OS Config v1alpha API - Class CreateOSPolicyAssignmentRequest (2.0.0-alpha07)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-alpha07 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.CreateOSPolicyAssignmentRequest)
- [2.0.0-alpha06](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/2.0.0-alpha06/Google.Cloud.OsConfig.V1Alpha.CreateOSPolicyAssignmentRequest)
- [1.0.0-alpha04](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/1.0.0-alpha04/Google.Cloud.OsConfig.V1Alpha.CreateOSPolicyAssignmentRequest)

    public sealed class CreateOSPolicyAssignmentRequest : IMessage<CreateOSPolicyAssignmentRequest>, IEquatable<CreateOSPolicyAssignmentRequest>, IDeepCloneable<CreateOSPolicyAssignmentRequest>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud OS Config v1alpha API class CreateOSPolicyAssignmentRequest.

A request message to create an OS policy assignment

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> CreateOSPolicyAssignmentRequest

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CreateOSPolicyAssignmentRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.CreateOSPolicyAssignmentRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CreateOSPolicyAssignmentRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.CreateOSPolicyAssignmentRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CreateOSPolicyAssignmentRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.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)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.OsConfig.V1Alpha](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha)

## Assembly

Google.Cloud.OsConfig.V1Alpha.dll

## Constructors

### CreateOSPolicyAssignmentRequest()

    public CreateOSPolicyAssignmentRequest()

### CreateOSPolicyAssignmentRequest(CreateOSPolicyAssignmentRequest)

    public CreateOSPolicyAssignmentRequest(CreateOSPolicyAssignmentRequest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.CreateOSPolicyAssignmentRequest` |

## Properties

### OsPolicyAssignment

    public OSPolicyAssignment OsPolicyAssignment { get; set; }

Required. The OS policy assignment to be created.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicyAssignment` |   |

### OsPolicyAssignmentId

    public string OsPolicyAssignmentId { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Parent

    public string Parent { get; set; }

Required. The parent resource name in the form:
projects/{project}/locations/{location}

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ParentAsLocationName

    public LocationName ParentAsLocationName { get; set; }

[LocationName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html)-typed view over the [Parent](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.CreateOSPolicyAssignmentRequest#Google_Cloud_OsConfig_V1Alpha_CreateOSPolicyAssignmentRequest_Parent) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html` |   |