Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .last-synced-sha
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
92db0495807c86fbbc4d45bd266a6c1f5bcbb59c
710 changes: 706 additions & 4 deletions .oagen-manifest.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/WorkOS.net/Client/WorkOSClient.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public partial class WorkOSClient
/// <summary>Gets the <see cref="OrganizationsService"/> for organizations API operations.</summary>
public virtual OrganizationsService Organizations => this.organizations ??= new OrganizationsService(this);

private GroupsService groups;

/// <summary>Gets the <see cref="GroupsService"/> for groups API operations.</summary>
public virtual GroupsService Groups => this.groups ??= new GroupsService(this);

private AdminPortalService adminPortal;

/// <summary>Gets the <see cref="AdminPortalService"/> for admin portal API operations.</summary>
Expand All @@ -77,6 +82,11 @@ public partial class WorkOSClient
/// <summary>Gets the <see cref="UserManagementService"/> for user management API operations.</summary>
public virtual UserManagementService UserManagement => this.userManagement ??= new UserManagementService(this);

private UserManagementOrganizationMembershipGroupsService userManagementOrganizationMembershipGroups;

/// <summary>Gets the <see cref="UserManagementOrganizationMembershipGroupsService"/> for user management organization membership groups API operations.</summary>
public virtual UserManagementOrganizationMembershipGroupsService UserManagementOrganizationMembershipGroups => this.userManagementOrganizationMembershipGroups ??= new UserManagementOrganizationMembershipGroupsService(this);

private WebhooksService webhooks;

/// <summary>Gets the <see cref="WebhooksService"/> for webhooks API operations.</summary>
Expand Down
16 changes: 16 additions & 0 deletions src/WorkOS.net/Entities/CreateGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file is auto-generated by oagen. Do not edit.

namespace WorkOS
{

/// <summary>Represents a create group.</summary>
public class CreateGroup
{

/// <summary>The name of the Group.</summary>
public string Name { get; set; } = default!;

/// <summary>An optional description of the Group.</summary>
public string? Description { get; set; }
}
}
13 changes: 13 additions & 0 deletions src/WorkOS.net/Entities/CreateGroupMembership.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file is auto-generated by oagen. Do not edit.

namespace WorkOS
{

/// <summary>Represents a create group membership.</summary>
public class CreateGroupMembership
{

/// <summary>The ID of the Organization Membership to add to the group.</summary>
public string OrganizationMembershipId { get; set; } = default!;
}
}
3 changes: 2 additions & 1 deletion src/WorkOS.net/Entities/DirectoryUserWithGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public class DirectoryUserWithGroups
/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset UpdatedAt { get; set; }

/// <summary>The directory groups the user belongs to.</summary>
/// <summary>The directory groups the user belongs to. Use the List Directory Groups endpoint with a user filter instead.</summary>
[System.Obsolete("This field is deprecated.")]
public List<DirectoryGroup> Groups { get; set; } = default!;

/// <summary>
Expand Down
13 changes: 13 additions & 0 deletions src/WorkOS.net/Entities/DomainVerificationIntentOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file is auto-generated by oagen. Do not edit.

namespace WorkOS
{

/// <summary>Represents a domain verification intent options.</summary>
public class DomainVerificationIntentOptions
{

/// <summary>The domain name to verify. When provided, the domain verification flow will skip the domain entry form and go directly to the verification step.</summary>
public string? DomainName { get; set; }
}
}
94 changes: 0 additions & 94 deletions src/WorkOS.net/Entities/EventSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,9 @@

