internal static KeyVaultRoleAssignment DeserializeKeyVaultRoleAssignment(JsonElement element)
        {
            Optional <string> id   = default;
            Optional <string> name = default;
            Optional <string> type = default;
            Optional <KeyVaultRoleAssignmentPropertiesWithScope> properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    properties = KeyVaultRoleAssignmentPropertiesWithScope.DeserializeKeyVaultRoleAssignmentPropertiesWithScope(property.Value);
                    continue;
                }
            }
            return(new KeyVaultRoleAssignment(id.Value, name.Value, type.Value, properties.Value));
        }
 /// <summary>
 /// Initializes a new instance of RoleAssignment.
 /// </summary>
 /// <param name="id"> The role assignment ID. </param>
 /// <param name="name"> The role assignment name. </param>
 /// <param name="type"> The role assignment type. </param>
 /// <param name="properties"> Role assignment properties. </param>
 public static KeyVaultRoleAssignment RoleAssignment(string id, string name, string type, KeyVaultRoleAssignmentPropertiesWithScope properties) =>
 new KeyVaultRoleAssignment(id, name, type, properties);