namespace WorkOS
{
using System;
using System.Collections.Generic;

/// <summary>An event emitted by WorkOS.</summary>
public class EventSchema
{

/// <summary>Distinguishes the Event object.</summary>
public string Object { get; internal set; } = "event";

/// <summary>Unique identifier for the Event.</summary>
public string Id { get; set; } = default!;

/// <summary>The type of event that occurred.</summary>
public string Event { get; set; } = default!;

/// <summary>The event payload.</summary>
public Dictionary<string, object> Data { get; set; } = default!;

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset CreatedAt { get; set; }

/// <summary>Additional context about the event.</summary>
public Dictionary<string, object>? Context { get; set; }

/// <summary>
/// Typed accessor for <see cref="Data"/>. Returns the value stored under
/// <paramref name="key"/> coerced to <typeparamref name="T"/>, or the default
/// value when the key is missing or the value is not convertible.
/// </summary>
/// <typeparam name="T">Expected value type.</typeparam>
/// <param name="key">The key to look up.</param>
public T? GetDataAttribute<T>(string key)
{
if (this.Data == null)
{
return default;
}

if (!this.Data.TryGetValue(key, out var value))
{
return default;
}

if (value is T typed)
{
return typed;
}

if (value is Newtonsoft.Json.Linq.JToken token)
{
return token.ToObject<T>();
}

if (value is System.Text.Json.JsonElement element)
{
return System.Text.Json.JsonSerializer.Deserialize<T>(element.GetRawText());
}

return default;
}

/// <summary>
/// Typed accessor for <see cref="Context"/>. Returns the value stored under
/// <paramref name="key"/> coerced to <typeparamref name="T"/>, or the default
/// value when the key is missing or the value is not convertible.
/// </summary>
/// <typeparam name="T">Expected value type.</typeparam>
/// <param name="key">The key to look up.</param>
public T? GetContextAttribute<T>(string key)
{
if (this.Context == null)
{
return default;
}

if (!this.Context.TryGetValue(key, out var value))
{
return default;
}

if (value is T typed)
{
return typed;
}

if (value is Newtonsoft.Json.Linq.JToken token)
{
return token.ToObject<T>();
}

if (value is System.Text.Json.JsonElement element)
{
return System.Text.Json.JsonSerializer.Deserialize<T>(element.GetRawText());
}

return default;
}
}
Comment on lines 7 to 9
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 EventSchema gutted — EventsService now returns empty objects

All properties (Id, Event, Data, CreatedAt, Context) and the helper methods GetDataAttribute<T> / GetContextAttribute<T> have been removed, leaving EventSchema as an empty class. EventsService.ListAsync still returns WorkOSList<EventSchema>, so callers receive a list of empty objects with no data accessible at all. Any code consuming event payloads (event type, payload data, timestamps) will break silently at runtime.

}
2 changes: 1 addition & 1 deletion src/WorkOS.net/Entities/FlagCreated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class FlagCreated
public DateTimeOffset CreatedAt { get; set; }

/// <summary>Additional context about the event.</summary>
public EventSchemaContext Context { get; set; } = default!;
public FlagCreatedContext Context { get; set; } = default!;

/// <summary>Distinguishes the Event object.</summary>
public string Object { get; internal set; } = "event";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace WorkOS
{

/// <summary>Additional context about the event.</summary>
public class EventSchemaContext
public class FlagCreatedContext
{

/// <summary>The client ID associated with the flag event.</summary>
Expand Down
2 changes: 1 addition & 1 deletion src/WorkOS.net/Entities/FlagDeleted.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class FlagDeleted
public DateTimeOffset CreatedAt { get; set; }

/// <summary>Additional context about the event.</summary>
public EventSchemaContext Context { get; set; } = default!;
public FlagCreatedContext Context { get; set; } = default!;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Misleading context type on FlagDeleted

FlagDeleted.Context is typed as FlagCreatedContext, which is semantically incorrect for a delete event. If FlagCreated and FlagDeleted share the same context shape, a neutral name such as FlagEventContext would be clearer; alternatively, introduce a separate FlagDeletedContext type.


/// <summary>Distinguishes the Event object.</summary>
public string Object { get; internal set; } = "event";
Expand Down
4 changes: 2 additions & 2 deletions src/WorkOS.net/Entities/GenerateLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GenerateLink
/// <summary>Options to configure the Admin Portal based on the intent.</summary>
public IntentOptions? IntentOptions { get; set; }

/// <summary>The email addresses of the IT admins to grant access to the Admin Portal for the given organization. Accepts up to 20 emails.</summary>
public List<string>? AdminEmails { get; set; }
/// <summary>The email addresses of the IT contacts to grant access to the Admin Portal for the given organization. Accepts up to 20 emails.</summary>
public List<string>? ItContactEmails { get; set; }
}
}
5 changes: 4 additions & 1 deletion src/WorkOS.net/Entities/IntentOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ public class IntentOptions
{

/// <summary>SSO-specific options for the Admin Portal.</summary>
public SSOIntentOptions SSO { get; set; } = default!;
public SSOIntentOptions? SSO { get; set; }

/// <summary>Domain verification-specific options for the Admin Portal.</summary>
public DomainVerificationIntentOptions? DomainVerification { get; set; }
}
}
3 changes: 3 additions & 0 deletions src/WorkOS.net/Entities/Invitation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class Invitation
/// <summary>The ID of the user who accepted the invitation, once accepted.</summary>
public string? AcceptedUserId { get; set; }

/// <summary>Slug of the role the invitee will be assigned on acceptance. Reflects the current role on the invitee's organization membership. null when the invitation has no associated organization.</summary>
public string? RoleSlug { get; set; }

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset CreatedAt { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions src/WorkOS.net/Entities/InvitationAcceptedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class InvitationAcceptedData
/// <summary>The ID of the user who accepted the invitation, once accepted.</summary>
public string? AcceptedUserId { get; set; }

/// <summary>Slug of the role the invitee will be assigned on acceptance. Reflects the current role on the invitee's organization membership. null when the invitation has no associated organization.</summary>
public string? RoleSlug { get; set; }

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset CreatedAt { get; set; }

Expand Down
36 changes: 36 additions & 0 deletions src/WorkOS.net/Entities/WaitlistUser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This file is auto-generated by oagen. Do not edit.

namespace WorkOS
{
using System;
using Newtonsoft.Json;
using STJS = System.Text.Json.Serialization;

/// <summary>Represents a waitlist user.</summary>
public class WaitlistUser
{

/// <summary>Distinguishes the Waitlist User object.</summary>
public string Object { get; internal set; } = "waitlist_user";

/// <summary>The unique ID of the Waitlist User.</summary>
public string Id { get; set; } = default!;

/// <summary>The email address of the Waitlist User.</summary>
public string Email { get; set; } = default!;

/// <summary>The state of the Waitlist User.</summary>
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
[STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingDefault)]
public WaitlistUserState State { get; set; }

/// <summary>The timestamp when the Waitlist User was approved, or null if not yet approved.</summary>
public DateTimeOffset? ApprovedAt { get; set; }

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset CreatedAt { get; set; }

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset UpdatedAt { get; set; }
}
}
25 changes: 25 additions & 0 deletions src/WorkOS.net/Entities/WaitlistUserApproved.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// This file is auto-generated by oagen. Do not edit.

namespace WorkOS
{
using System;

/// <summary>Represents a waitlist user approved.</summary>
public class WaitlistUserApproved
{

/// <summary>Unique identifier for the event.</summary>
public string Id { get; set; } = default!;
public string Event { get; internal set; } = "waitlist_user.approved";

/// <summary>The event payload.</summary>
public WaitlistUser Data { get; set; } = default!;

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset CreatedAt { get; set; }
public EventContext? Context { get; set; }

/// <summary>Distinguishes the Event object.</summary>
public string Object { get; internal set; } = "event";
}
}
25 changes: 25 additions & 0 deletions src/WorkOS.net/Entities/WaitlistUserCreated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// This file is auto-generated by oagen. Do not edit.

namespace WorkOS
{
using System;

/// <summary>Represents a waitlist user created.</summary>
public class WaitlistUserCreated
{

/// <summary>Unique identifier for the event.</summary>
public string Id { get; set; } = default!;
public string Event { get; internal set; } = "waitlist_user.created";

/// <summary>The event payload.</summary>
public WaitlistUser Data { get; set; } = default!;

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset CreatedAt { get; set; }
public EventContext? Context { get; set; }

/// <summary>Distinguishes the Event object.</summary>
public string Object { get; internal set; } = "event";
}
}
25 changes: 25 additions & 0 deletions src/WorkOS.net/Entities/WaitlistUserDenied.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// This file is auto-generated by oagen. Do not edit.

namespace WorkOS
{
using System;

/// <summary>Represents a waitlist user denied.</summary>
public class WaitlistUserDenied
{

/// <summary>Unique identifier for the event.</summary>
public string Id { get; set; } = default!;
public string Event { get; internal set; } = "waitlist_user.denied";

/// <summary>The event payload.</summary>
public WaitlistUser Data { get; set; } = default!;

/// <summary>An ISO 8601 timestamp.</summary>
public DateTimeOffset CreatedAt { get; set; }
public EventContext? Context { get; set; }

/// <summary>Distinguishes the Event object.</summary>
public string Object { get; internal set; } = "event";
}
}
6 changes: 6 additions & 0 deletions src/WorkOS.net/Enums/CreateWebhookEndpointEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,11 @@ public enum CreateWebhookEndpointEvents
SessionCreated,
[EnumMember(Value = "session.revoked")]
SessionRevoked,
[EnumMember(Value = "waitlist_user.approved")]
WaitlistUserApproved,
[EnumMember(Value = "waitlist_user.created")]
WaitlistUserCreated,
[EnumMember(Value = "waitlist_user.denied")]
WaitlistUserDenied,
}
}
Loading