code: 20 · tests: 1 · manifest: 1
dotnet/.oagen-manifest.json|
@@ -236,6 +236,8 @@
|
|
| 236 |
"src/WorkOS.net/Entities/InvitationCreated.cs",
|
| 237 |
"src/WorkOS.net/Entities/InvitationResent.cs",
|
| 238 |
"src/WorkOS.net/Entities/InvitationRevoked.cs",
|
|
|
|
|
|
|
| 239 |
"src/WorkOS.net/Entities/JWTTemplateResponse.cs",
|
| 240 |
"src/WorkOS.net/Entities/JwksResponse.cs",
|
| 241 |
"src/WorkOS.net/Entities/JwksResponseKeys.cs",
|
|
@@ -385,7 +387,6 @@
|
|
| 385 |
"src/WorkOS.net/Enums/ConnectionState.cs",
|
| 386 |
"src/WorkOS.net/Enums/ConnectionType.cs",
|
| 387 |
"src/WorkOS.net/Enums/ConnectionsConnectionType.cs",
|
| 388 |
-
"src/WorkOS.net/Enums/CreateDataIntegrationAuthMethods.cs",
|
| 389 |
"src/WorkOS.net/Enums/CreateUserInviteOptionsLocale.cs",
|
| 390 |
"src/WorkOS.net/Enums/CreateUserPasswordHashType.cs",
|
| 391 |
"src/WorkOS.net/Enums/CreateUserPasswordSaltPosition.cs",
|
|
@@ -461,6 +462,8 @@
|
|
| 461 |
"src/WorkOS.net/Services/OrganizationMembership/_interfaces/OrganizationMembershipOptions.cs",
|
| 462 |
"src/WorkOS.net/Services/Organizations/OrganizationsService.cs",
|
| 463 |
"src/WorkOS.net/Services/Organizations/_interfaces/OrganizationsOptions.cs",
|
|
|
|
|
|
|
| 464 |
"src/WorkOS.net/Services/Pipes/PipesService.cs",
|
| 465 |
"src/WorkOS.net/Services/Pipes/_interfaces/PipesOptions.cs",
|
| 466 |
"src/WorkOS.net/Services/PipesProvider/PipesProviderService.cs",
|
|
@@ -492,6 +495,7 @@
|
|
| 492 |
"test/WorkOSTests/Tests/MultiFactorAuthServiceTest.cs",
|
| 493 |
"test/WorkOSTests/Tests/OrganizationDomainsServiceTest.cs",
|
| 494 |
"test/WorkOSTests/Tests/OrganizationMembershipServiceTest.cs",
|
|
|
|
| 495 |
"test/WorkOSTests/Tests/OrganizationsServiceTest.cs",
|
| 496 |
"test/WorkOSTests/Tests/PipesProviderServiceTest.cs",
|
| 497 |
"test/WorkOSTests/Tests/PipesServiceTest.cs",
|
|
@@ -799,6 +803,7 @@
|
|
| 799 |
"test/WorkOSTests/testdata/create_group_nulls.json",
|
| 800 |
"test/WorkOSTests/testdata/create_group_role_assignment.json",
|
| 801 |
"test/WorkOSTests/testdata/create_group_role_assignment_nulls.json",
|
|
|
|
| 802 |
"test/WorkOSTests/testdata/create_m2m_application.json",
|
| 803 |
"test/WorkOSTests/testdata/create_m2m_application_nulls.json",
|
| 804 |
"test/WorkOSTests/testdata/create_magic_code_and_return.json",
|
|
@@ -1050,6 +1055,8 @@
|
|
| 1050 |
"test/WorkOSTests/testdata/invitation_revoked_data.json",
|
| 1051 |
"test/WorkOSTests/testdata/invitation_revoked_data_nulls.json",
|
| 1052 |
"test/WorkOSTests/testdata/invitation_revoked_nulls.json",
|
|
|
|
|
|
|
| 1053 |
"test/WorkOSTests/testdata/jwks_response.json",
|
| 1054 |
"test/WorkOSTests/testdata/jwks_response_keys.json",
|
| 1055 |
"test/WorkOSTests/testdata/jwt_template_response.json",
|
|
@@ -1742,6 +1749,10 @@
|
|
| 1742 |
"sdkMethod": "AuthorizeDataIntegrationAsync",
|
| 1743 |
"service": "pipes"
|
| 1744 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1745 |
"POST /data-integrations/{slug}/credentials": {
|
| 1746 |
"sdkMethod": "CreateDataIntegrationCredentialAsync",
|
| 1747 |
"service": "pipes"
|
|
@@ -1914,6 +1925,18 @@
|
|
| 1914 |
"sdkMethod": "ListAuthorizedApplicationsAsync",
|
| 1915 |
"service": "organizations"
|
| 1916 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1917 |
"POST /portal/generate_link": {
|
| 1918 |
"sdkMethod": "GenerateLinkAsync",
|
| 1919 |
"service": "admin_portal"
|
|
@@ -2293,10 +2316,6 @@
|
|
| 2293 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2294 |
"sdkMethod": "GetExportAsync",
|
| 2295 |
"service": "audit_logs"
|
| 2296 |
-
},
|
| 2297 |
-
"PUT /data-integrations/{slug}/client-credentials": {
|
| 2298 |
-
"sdkMethod": "UpdateDataIntegrationClientCredentialsAsync",
|
| 2299 |
-
"service": "pipes"
|
| 2300 |
}
|
| 2301 |
}
|
| 2302 |
}
|
|
|
|
| 236 |
"src/WorkOS.net/Entities/InvitationCreated.cs",
|
| 237 |
"src/WorkOS.net/Entities/InvitationResent.cs",
|
| 238 |
"src/WorkOS.net/Entities/InvitationRevoked.cs",
|
| 239 |
+
"src/WorkOS.net/Entities/ItContact.cs",
|
| 240 |
+
"src/WorkOS.net/Entities/ItContactList.cs",
|
| 241 |
"src/WorkOS.net/Entities/JWTTemplateResponse.cs",
|
| 242 |
"src/WorkOS.net/Entities/JwksResponse.cs",
|
| 243 |
"src/WorkOS.net/Entities/JwksResponseKeys.cs",
|
|
|
|
| 387 |
"src/WorkOS.net/Enums/ConnectionState.cs",
|
| 388 |
"src/WorkOS.net/Enums/ConnectionType.cs",
|
| 389 |
"src/WorkOS.net/Enums/ConnectionsConnectionType.cs",
|
|
|
|
| 390 |
"src/WorkOS.net/Enums/CreateUserInviteOptionsLocale.cs",
|
| 391 |
"src/WorkOS.net/Enums/CreateUserPasswordHashType.cs",
|
| 392 |
"src/WorkOS.net/Enums/CreateUserPasswordSaltPosition.cs",
|
|
|
|
| 462 |
"src/WorkOS.net/Services/OrganizationMembership/_interfaces/OrganizationMembershipOptions.cs",
|
| 463 |
"src/WorkOS.net/Services/Organizations/OrganizationsService.cs",
|
| 464 |
"src/WorkOS.net/Services/Organizations/_interfaces/OrganizationsOptions.cs",
|
| 465 |
+
"src/WorkOS.net/Services/OrganizationsItContacts/OrganizationsItContactsService.cs",
|
| 466 |
+
"src/WorkOS.net/Services/OrganizationsItContacts/_interfaces/OrganizationsItContactsOptions.cs",
|
| 467 |
"src/WorkOS.net/Services/Pipes/PipesService.cs",
|
| 468 |
"src/WorkOS.net/Services/Pipes/_interfaces/PipesOptions.cs",
|
| 469 |
"src/WorkOS.net/Services/PipesProvider/PipesProviderService.cs",
|
|
|
|
| 495 |
"test/WorkOSTests/Tests/MultiFactorAuthServiceTest.cs",
|
| 496 |
"test/WorkOSTests/Tests/OrganizationDomainsServiceTest.cs",
|
| 497 |
"test/WorkOSTests/Tests/OrganizationMembershipServiceTest.cs",
|
| 498 |
+
"test/WorkOSTests/Tests/OrganizationsItContactsServiceTest.cs",
|
| 499 |
"test/WorkOSTests/Tests/OrganizationsServiceTest.cs",
|
| 500 |
"test/WorkOSTests/Tests/PipesProviderServiceTest.cs",
|
| 501 |
"test/WorkOSTests/Tests/PipesServiceTest.cs",
|
|
|
|
| 803 |
"test/WorkOSTests/testdata/create_group_nulls.json",
|
| 804 |
"test/WorkOSTests/testdata/create_group_role_assignment.json",
|
| 805 |
"test/WorkOSTests/testdata/create_group_role_assignment_nulls.json",
|
| 806 |
+
"test/WorkOSTests/testdata/create_it_contact.json",
|
| 807 |
"test/WorkOSTests/testdata/create_m2m_application.json",
|
| 808 |
"test/WorkOSTests/testdata/create_m2m_application_nulls.json",
|
| 809 |
"test/WorkOSTests/testdata/create_magic_code_and_return.json",
|
|
|
|
| 1055 |
"test/WorkOSTests/testdata/invitation_revoked_data.json",
|
| 1056 |
"test/WorkOSTests/testdata/invitation_revoked_data_nulls.json",
|
| 1057 |
"test/WorkOSTests/testdata/invitation_revoked_nulls.json",
|
| 1058 |
+
"test/WorkOSTests/testdata/it_contact.json",
|
| 1059 |
+
"test/WorkOSTests/testdata/it_contact_list.json",
|
| 1060 |
"test/WorkOSTests/testdata/jwks_response.json",
|
| 1061 |
"test/WorkOSTests/testdata/jwks_response_keys.json",
|
| 1062 |
"test/WorkOSTests/testdata/jwt_template_response.json",
|
|
|
|
| 1749 |
"sdkMethod": "AuthorizeDataIntegrationAsync",
|
| 1750 |
"service": "pipes"
|
| 1751 |
},
|
| 1752 |
+
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1753 |
+
"sdkMethod": "UpdateDataIntegrationClientCredentialsAsync",
|
| 1754 |
+
"service": "pipes"
|
| 1755 |
+
},
|
| 1756 |
"POST /data-integrations/{slug}/credentials": {
|
| 1757 |
"sdkMethod": "CreateDataIntegrationCredentialAsync",
|
| 1758 |
"service": "pipes"
|
|
|
|
| 1925 |
"sdkMethod": "ListAuthorizedApplicationsAsync",
|
| 1926 |
"service": "organizations"
|
| 1927 |
},
|
| 1928 |
+
"GET /organizations/{organization_id}/it_contacts": {
|
| 1929 |
+
"sdkMethod": "ListAsync",
|
| 1930 |
+
"service": "organizations_it_contacts"
|
| 1931 |
+
},
|
| 1932 |
+
"POST /organizations/{organization_id}/it_contacts": {
|
| 1933 |
+
"sdkMethod": "CreateAsync",
|
| 1934 |
+
"service": "organizations_it_contacts"
|
| 1935 |
+
},
|
| 1936 |
+
"DELETE /organizations/{organization_id}/it_contacts/{contact_id}": {
|
| 1937 |
+
"sdkMethod": "DeleteAsync",
|
| 1938 |
+
"service": "organizations_it_contacts"
|
| 1939 |
+
},
|
| 1940 |
"POST /portal/generate_link": {
|
| 1941 |
"sdkMethod": "GenerateLinkAsync",
|
| 1942 |
"service": "admin_portal"
|
|
|
|
| 2316 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2317 |
"sdkMethod": "GetExportAsync",
|
| 2318 |
"service": "audit_logs"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2319 |
}
|
| 2320 |
}
|
| 2321 |
}
|
dotnet/src/WorkOS.net/Client/WorkOSClient.Generated.cs|
@@ -82,6 +82,11 @@ namespace WorkOS
|
|
| 82 |
/// <summary>Gets the <see cref="GroupsService"/> for groups API operations.</summary>
|
| 83 |
public virtual GroupsService Groups => this.groups ??= new GroupsService(this);
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
private AdminPortalService adminPortal;
|
| 86 |
|
| 87 |
/// <summary>Gets the <see cref="AdminPortalService"/> for admin portal API operations.</summary>
|
|
|
|
| 82 |
/// <summary>Gets the <see cref="GroupsService"/> for groups API operations.</summary>
|
| 83 |
public virtual GroupsService Groups => this.groups ??= new GroupsService(this);
|
| 84 |
|
| 85 |
+
private OrganizationsItContactsService organizationsItContacts;
|
| 86 |
+
|
| 87 |
+
/// <summary>Gets the <see cref="OrganizationsItContactsService"/> for organizations it contacts API operations.</summary>
|
| 88 |
+
public virtual OrganizationsItContactsService OrganizationsItContacts => this.organizationsItContacts ??= new OrganizationsItContactsService(this);
|
| 89 |
+
|
| 90 |
private AdminPortalService adminPortal;
|
| 91 |
|
| 92 |
/// <summary>Gets the <see cref="AdminPortalService"/> for admin portal API operations.</summary>
|
dotnet/src/WorkOS.net/Entities/ItContact.cs|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
namespace WorkOS
|
| 4 |
+
{
|
| 5 |
+
using System;
|
| 6 |
+
|
| 7 |
+
/// <summary>Represents an it contact.</summary>
|
| 8 |
+
public class ItContact
|
| 9 |
+
{
|
| 10 |
+
|
| 11 |
+
/// <summary>The IT Contact object.</summary>
|
| 12 |
+
public string Object { get; internal set; } = "it_contact";
|
| 13 |
+
|
| 14 |
+
/// <summary>The unique ID of the IT Contact.</summary>
|
| 15 |
+
public string Id { get; set; } = default!;
|
| 16 |
+
|
| 17 |
+
/// <summary>The email address of the IT Contact.</summary>
|
| 18 |
+
public string Email { get; set; } = default!;
|
| 19 |
+
|
| 20 |
+
/// <summary>An ISO 8601 timestamp.</summary>
|
| 21 |
+
public DateTimeOffset CreatedAt { get; set; }
|
| 22 |
+
|
| 23 |
+
/// <summary>An ISO 8601 timestamp.</summary>
|
| 24 |
+
public DateTimeOffset UpdatedAt { get; set; }
|
| 25 |
+
}
|
| 26 |
+
}
|
dotnet/src/WorkOS.net/Entities/ItContactList.cs|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
namespace WorkOS
|
| 4 |
+
{
|
| 5 |
+
using System.Collections.Generic;
|
| 6 |
+
|
| 7 |
+
/// <summary>Represents an it contact list.</summary>
|
| 8 |
+
public class ItContactList
|
| 9 |
+
{
|
| 10 |
+
|
| 11 |
+
/// <summary>Indicates this is a list response.</summary>
|
| 12 |
+
public string Object { get; internal set; } = "list";
|
| 13 |
+
|
| 14 |
+
/// <summary>The list of records for the current page.</summary>
|
| 15 |
+
public List<ItContact> Data { get; set; } = default!;
|
| 16 |
+
|
| 17 |
+
/// <summary>Pagination cursors for navigating between pages of results.</summary>
|
| 18 |
+
public ItContactListListMetadata ListMetadata { get; set; } = default!;
|
| 19 |
+
}
|
| 20 |
+
}
|
dotnet/src/WorkOS.net/Entities/WaitlistUser.cs|
@@ -3,6 +3,7 @@
|
|
| 3 |
namespace WorkOS
|
| 4 |
{
|
| 5 |
using System;
|
|
|
|
| 6 |
using Newtonsoft.Json;
|
| 7 |
using STJS = System.Text.Json.Serialization;
|
| 8 |
|
|
@@ -10,24 +11,24 @@ namespace WorkOS
|
|
| 10 |
public class WaitlistUser
|
| 11 |
{
|
| 12 |
|
| 13 |
-
/// <summary>Distinguishes the Waitlist User object.</summary>
|
| 14 |
-
public string Object { get; internal set; } = "waitlist_user";
|
| 15 |
-
|
| 16 |
-
/// <summary>The unique ID of the
|
| 17 |
public string Id { get; set; } = default!;
|
| 18 |
|
| 19 |
-
/// <summary>The email address of the
|
| 20 |
public string Email { get; set; } = default!;
|
| 21 |
|
| 22 |
-
/// <summary>The state of the
|
| 23 |
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
| 24 |
[STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingDefault)]
|
| 25 |
public WaitlistUserState State { get; set; }
|
| 26 |
|
| 27 |
-
/// <summary>The timestamp when the
|
| 28 |
public DateTimeOffset? ApprovedAt { get; set; }
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
-
/// <summary>The unique ID of the
|
| 31 |
public string? WaitlistId { get; set; }
|
| 32 |
|
| 33 |
/// <summary>An ISO 8601 timestamp.</summary>
|
|
@@ -35,5 +36,8 @@ namespace WorkOS
|
|
| 35 |
|
| 36 |
/// <summary>An ISO 8601 timestamp.</summary>
|
| 37 |
public DateTimeOffset UpdatedAt { get; set; }
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
}
|
|
|
|
| 3 |
namespace WorkOS
|
| 4 |
{
|
| 5 |
using System;
|
| 6 |
+
using System.Collections.Generic;
|
| 7 |
using Newtonsoft.Json;
|
| 8 |
using STJS = System.Text.Json.Serialization;
|
| 9 |
|
|
|
|
| 11 |
public class WaitlistUser
|
| 12 |
{
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
+
/// <summary>The unique ID of the waitlist entry.</summary>
|
| 15 |
public string Id { get; set; } = default!;
|
| 16 |
|
| 17 |
+
/// <summary>The email address of the user on the waitlist.</summary>
|
| 18 |
public string Email { get; set; } = default!;
|
| 19 |
|
| 20 |
+
/// <summary>The state of the waitlist entry.</summary>
|
| 21 |
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
| 22 |
[STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingDefault)]
|
| 23 |
public WaitlistUserState State { get; set; }
|
| 24 |
|
| 25 |
+
/// <summary>The timestamp when the entry was approved, or null if not yet approved.</summary>
|
| 26 |
public DateTimeOffset? ApprovedAt { get; set; }
|
| 27 |
|
| 28 |
+
/// <summary>Additional fields submitted when the user joined the waitlist. Values are user-provided — treat them as untrusted input when rendering or exporting.</summary>
|
| 29 |
+
public Dictionary<string, string>? AdditionalFields { get; set; }
|
| 30 |
+
|
| 31 |
+
/// <summary>The unique ID of the waitlist the entry belongs to.</summary>
|
| 32 |
public string? WaitlistId { get; set; }
|
| 33 |
|
| 34 |
/// <summary>An ISO 8601 timestamp.</summary>
|
|
|
|
| 36 |
|
| 37 |
/// <summary>An ISO 8601 timestamp.</summary>
|
| 38 |
public DateTimeOffset UpdatedAt { get; set; }
|
| 39 |
+
|
| 40 |
+
/// <summary>Distinguishes the Waitlist User object.</summary>
|
| 41 |
+
public string Object { get; internal set; } = "waitlist_user";
|
| 42 |
}
|
| 43 |
}
|
dotnet/src/WorkOS.net/Enums/CreateDataIntegrationAuthMethods.cs|
@@ -1,22 +0,0 @@
|
|
| 1 |
-
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
-
|
| 3 |
-
namespace WorkOS
|
| 4 |
-
{
|
| 5 |
-
using System.Runtime.Serialization;
|
| 6 |
-
using Newtonsoft.Json;
|
| 7 |
-
using STJS = System.Text.Json.Serialization;
|
| 8 |
-
|
| 9 |
-
/// <summary>Represents create data integration auth methods values.</summary>
|
| 10 |
-
[JsonConverter(typeof(WorkOSNewtonsoftStringEnumConverter))]
|
| 11 |
-
[STJS.JsonConverter(typeof(WorkOSStringEnumConverterFactory))]
|
| 12 |
-
public enum CreateDataIntegrationAuthMethods
|
| 13 |
-
{
|
| 14 |
-
[EnumMember(Value = "unknown")]
|
| 15 |
-
Unknown,
|
| 16 |
-
|
| 17 |
-
[EnumMember(Value = "oauth")]
|
| 18 |
-
OAuth,
|
| 19 |
-
[EnumMember(Value = "api_key")]
|
| 20 |
-
ApiKey,
|
| 21 |
-
}
|
| 22 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dotnet/src/WorkOS.net/Services/Authorization/AuthorizationService.cs|
@@ -263,7 +263,7 @@ namespace WorkOS
|
|
| 263 |
|
| 264 |
/// <summary>List effective permissions for an organization membership on a resource</summary>
|
| 265 |
/// <remarks>
|
| 266 |
-
/// Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources.
|
| 267 |
/// </remarks>
|
| 268 |
/// <param name="organizationMembershipId">The ID of the organization membership.</param>
|
| 269 |
/// <param name="resourceId">The ID of the authorization resource.</param>
|
|
@@ -296,7 +296,7 @@ namespace WorkOS
|
|
| 296 |
|
| 297 |
/// <summary>List effective permissions for an organization membership on a resource by external ID</summary>
|
| 298 |
/// <remarks>
|
| 299 |
-
/// Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources.
|
| 300 |
/// </remarks>
|
| 301 |
/// <param name="organizationMembershipId">The ID of the organization membership.</param>
|
| 302 |
/// <param name="resourceTypeSlug">The slug of the resource type.</param>
|
|
|
|
| 263 |
|
| 264 |
/// <summary>List effective permissions for an organization membership on a resource</summary>
|
| 265 |
/// <remarks>
|
| 266 |
+
/// Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 267 |
/// </remarks>
|
| 268 |
/// <param name="organizationMembershipId">The ID of the organization membership.</param>
|
| 269 |
/// <param name="resourceId">The ID of the authorization resource.</param>
|
|
|
|
| 296 |
|
| 297 |
/// <summary>List effective permissions for an organization membership on a resource by external ID</summary>
|
| 298 |
/// <remarks>
|
| 299 |
+
/// Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 300 |
/// </remarks>
|
| 301 |
/// <param name="organizationMembershipId">The ID of the organization membership.</param>
|
| 302 |
/// <param name="resourceTypeSlug">The slug of the resource type.</param>
|
dotnet/src/WorkOS.net/Services/Organizations/_interfaces/OrganizationsOptions.cs|
@@ -28,6 +28,7 @@ namespace WorkOS
|
|
| 28 |
public bool? AllowProfilesOutsideOrganization { get; set; }
|
| 29 |
|
| 30 |
/// <summary>The domains associated with the organization. Deprecated in favor of `domain_data`.</summary>
|
|
|
|
| 31 |
public List<string>? Domains { get; set; }
|
| 32 |
|
| 33 |
/// <summary>The domains associated with the organization, including verification state.</summary>
|
|
|
|
| 28 |
public bool? AllowProfilesOutsideOrganization { get; set; }
|
| 29 |
|
| 30 |
/// <summary>The domains associated with the organization. Deprecated in favor of `domain_data`.</summary>
|
| 31 |
+
[System.Obsolete("This field is deprecated.")]
|
| 32 |
public List<string>? Domains { get; set; }
|
| 33 |
|
| 34 |
/// <summary>The domains associated with the organization, including verification state.</summary>
|
dotnet/src/WorkOS.net/Services/OrganizationsItContacts/OrganizationsItContactsService.cs|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
namespace WorkOS
|
| 4 |
+
{
|
| 5 |
+
using System;
|
| 6 |
+
using System.Collections.Generic;
|
| 7 |
+
using System.Net.Http;
|
| 8 |
+
using System.Threading;
|
| 9 |
+
using System.Threading.Tasks;
|
| 10 |
+
|
| 11 |
+
/// <summary>Service that exposes the organizations it contacts API operations on <see cref="WorkOSClient"/>.</summary>
|
| 12 |
+
public class OrganizationsItContactsService : Service
|
| 13 |
+
{
|
| 14 |
+
/// <summary>
|
| 15 |
+
/// Initializes a new instance of the <see cref="OrganizationsItContactsService"/> class for mocking. The service uses the singleton
|
| 16 |
+
/// client configured via <see cref="WorkOSConfiguration.WorkOSClient"/>.
|
| 17 |
+
/// </summary>
|
| 18 |
+
public OrganizationsItContactsService() { }
|
| 19 |
+
|
| 20 |
+
/// <summary>
|
| 21 |
+
/// Initializes a new instance of the <see cref="OrganizationsItContactsService"/> class bound to the
|
| 22 |
+
/// supplied <paramref name="client"/>.
|
| 23 |
+
/// </summary>
|
| 24 |
+
/// <param name="client">The HTTP client used to make API requests.</param>
|
| 25 |
+
public OrganizationsItContactsService(WorkOSClient client) : base(client) { }
|
| 26 |
+
|
| 27 |
+
/// <summary>List IT contacts</summary>
|
| 28 |
+
/// <remarks>
|
| 29 |
+
/// Get the IT contacts for an organization.
|
| 30 |
+
/// </remarks>
|
| 31 |
+
/// <param name="organizationId">The ID of the organization.</param>
|
| 32 |
+
/// <param name="requestOptions">Per-request configuration overrides.</param>
|
| 33 |
+
/// <param name="cancellationToken">Cancellation token.</param>
|
| 34 |
+
/// <returns>The <see cref="ItContactList"/> result.</returns>
|
| 35 |
+
public virtual async Task<ItContactList> ListAsync(string organizationId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
|
| 36 |
+
{
|
| 37 |
+
return await this.GetAsync<ItContactList>($"/organizations/{Uri.EscapeDataString(organizationId)}/it_contacts", null, requestOptions, cancellationToken);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/// <summary>Compatibility wrapper for <see cref="ListAsync"/>.</summary>
|
| 41 |
+
public virtual Task<ItContactList> List(string organizationId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
|
| 42 |
+
{
|
| 43 |
+
return this.ListAsync(organizationId, requestOptions, cancellationToken);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
/// <summary>Create an IT contact</summary>
|
| 47 |
+
/// <remarks>
|
| 48 |
+
/// Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.
|
| 49 |
+
/// </remarks>
|
| 50 |
+
/// <param name="organizationId">The ID of the organization.</param>
|
| 51 |
+
/// <param name="options">Request options.</param>
|
| 52 |
+
/// <param name="requestOptions">Per-request configuration overrides.</param>
|
| 53 |
+
/// <param name="cancellationToken">Cancellation token.</param>
|
| 54 |
+
/// <returns>The <see cref="ItContact"/> result.</returns>
|
| 55 |
+
public virtual async Task<ItContact> CreateAsync(string organizationId, OrganizationsItContactsCreateOptions options, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
|
| 56 |
+
{
|
| 57 |
+
return await this.PostAsync<ItContact>($"/organizations/{Uri.EscapeDataString(organizationId)}/it_contacts", options, requestOptions, cancellationToken);
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
/// <summary>Compatibility wrapper for <see cref="CreateAsync"/>.</summary>
|
| 61 |
+
public virtual Task<ItContact> Create(string organizationId, OrganizationsItContactsCreateOptions options, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
|
| 62 |
+
{
|
| 63 |
+
return this.CreateAsync(organizationId, options, requestOptions, cancellationToken);
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/// <summary>Delete an IT contact</summary>
|
| 67 |
+
/// <remarks>
|
| 68 |
+
/// Remove an IT contact from an organization.
|
| 69 |
+
/// </remarks>
|
| 70 |
+
/// <param name="organizationId">The ID of the organization.</param>
|
| 71 |
+
/// <param name="contactId">The ID of the IT contact.</param>
|
| 72 |
+
/// <param name="requestOptions">Per-request configuration overrides.</param>
|
| 73 |
+
/// <param name="cancellationToken">Cancellation token.</param>
|
| 74 |
+
public virtual async Task DeleteAsync(string organizationId, string contactId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
|
| 75 |
+
{
|
| 76 |
+
await this.DeleteAsync($"/organizations/{Uri.EscapeDataString(organizationId)}/it_contacts/{Uri.EscapeDataString(contactId)}", null, requestOptions, cancellationToken);
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
/// <summary>Compatibility wrapper for <see cref="DeleteAsync"/>.</summary>
|
| 80 |
+
public virtual Task Delete(string organizationId, string contactId, RequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
|
| 81 |
+
{
|
| 82 |
+
return this.DeleteAsync(organizationId, contactId, requestOptions, cancellationToken);
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
}
|
dotnet/src/WorkOS.net/Services/OrganizationsItContacts/_interfaces/OrganizationsItContactsOptions.cs|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
namespace WorkOS
|
| 4 |
+
{
|
| 5 |
+
using System;
|
| 6 |
+
using System.Collections.Generic;
|
| 7 |
+
using Newtonsoft.Json;
|
| 8 |
+
using STJS = System.Text.Json.Serialization;
|
| 9 |
+
|
| 10 |
+
/// <summary>Request options for <see cref="OrganizationsItContactsService.CreateAsync"/>: Create an IT contact</summary>
|
| 11 |
+
public class OrganizationsItContactsCreateOptions : BaseOptions
|
| 12 |
+
{
|
| 13 |
+
/// <summary>The email address of the IT contact.</summary>
|
| 14 |
+
public string Email { get; set; } = default!;
|
| 15 |
+
|
| 16 |
+
}
|
| 17 |
+
}
|
dotnet/test/WorkOSTests/Tests/OrganizationsItContactsServiceTest.cs|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
namespace WorkOSTests
|
| 4 |
+
{
|
| 5 |
+
using System.Collections.Generic;
|
| 6 |
+
using System.Net;
|
| 7 |
+
using System.Net.Http;
|
| 8 |
+
using System.Threading.Tasks;
|
| 9 |
+
using WorkOS;
|
| 10 |
+
using Xunit;
|
| 11 |
+
|
| 12 |
+
public class OrganizationsItContactsServiceTest
|
| 13 |
+
{
|
| 14 |
+
private readonly HttpMock httpMock;
|
| 15 |
+
private readonly OrganizationsItContactsService service;
|
| 16 |
+
|
| 17 |
+
public OrganizationsItContactsServiceTest()
|
| 18 |
+
{
|
| 19 |
+
this.httpMock = new HttpMock();
|
| 20 |
+
var client = new WorkOSClient(new WorkOSOptions
|
| 21 |
+
{
|
| 22 |
+
ApiKey = "sk_test",
|
| 23 |
+
ClientId = "client_test",
|
| 24 |
+
HttpClient = this.httpMock.HttpClient,
|
| 25 |
+
});
|
| 26 |
+
this.service = new OrganizationsItContactsService(client);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
[Fact]
|
| 30 |
+
public async Task TestListAsync()
|
| 31 |
+
{
|
| 32 |
+
var fixture = System.IO.File.ReadAllText("testdata/it_contact_list.json");
|
| 33 |
+
this.httpMock.MockResponse(HttpMethod.Get, "/organizations/test_organization_id/it_contacts", HttpStatusCode.OK, fixture);
|
| 34 |
+
var result = await this.service.ListAsync("test_organization_id");
|
| 35 |
+
Assert.NotNull(result);
|
| 36 |
+
this.httpMock.AssertRequestWasMade(HttpMethod.Get, "/organizations/test_organization_id/it_contacts");
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
[Fact]
|
| 40 |
+
public async Task TestCreateAsync()
|
| 41 |
+
{
|
| 42 |
+
var fixture = System.IO.File.ReadAllText("testdata/it_contact.json");
|
| 43 |
+
this.httpMock.MockResponse(HttpMethod.Post, "/organizations/test_organization_id/it_contacts", HttpStatusCode.OK, fixture);
|
| 44 |
+
var options = new OrganizationsItContactsCreateOptions();
|
| 45 |
+
options.Email = "test_email";
|
| 46 |
+
var result = await this.service.CreateAsync("test_organization_id", options);
|
| 47 |
+
Assert.NotNull(result);
|
| 48 |
+
Assert.Equal("it_contact_01HXYZ123456789ABCDEFGHIJ", result.Id);
|
| 49 |
+
Assert.Equal("it-contact@example.com", result.Email);
|
| 50 |
+
this.httpMock.AssertRequestWasMade(HttpMethod.Post, "/organizations/test_organization_id/it_contacts");
|
| 51 |
+
await this.httpMock.AssertRequestBodyContainsAsync("email", "test_email");
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
[Fact]
|
| 55 |
+
public async Task TestDeleteAsync()
|
| 56 |
+
{
|
| 57 |
+
this.httpMock.MockResponse(HttpMethod.Delete, "/organizations/test_organization_id/it_contacts/test_contact_id", HttpStatusCode.NoContent, "");
|
| 58 |
+
await this.service.DeleteAsync("test_organization_id", "test_contact_id");
|
| 59 |
+
this.httpMock.AssertRequestWasMade(HttpMethod.Delete, "/organizations/test_organization_id/it_contacts/test_contact_id");
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
[Fact]
|
| 63 |
+
public async Task TestError401()
|
| 64 |
+
{
|
| 65 |
+
this.httpMock.MockResponseForAnyRequest(HttpStatusCode.Unauthorized, "{\"code\":\"unauthorized\",\"message\":\"Unauthorized\"}");
|
| 66 |
+
await Assert.ThrowsAsync<AuthenticationException>(() => this.service.ListAsync("test_organization_id"));
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
[Fact]
|
| 70 |
+
public async Task TestError404()
|
| 71 |
+
{
|
| 72 |
+
this.httpMock.MockResponseForAnyRequest(HttpStatusCode.NotFound, "{\"code\":\"not_found\",\"message\":\"Not Found\"}");
|
| 73 |
+
await Assert.ThrowsAsync<NotFoundException>(() => this.service.ListAsync("test_organization_id"));
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
[Fact]
|
| 77 |
+
public async Task TestError422()
|
| 78 |
+
{
|
| 79 |
+
this.httpMock.MockResponseForAnyRequest((HttpStatusCode)422, "{\"code\":\"unprocessable_entity\",\"message\":\"Unprocessable\"}");
|
| 80 |
+
await Assert.ThrowsAsync<UnprocessableEntityException>(() => this.service.ListAsync("test_organization_id"));
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
[Fact]
|
| 84 |
+
public async Task TestError429()
|
| 85 |
+
{
|
| 86 |
+
this.httpMock.MockResponseForAnyRequest((HttpStatusCode)429, "{\"code\":\"too_many_requests\",\"message\":\"Too Many Requests\"}");
|
| 87 |
+
await Assert.ThrowsAsync<RateLimitExceededException>(() => this.service.ListAsync("test_organization_id"));
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
[Fact]
|
| 91 |
+
public async Task TestError500()
|
| 92 |
+
{
|
| 93 |
+
this.httpMock.MockResponseForAnyRequest(HttpStatusCode.InternalServerError, "{\"code\":\"server_error\",\"message\":\"Server Error\"}");
|
| 94 |
+
await Assert.ThrowsAsync<ServerException>(() => this.service.ListAsync("test_organization_id"));
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
}
|
dotnet/test/WorkOSTests/testdata/create_it_contact.json|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"email": "it-contact@example.com"
|
| 3 |
+
}
|
dotnet/test/WorkOSTests/testdata/it_contact.json|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "it_contact",
|
| 3 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 4 |
+
"email": "it-contact@example.com",
|
| 5 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 6 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 7 |
+
}
|
dotnet/test/WorkOSTests/testdata/it_contact_list.json|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "list",
|
| 3 |
+
"data": [
|
| 4 |
+
{
|
| 5 |
+
"object": "it_contact",
|
| 6 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 7 |
+
"email": "it-contact@example.com",
|
| 8 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 10 |
+
}
|
| 11 |
+
],
|
| 12 |
+
"list_metadata": {
|
| 13 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 14 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 15 |
+
}
|
| 16 |
+
}
|
dotnet/test/WorkOSTests/testdata/waitlist_user.json|
@@ -1,10 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
"object": "waitlist_user",
|
| 3 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 4 |
"email": "marcelina.davis@example.com",
|
| 5 |
"state": "pending",
|
| 6 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 7 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 10 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 3 |
"email": "marcelina.davis@example.com",
|
| 4 |
"state": "pending",
|
| 5 |
"approved_at": null,
|
| 6 |
+
"additional_fields": {
|
| 7 |
+
"company": "Example Corp"
|
| 8 |
+
},
|
| 9 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 10 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 11 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
+
"object": "waitlist_user"
|
| 13 |
}
|
dotnet/test/WorkOSTests/testdata/waitlist_user_approved.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
dotnet/test/WorkOSTests/testdata/waitlist_user_approved_nulls.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": null
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": null
|
dotnet/test/WorkOSTests/testdata/waitlist_user_created.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
dotnet/test/WorkOSTests/testdata/waitlist_user_created_nulls.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": null
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": null
|
dotnet/test/WorkOSTests/testdata/waitlist_user_denied.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
dotnet/test/WorkOSTests/testdata/waitlist_user_denied_nulls.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": null
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": null
|
dotnet/test/WorkOSTests/testdata/waitlist_user_nulls.json|
@@ -1,10 +1,11 @@
|
|
| 1 |
{
|
| 2 |
-
"object": "waitlist_user",
|
| 3 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 4 |
"email": "marcelina.davis@example.com",
|
| 5 |
"state": "pending",
|
| 6 |
"approved_at": null,
|
|
|
|
| 7 |
"waitlist_id": null,
|
| 8 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 10 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 3 |
"email": "marcelina.davis@example.com",
|
| 4 |
"state": "pending",
|
| 5 |
"approved_at": null,
|
| 6 |
+
"additional_fields": null,
|
| 7 |
"waitlist_id": null,
|
| 8 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 10 |
+
"object": "waitlist_user"
|
| 11 |
}
|
All files in this language are hidden by the current filters.
code: 14 · tests: 1 · manifest: 1
go/.oagen-manifest.json|
@@ -34,6 +34,8 @@
|
|
| 34 |
"organization_membership.go",
|
| 35 |
"organization_membership_test.go",
|
| 36 |
"organizations.go",
|
|
|
|
|
|
|
| 37 |
"organizations_test.go",
|
| 38 |
"pipes.go",
|
| 39 |
"pipes_provider.go",
|
|
@@ -111,7 +113,6 @@
|
|
| 111 |
"testdata/audit_logs_retention.json",
|
| 112 |
"testdata/auth_method_mismatch_error.json",
|
| 113 |
"testdata/authenticate_response.json",
|
| 114 |
-
"testdata/authenticate_response_impersonator.json",
|
| 115 |
"testdata/authenticate_response_oauth_token.json",
|
| 116 |
"testdata/authentication_challenge.json",
|
| 117 |
"testdata/authentication_challenge_verify_response.json",
|
|
@@ -172,7 +173,6 @@
|
|
| 172 |
"testdata/client_api_token.json",
|
| 173 |
"testdata/client_api_token_response.json",
|
| 174 |
"testdata/configure_data_integration_body.json",
|
| 175 |
-
"testdata/confirm_email_change.json",
|
| 176 |
"testdata/connect_application.json",
|
| 177 |
"testdata/connect_application_m2m.json",
|
| 178 |
"testdata/connect_application_oauth.json",
|
|
@@ -208,6 +208,7 @@
|
|
| 208 |
"testdata/create_group.json",
|
| 209 |
"testdata/create_group_membership.json",
|
| 210 |
"testdata/create_group_role_assignment.json",
|
|
|
|
| 211 |
"testdata/create_m2m_application.json",
|
| 212 |
"testdata/create_magic_code_and_return.json",
|
| 213 |
"testdata/create_oauth_application.json",
|
|
@@ -333,6 +334,9 @@
|
|
| 333 |
"testdata/invitation_resent.json",
|
| 334 |
"testdata/invitation_resent_data.json",
|
| 335 |
"testdata/invitation_revoked.json",
|
|
|
|
|
|
|
|
|
|
| 336 |
"testdata/jwks_response.json",
|
| 337 |
"testdata/jwks_response_keys.json",
|
| 338 |
"testdata/jwt_template_response.json",
|
|
@@ -500,7 +504,6 @@
|
|
| 500 |
"testdata/user_role_assignment_resource.json",
|
| 501 |
"testdata/user_role_assignment_source.json",
|
| 502 |
"testdata/user_sessions_impersonator.json",
|
| 503 |
-
"testdata/user_sessions_list_item.json",
|
| 504 |
"testdata/user_updated.json",
|
| 505 |
"testdata/validate_api_key.json",
|
| 506 |
"testdata/vault_byok_key_deleted.json",
|
|
@@ -841,6 +844,10 @@
|
|
| 841 |
"sdkMethod": "AuthorizeDataIntegration",
|
| 842 |
"service": "pipes"
|
| 843 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 844 |
"POST /data-integrations/{slug}/credentials": {
|
| 845 |
"sdkMethod": "CreateDataIntegrationCredential",
|
| 846 |
"service": "pipes"
|
|
@@ -1013,6 +1020,18 @@
|
|
| 1013 |
"sdkMethod": "ListAuthorizedApplications",
|
| 1014 |
"service": "organizations"
|
| 1015 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1016 |
"POST /portal/generate_link": {
|
| 1017 |
"sdkMethod": "GenerateLink",
|
| 1018 |
"service": "admin_portal"
|
|
@@ -1392,10 +1411,6 @@
|
|
| 1392 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 1393 |
"sdkMethod": "GetExport",
|
| 1394 |
"service": "audit_logs"
|
| 1395 |
-
},
|
| 1396 |
-
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1397 |
-
"sdkMethod": "UpdateDataIntegrationClientCredentials",
|
| 1398 |
-
"service": "pipes"
|
| 1399 |
}
|
| 1400 |
}
|
| 1401 |
}
|
|
|
|
| 34 |
"organization_membership.go",
|
| 35 |
"organization_membership_test.go",
|
| 36 |
"organizations.go",
|
| 37 |
+
"organizations_it_contacts.go",
|
| 38 |
+
"organizations_it_contacts_test.go",
|
| 39 |
"organizations_test.go",
|
| 40 |
"pipes.go",
|
| 41 |
"pipes_provider.go",
|
|
|
|
| 113 |
"testdata/audit_logs_retention.json",
|
| 114 |
"testdata/auth_method_mismatch_error.json",
|
| 115 |
"testdata/authenticate_response.json",
|
|
|
|
| 116 |
"testdata/authenticate_response_oauth_token.json",
|
| 117 |
"testdata/authentication_challenge.json",
|
| 118 |
"testdata/authentication_challenge_verify_response.json",
|
|
|
|
| 173 |
"testdata/client_api_token.json",
|
| 174 |
"testdata/client_api_token_response.json",
|
| 175 |
"testdata/configure_data_integration_body.json",
|
|
|
|
| 176 |
"testdata/connect_application.json",
|
| 177 |
"testdata/connect_application_m2m.json",
|
| 178 |
"testdata/connect_application_oauth.json",
|
|
|
|
| 208 |
"testdata/create_group.json",
|
| 209 |
"testdata/create_group_membership.json",
|
| 210 |
"testdata/create_group_role_assignment.json",
|
| 211 |
+
"testdata/create_it_contact.json",
|
| 212 |
"testdata/create_m2m_application.json",
|
| 213 |
"testdata/create_magic_code_and_return.json",
|
| 214 |
"testdata/create_oauth_application.json",
|
|
|
|
| 334 |
"testdata/invitation_resent.json",
|
| 335 |
"testdata/invitation_resent_data.json",
|
| 336 |
"testdata/invitation_revoked.json",
|
| 337 |
+
"testdata/it_contact.json",
|
| 338 |
+
"testdata/it_contact_list.json",
|
| 339 |
+
"testdata/it_contact_list_list_metadata.json",
|
| 340 |
"testdata/jwks_response.json",
|
| 341 |
"testdata/jwks_response_keys.json",
|
| 342 |
"testdata/jwt_template_response.json",
|
|
|
|
| 504 |
"testdata/user_role_assignment_resource.json",
|
| 505 |
"testdata/user_role_assignment_source.json",
|
| 506 |
"testdata/user_sessions_impersonator.json",
|
|
|
|
| 507 |
"testdata/user_updated.json",
|
| 508 |
"testdata/validate_api_key.json",
|
| 509 |
"testdata/vault_byok_key_deleted.json",
|
|
|
|
| 844 |
"sdkMethod": "AuthorizeDataIntegration",
|
| 845 |
"service": "pipes"
|
| 846 |
},
|
| 847 |
+
"PUT /data-integrations/{slug}/client-credentials": {
|
| 848 |
+
"sdkMethod": "UpdateDataIntegrationClientCredentials",
|
| 849 |
+
"service": "pipes"
|
| 850 |
+
},
|
| 851 |
"POST /data-integrations/{slug}/credentials": {
|
| 852 |
"sdkMethod": "CreateDataIntegrationCredential",
|
| 853 |
"service": "pipes"
|
|
|
|
| 1020 |
"sdkMethod": "ListAuthorizedApplications",
|
| 1021 |
"service": "organizations"
|
| 1022 |
},
|
| 1023 |
+
"GET /organizations/{organization_id}/it_contacts": {
|
| 1024 |
+
"sdkMethod": "List",
|
| 1025 |
+
"service": "organizations_it_contacts"
|
| 1026 |
+
},
|
| 1027 |
+
"POST /organizations/{organization_id}/it_contacts": {
|
| 1028 |
+
"sdkMethod": "Create",
|
| 1029 |
+
"service": "organizations_it_contacts"
|
| 1030 |
+
},
|
| 1031 |
+
"DELETE /organizations/{organization_id}/it_contacts/{contact_id}": {
|
| 1032 |
+
"sdkMethod": "Delete",
|
| 1033 |
+
"service": "organizations_it_contacts"
|
| 1034 |
+
},
|
| 1035 |
"POST /portal/generate_link": {
|
| 1036 |
"sdkMethod": "GenerateLink",
|
| 1037 |
"service": "admin_portal"
|
|
|
|
| 1411 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 1412 |
"sdkMethod": "GetExport",
|
| 1413 |
"service": "audit_logs"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1414 |
}
|
| 1415 |
}
|
| 1416 |
}
|
go/authorization.go|
@@ -272,7 +272,7 @@ type AuthorizationListEffectivePermissionsParams struct {
|
|
| 272 |
}
|
| 273 |
|
| 274 |
// ListEffectivePermissions for an organization membership on a resource
|
| 275 |
-
// Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources.
|
| 276 |
func (s *AuthorizationService) ListEffectivePermissions(ctx context.Context, organizationMembershipID string, resourceID string, params *AuthorizationListEffectivePermissionsParams, opts ...RequestOption) *Iterator[AuthorizationPermission] {
|
| 277 |
return newIterator[AuthorizationPermission](ctx, s.client, "GET", fmt.Sprintf("/authorization/organization_memberships/%s/resources/%s/permissions", url.PathEscape(organizationMembershipID), url.PathEscape(resourceID)), params, "after", "data", opts, map[string]string{"limit": "10", "order": "desc"})
|
| 278 |
}
|
|
@@ -283,7 +283,7 @@ type AuthorizationListEffectivePermissionsByExternalIDParams struct {
|
|
| 283 |
}
|
| 284 |
|
| 285 |
// ListEffectivePermissionsByExternalID list effective permissions for an organization membership on a resource by external ID
|
| 286 |
-
// Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources.
|
| 287 |
func (s *AuthorizationService) ListEffectivePermissionsByExternalID(ctx context.Context, organizationMembershipID string, resourceTypeSlug string, externalID string, params *AuthorizationListEffectivePermissionsByExternalIDParams, opts ...RequestOption) *Iterator[AuthorizationPermission] {
|
| 288 |
return newIterator[AuthorizationPermission](ctx, s.client, "GET", fmt.Sprintf("/authorization/organization_memberships/%s/resources/%s/%s/permissions", url.PathEscape(organizationMembershipID), url.PathEscape(resourceTypeSlug), url.PathEscape(externalID)), params, "after", "data", opts, map[string]string{"limit": "10", "order": "desc"})
|
| 289 |
}
|
|
|
|
| 272 |
}
|
| 273 |
|
| 274 |
// ListEffectivePermissions for an organization membership on a resource
|
| 275 |
+
// Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 276 |
func (s *AuthorizationService) ListEffectivePermissions(ctx context.Context, organizationMembershipID string, resourceID string, params *AuthorizationListEffectivePermissionsParams, opts ...RequestOption) *Iterator[AuthorizationPermission] {
|
| 277 |
return newIterator[AuthorizationPermission](ctx, s.client, "GET", fmt.Sprintf("/authorization/organization_memberships/%s/resources/%s/permissions", url.PathEscape(organizationMembershipID), url.PathEscape(resourceID)), params, "after", "data", opts, map[string]string{"limit": "10", "order": "desc"})
|
| 278 |
}
|
|
|
|
| 283 |
}
|
| 284 |
|
| 285 |
// ListEffectivePermissionsByExternalID list effective permissions for an organization membership on a resource by external ID
|
| 286 |
+
// Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 287 |
func (s *AuthorizationService) ListEffectivePermissionsByExternalID(ctx context.Context, organizationMembershipID string, resourceTypeSlug string, externalID string, params *AuthorizationListEffectivePermissionsByExternalIDParams, opts ...RequestOption) *Iterator[AuthorizationPermission] {
|
| 288 |
return newIterator[AuthorizationPermission](ctx, s.client, "GET", fmt.Sprintf("/authorization/organization_memberships/%s/resources/%s/%s/permissions", url.PathEscape(organizationMembershipID), url.PathEscape(resourceTypeSlug), url.PathEscape(externalID)), params, "after", "data", opts, map[string]string{"limit": "10", "order": "desc"})
|
| 289 |
}
|
go/models.go|
@@ -1044,22 +1044,24 @@ type PipeConnectedAccount struct {
|
|
| 1044 |
|
| 1045 |
// WaitlistUser represents a waitlist user.
|
| 1046 |
type WaitlistUser struct {
|
| 1047 |
-
// Object distinguishes the Waitlist User object.
|
| 1048 |
-
Object string `json:"object"`
|
| 1049 |
-
// ID is the unique ID of the
|
| 1050 |
ID string `json:"id"`
|
| 1051 |
-
// Email is the email address of the
|
| 1052 |
Email string `json:"email"`
|
| 1053 |
-
// State is the state of the
|
| 1054 |
State WaitlistUserState `json:"state"`
|
| 1055 |
-
// ApprovedAt is the timestamp when the
|
| 1056 |
ApprovedAt *string `json:"approved_at"`
|
|
|
|
|
|
|
| 1057 |
-
// WaitlistID is the unique ID of the
|
| 1058 |
WaitlistID *string `json:"waitlist_id,omitempty"`
|
| 1059 |
// CreatedAt is an ISO 8601 timestamp.
|
| 1060 |
CreatedAt string `json:"created_at"`
|
| 1061 |
// UpdatedAt is an ISO 8601 timestamp.
|
| 1062 |
UpdatedAt string `json:"updated_at"`
|
|
|
|
|
|
|
| 1063 |
}
|
| 1064 |
|
| 1065 |
// EventSchema an event emitted by WorkOS.
|
|
@@ -4725,6 +4727,30 @@ type OrganizationAPIKeyWithValue struct {
|
|
| 4725 |
Value string `json:"value"`
|
| 4726 |
}
|
| 4727 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4728 |
// Organization represents an organization.
|
| 4729 |
type Organization struct {
|
| 4730 |
// Object distinguishes the Organization object.
|
|
@@ -5545,6 +5571,14 @@ type AuditLogConfigurationLogStream struct {
|
|
| 5545 |
CreatedAt string `json:"created_at"`
|
| 5546 |
}
|
| 5547 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5548 |
// OrganizationAPIKeyWithValueOwner is an alias for OrganizationAPIKeyOwner.
|
| 5549 |
type OrganizationAPIKeyWithValueOwner = OrganizationAPIKeyOwner
|
| 5550 |
|
|
|
|
| 1044 |
|
| 1045 |
// WaitlistUser represents a waitlist user.
|
| 1046 |
type WaitlistUser struct {
|
|
|
|
|
|
|
| 1047 |
+
// ID is the unique ID of the waitlist entry.
|
| 1048 |
ID string `json:"id"`
|
| 1049 |
+
// Email is the email address of the user on the waitlist.
|
| 1050 |
Email string `json:"email"`
|
| 1051 |
+
// State is the state of the waitlist entry.
|
| 1052 |
State WaitlistUserState `json:"state"`
|
| 1053 |
+
// ApprovedAt is the timestamp when the entry was approved, or null if not yet approved.
|
| 1054 |
ApprovedAt *string `json:"approved_at"`
|
| 1055 |
+
// AdditionalFields is additional fields submitted when the user joined the waitlist. Values are user-provided — treat them as untrusted input when rendering or exporting.
|
| 1056 |
+
AdditionalFields map[string]string `json:"additional_fields,omitempty"`
|
| 1057 |
+
// WaitlistID is the unique ID of the waitlist the entry belongs to.
|
| 1058 |
WaitlistID *string `json:"waitlist_id,omitempty"`
|
| 1059 |
// CreatedAt is an ISO 8601 timestamp.
|
| 1060 |
CreatedAt string `json:"created_at"`
|
| 1061 |
// UpdatedAt is an ISO 8601 timestamp.
|
| 1062 |
UpdatedAt string `json:"updated_at"`
|
| 1063 |
+
// Object distinguishes the Waitlist User object.
|
| 1064 |
+
Object string `json:"object"`
|
| 1065 |
}
|
| 1066 |
|
| 1067 |
// EventSchema an event emitted by WorkOS.
|
|
|
|
| 4727 |
Value string `json:"value"`
|
| 4728 |
}
|
| 4729 |
|
| 4730 |
+
// ItContact represents an it contact.
|
| 4731 |
+
type ItContact struct {
|
| 4732 |
+
// Object is the IT Contact object.
|
| 4733 |
+
Object string `json:"object"`
|
| 4734 |
+
// ID is the unique ID of the IT Contact.
|
| 4735 |
+
ID string `json:"id"`
|
| 4736 |
+
// Email is the email address of the IT Contact.
|
| 4737 |
+
Email string `json:"email"`
|
| 4738 |
+
// CreatedAt is an ISO 8601 timestamp.
|
| 4739 |
+
CreatedAt string `json:"created_at"`
|
| 4740 |
+
// UpdatedAt is an ISO 8601 timestamp.
|
| 4741 |
+
UpdatedAt string `json:"updated_at"`
|
| 4742 |
+
}
|
| 4743 |
+
|
| 4744 |
+
// ItContactList represents an it contact list.
|
| 4745 |
+
type ItContactList struct {
|
| 4746 |
+
// Object indicates this is a list response.
|
| 4747 |
+
Object string `json:"object"`
|
| 4748 |
+
// Data is the list of records for the current page.
|
| 4749 |
+
Data []*ItContact `json:"data"`
|
| 4750 |
+
// ListMetadata is pagination cursors for navigating between pages of results.
|
| 4751 |
+
ListMetadata *ItContactListListMetadata `json:"list_metadata"`
|
| 4752 |
+
}
|
| 4753 |
+
|
| 4754 |
// Organization represents an organization.
|
| 4755 |
type Organization struct {
|
| 4756 |
// Object distinguishes the Organization object.
|
|
|
|
| 5571 |
CreatedAt string `json:"created_at"`
|
| 5572 |
}
|
| 5573 |
|
| 5574 |
+
// ItContactListListMetadata pagination cursors for navigating between pages of results.
|
| 5575 |
+
type ItContactListListMetadata struct {
|
| 5576 |
+
// Before is an object ID that defines your place in the list. When the ID is not present, you are at the start of the list.
|
| 5577 |
+
Before *string `json:"before"`
|
| 5578 |
+
// After is an object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
|
| 5579 |
+
After *string `json:"after"`
|
| 5580 |
+
}
|
| 5581 |
+
|
| 5582 |
// OrganizationAPIKeyWithValueOwner is an alias for OrganizationAPIKeyOwner.
|
| 5583 |
type OrganizationAPIKeyWithValueOwner = OrganizationAPIKeyOwner
|
| 5584 |
|
go/organizations.go|
@@ -36,6 +36,8 @@ type OrganizationsCreateParams struct {
|
|
| 36 |
// AllowProfilesOutsideOrganization is whether the organization allows profiles from outside the organization to sign in.
|
| 37 |
AllowProfilesOutsideOrganization *bool `json:"allow_profiles_outside_organization,omitempty" url:"-"`
|
| 38 |
// Domains is the domains associated with the organization. Deprecated in favor of `domain_data`.
|
|
|
|
|
|
|
| 39 |
Domains []string `json:"domains,omitempty" url:"-"`
|
| 40 |
// DomainData is the domains associated with the organization, including verification state.
|
| 41 |
DomainData []*OrganizationDomainData `json:"domain_data,omitempty" url:"-"`
|
|
|
|
| 36 |
// AllowProfilesOutsideOrganization is whether the organization allows profiles from outside the organization to sign in.
|
| 37 |
AllowProfilesOutsideOrganization *bool `json:"allow_profiles_outside_organization,omitempty" url:"-"`
|
| 38 |
// Domains is the domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 39 |
+
//
|
| 40 |
+
// Deprecated: this field is deprecated.
|
| 41 |
Domains []string `json:"domains,omitempty" url:"-"`
|
| 42 |
// DomainData is the domains associated with the organization, including verification state.
|
| 43 |
DomainData []*OrganizationDomainData `json:"domain_data,omitempty" url:"-"`
|
go/organizations_it_contacts.go|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Code generated by oagen. DO NOT EDIT.
|
| 2 |
+
|
| 3 |
+
package workos
|
| 4 |
+
|
| 5 |
+
import (
|
| 6 |
+
"context"
|
| 7 |
+
"fmt"
|
| 8 |
+
"net/url"
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
// OrganizationsItContactService handles OrganizationsItContacts operations.
|
| 12 |
+
type OrganizationsItContactService struct {
|
| 13 |
+
client *Client
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
// List it contacts
|
| 17 |
+
// Get the IT contacts for an organization.
|
| 18 |
+
func (s *OrganizationsItContactService) List(ctx context.Context, organizationID string, opts ...RequestOption) (*ItContactList, error) {
|
| 19 |
+
var result ItContactList
|
| 20 |
+
_, err := s.client.request(ctx, "GET", fmt.Sprintf("/organizations/%s/it_contacts", url.PathEscape(organizationID)), nil, nil, &result, opts)
|
| 21 |
+
if err != nil {
|
| 22 |
+
return nil, err
|
| 23 |
+
}
|
| 24 |
+
return &result, nil
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
// OrganizationsItContactsCreateParams contains the parameters for Create.
|
| 28 |
+
type OrganizationsItContactsCreateParams struct {
|
| 29 |
+
// Email is the email address of the IT contact.
|
| 30 |
+
Email string `json:"email" url:"-"`
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
// Create an IT contact
|
| 34 |
+
// Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.
|
| 35 |
+
func (s *OrganizationsItContactService) Create(ctx context.Context, organizationID string, params *OrganizationsItContactsCreateParams, opts ...RequestOption) (*ItContact, error) {
|
| 36 |
+
var result ItContact
|
| 37 |
+
_, err := s.client.request(ctx, "POST", fmt.Sprintf("/organizations/%s/it_contacts", url.PathEscape(organizationID)), nil, params, &result, opts)
|
| 38 |
+
if err != nil {
|
| 39 |
+
return nil, err
|
| 40 |
+
}
|
| 41 |
+
return &result, nil
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
// Delete an IT contact
|
| 45 |
+
// Remove an IT contact from an organization.
|
| 46 |
+
func (s *OrganizationsItContactService) Delete(ctx context.Context, organizationID string, contactID string, opts ...RequestOption) error {
|
| 47 |
+
_, err := s.client.request(ctx, "DELETE", fmt.Sprintf("/organizations/%s/it_contacts/%s", url.PathEscape(organizationID), url.PathEscape(contactID)), nil, nil, nil, opts)
|
| 48 |
+
return err
|
| 49 |
+
}
|
go/organizations_it_contacts_test.go|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Code generated by oagen. DO NOT EDIT.
|
| 2 |
+
|
| 3 |
+
package workos_test
|
| 4 |
+
|
| 5 |
+
import (
|
| 6 |
+
"context"
|
| 7 |
+
"encoding/json"
|
| 8 |
+
"io"
|
| 9 |
+
"net/http"
|
| 10 |
+
"net/http/httptest"
|
| 11 |
+
"os"
|
| 12 |
+
"testing"
|
| 13 |
+
|
| 14 |
+
"github.com/stretchr/testify/require"
|
| 15 |
+
"github.com/workos/workos-go/v10"
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
func TestOrganizationsItContacts_List(t *testing.T) {
|
| 19 |
+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
| 20 |
+
require.Equal(t, "GET", r.Method)
|
| 21 |
+
require.Equal(t, "/organizations/test_organization_id/it_contacts", r.URL.Path)
|
| 22 |
+
w.Header().Set("Content-Type", "application/json")
|
| 23 |
+
w.WriteHeader(http.StatusOK)
|
| 24 |
+
fixture, err := os.ReadFile("testdata/it_contact_list.json")
|
| 25 |
+
if err != nil {
|
| 26 |
+
t.Fatalf("failed to read fixture: %v", err)
|
| 27 |
+
}
|
| 28 |
+
w.Write(fixture)
|
| 29 |
+
}))
|
| 30 |
+
defer server.Close()
|
| 31 |
+
|
| 32 |
+
client := workos.NewClient("sk_test", workos.WithBaseURL(server.URL))
|
| 33 |
+
result, err := client.OrganizationsItContacts().List(context.Background(), "test_organization_id")
|
| 34 |
+
require.NoError(t, err)
|
| 35 |
+
require.NotNil(t, result)
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
func TestOrganizationsItContacts_Create(t *testing.T) {
|
| 39 |
+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
| 40 |
+
require.Equal(t, "POST", r.Method)
|
| 41 |
+
require.Equal(t, "/organizations/test_organization_id/it_contacts", r.URL.Path)
|
| 42 |
+
body, _ := io.ReadAll(r.Body)
|
| 43 |
+
var bodyMap map[string]interface{}
|
| 44 |
+
require.NoError(t, json.Unmarshal(body, &bodyMap))
|
| 45 |
+
w.Header().Set("Content-Type", "application/json")
|
| 46 |
+
w.WriteHeader(http.StatusOK)
|
| 47 |
+
fixture, err := os.ReadFile("testdata/it_contact.json")
|
| 48 |
+
if err != nil {
|
| 49 |
+
t.Fatalf("failed to read fixture: %v", err)
|
| 50 |
+
}
|
| 51 |
+
w.Write(fixture)
|
| 52 |
+
}))
|
| 53 |
+
defer server.Close()
|
| 54 |
+
|
| 55 |
+
client := workos.NewClient("sk_test", workos.WithBaseURL(server.URL))
|
| 56 |
+
result, err := client.OrganizationsItContacts().Create(context.Background(), "test_organization_id", &workos.OrganizationsItContactsCreateParams{})
|
| 57 |
+
require.NoError(t, err)
|
| 58 |
+
require.NotNil(t, result)
|
| 59 |
+
require.Equal(t, "it_contact_01HXYZ123456789ABCDEFGHIJ", result.ID)
|
| 60 |
+
require.Equal(t, "it-contact@example.com", result.Email)
|
| 61 |
+
require.Equal(t, "2026-01-15T12:00:00.000Z", result.CreatedAt)
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
func TestOrganizationsItContacts_Delete(t *testing.T) {
|
| 65 |
+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
| 66 |
+
require.Equal(t, "DELETE", r.Method)
|
| 67 |
+
require.Equal(t, "/organizations/test_organization_id/it_contacts/test_contact_id", r.URL.Path)
|
| 68 |
+
w.WriteHeader(http.StatusNoContent)
|
| 69 |
+
}))
|
| 70 |
+
defer server.Close()
|
| 71 |
+
|
| 72 |
+
client := workos.NewClient("sk_test", workos.WithBaseURL(server.URL))
|
| 73 |
+
err := client.OrganizationsItContacts().Delete(context.Background(), "test_organization_id", "test_contact_id")
|
| 74 |
+
require.NoError(t, err)
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
func TestOrganizationsItContacts_Error401(t *testing.T) {
|
| 78 |
+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
| 79 |
+
w.Header().Set("Content-Type", "application/json")
|
| 80 |
+
w.WriteHeader(http.StatusUnauthorized)
|
| 81 |
+
w.Write([]byte(`{"code":"unauthorized","message":"Unauthorized"}`))
|
| 82 |
+
}))
|
| 83 |
+
defer server.Close()
|
| 84 |
+
|
| 85 |
+
client := workos.NewClient("sk_test", workos.WithBaseURL(server.URL))
|
| 86 |
+
_, err := client.OrganizationsItContacts().List(context.Background(), "test_organization_id")
|
| 87 |
+
require.IsType(t, &workos.AuthenticationError{}, err)
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
func TestOrganizationsItContacts_Error404(t *testing.T) {
|
| 91 |
+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
| 92 |
+
w.Header().Set("Content-Type", "application/json")
|
| 93 |
+
w.WriteHeader(http.StatusNotFound)
|
| 94 |
+
w.Write([]byte(`{"code":"not_found","message":"Not Found"}`))
|
| 95 |
+
}))
|
| 96 |
+
defer server.Close()
|
| 97 |
+
|
| 98 |
+
client := workos.NewClient("sk_test", workos.WithBaseURL(server.URL))
|
| 99 |
+
_, err := client.OrganizationsItContacts().List(context.Background(), "test_organization_id")
|
| 100 |
+
require.IsType(t, &workos.NotFoundError{}, err)
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
func TestOrganizationsItContacts_Error422(t *testing.T) {
|
| 104 |
+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
| 105 |
+
w.Header().Set("Content-Type", "application/json")
|
| 106 |
+
w.WriteHeader(422)
|
| 107 |
+
w.Write([]byte(`{"code":"unprocessable_entity","message":"Unprocessable"}`))
|
| 108 |
+
}))
|
| 109 |
+
defer server.Close()
|
| 110 |
+
|
| 111 |
+
client := workos.NewClient("sk_test", workos.WithBaseURL(server.URL))
|
| 112 |
+
_, err := client.OrganizationsItContacts().List(context.Background(), "test_organization_id")
|
| 113 |
+
require.IsType(t, &workos.UnprocessableEntityError{}, err)
|
| 114 |
+
}
|
go/pkg/events/events.go|
@@ -11,6 +11,7 @@ const (
|
|
| 11 |
AgentRegistrationClaimCompleted = "agent.registration.claim.completed"
|
| 12 |
AgentRegistrationCredentialIssued = "agent.registration.credential.issued"
|
| 13 |
AgentRegistrationDeleted = "agent.registration.deleted"
|
|
|
|
| 14 |
AgentRegistrationExpired = "agent.registration.expired"
|
| 15 |
AgentRegistrationOrganizationSwitched = "agent.registration.organization.switched"
|
| 16 |
AgentRegistrationRevoked = "agent.registration.revoked"
|
|
|
|
| 11 |
AgentRegistrationClaimCompleted = "agent.registration.claim.completed"
|
| 12 |
AgentRegistrationCredentialIssued = "agent.registration.credential.issued"
|
| 13 |
AgentRegistrationDeleted = "agent.registration.deleted"
|
| 14 |
+
AgentRegistrationRefreshed = "agent.registration.refreshed"
|
| 15 |
AgentRegistrationExpired = "agent.registration.expired"
|
| 16 |
AgentRegistrationOrganizationSwitched = "agent.registration.organization.switched"
|
| 17 |
AgentRegistrationRevoked = "agent.registration.revoked"
|
go/testdata/create_it_contact.json|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"email": "it-contact@example.com"
|
| 3 |
+
}
|
go/testdata/it_contact.json|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "it_contact",
|
| 3 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 4 |
+
"email": "it-contact@example.com",
|
| 5 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 6 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 7 |
+
}
|
go/testdata/it_contact_list.json|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "list",
|
| 3 |
+
"data": [
|
| 4 |
+
{
|
| 5 |
+
"object": "it_contact",
|
| 6 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 7 |
+
"email": "it-contact@example.com",
|
| 8 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 10 |
+
}
|
| 11 |
+
],
|
| 12 |
+
"list_metadata": {
|
| 13 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 14 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 15 |
+
}
|
| 16 |
+
}
|
go/testdata/it_contact_list_list_metadata.json|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 3 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 4 |
+
}
|
go/testdata/waitlist_user.json|
@@ -1,10 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
"object": "waitlist_user",
|
| 3 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 4 |
"email": "marcelina.davis@example.com",
|
| 5 |
"state": "pending",
|
| 6 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 7 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 10 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 3 |
"email": "marcelina.davis@example.com",
|
| 4 |
"state": "pending",
|
| 5 |
"approved_at": null,
|
| 6 |
+
"additional_fields": {
|
| 7 |
+
"company": "Example Corp"
|
| 8 |
+
},
|
| 9 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 10 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 11 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
+
"object": "waitlist_user"
|
| 13 |
}
|
go/testdata/waitlist_user_approved.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
go/testdata/waitlist_user_created.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
go/testdata/waitlist_user_denied.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
go/workos.go|
@@ -14,30 +14,31 @@ type Client struct {
|
|
| 14 |
logger Logger
|
| 15 |
appInfo appInfo
|
| 16 |
|
| 17 |
-
agents
|
| 18 |
-
multiFactorAuth
|
| 19 |
-
connect
|
| 20 |
-
authorization
|
| 21 |
-
clientAPI
|
| 22 |
-
sso
|
| 23 |
-
pipes
|
| 24 |
-
directorySync
|
| 25 |
-
events
|
| 26 |
-
featureFlags
|
| 27 |
-
organizationDomains
|
| 28 |
-
organizations
|
| 29 |
-
apiKeys
|
| 30 |
-
pipesProvider
|
| 31 |
-
groups
|
|
|
|
| 32 |
-
adminPortal
|
| 33 |
-
radar
|
| 34 |
-
userManagement
|
| 35 |
-
organizationMembership
|
| 36 |
-
vault
|
| 37 |
-
webhooks
|
| 38 |
-
widgets
|
| 39 |
-
auditLogs
|
| 40 |
-
passwordless
|
| 41 |
}
|
| 42 |
|
| 43 |
// NewClient creates a new WorkOS API client.
|
|
@@ -66,6 +67,7 @@ func NewClient(apiKey string, opts ...ClientOption) *Client {
|
|
| 66 |
c.apiKeys = &APIKeyService{client: c}
|
| 67 |
c.pipesProvider = &PipesProviderService{client: c}
|
| 68 |
c.groups = &GroupService{client: c}
|
|
|
|
| 69 |
c.adminPortal = &AdminPortalService{client: c}
|
| 70 |
c.radar = &RadarService{client: c}
|
| 71 |
c.userManagement = &UserManagementService{client: c}
|
|
@@ -153,6 +155,11 @@ func (c *Client) Groups() *GroupService {
|
|
| 153 |
return c.groups
|
| 154 |
}
|
| 155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
// AdminPortal returns the AdminPortal service.
|
| 157 |
func (c *Client) AdminPortal() *AdminPortalService {
|
| 158 |
return c.adminPortal
|
|
|
|
| 14 |
logger Logger
|
| 15 |
appInfo appInfo
|
| 16 |
|
| 17 |
+
agents *AgentService
|
| 18 |
+
multiFactorAuth *MultiFactorAuthService
|
| 19 |
+
connect *ConnectService
|
| 20 |
+
authorization *AuthorizationService
|
| 21 |
+
clientAPI *ClientAPIService
|
| 22 |
+
sso *SSOService
|
| 23 |
+
pipes *PipeService
|
| 24 |
+
directorySync *DirectorySyncService
|
| 25 |
+
events *EventService
|
| 26 |
+
featureFlags *FeatureFlagService
|
| 27 |
+
organizationDomains *OrganizationDomainService
|
| 28 |
+
organizations *OrganizationService
|
| 29 |
+
apiKeys *APIKeyService
|
| 30 |
+
pipesProvider *PipesProviderService
|
| 31 |
+
groups *GroupService
|
| 32 |
+
organizationsItContacts *OrganizationsItContactService
|
| 33 |
+
adminPortal *AdminPortalService
|
| 34 |
+
radar *RadarService
|
| 35 |
+
userManagement *UserManagementService
|
| 36 |
+
organizationMembership *OrganizationMembershipService
|
| 37 |
+
vault *VaultService
|
| 38 |
+
webhooks *WebhookService
|
| 39 |
+
widgets *WidgetService
|
| 40 |
+
auditLogs *AuditLogService
|
| 41 |
+
passwordless *PasswordlessService
|
| 42 |
}
|
| 43 |
|
| 44 |
// NewClient creates a new WorkOS API client.
|
|
|
|
| 67 |
c.apiKeys = &APIKeyService{client: c}
|
| 68 |
c.pipesProvider = &PipesProviderService{client: c}
|
| 69 |
c.groups = &GroupService{client: c}
|
| 70 |
+
c.organizationsItContacts = &OrganizationsItContactService{client: c}
|
| 71 |
c.adminPortal = &AdminPortalService{client: c}
|
| 72 |
c.radar = &RadarService{client: c}
|
| 73 |
c.userManagement = &UserManagementService{client: c}
|
|
|
|
| 155 |
return c.groups
|
| 156 |
}
|
| 157 |
|
| 158 |
+
// OrganizationsItContacts returns the OrganizationsItContacts service.
|
| 159 |
+
func (c *Client) OrganizationsItContacts() *OrganizationsItContactService {
|
| 160 |
+
return c.organizationsItContacts
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
// AdminPortal returns the AdminPortal service.
|
| 164 |
func (c *Client) AdminPortal() *AdminPortalService {
|
| 165 |
return c.adminPortal
|
All files in this language are hidden by the current filters.
code: 0 · tests: 0 · manifest: 0
No changes for this language.
All files in this language are hidden by the current filters.
code: 11 · tests: 3 · manifest: 1
kotlin/.oagen-manifest.json|
@@ -195,6 +195,7 @@
|
|
| 195 |
"src/main/kotlin/com/workos/models/CreateGroup.kt",
|
| 196 |
"src/main/kotlin/com/workos/models/CreateGroupMembership.kt",
|
| 197 |
"src/main/kotlin/com/workos/models/CreateGroupRoleAssignment.kt",
|
|
|
|
| 198 |
"src/main/kotlin/com/workos/models/CreateM2MApplication.kt",
|
| 199 |
"src/main/kotlin/com/workos/models/CreateMagicCodeAndReturn.kt",
|
| 200 |
"src/main/kotlin/com/workos/models/CreateOAuthApplication.kt",
|
|
@@ -341,6 +342,9 @@
|
|
| 341 |
"src/main/kotlin/com/workos/models/InvitationResentData.kt",
|
| 342 |
"src/main/kotlin/com/workos/models/InvitationRevoked.kt",
|
| 343 |
"src/main/kotlin/com/workos/models/InvitationRevokedData.kt",
|
|
|
|
|
|
|
|
|
|
| 344 |
"src/main/kotlin/com/workos/models/JWTTemplateResponse.kt",
|
| 345 |
"src/main/kotlin/com/workos/models/JwksResponse.kt",
|
| 346 |
"src/main/kotlin/com/workos/models/JwksResponseKeys.kt",
|
|
@@ -550,6 +554,7 @@
|
|
| 550 |
"src/main/kotlin/com/workos/organizationdomains/OrganizationDomains.kt",
|
| 551 |
"src/main/kotlin/com/workos/organizationmembership/OrganizationMembershipService.kt",
|
| 552 |
"src/main/kotlin/com/workos/organizations/Organizations.kt",
|
|
|
|
| 553 |
"src/main/kotlin/com/workos/pipes/Pipes.kt",
|
| 554 |
"src/main/kotlin/com/workos/pipesprovider/PipesProvider.kt",
|
| 555 |
"src/main/kotlin/com/workos/radar/Radar.kt",
|
|
@@ -721,6 +726,7 @@
|
|
| 721 |
"src/test/kotlin/com/workos/organizationdomains/OrganizationDomainsTest.kt",
|
| 722 |
"src/test/kotlin/com/workos/organizationmembership/OrganizationMembershipServiceTest.kt",
|
| 723 |
"src/test/kotlin/com/workos/organizations/OrganizationsTest.kt",
|
|
|
|
| 724 |
"src/test/kotlin/com/workos/pipes/PipesTest.kt",
|
| 725 |
"src/test/kotlin/com/workos/pipesprovider/PipesProviderTest.kt",
|
| 726 |
"src/test/kotlin/com/workos/radar/RadarTest.kt",
|
|
@@ -1029,6 +1035,10 @@
|
|
| 1029 |
"sdkMethod": "authorizeDataIntegration",
|
| 1030 |
"service": "pipes"
|
| 1031 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1032 |
"POST /data-integrations/{slug}/credentials": {
|
| 1033 |
"sdkMethod": "createDataIntegrationCredential",
|
| 1034 |
"service": "pipes"
|
|
@@ -1201,6 +1211,18 @@
|
|
| 1201 |
"sdkMethod": "listAuthorizedApplications",
|
| 1202 |
"service": "organizations"
|
| 1203 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1204 |
"POST /portal/generate_link": {
|
| 1205 |
"sdkMethod": "generateLink",
|
| 1206 |
"service": "adminPortal"
|
|
@@ -1602,10 +1624,6 @@
|
|
| 1602 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 1603 |
"sdkMethod": "getExport",
|
| 1604 |
"service": "auditLogs"
|
| 1605 |
-
},
|
| 1606 |
-
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1607 |
-
"sdkMethod": "updateDataIntegrationClientCredentials",
|
| 1608 |
-
"service": "pipes"
|
| 1609 |
}
|
| 1610 |
}
|
| 1611 |
}
|
|
|
|
| 195 |
"src/main/kotlin/com/workos/models/CreateGroup.kt",
|
| 196 |
"src/main/kotlin/com/workos/models/CreateGroupMembership.kt",
|
| 197 |
"src/main/kotlin/com/workos/models/CreateGroupRoleAssignment.kt",
|
| 198 |
+
"src/main/kotlin/com/workos/models/CreateItContact.kt",
|
| 199 |
"src/main/kotlin/com/workos/models/CreateM2MApplication.kt",
|
| 200 |
"src/main/kotlin/com/workos/models/CreateMagicCodeAndReturn.kt",
|
| 201 |
"src/main/kotlin/com/workos/models/CreateOAuthApplication.kt",
|
|
|
|
| 342 |
"src/main/kotlin/com/workos/models/InvitationResentData.kt",
|
| 343 |
"src/main/kotlin/com/workos/models/InvitationRevoked.kt",
|
| 344 |
"src/main/kotlin/com/workos/models/InvitationRevokedData.kt",
|
| 345 |
+
"src/main/kotlin/com/workos/models/ItContact.kt",
|
| 346 |
+
"src/main/kotlin/com/workos/models/ItContactList.kt",
|
| 347 |
+
"src/main/kotlin/com/workos/models/ItContactListListMetadata.kt",
|
| 348 |
"src/main/kotlin/com/workos/models/JWTTemplateResponse.kt",
|
| 349 |
"src/main/kotlin/com/workos/models/JwksResponse.kt",
|
| 350 |
"src/main/kotlin/com/workos/models/JwksResponseKeys.kt",
|
|
|
|
| 554 |
"src/main/kotlin/com/workos/organizationdomains/OrganizationDomains.kt",
|
| 555 |
"src/main/kotlin/com/workos/organizationmembership/OrganizationMembershipService.kt",
|
| 556 |
"src/main/kotlin/com/workos/organizations/Organizations.kt",
|
| 557 |
+
"src/main/kotlin/com/workos/organizationsitcontacts/OrganizationsItContacts.kt",
|
| 558 |
"src/main/kotlin/com/workos/pipes/Pipes.kt",
|
| 559 |
"src/main/kotlin/com/workos/pipesprovider/PipesProvider.kt",
|
| 560 |
"src/main/kotlin/com/workos/radar/Radar.kt",
|
|
|
|
| 726 |
"src/test/kotlin/com/workos/organizationdomains/OrganizationDomainsTest.kt",
|
| 727 |
"src/test/kotlin/com/workos/organizationmembership/OrganizationMembershipServiceTest.kt",
|
| 728 |
"src/test/kotlin/com/workos/organizations/OrganizationsTest.kt",
|
| 729 |
+
"src/test/kotlin/com/workos/organizationsitcontacts/OrganizationsItContactsTest.kt",
|
| 730 |
"src/test/kotlin/com/workos/pipes/PipesTest.kt",
|
| 731 |
"src/test/kotlin/com/workos/pipesprovider/PipesProviderTest.kt",
|
| 732 |
"src/test/kotlin/com/workos/radar/RadarTest.kt",
|
|
|
|
| 1035 |
"sdkMethod": "authorizeDataIntegration",
|
| 1036 |
"service": "pipes"
|
| 1037 |
},
|
| 1038 |
+
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1039 |
+
"sdkMethod": "updateDataIntegrationClientCredentials",
|
| 1040 |
+
"service": "pipes"
|
| 1041 |
+
},
|
| 1042 |
"POST /data-integrations/{slug}/credentials": {
|
| 1043 |
"sdkMethod": "createDataIntegrationCredential",
|
| 1044 |
"service": "pipes"
|
|
|
|
| 1211 |
"sdkMethod": "listAuthorizedApplications",
|
| 1212 |
"service": "organizations"
|
| 1213 |
},
|
| 1214 |
+
"GET /organizations/{organization_id}/it_contacts": {
|
| 1215 |
+
"sdkMethod": "list",
|
| 1216 |
+
"service": "organizationsItContacts"
|
| 1217 |
+
},
|
| 1218 |
+
"POST /organizations/{organization_id}/it_contacts": {
|
| 1219 |
+
"sdkMethod": "create",
|
| 1220 |
+
"service": "organizationsItContacts"
|
| 1221 |
+
},
|
| 1222 |
+
"DELETE /organizations/{organization_id}/it_contacts/{contact_id}": {
|
| 1223 |
+
"sdkMethod": "delete",
|
| 1224 |
+
"service": "organizationsItContacts"
|
| 1225 |
+
},
|
| 1226 |
"POST /portal/generate_link": {
|
| 1227 |
"sdkMethod": "generateLink",
|
| 1228 |
"service": "adminPortal"
|
|
|
|
| 1624 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 1625 |
"sdkMethod": "getExport",
|
| 1626 |
"service": "auditLogs"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1627 |
}
|
| 1628 |
}
|
| 1629 |
}
|
kotlin/src/main/kotlin/com/workos/WorkOS.kt|
@@ -20,6 +20,7 @@ import com.workos.multifactorauth.MultiFactorAuth
|
|
| 20 |
import com.workos.organizationdomains.OrganizationDomains
|
| 21 |
import com.workos.organizationmembership.OrganizationMembershipService
|
| 22 |
import com.workos.organizations.Organizations
|
|
|
|
| 23 |
import com.workos.pipes.Pipes
|
| 24 |
import com.workos.pipesprovider.PipesProvider
|
| 25 |
import com.workos.radar.Radar
|
|
@@ -281,4 +282,13 @@ open class WorkOS
|
|
| 281 |
) {
|
| 282 |
Agents(this)
|
| 283 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
}
|
|
|
|
| 20 |
import com.workos.organizationdomains.OrganizationDomains
|
| 21 |
import com.workos.organizationmembership.OrganizationMembershipService
|
| 22 |
import com.workos.organizations.Organizations
|
| 23 |
+
import com.workos.organizationsitcontacts.OrganizationsItContacts
|
| 24 |
import com.workos.pipes.Pipes
|
| 25 |
import com.workos.pipesprovider.PipesProvider
|
| 26 |
import com.workos.radar.Radar
|
|
|
|
| 282 |
) {
|
| 283 |
Agents(this)
|
| 284 |
}
|
| 285 |
+
|
| 286 |
+
/** Lazily-constructed [OrganizationsItContacts] accessor for this [WorkOS] client. */
|
| 287 |
+
val organizationsItContacts: OrganizationsItContacts
|
| 288 |
+
get() =
|
| 289 |
+
service(
|
| 290 |
+
OrganizationsItContacts::class
|
| 291 |
+
) {
|
| 292 |
+
OrganizationsItContacts(this)
|
| 293 |
+
}
|
| 294 |
}
|
kotlin/src/main/kotlin/com/workos/authorization/Authorization.kt|
@@ -768,7 +768,7 @@ class Authorization(
|
|
| 768 |
/**
|
| 769 |
* List effective permissions for an organization membership on a resource
|
| 770 |
*
|
| 771 |
-
* Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources.
|
| 772 |
*
|
| 773 |
* @param organizationMembershipId The ID of the organization membership.
|
| 774 |
* @param resourceId The ID of the authorization resource.
|
|
@@ -831,7 +831,7 @@ class Authorization(
|
|
| 831 |
/**
|
| 832 |
* List effective permissions for an organization membership on a resource by external ID
|
| 833 |
*
|
| 834 |
-
* Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources.
|
| 835 |
*
|
| 836 |
* @param organizationMembershipId The ID of the organization membership.
|
| 837 |
* @param resourceTypeSlug The slug of the resource type.
|
|
|
|
| 768 |
/**
|
| 769 |
* List effective permissions for an organization membership on a resource
|
| 770 |
*
|
| 771 |
+
* Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 772 |
*
|
| 773 |
* @param organizationMembershipId The ID of the organization membership.
|
| 774 |
* @param resourceId The ID of the authorization resource.
|
|
|
|
| 831 |
/**
|
| 832 |
* List effective permissions for an organization membership on a resource by external ID
|
| 833 |
*
|
| 834 |
+
* Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 835 |
*
|
| 836 |
* @param organizationMembershipId The ID of the organization membership.
|
| 837 |
* @param resourceTypeSlug The slug of the resource type.
|
kotlin/src/main/kotlin/com/workos/models/CreateItContact.kt|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
package com.workos.models
|
| 4 |
+
|
| 5 |
+
import com.fasterxml.jackson.annotation.JsonProperty
|
| 6 |
+
|
| 7 |
+
/** CreateItContact model. */
|
| 8 |
+
data class CreateItContact(
|
| 9 |
+
/** The email address of the IT contact. */
|
| 10 |
+
@JsonProperty("email")
|
| 11 |
+
val email: String
|
| 12 |
+
)
|
kotlin/src/main/kotlin/com/workos/models/CreatePasswordResetToken.kt|
@@ -2,11 +2,5 @@
|
|
| 2 |
|
| 3 |
package com.workos.models
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
data class CreatePasswordResetToken(
|
| 9 |
-
/** The email address of the user requesting a password reset. */
|
| 10 |
-
@JsonProperty("email")
|
| 11 |
-
val email: String
|
| 12 |
-
)
|
|
|
|
| 2 |
|
| 3 |
package com.workos.models
|
| 4 |
|
| 5 |
+
/** Alias for [CreateItContact]. */
|
|
|
|
| 6 |
+
typealias CreatePasswordResetToken = CreateItContact
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
kotlin/src/main/kotlin/com/workos/models/ItContact.kt|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
package com.workos.models
|
| 4 |
+
|
| 5 |
+
import com.fasterxml.jackson.annotation.JsonProperty
|
| 6 |
+
import java.time.OffsetDateTime
|
| 7 |
+
|
| 8 |
+
/** ItContact model. */
|
| 9 |
+
data class ItContact(
|
| 10 |
+
/** The unique ID of the IT Contact. */
|
| 11 |
+
@JsonProperty("id")
|
| 12 |
+
val id: String,
|
| 13 |
+
|
| 14 |
+
/** The email address of the IT Contact. */
|
| 15 |
+
@JsonProperty("email")
|
| 16 |
+
val email: String,
|
| 17 |
+
|
| 18 |
+
/** An ISO 8601 timestamp. */
|
| 19 |
+
@JsonProperty("created_at")
|
| 20 |
+
val createdAt: OffsetDateTime,
|
| 21 |
+
|
| 22 |
+
/** An ISO 8601 timestamp. */
|
| 23 |
+
@JsonProperty("updated_at")
|
| 24 |
+
val updatedAt: OffsetDateTime,
|
| 25 |
+
|
| 26 |
+
/** The IT Contact object. */
|
| 27 |
+
@JsonProperty("object")
|
| 28 |
+
val objectType: String = "it_contact"
|
| 29 |
+
)
|
kotlin/src/main/kotlin/com/workos/models/ItContactList.kt|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
package com.workos.models
|
| 4 |
+
|
| 5 |
+
import com.fasterxml.jackson.annotation.JsonProperty
|
| 6 |
+
|
| 7 |
+
/** ItContactList model. */
|
| 8 |
+
data class ItContactList(
|
| 9 |
+
/** The list of records for the current page. */
|
| 10 |
+
@JsonProperty("data")
|
| 11 |
+
val data: List<ItContact>,
|
| 12 |
+
|
| 13 |
+
/** Pagination cursors for navigating between pages of results. */
|
| 14 |
+
@JsonProperty("list_metadata")
|
| 15 |
+
val listMetadata: ItContactListListMetadata,
|
| 16 |
+
|
| 17 |
+
/** Indicates this is a list response. */
|
| 18 |
+
@JsonProperty("object")
|
| 19 |
+
val objectType: String = "list"
|
| 20 |
+
)
|
kotlin/src/main/kotlin/com/workos/models/ItContactListListMetadata.kt|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
package com.workos.models
|
| 4 |
+
|
| 5 |
+
import com.fasterxml.jackson.annotation.JsonProperty
|
| 6 |
+
|
| 7 |
+
/** Pagination cursors for navigating between pages of results. */
|
| 8 |
+
data class ItContactListListMetadata(
|
| 9 |
+
/** An object ID that defines your place in the list. When the ID is not present, you are at the start of the list. */
|
| 10 |
+
@JsonProperty("before")
|
| 11 |
+
val before: String?,
|
| 12 |
+
|
| 13 |
+
/** An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. */
|
| 14 |
+
@JsonProperty("after")
|
| 15 |
+
val after: String?
|
| 16 |
+
)
|
kotlin/src/main/kotlin/com/workos/models/OrganizationInput.kt|
@@ -16,6 +16,7 @@ data class OrganizationInput(
|
|
| 16 |
|
| 17 |
/** The domains associated with the organization. Deprecated in favor of `domain_data`. */
|
| 18 |
@JsonProperty("domains")
|
|
|
|
| 19 |
val domains: List<String>? = null,
|
| 20 |
|
| 21 |
/** The domains associated with the organization, including verification state. */
|
|
|
|
| 16 |
|
| 17 |
/** The domains associated with the organization. Deprecated in favor of `domain_data`. */
|
| 18 |
@JsonProperty("domains")
|
| 19 |
+
@Deprecated("The domains associated with the organization. Deprecated in favor of `domain_data`.")
|
| 20 |
val domains: List<String>? = null,
|
| 21 |
|
| 22 |
/** The domains associated with the organization, including verification state. */
|
kotlin/src/main/kotlin/com/workos/models/WaitlistUser.kt|
@@ -8,19 +8,19 @@ import java.time.OffsetDateTime
|
|
| 8 |
|
| 9 |
/** WaitlistUser model. */
|
| 10 |
data class WaitlistUser(
|
| 11 |
-
/** The unique ID of the
|
| 12 |
@JsonProperty("id")
|
| 13 |
val id: String,
|
| 14 |
|
| 15 |
-
/** The email address of the
|
| 16 |
@JsonProperty("email")
|
| 17 |
val email: String,
|
| 18 |
|
| 19 |
-
/** The state of the
|
| 20 |
@JsonProperty("state")
|
| 21 |
val state: WaitlistUserState,
|
| 22 |
|
| 23 |
-
/** The timestamp when the
|
| 24 |
@JsonProperty("approved_at")
|
| 25 |
val approvedAt: OffsetDateTime?,
|
| 26 |
|
|
@@ -32,11 +32,15 @@ data class WaitlistUser(
|
|
| 32 |
@JsonProperty("updated_at")
|
| 33 |
val updatedAt: OffsetDateTime,
|
| 34 |
|
| 35 |
-
/**
|
| 36 |
-
@JsonProperty("
|
| 37 |
-
val
|
| 38 |
|
| 39 |
-
/** The unique ID of the
|
| 40 |
@JsonProperty("waitlist_id")
|
| 41 |
-
val waitlistId: String? = null
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
)
|
|
|
|
| 8 |
|
| 9 |
/** WaitlistUser model. */
|
| 10 |
data class WaitlistUser(
|
| 11 |
+
/** The unique ID of the waitlist entry. */
|
| 12 |
@JsonProperty("id")
|
| 13 |
val id: String,
|
| 14 |
|
| 15 |
+
/** The email address of the user on the waitlist. */
|
| 16 |
@JsonProperty("email")
|
| 17 |
val email: String,
|
| 18 |
|
| 19 |
+
/** The state of the waitlist entry. */
|
| 20 |
@JsonProperty("state")
|
| 21 |
val state: WaitlistUserState,
|
| 22 |
|
| 23 |
+
/** The timestamp when the entry was approved, or null if not yet approved. */
|
| 24 |
@JsonProperty("approved_at")
|
| 25 |
val approvedAt: OffsetDateTime?,
|
| 26 |
|
|
|
|
| 32 |
@JsonProperty("updated_at")
|
| 33 |
val updatedAt: OffsetDateTime,
|
| 34 |
|
| 35 |
+
/** Additional fields submitted when the user joined the waitlist. Values are user-provided — treat them as untrusted input when rendering or exporting. */
|
| 36 |
+
@JsonProperty("additional_fields")
|
| 37 |
+
val additionalFields: Map<String, String>? = null,
|
| 38 |
|
| 39 |
+
/** The unique ID of the waitlist the entry belongs to. */
|
| 40 |
@JsonProperty("waitlist_id")
|
| 41 |
+
val waitlistId: String? = null,
|
| 42 |
+
|
| 43 |
+
/** Distinguishes the Waitlist User object. */
|
| 44 |
+
@JsonProperty("object")
|
| 45 |
+
val objectType: String = "waitlist_user"
|
| 46 |
)
|
kotlin/src/main/kotlin/com/workos/organizations/Organizations.kt|
@@ -97,7 +97,7 @@ class Organizations(
|
|
| 97 |
*
|
| 98 |
* @param name The name of the organization.
|
| 99 |
* @param allowProfilesOutsideOrganization Whether the organization allows profiles from outside the organization to sign in.
|
| 100 |
-
* @param domains The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 101 |
* @param domainData The domains associated with the organization, including verification state.
|
| 102 |
* @param metadata Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 103 |
* @param externalId An external identifier for the Organization.
|
|
|
|
| 97 |
*
|
| 98 |
* @param name The name of the organization.
|
| 99 |
* @param allowProfilesOutsideOrganization Whether the organization allows profiles from outside the organization to sign in.
|
| 100 |
+
* @param domains **Deprecated.** The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 101 |
* @param domainData The domains associated with the organization, including verification state.
|
| 102 |
* @param metadata Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 103 |
* @param externalId An external identifier for the Organization.
|
kotlin/src/main/kotlin/com/workos/organizationsitcontacts/OrganizationsItContacts.kt|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
package com.workos.organizationsitcontacts
|
| 4 |
+
|
| 5 |
+
import com.workos.WorkOS
|
| 6 |
+
import com.workos.common.http.RequestConfig
|
| 7 |
+
import com.workos.common.http.RequestOptions
|
| 8 |
+
import com.workos.common.http.bodyOf
|
| 9 |
+
import com.workos.common.http.encodePathSegment
|
| 10 |
+
import com.workos.models.ItContact
|
| 11 |
+
import com.workos.models.ItContactList
|
| 12 |
+
import kotlinx.coroutines.Dispatchers
|
| 13 |
+
import kotlinx.coroutines.withContext
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* API accessor for OrganizationsItContacts.
|
| 17 |
+
*
|
| 18 |
+
* Every operation on this class is available in two flavors: a blocking variant (`<methodName>`) and a coroutine-aware variant (`<methodName>Suspend`). The `Suspend` variants delegate to the blocking ones under `withContext(Dispatchers.IO)`, so they are safe to call from any coroutine dispatcher (including `Dispatchers.Main`).
|
| 19 |
+
*/
|
| 20 |
+
class OrganizationsItContacts(
|
| 21 |
+
internal val workos: WorkOS
|
| 22 |
+
) {
|
| 23 |
+
/**
|
| 24 |
+
* List IT contacts
|
| 25 |
+
*
|
| 26 |
+
* Get the IT contacts for an organization.
|
| 27 |
+
*
|
| 28 |
+
* @param organizationId The ID of the organization.
|
| 29 |
+
* @param requestOptions per-request overrides (idempotency key, API key, headers, timeout)
|
| 30 |
+
*
|
| 31 |
+
* @return the ItContactList
|
| 32 |
+
*/
|
| 33 |
+
@JvmOverloads
|
| 34 |
+
fun list(
|
| 35 |
+
organizationId: String,
|
| 36 |
+
requestOptions: RequestOptions? = null
|
| 37 |
+
): ItContactList {
|
| 38 |
+
val config =
|
| 39 |
+
RequestConfig(
|
| 40 |
+
method = "GET",
|
| 41 |
+
path = "/organizations/${encodePathSegment(organizationId)}/it_contacts",
|
| 42 |
+
requestOptions = requestOptions
|
| 43 |
+
)
|
| 44 |
+
return workos.baseClient.request(config, ItContactList::class.java)
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* Coroutine-aware variant of [list]. Use this from
|
| 49 |
+
* a `suspend` function or coroutine scope.
|
| 50 |
+
*
|
| 51 |
+
* Delegates to the blocking [list] under
|
| 52 |
+
* `withContext(Dispatchers.IO)`, so this is safe to call from any
|
| 53 |
+
* coroutine dispatcher (including `Dispatchers.Main`).
|
| 54 |
+
*/
|
| 55 |
+
@JvmName("listSuspend")
|
| 56 |
+
suspend fun listSuspend(
|
| 57 |
+
organizationId: String,
|
| 58 |
+
requestOptions: RequestOptions? = null
|
| 59 |
+
): ItContactList =
|
| 60 |
+
withContext(Dispatchers.IO) {
|
| 61 |
+
list(organizationId, requestOptions)
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* Create an IT contact
|
| 66 |
+
*
|
| 67 |
+
* Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.
|
| 68 |
+
*
|
| 69 |
+
* @param organizationId The ID of the organization.
|
| 70 |
+
* @param email The email address of the IT contact.
|
| 71 |
+
* @param requestOptions per-request overrides (idempotency key, API key, headers, timeout)
|
| 72 |
+
*
|
| 73 |
+
* @return the ItContact
|
| 74 |
+
*/
|
| 75 |
+
@JvmOverloads
|
| 76 |
+
fun create(
|
| 77 |
+
organizationId: String,
|
| 78 |
+
email: String,
|
| 79 |
+
requestOptions: RequestOptions? = null
|
| 80 |
+
): ItContact {
|
| 81 |
+
val body =
|
| 82 |
+
bodyOf(
|
| 83 |
+
"email" to email
|
| 84 |
+
)
|
| 85 |
+
val config =
|
| 86 |
+
RequestConfig(
|
| 87 |
+
method = "POST",
|
| 88 |
+
path = "/organizations/${encodePathSegment(organizationId)}/it_contacts",
|
| 89 |
+
body = body,
|
| 90 |
+
requestOptions = requestOptions
|
| 91 |
+
)
|
| 92 |
+
return workos.baseClient.request(config, ItContact::class.java)
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* Coroutine-aware variant of [create]. Use this from
|
| 97 |
+
* a `suspend` function or coroutine scope.
|
| 98 |
+
*
|
| 99 |
+
* Delegates to the blocking [create] under
|
| 100 |
+
* `withContext(Dispatchers.IO)`, so this is safe to call from any
|
| 101 |
+
* coroutine dispatcher (including `Dispatchers.Main`).
|
| 102 |
+
*/
|
| 103 |
+
@JvmName("createSuspend")
|
| 104 |
+
suspend fun createSuspend(
|
| 105 |
+
organizationId: String,
|
| 106 |
+
email: String,
|
| 107 |
+
requestOptions: RequestOptions? = null
|
| 108 |
+
): ItContact =
|
| 109 |
+
withContext(Dispatchers.IO) {
|
| 110 |
+
create(organizationId, email, requestOptions)
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
* Delete an IT contact
|
| 115 |
+
*
|
| 116 |
+
* Remove an IT contact from an organization.
|
| 117 |
+
*
|
| 118 |
+
* @param organizationId The ID of the organization.
|
| 119 |
+
* @param contactId The ID of the IT contact.
|
| 120 |
+
* @param requestOptions per-request overrides (idempotency key, API key, headers, timeout)
|
| 121 |
+
*/
|
| 122 |
+
@JvmOverloads
|
| 123 |
+
fun delete(
|
| 124 |
+
organizationId: String,
|
| 125 |
+
contactId: String,
|
| 126 |
+
requestOptions: RequestOptions? = null
|
| 127 |
+
) {
|
| 128 |
+
val config =
|
| 129 |
+
RequestConfig(
|
| 130 |
+
method = "DELETE",
|
| 131 |
+
path = "/organizations/${encodePathSegment(organizationId)}/it_contacts/${encodePathSegment(contactId)}",
|
| 132 |
+
requestOptions = requestOptions
|
| 133 |
+
)
|
| 134 |
+
workos.baseClient.requestVoid(config)
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
/**
|
| 138 |
+
* Coroutine-aware variant of [delete]. Use this from
|
| 139 |
+
* a `suspend` function or coroutine scope.
|
| 140 |
+
*
|
| 141 |
+
* Delegates to the blocking [delete] under
|
| 142 |
+
* `withContext(Dispatchers.IO)`, so this is safe to call from any
|
| 143 |
+
* coroutine dispatcher (including `Dispatchers.Main`).
|
| 144 |
+
*/
|
| 145 |
+
@JvmName("deleteSuspend")
|
| 146 |
+
suspend fun deleteSuspend(
|
| 147 |
+
organizationId: String,
|
| 148 |
+
contactId: String,
|
| 149 |
+
requestOptions: RequestOptions? = null
|
| 150 |
+
) = withContext(Dispatchers.IO) {
|
| 151 |
+
delete(organizationId, contactId, requestOptions)
|
| 152 |
+
}
|
| 153 |
+
}
|
kotlin/src/test/kotlin/com/workos/models/GeneratedForwardCompatTest.kt|
@@ -8,7 +8,7 @@ import com.workos.types.ConnectedAccountInputState
|
|
| 8 |
import com.workos.types.CreateDataIntegrationAuthMethods
|
| 9 |
import com.workos.types.CreateUserInviteOptionsLocale
|
| 10 |
import com.workos.types.CreateUserPasswordHashType
|
| 11 |
-
import com.workos.types.
|
| 12 |
import com.workos.types.CustomProviderDefinitionAuthenticateVia
|
| 13 |
import com.workos.types.DataIntegrationCredentialsInputType
|
| 14 |
import com.workos.types.GenerateLinkIntent
|
|
@@ -17,7 +17,7 @@ import com.workos.types.PaginationOrder
|
|
| 17 |
import com.workos.types.ResendUserInviteOptionsLocale
|
| 18 |
import com.workos.types.UpdateCustomProviderDefinitionAuthenticateVia
|
| 19 |
import com.workos.types.UpdateUserPasswordHashType
|
| 20 |
-
import com.workos.types.
|
| 21 |
import com.workos.types.VaultByokKeyProvider
|
| 22 |
import org.junit.jupiter.api.Assertions.assertEquals
|
| 23 |
import org.junit.jupiter.api.Assertions.assertNotNull
|
|
@@ -111,24 +111,24 @@ class GeneratedForwardCompatTest {
|
|
| 111 |
}
|
| 112 |
|
| 113 |
@Test
|
| 114 |
-
fun `unknown
|
| 115 |
// Simulates a future server release that introduces a new enum variant.
|
| 116 |
-
val parsed = mapper.readValue("\"__oagen_new_variant__\"",
|
| 117 |
-
assertEquals(
|
| 118 |
}
|
| 119 |
|
| 120 |
@Test
|
| 121 |
-
fun `unknown
|
| 122 |
// Simulates a future server release that introduces a new enum variant.
|
| 123 |
-
val parsed = mapper.readValue("\"__oagen_new_variant__\"",
|
| 124 |
-
assertEquals(
|
| 125 |
}
|
| 126 |
|
| 127 |
@Test
|
| 128 |
-
fun `unknown
|
| 129 |
// Simulates a future server release that introduces a new enum variant.
|
| 130 |
-
val parsed = mapper.readValue("\"__oagen_new_variant__\"",
|
| 131 |
-
assertEquals(
|
| 132 |
}
|
| 133 |
|
| 134 |
@Test
|
|
|
|
| 8 |
import com.workos.types.CreateDataIntegrationAuthMethods
|
| 9 |
import com.workos.types.CreateUserInviteOptionsLocale
|
| 10 |
import com.workos.types.CreateUserPasswordHashType
|
| 11 |
+
import com.workos.types.CreateUserPasswordSaltPosition
|
| 12 |
import com.workos.types.CustomProviderDefinitionAuthenticateVia
|
| 13 |
import com.workos.types.DataIntegrationCredentialsInputType
|
| 14 |
import com.workos.types.GenerateLinkIntent
|
|
|
|
| 17 |
import com.workos.types.ResendUserInviteOptionsLocale
|
| 18 |
import com.workos.types.UpdateCustomProviderDefinitionAuthenticateVia
|
| 19 |
import com.workos.types.UpdateUserPasswordHashType
|
| 20 |
+
import com.workos.types.UpdateUserPasswordSaltPosition
|
| 21 |
import com.workos.types.VaultByokKeyProvider
|
| 22 |
import org.junit.jupiter.api.Assertions.assertEquals
|
| 23 |
import org.junit.jupiter.api.Assertions.assertNotNull
|
|
|
|
| 111 |
}
|
| 112 |
|
| 113 |
@Test
|
| 114 |
+
fun `unknown CreateUserPasswordSaltPosition wire values deserialize to Unknown`() {
|
| 115 |
// Simulates a future server release that introduces a new enum variant.
|
| 116 |
+
val parsed = mapper.readValue("\"__oagen_new_variant__\"", CreateUserPasswordSaltPosition::class.java)
|
| 117 |
+
assertEquals(CreateUserPasswordSaltPosition.Unknown, parsed)
|
| 118 |
}
|
| 119 |
|
| 120 |
@Test
|
| 121 |
+
fun `unknown UpdateUserPasswordHashType wire values deserialize to Unknown`() {
|
| 122 |
// Simulates a future server release that introduces a new enum variant.
|
| 123 |
+
val parsed = mapper.readValue("\"__oagen_new_variant__\"", UpdateUserPasswordHashType::class.java)
|
| 124 |
+
assertEquals(UpdateUserPasswordHashType.Unknown, parsed)
|
| 125 |
}
|
| 126 |
|
| 127 |
@Test
|
| 128 |
+
fun `unknown UpdateUserPasswordSaltPosition wire values deserialize to Unknown`() {
|
| 129 |
// Simulates a future server release that introduces a new enum variant.
|
| 130 |
+
val parsed = mapper.readValue("\"__oagen_new_variant__\"", UpdateUserPasswordSaltPosition::class.java)
|
| 131 |
+
assertEquals(UpdateUserPasswordSaltPosition.Unknown, parsed)
|
| 132 |
}
|
| 133 |
|
| 134 |
@Test
|
kotlin/src/test/kotlin/com/workos/models/GeneratedModelRoundTripTest.kt|
@@ -99,6 +99,16 @@ class GeneratedModelRoundTripTest {
|
|
| 99 |
assertEquals(tree1, tree2)
|
| 100 |
}
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
@Test
|
| 103 |
fun `CreateRedirectUri round-trips through Jackson`() {
|
| 104 |
val json = "{\"uri\": \"sample\"}"
|
|
@@ -1061,6 +1071,18 @@ class GeneratedModelRoundTripTest {
|
|
| 1061 |
assertEquals(tree1, tree2)
|
| 1062 |
}
|
| 1063 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1064 |
@Test
|
| 1065 |
fun `DataIntegrationAuthorizeUrlResponse round-trips through Jackson`() {
|
| 1066 |
val json = "{\"url\": \"sample\"}"
|
|
|
|
| 99 |
assertEquals(tree1, tree2)
|
| 100 |
}
|
| 101 |
|
| 102 |
+
@Test
|
| 103 |
+
fun `CreateItContact round-trips through Jackson`() {
|
| 104 |
+
val json = "{\"email\": \"sample\"}"
|
| 105 |
+
val parsed = mapper.readValue(json, CreateItContact::class.java)
|
| 106 |
+
val reserialized = mapper.writeValueAsString(parsed)
|
| 107 |
+
val tree1 = mapper.readTree(json)
|
| 108 |
+
val tree2 = mapper.readTree(reserialized)
|
| 109 |
+
assertEquals(tree1, tree2)
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
@Test
|
| 113 |
fun `CreateRedirectUri round-trips through Jackson`() {
|
| 114 |
val json = "{\"uri\": \"sample\"}"
|
|
|
|
| 1071 |
assertEquals(tree1, tree2)
|
| 1072 |
}
|
| 1073 |
|
| 1074 |
+
@Test
|
| 1075 |
+
fun `ItContact round-trips through Jackson`() {
|
| 1076 |
+
val json =
|
| 1077 |
+
"{\"object\": \"it_contact\", \"id\": \"sample\", \"email\": \"sample\", \"created_at\": \"2024-01-01T00:00:00Z\", " +
|
| 1078 |
+
"\"updated_at\": \"2024-01-01T00:00:00Z\"}"
|
| 1079 |
+
val parsed = mapper.readValue(json, ItContact::class.java)
|
| 1080 |
+
val reserialized = mapper.writeValueAsString(parsed)
|
| 1081 |
+
val tree1 = mapper.readTree(json)
|
| 1082 |
+
val tree2 = mapper.readTree(reserialized)
|
| 1083 |
+
assertEquals(tree1, tree2)
|
| 1084 |
+
}
|
| 1085 |
+
|
| 1086 |
@Test
|
| 1087 |
fun `DataIntegrationAuthorizeUrlResponse round-trips through Jackson`() {
|
| 1088 |
val json = "{\"url\": \"sample\"}"
|
kotlin/src/test/kotlin/com/workos/organizationsitcontacts/OrganizationsItContactsTest.kt|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
package com.workos.organizationsitcontacts
|
| 4 |
+
|
| 5 |
+
import com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath
|
| 6 |
+
import com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor
|
| 7 |
+
import com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching
|
| 8 |
+
import com.workos.common.exceptions.GenericServerException
|
| 9 |
+
import com.workos.common.exceptions.NotFoundException
|
| 10 |
+
import com.workos.common.exceptions.RateLimitException
|
| 11 |
+
import com.workos.common.exceptions.UnauthorizedException
|
| 12 |
+
import com.workos.test.TestBase
|
| 13 |
+
import org.junit.jupiter.api.Assertions.assertEquals
|
| 14 |
+
import org.junit.jupiter.api.Assertions.assertNotNull
|
| 15 |
+
import org.junit.jupiter.api.Assertions.assertThrows
|
| 16 |
+
import org.junit.jupiter.api.Test
|
| 17 |
+
|
| 18 |
+
class OrganizationsItContactsTest : TestBase() {
|
| 19 |
+
private fun api() = OrganizationsItContacts(createWorkOSClient())
|
| 20 |
+
|
| 21 |
+
@Test
|
| 22 |
+
fun `list returns a typed response`() {
|
| 23 |
+
stubResponse(
|
| 24 |
+
"GET",
|
| 25 |
+
"/organizations/sample-arg/it_contacts",
|
| 26 |
+
200,
|
| 27 |
+
"{\"object\": \"list\", \"data\": [], \"list_metadata\": {\"before\": null, \"after\": null}}"
|
| 28 |
+
)
|
| 29 |
+
val result = api().list("sample-arg")
|
| 30 |
+
assertNotNull(result)
|
| 31 |
+
assertEquals("list", result.objectType)
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
@Test
|
| 35 |
+
fun `create returns a typed response`() {
|
| 36 |
+
stubResponse(
|
| 37 |
+
"POST",
|
| 38 |
+
"/organizations/sample-arg/it_contacts",
|
| 39 |
+
200,
|
| 40 |
+
"{\"object\": \"it_contact\", \"id\": \"sample\", \"email\": \"sample\", \"created_at\": \"2024-01-01T00:00:00Z\", " +
|
| 41 |
+
"\"updated_at\": \"2024-01-01T00:00:00Z\"}"
|
| 42 |
+
)
|
| 43 |
+
val result = api().create("sample-arg", "sample-arg")
|
| 44 |
+
assertNotNull(result)
|
| 45 |
+
assertEquals("it_contact", result.objectType)
|
| 46 |
+
assertEquals("sample", result.id)
|
| 47 |
+
assertEquals("sample", result.email)
|
| 48 |
+
wireMockRule.verify(
|
| 49 |
+
postRequestedFor(urlPathMatching("/organizations/sample-arg/it_contacts"))
|
| 50 |
+
.withRequestBody(matchingJsonPath("\$.email"))
|
| 51 |
+
)
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
@Test
|
| 55 |
+
fun `delete completes without throwing`() {
|
| 56 |
+
stubResponse("DELETE", "/organizations/sample-arg/it_contacts/sample-arg", 204)
|
| 57 |
+
api().delete("sample-arg", "sample-arg")
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
@Test
|
| 61 |
+
fun `list translates 401 to UnauthorizedException`() {
|
| 62 |
+
stubResponse("GET", "/organizations/sample-arg/it_contacts", 401)
|
| 63 |
+
assertThrows(UnauthorizedException::class.java) {
|
| 64 |
+
api().list("sample-arg")
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
@Test
|
| 69 |
+
fun `list translates 404 to NotFoundException`() {
|
| 70 |
+
stubResponse("GET", "/organizations/sample-arg/it_contacts", 404)
|
| 71 |
+
assertThrows(NotFoundException::class.java) {
|
| 72 |
+
api().list("sample-arg")
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
@Test
|
| 77 |
+
fun `list translates 429 to RateLimitException`() {
|
| 78 |
+
stubResponse("GET", "/organizations/sample-arg/it_contacts", 429)
|
| 79 |
+
assertThrows(RateLimitException::class.java) {
|
| 80 |
+
api().list("sample-arg")
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
@Test
|
| 85 |
+
fun `list translates 500 to GenericServerException`() {
|
| 86 |
+
stubResponse("GET", "/organizations/sample-arg/it_contacts", 500)
|
| 87 |
+
assertThrows(GenericServerException::class.java) {
|
| 88 |
+
api().list("sample-arg")
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
}
|
All files in this language are hidden by the current filters.
code: 11 · tests: 8 · manifest: 1
php/.oagen-manifest.json|
@@ -200,12 +200,12 @@
|
|
| 200 |
"lib/Resource/CreateAuthorizationResource.php",
|
| 201 |
"lib/Resource/CreateCORSOrigin.php",
|
| 202 |
"lib/Resource/CreateDataIntegration.php",
|
| 203 |
-
"lib/Resource/CreateDataIntegrationAuthMethods.php",
|
| 204 |
"lib/Resource/CreateDataKeyRequest.php",
|
| 205 |
"lib/Resource/CreateDataKeyResponse.php",
|
| 206 |
"lib/Resource/CreateGroup.php",
|
| 207 |
"lib/Resource/CreateGroupMembership.php",
|
| 208 |
"lib/Resource/CreateGroupRoleAssignment.php",
|
|
|
|
| 209 |
"lib/Resource/CreateM2MApplication.php",
|
| 210 |
"lib/Resource/CreateMagicCodeAndReturn.php",
|
| 211 |
"lib/Resource/CreateOAuthApplication.php",
|
|
@@ -371,6 +371,9 @@
|
|
| 371 |
"lib/Resource/InvitationResentData.php",
|
| 372 |
"lib/Resource/InvitationRevoked.php",
|
| 373 |
"lib/Resource/InvitationRevokedData.php",
|
|
|
|
|
|
|
|
|
|
| 374 |
"lib/Resource/JWTTemplateResponse.php",
|
| 375 |
"lib/Resource/JsonSerializableTrait.php",
|
| 376 |
"lib/Resource/JwksResponse.php",
|
|
@@ -618,6 +621,7 @@
|
|
| 618 |
"lib/Service/OrganizationDomains.php",
|
| 619 |
"lib/Service/OrganizationMembershipService.php",
|
| 620 |
"lib/Service/Organizations.php",
|
|
|
|
| 621 |
"lib/Service/ParentByExternalId.php",
|
| 622 |
"lib/Service/ParentById.php",
|
| 623 |
"lib/Service/ParentResourceByExternalId.php",
|
|
@@ -818,6 +822,7 @@
|
|
| 818 |
"tests/Fixtures/create_group.json",
|
| 819 |
"tests/Fixtures/create_group_membership.json",
|
| 820 |
"tests/Fixtures/create_group_role_assignment.json",
|
|
|
|
| 821 |
"tests/Fixtures/create_m2m_application.json",
|
| 822 |
"tests/Fixtures/create_magic_code_and_return.json",
|
| 823 |
"tests/Fixtures/create_oauth_application.json",
|
|
@@ -963,6 +968,8 @@
|
|
| 963 |
"tests/Fixtures/invitation_resent_data.json",
|
| 964 |
"tests/Fixtures/invitation_revoked.json",
|
| 965 |
"tests/Fixtures/invitation_revoked_data.json",
|
|
|
|
|
|
|
| 966 |
"tests/Fixtures/jwks_response.json",
|
| 967 |
"tests/Fixtures/jwks_response_keys.json",
|
| 968 |
"tests/Fixtures/jwt_template_response.json",
|
|
@@ -1210,6 +1217,7 @@
|
|
| 1210 |
"tests/Service/MultiFactorAuthTest.php",
|
| 1211 |
"tests/Service/OrganizationDomainsTest.php",
|
| 1212 |
"tests/Service/OrganizationMembershipTest.php",
|
|
|
|
| 1213 |
"tests/Service/OrganizationsTest.php",
|
| 1214 |
"tests/Service/PipesProviderTest.php",
|
| 1215 |
"tests/Service/PipesTest.php",
|
|
@@ -1513,6 +1521,10 @@
|
|
| 1513 |
"sdkMethod": "authorizeDataIntegration",
|
| 1514 |
"service": "pipes"
|
| 1515 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1516 |
"POST /data-integrations/{slug}/credentials": {
|
| 1517 |
"sdkMethod": "createDataIntegrationCredential",
|
| 1518 |
"service": "pipes"
|
|
@@ -1685,6 +1697,18 @@
|
|
| 1685 |
"sdkMethod": "listAuthorizedApplications",
|
| 1686 |
"service": "organizations"
|
| 1687 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1688 |
"POST /portal/generate_link": {
|
| 1689 |
"sdkMethod": "generateLink",
|
| 1690 |
"service": "adminPortal"
|
|
@@ -2064,10 +2088,6 @@
|
|
| 2064 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2065 |
"sdkMethod": "getExport",
|
| 2066 |
"service": "auditLogs"
|
| 2067 |
-
},
|
| 2068 |
-
"PUT /data-integrations/{slug}/client-credentials": {
|
| 2069 |
-
"sdkMethod": "updateDataIntegrationClientCredentials",
|
| 2070 |
-
"service": "pipes"
|
| 2071 |
}
|
| 2072 |
}
|
| 2073 |
}
|
|
|
|
| 200 |
"lib/Resource/CreateAuthorizationResource.php",
|
| 201 |
"lib/Resource/CreateCORSOrigin.php",
|
| 202 |
"lib/Resource/CreateDataIntegration.php",
|
|
|
|
| 203 |
"lib/Resource/CreateDataKeyRequest.php",
|
| 204 |
"lib/Resource/CreateDataKeyResponse.php",
|
| 205 |
"lib/Resource/CreateGroup.php",
|
| 206 |
"lib/Resource/CreateGroupMembership.php",
|
| 207 |
"lib/Resource/CreateGroupRoleAssignment.php",
|
| 208 |
+
"lib/Resource/CreateItContact.php",
|
| 209 |
"lib/Resource/CreateM2MApplication.php",
|
| 210 |
"lib/Resource/CreateMagicCodeAndReturn.php",
|
| 211 |
"lib/Resource/CreateOAuthApplication.php",
|
|
|
|
| 371 |
"lib/Resource/InvitationResentData.php",
|
| 372 |
"lib/Resource/InvitationRevoked.php",
|
| 373 |
"lib/Resource/InvitationRevokedData.php",
|
| 374 |
+
"lib/Resource/ItContact.php",
|
| 375 |
+
"lib/Resource/ItContactList.php",
|
| 376 |
+
"lib/Resource/ItContactListListMetadata.php",
|
| 377 |
"lib/Resource/JWTTemplateResponse.php",
|
| 378 |
"lib/Resource/JsonSerializableTrait.php",
|
| 379 |
"lib/Resource/JwksResponse.php",
|
|
|
|
| 621 |
"lib/Service/OrganizationDomains.php",
|
| 622 |
"lib/Service/OrganizationMembershipService.php",
|
| 623 |
"lib/Service/Organizations.php",
|
| 624 |
+
"lib/Service/OrganizationsItContacts.php",
|
| 625 |
"lib/Service/ParentByExternalId.php",
|
| 626 |
"lib/Service/ParentById.php",
|
| 627 |
"lib/Service/ParentResourceByExternalId.php",
|
|
|
|
| 822 |
"tests/Fixtures/create_group.json",
|
| 823 |
"tests/Fixtures/create_group_membership.json",
|
| 824 |
"tests/Fixtures/create_group_role_assignment.json",
|
| 825 |
+
"tests/Fixtures/create_it_contact.json",
|
| 826 |
"tests/Fixtures/create_m2m_application.json",
|
| 827 |
"tests/Fixtures/create_magic_code_and_return.json",
|
| 828 |
"tests/Fixtures/create_oauth_application.json",
|
|
|
|
| 968 |
"tests/Fixtures/invitation_resent_data.json",
|
| 969 |
"tests/Fixtures/invitation_revoked.json",
|
| 970 |
"tests/Fixtures/invitation_revoked_data.json",
|
| 971 |
+
"tests/Fixtures/it_contact.json",
|
| 972 |
+
"tests/Fixtures/it_contact_list_list_metadata.json",
|
| 973 |
"tests/Fixtures/jwks_response.json",
|
| 974 |
"tests/Fixtures/jwks_response_keys.json",
|
| 975 |
"tests/Fixtures/jwt_template_response.json",
|
|
|
|
| 1217 |
"tests/Service/MultiFactorAuthTest.php",
|
| 1218 |
"tests/Service/OrganizationDomainsTest.php",
|
| 1219 |
"tests/Service/OrganizationMembershipTest.php",
|
| 1220 |
+
"tests/Service/OrganizationsItContactsTest.php",
|
| 1221 |
"tests/Service/OrganizationsTest.php",
|
| 1222 |
"tests/Service/PipesProviderTest.php",
|
| 1223 |
"tests/Service/PipesTest.php",
|
|
|
|
| 1521 |
"sdkMethod": "authorizeDataIntegration",
|
| 1522 |
"service": "pipes"
|
| 1523 |
},
|
| 1524 |
+
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1525 |
+
"sdkMethod": "updateDataIntegrationClientCredentials",
|
| 1526 |
+
"service": "pipes"
|
| 1527 |
+
},
|
| 1528 |
"POST /data-integrations/{slug}/credentials": {
|
| 1529 |
"sdkMethod": "createDataIntegrationCredential",
|
| 1530 |
"service": "pipes"
|
|
|
|
| 1697 |
"sdkMethod": "listAuthorizedApplications",
|
| 1698 |
"service": "organizations"
|
| 1699 |
},
|
| 1700 |
+
"GET /organizations/{organization_id}/it_contacts": {
|
| 1701 |
+
"sdkMethod": "listOrganizationItContacts",
|
| 1702 |
+
"service": "organizationsItContacts"
|
| 1703 |
+
},
|
| 1704 |
+
"POST /organizations/{organization_id}/it_contacts": {
|
| 1705 |
+
"sdkMethod": "createOrganizationItContact",
|
| 1706 |
+
"service": "organizationsItContacts"
|
| 1707 |
+
},
|
| 1708 |
+
"DELETE /organizations/{organization_id}/it_contacts/{contact_id}": {
|
| 1709 |
+
"sdkMethod": "deleteOrganizationItContact",
|
| 1710 |
+
"service": "organizationsItContacts"
|
| 1711 |
+
},
|
| 1712 |
"POST /portal/generate_link": {
|
| 1713 |
"sdkMethod": "generateLink",
|
| 1714 |
"service": "adminPortal"
|
|
|
|
| 2088 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2089 |
"sdkMethod": "getExport",
|
| 2090 |
"service": "auditLogs"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2091 |
}
|
| 2092 |
}
|
| 2093 |
}
|
php/lib/Resource/CreateDataIntegrationAuthMethods.php|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
declare(strict_types=1);
|
| 4 |
-
|
| 5 |
-
// This file is auto-generated by oagen. Do not edit.
|
| 6 |
-
|
| 7 |
-
namespace WorkOS\Resource;
|
| 8 |
-
|
| 9 |
-
enum CreateDataIntegrationAuthMethods: string
|
| 10 |
-
{
|
| 11 |
-
case OAuth = 'oauth';
|
| 12 |
-
case ApiKey = 'api_key';
|
| 13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
php/lib/Resource/CreateItContact.php|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
declare(strict_types=1);
|
| 4 |
+
|
| 5 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 6 |
+
|
| 7 |
+
namespace WorkOS\Resource;
|
| 8 |
+
|
| 9 |
+
readonly class CreateItContact implements \JsonSerializable
|
| 10 |
+
{
|
| 11 |
+
use JsonSerializableTrait;
|
| 12 |
+
|
| 13 |
+
public function __construct(
|
| 14 |
+
/** The email address of the IT contact. */
|
| 15 |
+
public string $email,
|
| 16 |
+
) {
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
public static function fromArray(array $data): self
|
| 20 |
+
{
|
| 21 |
+
return new self(
|
| 22 |
+
email: $data['email'],
|
| 23 |
+
);
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
public function toArray(): array
|
| 27 |
+
{
|
| 28 |
+
return [
|
| 29 |
+
'email' => $this->email,
|
| 30 |
+
];
|
| 31 |
+
}
|
| 32 |
+
}
|
php/lib/Resource/ItContact.php|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
declare(strict_types=1);
|
| 4 |
+
|
| 5 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 6 |
+
|
| 7 |
+
namespace WorkOS\Resource;
|
| 8 |
+
|
| 9 |
+
readonly class ItContact implements \JsonSerializable
|
| 10 |
+
{
|
| 11 |
+
use JsonSerializableTrait;
|
| 12 |
+
|
| 13 |
+
public function __construct(
|
| 14 |
+
/** The IT Contact object. */
|
| 15 |
+
public string $object,
|
| 16 |
+
/** The unique ID of the IT Contact. */
|
| 17 |
+
public string $id,
|
| 18 |
+
/** The email address of the IT Contact. */
|
| 19 |
+
public string $email,
|
| 20 |
+
/** An ISO 8601 timestamp. */
|
| 21 |
+
public \DateTimeImmutable $createdAt,
|
| 22 |
+
/** An ISO 8601 timestamp. */
|
| 23 |
+
public \DateTimeImmutable $updatedAt,
|
| 24 |
+
) {
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
public static function fromArray(array $data): self
|
| 28 |
+
{
|
| 29 |
+
return new self(
|
| 30 |
+
object: $data['object'] ?? 'it_contact',
|
| 31 |
+
id: $data['id'],
|
| 32 |
+
email: $data['email'],
|
| 33 |
+
createdAt: new \DateTimeImmutable($data['created_at']),
|
| 34 |
+
updatedAt: new \DateTimeImmutable($data['updated_at']),
|
| 35 |
+
);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
public function toArray(): array
|
| 39 |
+
{
|
| 40 |
+
return [
|
| 41 |
+
'object' => $this->object,
|
| 42 |
+
'id' => $this->id,
|
| 43 |
+
'email' => $this->email,
|
| 44 |
+
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 45 |
+
'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 46 |
+
];
|
| 47 |
+
}
|
| 48 |
+
}
|
php/lib/Resource/ItContactList.php|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
declare(strict_types=1);
|
| 4 |
+
|
| 5 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 6 |
+
|
| 7 |
+
namespace WorkOS\Resource;
|
| 8 |
+
|
| 9 |
+
readonly class ItContactList implements \JsonSerializable
|
| 10 |
+
{
|
| 11 |
+
use JsonSerializableTrait;
|
| 12 |
+
|
| 13 |
+
public function __construct(
|
| 14 |
+
/** Indicates this is a list response. */
|
| 15 |
+
public string $object,
|
| 16 |
+
/**
|
| 17 |
+
* The list of records for the current page.
|
| 18 |
+
* @var array<\WorkOS\Resource\ItContact>
|
| 19 |
+
*/
|
| 20 |
+
public array $data,
|
| 21 |
+
/** Pagination cursors for navigating between pages of results. */
|
| 22 |
+
public ItContactListListMetadata $listMetadata,
|
| 23 |
+
) {
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
public static function fromArray(array $data): self
|
| 27 |
+
{
|
| 28 |
+
return new self(
|
| 29 |
+
object: $data['object'] ?? 'list',
|
| 30 |
+
data: array_map(fn ($item) => ItContact::fromArray($item), $data['data']),
|
| 31 |
+
listMetadata: ItContactListListMetadata::fromArray($data['list_metadata']),
|
| 32 |
+
);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
public function toArray(): array
|
| 36 |
+
{
|
| 37 |
+
return [
|
| 38 |
+
'object' => $this->object,
|
| 39 |
+
'data' => array_map(fn ($item) => $item->toArray(), $this->data),
|
| 40 |
+
'list_metadata' => $this->listMetadata->toArray(),
|
| 41 |
+
];
|
| 42 |
+
}
|
| 43 |
+
}
|
php/lib/Resource/ItContactListListMetadata.php|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
declare(strict_types=1);
|
| 4 |
+
|
| 5 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 6 |
+
|
| 7 |
+
namespace WorkOS\Resource;
|
| 8 |
+
|
| 9 |
+
/** Pagination cursors for navigating between pages of results. */
|
| 10 |
+
readonly class ItContactListListMetadata implements \JsonSerializable
|
| 11 |
+
{
|
| 12 |
+
use JsonSerializableTrait;
|
| 13 |
+
|
| 14 |
+
public function __construct(
|
| 15 |
+
/** An object ID that defines your place in the list. When the ID is not present, you are at the start of the list. */
|
| 16 |
+
public ?string $before,
|
| 17 |
+
/** An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. */
|
| 18 |
+
public ?string $after,
|
| 19 |
+
) {
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
public static function fromArray(array $data): self
|
| 23 |
+
{
|
| 24 |
+
return new self(
|
| 25 |
+
before: $data['before'] ?? null,
|
| 26 |
+
after: $data['after'] ?? null,
|
| 27 |
+
);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
public function toArray(): array
|
| 31 |
+
{
|
| 32 |
+
return [
|
| 33 |
+
'before' => $this->before,
|
| 34 |
+
'after' => $this->after,
|
| 35 |
+
];
|
| 36 |
+
}
|
| 37 |
+
}
|
php/lib/Resource/OrganizationInput.php|
@@ -18,6 +18,7 @@ readonly class OrganizationInput implements \JsonSerializable
|
|
| 18 |
/**
|
| 19 |
* The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 20 |
* @var array<string>|null
|
|
|
|
| 21 |
*/
|
| 22 |
public ?array $domains = null,
|
| 23 |
/**
|
|
|
|
| 18 |
/**
|
| 19 |
* The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 20 |
* @var array<string>|null
|
| 21 |
+
* @deprecated
|
| 22 |
*/
|
| 23 |
public ?array $domains = null,
|
| 24 |
/**
|
php/lib/Resource/WaitlistUser.php|
@@ -11,21 +11,26 @@ readonly class WaitlistUser implements \JsonSerializable
|
|
| 11 |
use JsonSerializableTrait;
|
| 12 |
|
| 13 |
public function __construct(
|
| 14 |
-
/** Distinguishes the Waitlist User object. */
|
| 15 |
-
public string $object,
|
| 16 |
-
/** The unique ID of the
|
| 17 |
public string $id,
|
| 18 |
-
/** The email address of the
|
| 19 |
public string $email,
|
| 20 |
-
/** The state of the
|
| 21 |
public WaitlistUserState $state,
|
| 22 |
-
/** The timestamp when the
|
| 23 |
public ?\DateTimeImmutable $approvedAt,
|
| 24 |
/** An ISO 8601 timestamp. */
|
| 25 |
public \DateTimeImmutable $createdAt,
|
| 26 |
/** An ISO 8601 timestamp. */
|
| 27 |
public \DateTimeImmutable $updatedAt,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
-
/** The unique ID of the
|
| 29 |
public ?string $waitlistId = null,
|
| 30 |
) {
|
| 31 |
}
|
|
@@ -33,13 +38,14 @@ readonly class WaitlistUser implements \JsonSerializable
|
|
| 33 |
public static function fromArray(array $data): self
|
| 34 |
{
|
| 35 |
return new self(
|
| 36 |
-
object: $data['object'] ?? 'waitlist_user',
|
| 37 |
id: $data['id'],
|
| 38 |
email: $data['email'],
|
| 39 |
state: WaitlistUserState::from($data['state']),
|
| 40 |
approvedAt: isset($data['approved_at']) ? new \DateTimeImmutable($data['approved_at']) : null,
|
| 41 |
createdAt: new \DateTimeImmutable($data['created_at']),
|
| 42 |
updatedAt: new \DateTimeImmutable($data['updated_at']),
|
|
|
|
|
|
|
| 43 |
waitlistId: $data['waitlist_id'] ?? null,
|
| 44 |
);
|
| 45 |
}
|
|
@@ -47,13 +53,14 @@ readonly class WaitlistUser implements \JsonSerializable
|
|
| 47 |
public function toArray(): array
|
| 48 |
{
|
| 49 |
return [
|
| 50 |
-
'object' => $this->object,
|
| 51 |
'id' => $this->id,
|
| 52 |
'email' => $this->email,
|
| 53 |
'state' => $this->state->value,
|
| 54 |
'approved_at' => $this->approvedAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 55 |
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 56 |
'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED),
|
|
|
|
|
|
|
| 57 |
'waitlist_id' => $this->waitlistId,
|
| 58 |
];
|
| 59 |
}
|
|
|
|
| 11 |
use JsonSerializableTrait;
|
| 12 |
|
| 13 |
public function __construct(
|
|
|
|
|
|
|
| 14 |
+
/** The unique ID of the waitlist entry. */
|
| 15 |
public string $id,
|
| 16 |
+
/** The email address of the user on the waitlist. */
|
| 17 |
public string $email,
|
| 18 |
+
/** The state of the waitlist entry. */
|
| 19 |
public WaitlistUserState $state,
|
| 20 |
+
/** The timestamp when the entry was approved, or null if not yet approved. */
|
| 21 |
public ?\DateTimeImmutable $approvedAt,
|
| 22 |
/** An ISO 8601 timestamp. */
|
| 23 |
public \DateTimeImmutable $createdAt,
|
| 24 |
/** An ISO 8601 timestamp. */
|
| 25 |
public \DateTimeImmutable $updatedAt,
|
| 26 |
+
/** Distinguishes the Waitlist User object. */
|
| 27 |
+
public string $object,
|
| 28 |
+
/**
|
| 29 |
+
* Additional fields submitted when the user joined the waitlist. Values are user-provided — treat them as untrusted input when rendering or exporting.
|
| 30 |
+
* @var array<string, string>|null
|
| 31 |
+
*/
|
| 32 |
+
public ?array $additionalFields = null,
|
| 33 |
+
/** The unique ID of the waitlist the entry belongs to. */
|
| 34 |
public ?string $waitlistId = null,
|
| 35 |
) {
|
| 36 |
}
|
|
|
|
| 38 |
public static function fromArray(array $data): self
|
| 39 |
{
|
| 40 |
return new self(
|
|
|
|
| 41 |
id: $data['id'],
|
| 42 |
email: $data['email'],
|
| 43 |
state: WaitlistUserState::from($data['state']),
|
| 44 |
approvedAt: isset($data['approved_at']) ? new \DateTimeImmutable($data['approved_at']) : null,
|
| 45 |
createdAt: new \DateTimeImmutable($data['created_at']),
|
| 46 |
updatedAt: new \DateTimeImmutable($data['updated_at']),
|
| 47 |
+
object: $data['object'] ?? 'waitlist_user',
|
| 48 |
+
additionalFields: $data['additional_fields'] ?? null,
|
| 49 |
waitlistId: $data['waitlist_id'] ?? null,
|
| 50 |
);
|
| 51 |
}
|
|
|
|
| 53 |
public function toArray(): array
|
| 54 |
{
|
| 55 |
return [
|
|
|
|
| 56 |
'id' => $this->id,
|
| 57 |
'email' => $this->email,
|
| 58 |
'state' => $this->state->value,
|
| 59 |
'approved_at' => $this->approvedAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 60 |
'created_at' => $this->createdAt->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 61 |
'updated_at' => $this->updatedAt->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 62 |
+
'object' => $this->object,
|
| 63 |
+
'additional_fields' => $this->additionalFields,
|
| 64 |
'waitlist_id' => $this->waitlistId,
|
| 65 |
];
|
| 66 |
}
|
php/lib/Service/Authorization.php|
@@ -282,7 +282,7 @@ class Authorization
|
|
| 282 |
/**
|
| 283 |
* List effective permissions for an organization membership on a resource
|
| 284 |
*
|
| 285 |
-
* Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources.
|
| 286 |
* @param string $organizationMembershipId The ID of the organization membership.
|
| 287 |
* @param string $resourceId The ID of the authorization resource.
|
| 288 |
* @param string|null $before An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
@@ -319,7 +319,7 @@ class Authorization
|
|
| 319 |
/**
|
| 320 |
* List effective permissions for an organization membership on a resource by external ID
|
| 321 |
*
|
| 322 |
-
* Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources.
|
| 323 |
* @param string $organizationMembershipId The ID of the organization membership.
|
| 324 |
* @param string $resourceTypeSlug The slug of the resource type.
|
| 325 |
* @param string $externalId An identifier you provide to reference the resource in your system.
|
|
|
|
| 282 |
/**
|
| 283 |
* List effective permissions for an organization membership on a resource
|
| 284 |
*
|
| 285 |
+
* Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 286 |
* @param string $organizationMembershipId The ID of the organization membership.
|
| 287 |
* @param string $resourceId The ID of the authorization resource.
|
| 288 |
* @param string|null $before An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
|
|
| 319 |
/**
|
| 320 |
* List effective permissions for an organization membership on a resource by external ID
|
| 321 |
*
|
| 322 |
+
* Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 323 |
* @param string $organizationMembershipId The ID of the organization membership.
|
| 324 |
* @param string $resourceTypeSlug The slug of the resource type.
|
| 325 |
* @param string $externalId An identifier you provide to reference the resource in your system.
|
php/lib/Service/Organizations.php|
@@ -62,7 +62,7 @@ class Organizations
|
|
| 62 |
* Creates a new organization in the current environment.
|
| 63 |
* @param string $name The name of the organization.
|
| 64 |
* @param bool|null $allowProfilesOutsideOrganization Whether the organization allows profiles from outside the organization to sign in.
|
| 65 |
-
* @param array<string>|null $domains The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 66 |
* @param array<\WorkOS\Resource\OrganizationDomainData>|null $domainData The domains associated with the organization, including verification state.
|
| 67 |
* @param array<string, string>|null $metadata Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 68 |
* @param string|null $externalId An external identifier for the Organization.
|
|
|
|
| 62 |
* Creates a new organization in the current environment.
|
| 63 |
* @param string $name The name of the organization.
|
| 64 |
* @param bool|null $allowProfilesOutsideOrganization Whether the organization allows profiles from outside the organization to sign in.
|
| 65 |
+
* @param array<string>|null $domains (deprecated) The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 66 |
* @param array<\WorkOS\Resource\OrganizationDomainData>|null $domainData The domains associated with the organization, including verification state.
|
| 67 |
* @param array<string, string>|null $metadata Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 68 |
* @param string|null $externalId An external identifier for the Organization.
|
php/lib/Service/OrganizationsItContacts.php|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
declare(strict_types=1);
|
| 4 |
+
|
| 5 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 6 |
+
|
| 7 |
+
namespace WorkOS\Service;
|
| 8 |
+
|
| 9 |
+
use WorkOS\Resource\ItContact;
|
| 10 |
+
use WorkOS\Resource\ItContactList;
|
| 11 |
+
|
| 12 |
+
class OrganizationsItContacts
|
| 13 |
+
{
|
| 14 |
+
public function __construct(
|
| 15 |
+
private readonly \WorkOS\HttpClient $client,
|
| 16 |
+
) {
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* List IT contacts
|
| 21 |
+
*
|
| 22 |
+
* Get the IT contacts for an organization.
|
| 23 |
+
* @param string $organizationId The ID of the organization.
|
| 24 |
+
* @return \WorkOS\Resource\ItContactList
|
| 25 |
+
* @throws \WorkOS\Exception\WorkOSException
|
| 26 |
+
*/
|
| 27 |
+
public function listOrganizationItContacts(
|
| 28 |
+
string $organizationId,
|
| 29 |
+
?\WorkOS\RequestOptions $options = null,
|
| 30 |
+
): \WorkOS\Resource\ItContactList {
|
| 31 |
+
$response = $this->client->request(
|
| 32 |
+
method: 'GET',
|
| 33 |
+
path: 'organizations/' . rawurlencode($organizationId) . '/it_contacts',
|
| 34 |
+
options: $options,
|
| 35 |
+
);
|
| 36 |
+
return ItContactList::fromArray($response);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* Create an IT contact
|
| 41 |
+
*
|
| 42 |
+
* Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.
|
| 43 |
+
* @param string $organizationId The ID of the organization.
|
| 44 |
+
* @param string $email The email address of the IT contact.
|
| 45 |
+
* @return \WorkOS\Resource\ItContact
|
| 46 |
+
* @throws \WorkOS\Exception\WorkOSException
|
| 47 |
+
*/
|
| 48 |
+
public function createOrganizationItContact(
|
| 49 |
+
string $organizationId,
|
| 50 |
+
string $email,
|
| 51 |
+
?\WorkOS\RequestOptions $options = null,
|
| 52 |
+
): \WorkOS\Resource\ItContact {
|
| 53 |
+
$body = [
|
| 54 |
+
'email' => $email,
|
| 55 |
+
];
|
| 56 |
+
$response = $this->client->request(
|
| 57 |
+
method: 'POST',
|
| 58 |
+
path: 'organizations/' . rawurlencode($organizationId) . '/it_contacts',
|
| 59 |
+
body: $body,
|
| 60 |
+
options: $options,
|
| 61 |
+
);
|
| 62 |
+
return ItContact::fromArray($response);
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/**
|
| 66 |
+
* Delete an IT contact
|
| 67 |
+
*
|
| 68 |
+
* Remove an IT contact from an organization.
|
| 69 |
+
* @param string $organizationId The ID of the organization.
|
| 70 |
+
* @param string $contactId The ID of the IT contact.
|
| 71 |
+
* @return void
|
| 72 |
+
* @throws \WorkOS\Exception\WorkOSException
|
| 73 |
+
*/
|
| 74 |
+
public function deleteOrganizationItContact(
|
| 75 |
+
string $organizationId,
|
| 76 |
+
string $contactId,
|
| 77 |
+
?\WorkOS\RequestOptions $options = null,
|
| 78 |
+
): void {
|
| 79 |
+
$this->client->request(
|
| 80 |
+
method: 'DELETE',
|
| 81 |
+
path: 'organizations/' . rawurlencode($organizationId) . '/it_contacts/' . rawurlencode($contactId),
|
| 82 |
+
options: $options,
|
| 83 |
+
);
|
| 84 |
+
}
|
| 85 |
+
}
|
php/lib/WorkOS.php|
@@ -21,6 +21,7 @@ use WorkOS\Service\MultiFactorAuth;
|
|
| 21 |
use WorkOS\Service\OrganizationDomains;
|
| 22 |
use WorkOS\Service\OrganizationMembershipService;
|
| 23 |
use WorkOS\Service\Organizations;
|
|
|
|
| 24 |
use WorkOS\Service\Pipes;
|
| 25 |
use WorkOS\Service\PipesProvider;
|
| 26 |
use WorkOS\Service\Radar;
|
|
@@ -70,6 +71,7 @@ class WorkOS
|
|
| 70 |
private ?Service\ApiKeys $apiKeys = null;
|
| 71 |
private ?Service\PipesProvider $pipesProvider = null;
|
| 72 |
private ?Service\Groups $groups = null;
|
|
|
|
| 73 |
private ?Service\AdminPortal $adminPortal = null;
|
| 74 |
private ?Service\Radar $radar = null;
|
| 75 |
private ?Service\UserManagement $userManagement = null;
|
|
@@ -168,6 +170,11 @@ class WorkOS
|
|
| 168 |
return $this->groups ??= new Service\Groups($this->httpClient);
|
| 169 |
}
|
| 170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
public function adminPortal(): AdminPortal
|
| 172 |
{
|
| 173 |
return $this->adminPortal ??= new Service\AdminPortal($this->httpClient);
|
|
|
|
| 21 |
use WorkOS\Service\OrganizationDomains;
|
| 22 |
use WorkOS\Service\OrganizationMembershipService;
|
| 23 |
use WorkOS\Service\Organizations;
|
| 24 |
+
use WorkOS\Service\OrganizationsItContacts;
|
| 25 |
use WorkOS\Service\Pipes;
|
| 26 |
use WorkOS\Service\PipesProvider;
|
| 27 |
use WorkOS\Service\Radar;
|
|
|
|
| 71 |
private ?Service\ApiKeys $apiKeys = null;
|
| 72 |
private ?Service\PipesProvider $pipesProvider = null;
|
| 73 |
private ?Service\Groups $groups = null;
|
| 74 |
+
private ?Service\OrganizationsItContacts $organizationsItContacts = null;
|
| 75 |
private ?Service\AdminPortal $adminPortal = null;
|
| 76 |
private ?Service\Radar $radar = null;
|
| 77 |
private ?Service\UserManagement $userManagement = null;
|
|
|
|
| 170 |
return $this->groups ??= new Service\Groups($this->httpClient);
|
| 171 |
}
|
| 172 |
|
| 173 |
+
public function organizationsItContacts(): OrganizationsItContacts
|
| 174 |
+
{
|
| 175 |
+
return $this->organizationsItContacts ??= new Service\OrganizationsItContacts($this->httpClient);
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
public function adminPortal(): AdminPortal
|
| 179 |
{
|
| 180 |
return $this->adminPortal ??= new Service\AdminPortal($this->httpClient);
|
php/tests/Fixtures/create_it_contact.json|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"email": "it-contact@example.com"
|
| 3 |
+
}
|
php/tests/Fixtures/it_contact.json|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "it_contact",
|
| 3 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 4 |
+
"email": "it-contact@example.com",
|
| 5 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 6 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 7 |
+
}
|
php/tests/Fixtures/it_contact_list_list_metadata.json|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 3 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 4 |
+
}
|
php/tests/Fixtures/waitlist_user.json|
@@ -1,10 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
"object": "waitlist_user",
|
| 3 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 4 |
"email": "marcelina.davis@example.com",
|
| 5 |
"state": "pending",
|
| 6 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 7 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 10 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 3 |
"email": "marcelina.davis@example.com",
|
| 4 |
"state": "pending",
|
| 5 |
"approved_at": null,
|
| 6 |
+
"additional_fields": {
|
| 7 |
+
"company": "Example Corp"
|
| 8 |
+
},
|
| 9 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 10 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 11 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
+
"object": "waitlist_user"
|
| 13 |
}
|
php/tests/Fixtures/waitlist_user_approved.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
php/tests/Fixtures/waitlist_user_created.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
php/tests/Fixtures/waitlist_user_denied.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
php/tests/Service/OrganizationsItContactsTest.php|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
declare(strict_types=1);
|
| 4 |
+
|
| 5 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 6 |
+
|
| 7 |
+
namespace Tests\Service;
|
| 8 |
+
|
| 9 |
+
use PHPUnit\Framework\TestCase;
|
| 10 |
+
use WorkOS\TestHelper;
|
| 11 |
+
|
| 12 |
+
class OrganizationsItContactsTest extends TestCase
|
| 13 |
+
{
|
| 14 |
+
use TestHelper;
|
| 15 |
+
|
| 16 |
+
public function testListOrganizationItContacts(): void
|
| 17 |
+
{
|
| 18 |
+
$fixture = $this->loadFixture('it_contact_list');
|
| 19 |
+
$client = $this->createMockClient([['status' => 200, 'body' => $fixture]]);
|
| 20 |
+
$result = $client->organizationsItContacts()->listOrganizationItContacts('test_organization_id');
|
| 21 |
+
$this->assertInstanceOf(\WorkOS\Resource\ItContactList::class, $result);
|
| 22 |
+
$this->assertIsArray($result->toArray());
|
| 23 |
+
$request = $this->getLastRequest();
|
| 24 |
+
$this->assertSame('GET', $request->getMethod());
|
| 25 |
+
$this->assertStringEndsWith('organizations/test_organization_id/it_contacts', $request->getUri()->getPath());
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
public function testCreateOrganizationItContact(): void
|
| 29 |
+
{
|
| 30 |
+
$fixture = $this->loadFixture('it_contact');
|
| 31 |
+
$client = $this->createMockClient([['status' => 200, 'body' => $fixture]]);
|
| 32 |
+
$result = $client->organizationsItContacts()->createOrganizationItContact('test_organization_id', email: 'test_value');
|
| 33 |
+
$this->assertInstanceOf(\WorkOS\Resource\ItContact::class, $result);
|
| 34 |
+
$this->assertSame($fixture['id'], $result->id);
|
| 35 |
+
$this->assertIsArray($result->toArray());
|
| 36 |
+
$request = $this->getLastRequest();
|
| 37 |
+
$this->assertSame('POST', $request->getMethod());
|
| 38 |
+
$this->assertStringEndsWith('organizations/test_organization_id/it_contacts', $request->getUri()->getPath());
|
| 39 |
+
$body = json_decode((string) $request->getBody(), true);
|
| 40 |
+
$this->assertSame('test_value', $body['email']);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
public function testDeleteOrganizationItContact(): void
|
| 44 |
+
{
|
| 45 |
+
$client = $this->createMockClient([['status' => 204]]);
|
| 46 |
+
$client->organizationsItContacts()->deleteOrganizationItContact('test_organization_id', 'test_contact_id');
|
| 47 |
+
$request = $this->getLastRequest();
|
| 48 |
+
$this->assertSame('DELETE', $request->getMethod());
|
| 49 |
+
$this->assertStringEndsWith('organizations/test_organization_id/it_contacts/test_contact_id', $request->getUri()->getPath());
|
| 50 |
+
}
|
| 51 |
+
}
|
All files in this language are hidden by the current filters.
code: 17 · tests: 11 · manifest: 1
python/.oagen-manifest.json|
@@ -601,6 +601,13 @@
|
|
| 601 |
"src/workos/organizations/models/organization_input.py",
|
| 602 |
"src/workos/organizations/models/update_audit_logs_retention.py",
|
| 603 |
"src/workos/organizations/models/update_organization.py",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
"src/workos/pipes/__init__.py",
|
| 605 |
"src/workos/pipes/_resource.py",
|
| 606 |
"src/workos/pipes/models/__init__.py",
|
|
@@ -676,6 +683,7 @@
|
|
| 676 |
"src/workos/types/organization_domains/__init__.py",
|
| 677 |
"src/workos/types/organization_membership/__init__.py",
|
| 678 |
"src/workos/types/organizations/__init__.py",
|
|
|
|
| 679 |
"src/workos/types/pipes/__init__.py",
|
| 680 |
"src/workos/types/pipes_provider/__init__.py",
|
| 681 |
"src/workos/types/radar/__init__.py",
|
|
@@ -953,6 +961,7 @@
|
|
| 953 |
"tests/fixtures/create_group.json",
|
| 954 |
"tests/fixtures/create_group_membership.json",
|
| 955 |
"tests/fixtures/create_group_role_assignment.json",
|
|
|
|
| 956 |
"tests/fixtures/create_m2m_application.json",
|
| 957 |
"tests/fixtures/create_magic_code_and_return.json",
|
| 958 |
"tests/fixtures/create_oauth_application.json",
|
|
@@ -1099,6 +1108,9 @@
|
|
| 1099 |
"tests/fixtures/invitation_resent_data.json",
|
| 1100 |
"tests/fixtures/invitation_revoked.json",
|
| 1101 |
"tests/fixtures/invitation_revoked_data.json",
|
|
|
|
|
|
|
|
|
|
| 1102 |
"tests/fixtures/jwks_response.json",
|
| 1103 |
"tests/fixtures/jwks_response_keys.json",
|
| 1104 |
"tests/fixtures/jwt_template_response.json",
|
|
@@ -1363,6 +1375,8 @@
|
|
| 1363 |
"tests/test_organization_membership.py",
|
| 1364 |
"tests/test_organization_membership_models_round_trip.py",
|
| 1365 |
"tests/test_organizations.py",
|
|
|
|
|
|
|
| 1366 |
"tests/test_organizations_models_round_trip.py",
|
| 1367 |
"tests/test_pipes.py",
|
| 1368 |
"tests/test_pipes_models_round_trip.py",
|
|
@@ -1674,6 +1688,10 @@
|
|
| 1674 |
"sdkMethod": "authorize_data_integration",
|
| 1675 |
"service": "pipes"
|
| 1676 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1677 |
"POST /data-integrations/{slug}/credentials": {
|
| 1678 |
"sdkMethod": "create_data_integration_credential",
|
| 1679 |
"service": "pipes"
|
|
@@ -1846,6 +1864,18 @@
|
|
| 1846 |
"sdkMethod": "list_authorized_applications",
|
| 1847 |
"service": "organizations"
|
| 1848 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1849 |
"POST /portal/generate_link": {
|
| 1850 |
"sdkMethod": "generate_link",
|
| 1851 |
"service": "admin_portal"
|
|
@@ -2225,10 +2255,6 @@
|
|
| 2225 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2226 |
"sdkMethod": "get_export",
|
| 2227 |
"service": "audit_logs"
|
| 2228 |
-
},
|
| 2229 |
-
"PUT /data-integrations/{slug}/client-credentials": {
|
| 2230 |
-
"sdkMethod": "update_data_integration_client_credentials",
|
| 2231 |
-
"service": "pipes"
|
| 2232 |
}
|
| 2233 |
}
|
| 2234 |
}
|
|
|
|
| 601 |
"src/workos/organizations/models/organization_input.py",
|
| 602 |
"src/workos/organizations/models/update_audit_logs_retention.py",
|
| 603 |
"src/workos/organizations/models/update_organization.py",
|
| 604 |
+
"src/workos/organizations_it_contacts/__init__.py",
|
| 605 |
+
"src/workos/organizations_it_contacts/_resource.py",
|
| 606 |
+
"src/workos/organizations_it_contacts/models/__init__.py",
|
| 607 |
+
"src/workos/organizations_it_contacts/models/create_it_contact.py",
|
| 608 |
+
"src/workos/organizations_it_contacts/models/it_contact.py",
|
| 609 |
+
"src/workos/organizations_it_contacts/models/it_contact_list.py",
|
| 610 |
+
"src/workos/organizations_it_contacts/models/it_contact_list_list_metadata.py",
|
| 611 |
"src/workos/pipes/__init__.py",
|
| 612 |
"src/workos/pipes/_resource.py",
|
| 613 |
"src/workos/pipes/models/__init__.py",
|
|
|
|
| 683 |
"src/workos/types/organization_domains/__init__.py",
|
| 684 |
"src/workos/types/organization_membership/__init__.py",
|
| 685 |
"src/workos/types/organizations/__init__.py",
|
| 686 |
+
"src/workos/types/organizations_it_contacts/__init__.py",
|
| 687 |
"src/workos/types/pipes/__init__.py",
|
| 688 |
"src/workos/types/pipes_provider/__init__.py",
|
| 689 |
"src/workos/types/radar/__init__.py",
|
|
|
|
| 961 |
"tests/fixtures/create_group.json",
|
| 962 |
"tests/fixtures/create_group_membership.json",
|
| 963 |
"tests/fixtures/create_group_role_assignment.json",
|
| 964 |
+
"tests/fixtures/create_it_contact.json",
|
| 965 |
"tests/fixtures/create_m2m_application.json",
|
| 966 |
"tests/fixtures/create_magic_code_and_return.json",
|
| 967 |
"tests/fixtures/create_oauth_application.json",
|
|
|
|
| 1108 |
"tests/fixtures/invitation_resent_data.json",
|
| 1109 |
"tests/fixtures/invitation_revoked.json",
|
| 1110 |
"tests/fixtures/invitation_revoked_data.json",
|
| 1111 |
+
"tests/fixtures/it_contact.json",
|
| 1112 |
+
"tests/fixtures/it_contact_list.json",
|
| 1113 |
+
"tests/fixtures/it_contact_list_list_metadata.json",
|
| 1114 |
"tests/fixtures/jwks_response.json",
|
| 1115 |
"tests/fixtures/jwks_response_keys.json",
|
| 1116 |
"tests/fixtures/jwt_template_response.json",
|
|
|
|
| 1375 |
"tests/test_organization_membership.py",
|
| 1376 |
"tests/test_organization_membership_models_round_trip.py",
|
| 1377 |
"tests/test_organizations.py",
|
| 1378 |
+
"tests/test_organizations_it_contacts.py",
|
| 1379 |
+
"tests/test_organizations_it_contacts_models_round_trip.py",
|
| 1380 |
"tests/test_organizations_models_round_trip.py",
|
| 1381 |
"tests/test_pipes.py",
|
| 1382 |
"tests/test_pipes_models_round_trip.py",
|
|
|
|
| 1688 |
"sdkMethod": "authorize_data_integration",
|
| 1689 |
"service": "pipes"
|
| 1690 |
},
|
| 1691 |
+
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1692 |
+
"sdkMethod": "update_data_integration_client_credentials",
|
| 1693 |
+
"service": "pipes"
|
| 1694 |
+
},
|
| 1695 |
"POST /data-integrations/{slug}/credentials": {
|
| 1696 |
"sdkMethod": "create_data_integration_credential",
|
| 1697 |
"service": "pipes"
|
|
|
|
| 1864 |
"sdkMethod": "list_authorized_applications",
|
| 1865 |
"service": "organizations"
|
| 1866 |
},
|
| 1867 |
+
"GET /organizations/{organization_id}/it_contacts": {
|
| 1868 |
+
"sdkMethod": "list_organization_it_contacts",
|
| 1869 |
+
"service": "organizations_it_contacts"
|
| 1870 |
+
},
|
| 1871 |
+
"POST /organizations/{organization_id}/it_contacts": {
|
| 1872 |
+
"sdkMethod": "create_organization_it_contact",
|
| 1873 |
+
"service": "organizations_it_contacts"
|
| 1874 |
+
},
|
| 1875 |
+
"DELETE /organizations/{organization_id}/it_contacts/{contact_id}": {
|
| 1876 |
+
"sdkMethod": "delete_organization_it_contact",
|
| 1877 |
+
"service": "organizations_it_contacts"
|
| 1878 |
+
},
|
| 1879 |
"POST /portal/generate_link": {
|
| 1880 |
"sdkMethod": "generate_link",
|
| 1881 |
"service": "admin_portal"
|
|
|
|
| 2255 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2256 |
"sdkMethod": "get_export",
|
| 2257 |
"service": "audit_logs"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2258 |
}
|
| 2259 |
}
|
| 2260 |
}
|
python/src/workos/_client.py|
@@ -5,41 +5,47 @@ from __future__ import annotations
|
|
| 5 |
import functools
|
| 6 |
|
| 7 |
from ._base_client import (
|
| 8 |
-
WorkOSClient as _SyncBase,
|
| 9 |
AsyncWorkOSClient as _AsyncBase,
|
| 10 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
from .agents._resource import Agents, AsyncAgents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
-
from .multi_factor_auth._resource import
|
| 13 |
-
from .connect._resource import Connect, AsyncConnect
|
| 14 |
-
from .authorization._resource import Authorization, AsyncAuthorization
|
| 15 |
-
from .client_api._resource import ClientApi, AsyncClientApi
|
| 16 |
-
from .sso._resource import SSO, AsyncSSO
|
| 17 |
-
from .pipes._resource import Pipes, AsyncPipes
|
| 18 |
-
from .directory_sync._resource import DirectorySync, AsyncDirectorySync
|
| 19 |
-
from .events._resource import Events, AsyncEvents
|
| 20 |
-
from .feature_flags._resource import FeatureFlags, AsyncFeatureFlags
|
| 21 |
from .organization_domains._resource import (
|
| 22 |
-
OrganizationDomains,
|
| 23 |
AsyncOrganizationDomains,
|
|
|
|
| 24 |
)
|
| 25 |
-
from .organizations._resource import Organizations, AsyncOrganizations
|
| 26 |
-
from .api_keys._resource import ApiKeys, AsyncApiKeys
|
| 27 |
-
from .pipes_provider._resource import PipesProvider, AsyncPipesProvider
|
| 28 |
-
from .groups._resource import Groups, AsyncGroups
|
| 29 |
-
from .admin_portal._resource import AdminPortal, AsyncAdminPortal
|
| 30 |
-
from .radar._resource import Radar, AsyncRadar
|
| 31 |
-
from .user_management._resource import UserManagement, AsyncUserManagement
|
| 32 |
from .organization_membership._resource import (
|
| 33 |
-
OrganizationMembershipService,
|
| 34 |
AsyncOrganizationMembershipService,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
)
|
| 36 |
-
from .vault._resource import Vault, AsyncVault
|
| 37 |
-
from .webhooks._resource import Webhooks, AsyncWebhooks
|
| 38 |
-
from .widgets._resource import Widgets, AsyncWidgets
|
| 39 |
-
from .audit_logs._resource import AuditLogs, AsyncAuditLogs
|
| 40 |
from .passwordless import AsyncPasswordless, Passwordless
|
| 41 |
-
from .
|
|
|
|
| 42 |
from .pkce import PKCE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
class WorkOSClient(_SyncBase):
|
|
@@ -120,6 +126,11 @@ class WorkOSClient(_SyncBase):
|
|
| 120 |
"""Groups API resources."""
|
| 121 |
return Groups(self)
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
@functools.cached_property
|
| 124 |
def admin_portal(self) -> AdminPortal:
|
| 125 |
"""Admin Portal API resources."""
|
|
@@ -263,6 +274,11 @@ class AsyncWorkOSClient(_AsyncBase):
|
|
| 263 |
"""Groups API resources."""
|
| 264 |
return AsyncGroups(self)
|
| 265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
@functools.cached_property
|
| 267 |
def admin_portal(self) -> AsyncAdminPortal:
|
| 268 |
"""Admin Portal API resources."""
|
|
|
|
| 5 |
import functools
|
| 6 |
|
| 7 |
from ._base_client import (
|
|
|
|
| 8 |
AsyncWorkOSClient as _AsyncBase,
|
| 9 |
)
|
| 10 |
+
from ._base_client import (
|
| 11 |
+
WorkOSClient as _SyncBase,
|
| 12 |
+
)
|
| 13 |
+
from .actions import Actions, AsyncActions
|
| 14 |
+
from .admin_portal._resource import AdminPortal, AsyncAdminPortal
|
| 15 |
from .agents._resource import Agents, AsyncAgents
|
| 16 |
+
from .api_keys._resource import ApiKeys, AsyncApiKeys
|
| 17 |
+
from .audit_logs._resource import AsyncAuditLogs, AuditLogs
|
| 18 |
+
from .authorization._resource import AsyncAuthorization, Authorization
|
| 19 |
+
from .client_api._resource import AsyncClientApi, ClientApi
|
| 20 |
+
from .connect._resource import AsyncConnect, Connect
|
| 21 |
+
from .directory_sync._resource import AsyncDirectorySync, DirectorySync
|
| 22 |
+
from .events._resource import AsyncEvents, Events
|
| 23 |
+
from .feature_flags._resource import AsyncFeatureFlags, FeatureFlags
|
| 24 |
+
from .groups._resource import AsyncGroups, Groups
|
| 25 |
+
from .multi_factor_auth._resource import AsyncMultiFactorAuth, MultiFactorAuth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
from .organization_domains._resource import (
|
|
|
|
| 27 |
AsyncOrganizationDomains,
|
| 28 |
+
OrganizationDomains,
|
| 29 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
from .organization_membership._resource import (
|
|
|
|
| 31 |
AsyncOrganizationMembershipService,
|
| 32 |
+
OrganizationMembershipService,
|
| 33 |
+
)
|
| 34 |
+
from .organizations._resource import AsyncOrganizations, Organizations
|
| 35 |
+
from .organizations_it_contacts._resource import (
|
| 36 |
+
AsyncOrganizationsItContacts,
|
| 37 |
+
OrganizationsItContacts,
|
| 38 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
from .passwordless import AsyncPasswordless, Passwordless
|
| 40 |
+
from .pipes._resource import AsyncPipes, Pipes
|
| 41 |
+
from .pipes_provider._resource import AsyncPipesProvider, PipesProvider
|
| 42 |
from .pkce import PKCE
|
| 43 |
+
from .radar._resource import AsyncRadar, Radar
|
| 44 |
+
from .sso._resource import SSO, AsyncSSO
|
| 45 |
+
from .user_management._resource import AsyncUserManagement, UserManagement
|
| 46 |
+
from .vault._resource import AsyncVault, Vault
|
| 47 |
+
from .webhooks._resource import AsyncWebhooks, Webhooks
|
| 48 |
+
from .widgets._resource import AsyncWidgets, Widgets
|
| 49 |
|
| 50 |
|
| 51 |
class WorkOSClient(_SyncBase):
|
|
|
|
| 126 |
"""Groups API resources."""
|
| 127 |
return Groups(self)
|
| 128 |
|
| 129 |
+
@functools.cached_property
|
| 130 |
+
def organizations_it_contacts(self) -> OrganizationsItContacts:
|
| 131 |
+
"""Organizations It Contacts API resources."""
|
| 132 |
+
return OrganizationsItContacts(self)
|
| 133 |
+
|
| 134 |
@functools.cached_property
|
| 135 |
def admin_portal(self) -> AdminPortal:
|
| 136 |
"""Admin Portal API resources."""
|
|
|
|
| 274 |
"""Groups API resources."""
|
| 275 |
return AsyncGroups(self)
|
| 276 |
|
| 277 |
+
@functools.cached_property
|
| 278 |
+
def organizations_it_contacts(self) -> AsyncOrganizationsItContacts:
|
| 279 |
+
"""Organizations It Contacts API resources."""
|
| 280 |
+
return AsyncOrganizationsItContacts(self)
|
| 281 |
+
|
| 282 |
@functools.cached_property
|
| 283 |
def admin_portal(self) -> AsyncAdminPortal:
|
| 284 |
"""Admin Portal API resources."""
|
python/src/workos/authorization/_resource.py|
@@ -479,7 +479,7 @@ class Authorization:
|
|
| 479 |
) -> SyncPage[AuthorizationPermission]:
|
| 480 |
"""List effective permissions for an organization membership on a resource
|
| 481 |
|
| 482 |
-
Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources.
|
| 483 |
|
| 484 |
Args:
|
| 485 |
organization_membership_id: The ID of the organization membership.
|
|
@@ -540,7 +540,7 @@ class Authorization:
|
|
| 540 |
) -> SyncPage[AuthorizationPermission]:
|
| 541 |
"""List effective permissions for an organization membership on a resource by external ID
|
| 542 |
|
| 543 |
-
Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources.
|
| 544 |
|
| 545 |
Args:
|
| 546 |
organization_membership_id: The ID of the organization membership.
|
|
@@ -2650,7 +2650,7 @@ class AsyncAuthorization:
|
|
| 2650 |
) -> AsyncPage[AuthorizationPermission]:
|
| 2651 |
"""List effective permissions for an organization membership on a resource
|
| 2652 |
|
| 2653 |
-
Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources.
|
| 2654 |
|
| 2655 |
Args:
|
| 2656 |
organization_membership_id: The ID of the organization membership.
|
|
@@ -2711,7 +2711,7 @@ class AsyncAuthorization:
|
|
| 2711 |
) -> AsyncPage[AuthorizationPermission]:
|
| 2712 |
"""List effective permissions for an organization membership on a resource by external ID
|
| 2713 |
|
| 2714 |
-
Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources.
|
| 2715 |
|
| 2716 |
Args:
|
| 2717 |
organization_membership_id: The ID of the organization membership.
|
|
|
|
| 479 |
) -> SyncPage[AuthorizationPermission]:
|
| 480 |
"""List effective permissions for an organization membership on a resource
|
| 481 |
|
| 482 |
+
Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 483 |
|
| 484 |
Args:
|
| 485 |
organization_membership_id: The ID of the organization membership.
|
|
|
|
| 540 |
) -> SyncPage[AuthorizationPermission]:
|
| 541 |
"""List effective permissions for an organization membership on a resource by external ID
|
| 542 |
|
| 543 |
+
Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 544 |
|
| 545 |
Args:
|
| 546 |
organization_membership_id: The ID of the organization membership.
|
|
|
|
| 2650 |
) -> AsyncPage[AuthorizationPermission]:
|
| 2651 |
"""List effective permissions for an organization membership on a resource
|
| 2652 |
|
| 2653 |
+
Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 2654 |
|
| 2655 |
Args:
|
| 2656 |
organization_membership_id: The ID of the organization membership.
|
|
|
|
| 2711 |
) -> AsyncPage[AuthorizationPermission]:
|
| 2712 |
"""List effective permissions for an organization membership on a resource by external ID
|
| 2713 |
|
| 2714 |
+
Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 2715 |
|
| 2716 |
Args:
|
| 2717 |
organization_membership_id: The ID of the organization membership.
|
python/src/workos/common/__init__.py|
@@ -1,6 +1,5 @@
|
|
| 1 |
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
|
| 3 |
-
from .models import *
|
| 4 |
from .models import (
|
| 5 |
AccessTokenAgentRegistrationCredentialIssuedDataDetail as AccessTokenAgentRegistrationCredentialIssuedDataDetail,
|
| 6 |
)
|
|
|
|
| 1 |
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
|
|
|
|
| 3 |
from .models import (
|
| 4 |
AccessTokenAgentRegistrationCredentialIssuedDataDetail as AccessTokenAgentRegistrationCredentialIssuedDataDetail,
|
| 5 |
)
|
python/src/workos/common/models/__init__.py|
@@ -44,9 +44,6 @@ from .agent_registration_created_data import (
|
|
| 44 |
from .agent_registration_created_data_agent_identity import (
|
| 45 |
AgentRegistrationCreatedDataAgentIdentity as AgentRegistrationCreatedDataAgentIdentity,
|
| 46 |
)
|
| 47 |
-
from .agent_registration_created_data_kind import *
|
| 48 |
-
from .agent_registration_created_data_method import *
|
| 49 |
-
from .agent_registration_created_data_status import *
|
| 50 |
from .agent_registration_credential_issued import (
|
| 51 |
AgentRegistrationCredentialIssued as AgentRegistrationCredentialIssued,
|
| 52 |
)
|
|
@@ -243,7 +240,6 @@ from .authentication_radar_risk_detected import (
|
|
| 243 |
from .authentication_radar_risk_detected_data import (
|
| 244 |
AuthenticationRadarRiskDetectedData as AuthenticationRadarRiskDetectedData,
|
| 245 |
)
|
| 246 |
-
from .authentication_radar_risk_detected_data_action import *
|
| 247 |
from .authentication_reauthentication_succeeded import (
|
| 248 |
AuthenticationReauthenticationSucceeded as AuthenticationReauthenticationSucceeded,
|
| 249 |
)
|
|
@@ -318,26 +314,18 @@ from .connection_activated import ConnectionActivated as ConnectionActivated
|
|
| 318 |
from .connection_activated_data import (
|
| 319 |
ConnectionActivatedData as ConnectionActivatedData,
|
| 320 |
)
|
| 321 |
-
from .connection_activated_data_connection_type import *
|
| 322 |
from .connection_activated_data_domain import (
|
| 323 |
ConnectionActivatedDataDomain as ConnectionActivatedDataDomain,
|
| 324 |
)
|
| 325 |
-
from .connection_activated_data_state import *
|
| 326 |
-
from .connection_activated_data_status import *
|
| 327 |
from .connection_deactivated import ConnectionDeactivated as ConnectionDeactivated
|
| 328 |
from .connection_deactivated_data import (
|
| 329 |
ConnectionDeactivatedData as ConnectionDeactivatedData,
|
| 330 |
)
|
| 331 |
-
from .connection_deactivated_data_connection_type import *
|
| 332 |
from .connection_deactivated_data_domain import (
|
| 333 |
ConnectionDeactivatedDataDomain as ConnectionDeactivatedDataDomain,
|
| 334 |
)
|
| 335 |
-
from .connection_deactivated_data_state import *
|
| 336 |
-
from .connection_deactivated_data_status import *
|
| 337 |
from .connection_deleted import ConnectionDeleted as ConnectionDeleted
|
| 338 |
from .connection_deleted_data import ConnectionDeletedData as ConnectionDeletedData
|
| 339 |
-
from .connection_deleted_data_connection_type import *
|
| 340 |
-
from .connection_deleted_data_state import *
|
| 341 |
from .connection_saml_certificate_renewal_required import (
|
| 342 |
ConnectionSAMLCertificateRenewalRequired as ConnectionSAMLCertificateRenewalRequired,
|
| 343 |
)
|
|
@@ -347,7 +335,6 @@ from .connection_saml_certificate_renewal_required_data import (
|
|
| 347 |
from .connection_saml_certificate_renewal_required_data_certificate import (
|
| 348 |
ConnectionSAMLCertificateRenewalRequiredDataCertificate as ConnectionSAMLCertificateRenewalRequiredDataCertificate,
|
| 349 |
)
|
| 350 |
-
from .connection_saml_certificate_renewal_required_data_certificate_certificate_type import *
|
| 351 |
from .connection_saml_certificate_renewal_required_data_connection import (
|
| 352 |
ConnectionSAMLCertificateRenewalRequiredDataConnection as ConnectionSAMLCertificateRenewalRequiredDataConnection,
|
| 353 |
)
|
|
@@ -360,7 +347,6 @@ from .connection_saml_certificate_renewed_data import (
|
|
| 360 |
from .connection_saml_certificate_renewed_data_certificate import (
|
| 361 |
ConnectionSAMLCertificateRenewedDataCertificate as ConnectionSAMLCertificateRenewedDataCertificate,
|
| 362 |
)
|
| 363 |
-
from .connection_saml_certificate_renewed_data_certificate_certificate_type import *
|
| 364 |
from .connection_saml_certificate_renewed_data_connection import (
|
| 365 |
ConnectionSAMLCertificateRenewedDataConnection as ConnectionSAMLCertificateRenewedDataConnection,
|
| 366 |
)
|
|
@@ -424,7 +410,6 @@ from .directory_state import DirectoryState as DirectoryState
|
|
| 424 |
from .directory_type import DirectoryType as DirectoryType
|
| 425 |
from .directory_user import DirectoryUser as DirectoryUser
|
| 426 |
from .directory_user_email import DirectoryUserEmail as DirectoryUserEmail
|
| 427 |
-
from .directory_user_state import *
|
| 428 |
from .directory_user_with_groups_state import (
|
| 429 |
DirectoryUserWithGroupsState as DirectoryUserWithGroupsState,
|
| 430 |
)
|
|
@@ -433,12 +418,8 @@ from .dsync_activated_data import DsyncActivatedData as DsyncActivatedData
|
|
| 433 |
from .dsync_activated_data_domain import (
|
| 434 |
DsyncActivatedDataDomain as DsyncActivatedDataDomain,
|
| 435 |
)
|
| 436 |
-
from .dsync_activated_data_state import *
|
| 437 |
-
from .dsync_activated_data_type import *
|
| 438 |
from .dsync_deleted import DsyncDeleted as DsyncDeleted
|
| 439 |
from .dsync_deleted_data import DsyncDeletedData as DsyncDeletedData
|
| 440 |
-
from .dsync_deleted_data_state import *
|
| 441 |
-
from .dsync_deleted_data_type import *
|
| 442 |
from .dsync_group_created import DsyncGroupCreated as DsyncGroupCreated
|
| 443 |
from .dsync_group_deleted import DsyncGroupDeleted as DsyncGroupDeleted
|
| 444 |
from .dsync_group_updated import DsyncGroupUpdated as DsyncGroupUpdated
|
|
@@ -462,7 +443,6 @@ from .dsync_user_updated_data import DsyncUserUpdatedData as DsyncUserUpdatedDat
|
|
| 462 |
from .dsync_user_updated_data_email import (
|
| 463 |
DsyncUserUpdatedDataEmail as DsyncUserUpdatedDataEmail,
|
| 464 |
)
|
| 465 |
-
from .dsync_user_updated_data_state import *
|
| 466 |
from .email_verification_created import (
|
| 467 |
EmailVerificationCreated as EmailVerificationCreated,
|
| 468 |
)
|
|
@@ -472,7 +452,6 @@ from .email_verification_created_data import (
|
|
| 472 |
from .error_response import ErrorResponse as ErrorResponse
|
| 473 |
from .event_context import EventContext as EventContext
|
| 474 |
from .event_context_actor import EventContextActor as EventContextActor
|
| 475 |
-
from .event_context_actor_source import *
|
| 476 |
from .event_context_google_analytics_session import (
|
| 477 |
EventContextGoogleAnalyticsSession as EventContextGoogleAnalyticsSession,
|
| 478 |
)
|
|
@@ -484,7 +463,6 @@ from .flag_created_context import FlagCreatedContext as FlagCreatedContext
|
|
| 484 |
from .flag_created_context_actor import (
|
| 485 |
FlagCreatedContextActor as FlagCreatedContextActor,
|
| 486 |
)
|
| 487 |
-
from .flag_created_context_actor_source import *
|
| 488 |
from .flag_created_data import FlagCreatedData as FlagCreatedData
|
| 489 |
from .flag_created_data_owner import FlagCreatedDataOwner as FlagCreatedDataOwner
|
| 490 |
from .flag_deleted import FlagDeleted as FlagDeleted
|
|
@@ -492,17 +470,14 @@ from .flag_deleted_context import FlagDeletedContext as FlagDeletedContext
|
|
| 492 |
from .flag_deleted_context_actor import (
|
| 493 |
FlagDeletedContextActor as FlagDeletedContextActor,
|
| 494 |
)
|
| 495 |
-
from .flag_deleted_context_actor_source import *
|
| 496 |
from .flag_deleted_data import FlagDeletedData as FlagDeletedData
|
| 497 |
from .flag_deleted_data_owner import FlagDeletedDataOwner as FlagDeletedDataOwner
|
| 498 |
from .flag_owner import FlagOwner as FlagOwner
|
| 499 |
from .flag_rule_updated import FlagRuleUpdated as FlagRuleUpdated
|
| 500 |
from .flag_rule_updated_context import FlagRuleUpdatedContext as FlagRuleUpdatedContext
|
| 501 |
-
from .flag_rule_updated_context_access_type import *
|
| 502 |
from .flag_rule_updated_context_actor import (
|
| 503 |
FlagRuleUpdatedContextActor as FlagRuleUpdatedContextActor,
|
| 504 |
)
|
| 505 |
-
from .flag_rule_updated_context_actor_source import *
|
| 506 |
from .flag_rule_updated_context_configured_target import (
|
| 507 |
FlagRuleUpdatedContextConfiguredTarget as FlagRuleUpdatedContextConfiguredTarget,
|
| 508 |
)
|
|
@@ -518,7 +493,6 @@ from .flag_rule_updated_context_previous_attribute import (
|
|
| 518 |
from .flag_rule_updated_context_previous_attribute_context import (
|
| 519 |
FlagRuleUpdatedContextPreviousAttributeContext as FlagRuleUpdatedContextPreviousAttributeContext,
|
| 520 |
)
|
| 521 |
-
from .flag_rule_updated_context_previous_attribute_context_access_type import *
|
| 522 |
from .flag_rule_updated_context_previous_attribute_context_configured_target import (
|
| 523 |
FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget as FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget,
|
| 524 |
)
|
|
@@ -540,7 +514,6 @@ from .flag_updated_context import FlagUpdatedContext as FlagUpdatedContext
|
|
| 540 |
from .flag_updated_context_actor import (
|
| 541 |
FlagUpdatedContextActor as FlagUpdatedContextActor,
|
| 542 |
)
|
| 543 |
-
from .flag_updated_context_actor_source import *
|
| 544 |
from .flag_updated_context_previous_attribute import (
|
| 545 |
FlagUpdatedContextPreviousAttribute as FlagUpdatedContextPreviousAttribute,
|
| 546 |
)
|
|
@@ -560,16 +533,12 @@ from .group_member_removed_data import GroupMemberRemovedData as GroupMemberRemo
|
|
| 560 |
from .group_updated import GroupUpdated as GroupUpdated
|
| 561 |
from .invitation_accepted import InvitationAccepted as InvitationAccepted
|
| 562 |
from .invitation_accepted_data import InvitationAcceptedData as InvitationAcceptedData
|
| 563 |
-
from .invitation_accepted_data_state import *
|
| 564 |
from .invitation_created import InvitationCreated as InvitationCreated
|
| 565 |
from .invitation_created_data import InvitationCreatedData as InvitationCreatedData
|
| 566 |
-
from .invitation_created_data_state import *
|
| 567 |
from .invitation_resent import InvitationResent as InvitationResent
|
| 568 |
from .invitation_resent_data import InvitationResentData as InvitationResentData
|
| 569 |
-
from .invitation_resent_data_state import *
|
| 570 |
from .invitation_revoked import InvitationRevoked as InvitationRevoked
|
| 571 |
from .invitation_revoked_data import InvitationRevokedData as InvitationRevokedData
|
| 572 |
-
from .invitation_revoked_data_state import *
|
| 573 |
from .invitation_state import InvitationState as InvitationState
|
| 574 |
from .list_metadata import ListMetadata as ListMetadata
|
| 575 |
from .magic_auth_created import MagicAuthCreated as MagicAuthCreated
|
|
@@ -581,8 +550,6 @@ from .organization_created_data import (
|
|
| 581 |
from .organization_created_data_domain import (
|
| 582 |
OrganizationCreatedDataDomain as OrganizationCreatedDataDomain,
|
| 583 |
)
|
| 584 |
-
from .organization_created_data_domain_state import *
|
| 585 |
-
from .organization_created_data_domain_verification_strategy import *
|
| 586 |
from .organization_deleted import OrganizationDeleted as OrganizationDeleted
|
| 587 |
from .organization_deleted_data import (
|
| 588 |
OrganizationDeletedData as OrganizationDeletedData,
|
|
@@ -590,8 +557,6 @@ from .organization_deleted_data import (
|
|
| 590 |
from .organization_deleted_data_domain import (
|
| 591 |
OrganizationDeletedDataDomain as OrganizationDeletedDataDomain,
|
| 592 |
)
|
| 593 |
-
from .organization_deleted_data_domain_state import *
|
| 594 |
-
from .organization_deleted_data_domain_verification_strategy import *
|
| 595 |
from .organization_domain import OrganizationDomain as OrganizationDomain
|
| 596 |
from .organization_domain_created import (
|
| 597 |
OrganizationDomainCreated as OrganizationDomainCreated,
|
|
@@ -599,8 +564,6 @@ from .organization_domain_created import (
|
|
| 599 |
from .organization_domain_created_data import (
|
| 600 |
OrganizationDomainCreatedData as OrganizationDomainCreatedData,
|
| 601 |
)
|
| 602 |
-
from .organization_domain_created_data_state import *
|
| 603 |
-
from .organization_domain_created_data_verification_strategy import *
|
| 604 |
from .organization_domain_data_state import (
|
| 605 |
OrganizationDomainDataState as OrganizationDomainDataState,
|
| 606 |
)
|
|
@@ -610,8 +573,6 @@ from .organization_domain_deleted import (
|
|
| 610 |
from .organization_domain_deleted_data import (
|
| 611 |
OrganizationDomainDeletedData as OrganizationDomainDeletedData,
|
| 612 |
)
|
| 613 |
-
from .organization_domain_deleted_data_state import *
|
| 614 |
-
from .organization_domain_deleted_data_verification_strategy import *
|
| 615 |
from .organization_domain_state import (
|
| 616 |
OrganizationDomainState as OrganizationDomainState,
|
| 617 |
)
|
|
@@ -621,8 +582,6 @@ from .organization_domain_updated import (
|
|
| 621 |
from .organization_domain_updated_data import (
|
| 622 |
OrganizationDomainUpdatedData as OrganizationDomainUpdatedData,
|
| 623 |
)
|
| 624 |
-
from .organization_domain_updated_data_state import *
|
| 625 |
-
from .organization_domain_updated_data_verification_strategy import *
|
| 626 |
from .organization_domain_verification_failed import (
|
| 627 |
OrganizationDomainVerificationFailed as OrganizationDomainVerificationFailed,
|
| 628 |
)
|
|
@@ -632,9 +591,6 @@ from .organization_domain_verification_failed_data import (
|
|
| 632 |
from .organization_domain_verification_failed_data_organization_domain import (
|
| 633 |
OrganizationDomainVerificationFailedDataOrganizationDomain as OrganizationDomainVerificationFailedDataOrganizationDomain,
|
| 634 |
)
|
| 635 |
-
from .organization_domain_verification_failed_data_organization_domain_state import *
|
| 636 |
-
from .organization_domain_verification_failed_data_organization_domain_verification_strategy import *
|
| 637 |
-
from .organization_domain_verification_failed_data_reason import *
|
| 638 |
from .organization_domain_verification_strategy import (
|
| 639 |
OrganizationDomainVerificationStrategy as OrganizationDomainVerificationStrategy,
|
| 640 |
)
|
|
@@ -644,22 +600,18 @@ from .organization_domain_verified import (
|
|
| 644 |
from .organization_domain_verified_data import (
|
| 645 |
OrganizationDomainVerifiedData as OrganizationDomainVerifiedData,
|
| 646 |
)
|
| 647 |
-
from .organization_domain_verified_data_state import *
|
| 648 |
-
from .organization_domain_verified_data_verification_strategy import *
|
| 649 |
from .organization_membership_created import (
|
| 650 |
OrganizationMembershipCreated as OrganizationMembershipCreated,
|
| 651 |
)
|
| 652 |
from .organization_membership_created_data import (
|
| 653 |
OrganizationMembershipCreatedData as OrganizationMembershipCreatedData,
|
| 654 |
)
|
| 655 |
-
from .organization_membership_created_data_status import *
|
| 656 |
from .organization_membership_deleted import (
|
| 657 |
OrganizationMembershipDeleted as OrganizationMembershipDeleted,
|
| 658 |
)
|
| 659 |
from .organization_membership_deleted_data import (
|
| 660 |
OrganizationMembershipDeletedData as OrganizationMembershipDeletedData,
|
| 661 |
)
|
| 662 |
-
from .organization_membership_deleted_data_status import *
|
| 663 |
from .organization_membership_status import (
|
| 664 |
OrganizationMembershipStatus as OrganizationMembershipStatus,
|
| 665 |
)
|
|
@@ -669,7 +621,6 @@ from .organization_membership_updated import (
|
|
| 669 |
from .organization_membership_updated_data import (
|
| 670 |
OrganizationMembershipUpdatedData as OrganizationMembershipUpdatedData,
|
| 671 |
)
|
| 672 |
-
from .organization_membership_updated_data_status import *
|
| 673 |
from .organization_role_created import (
|
| 674 |
OrganizationRoleCreated as OrganizationRoleCreated,
|
| 675 |
)
|
|
@@ -695,8 +646,6 @@ from .organization_updated_data import (
|
|
| 695 |
from .organization_updated_data_domain import (
|
| 696 |
OrganizationUpdatedDataDomain as OrganizationUpdatedDataDomain,
|
| 697 |
)
|
| 698 |
-
from .organization_updated_data_domain_state import *
|
| 699 |
-
from .organization_updated_data_domain_verification_strategy import *
|
| 700 |
from .pagination_order import PaginationOrder as PaginationOrder
|
| 701 |
from .password_reset_created import PasswordResetCreated as PasswordResetCreated
|
| 702 |
from .password_reset_created_data import (
|
|
@@ -713,7 +662,6 @@ from .permission_deleted_data import PermissionDeletedData as PermissionDeletedD
|
|
| 713 |
from .permission_updated import PermissionUpdated as PermissionUpdated
|
| 714 |
from .permission_updated_data import PermissionUpdatedData as PermissionUpdatedData
|
| 715 |
from .pipe_connected_account import PipeConnectedAccount as PipeConnectedAccount
|
| 716 |
-
from .pipe_connected_account_state import *
|
| 717 |
from .pipes_connected_account_connected import (
|
| 718 |
PipesConnectedAccountConnected as PipesConnectedAccountConnected,
|
| 719 |
)
|
|
@@ -761,18 +709,14 @@ from .role_updated import RoleUpdated as RoleUpdated
|
|
| 761 |
from .role_updated_data import RoleUpdatedData as RoleUpdatedData
|
| 762 |
from .session_created import SessionCreated as SessionCreated
|
| 763 |
from .session_created_data import SessionCreatedData as SessionCreatedData
|
| 764 |
-
from .session_created_data_auth_method import *
|
| 765 |
from .session_created_data_impersonator import (
|
| 766 |
SessionCreatedDataImpersonator as SessionCreatedDataImpersonator,
|
| 767 |
)
|
| 768 |
-
from .session_created_data_status import *
|
| 769 |
from .session_revoked import SessionRevoked as SessionRevoked
|
| 770 |
from .session_revoked_data import SessionRevokedData as SessionRevokedData
|
| 771 |
-
from .session_revoked_data_auth_method import *
|
| 772 |
from .session_revoked_data_impersonator import (
|
| 773 |
SessionRevokedDataImpersonator as SessionRevokedDataImpersonator,
|
| 774 |
)
|
| 775 |
-
from .session_revoked_data_status import *
|
| 776 |
from .slim_role import SlimRole as SlimRole
|
| 777 |
from .update_custom_provider_definition_authenticate_via import (
|
| 778 |
UpdateCustomProviderDefinitionAuthenticateVia as UpdateCustomProviderDefinitionAuthenticateVia,
|
|
@@ -828,7 +772,6 @@ from .vault_byok_key_deleted import VaultByokKeyDeleted as VaultByokKeyDeleted
|
|
| 828 |
from .vault_byok_key_deleted_data import (
|
| 829 |
VaultByokKeyDeletedData as VaultByokKeyDeletedData,
|
| 830 |
)
|
| 831 |
-
from .vault_byok_key_provider import *
|
| 832 |
from .vault_byok_key_verification_completed import (
|
| 833 |
VaultByokKeyVerificationCompleted as VaultByokKeyVerificationCompleted,
|
| 834 |
)
|
|
@@ -837,39 +780,28 @@ from .vault_byok_key_verification_completed_data import (
|
|
| 837 |
)
|
| 838 |
from .vault_data_created import VaultDataCreated as VaultDataCreated
|
| 839 |
from .vault_data_created_data import VaultDataCreatedData as VaultDataCreatedData
|
| 840 |
-
from .vault_data_created_data_actor_source import *
|
| 841 |
from .vault_data_deleted import VaultDataDeleted as VaultDataDeleted
|
| 842 |
from .vault_data_deleted_data import VaultDataDeletedData as VaultDataDeletedData
|
| 843 |
-
from .vault_data_deleted_data_actor_source import *
|
| 844 |
from .vault_data_read import VaultDataRead as VaultDataRead
|
| 845 |
from .vault_data_read_data import VaultDataReadData as VaultDataReadData
|
| 846 |
-
from .vault_data_read_data_actor_source import *
|
| 847 |
from .vault_data_updated import VaultDataUpdated as VaultDataUpdated
|
| 848 |
from .vault_data_updated_data import VaultDataUpdatedData as VaultDataUpdatedData
|
| 849 |
-
from .vault_data_updated_data_actor_source import *
|
| 850 |
from .vault_dek_decrypted import VaultDekDecrypted as VaultDekDecrypted
|
| 851 |
from .vault_dek_decrypted_data import VaultDekDecryptedData as VaultDekDecryptedData
|
| 852 |
-
from .vault_dek_decrypted_data_actor_source import *
|
| 853 |
from .vault_dek_read import VaultDekRead as VaultDekRead
|
| 854 |
from .vault_dek_read_data import VaultDekReadData as VaultDekReadData
|
| 855 |
-
from .vault_dek_read_data_actor_source import *
|
| 856 |
from .vault_kek_created import VaultKekCreated as VaultKekCreated
|
| 857 |
from .vault_kek_created_data import VaultKekCreatedData as VaultKekCreatedData
|
| 858 |
-
from .vault_kek_created_data_actor_source import *
|
| 859 |
from .vault_kek_deleted import VaultKekDeleted as VaultKekDeleted
|
| 860 |
from .vault_kek_deleted_data import VaultKekDeletedData as VaultKekDeletedData
|
| 861 |
-
from .vault_kek_deleted_data_actor_source import *
|
| 862 |
from .vault_metadata_read import VaultMetadataRead as VaultMetadataRead
|
| 863 |
from .vault_metadata_read_data import VaultMetadataReadData as VaultMetadataReadData
|
| 864 |
-
from .vault_metadata_read_data_actor_source import *
|
| 865 |
from .vault_names_listed import VaultNamesListed as VaultNamesListed
|
| 866 |
from .vault_names_listed_data import VaultNamesListedData as VaultNamesListedData
|
| 867 |
-
from .vault_names_listed_data_actor_source import *
|
| 868 |
from .waitlist_user import WaitlistUser as WaitlistUser
|
| 869 |
from .waitlist_user_approved import WaitlistUserApproved as WaitlistUserApproved
|
| 870 |
from .waitlist_user_created import WaitlistUserCreated as WaitlistUserCreated
|
| 871 |
from .waitlist_user_denied import WaitlistUserDenied as WaitlistUserDenied
|
| 872 |
-
from .waitlist_user_state import *
|
| 873 |
from .webhook_endpoint_status import WebhookEndpointStatus as WebhookEndpointStatus
|
| 874 |
from .widget_session_token_scopes import (
|
| 875 |
WidgetSessionTokenScopes as WidgetSessionTokenScopes,
|
|
|
|
| 44 |
from .agent_registration_created_data_agent_identity import (
|
| 45 |
AgentRegistrationCreatedDataAgentIdentity as AgentRegistrationCreatedDataAgentIdentity,
|
| 46 |
)
|
|
|
|
|
|
|
|
|
|
| 47 |
from .agent_registration_credential_issued import (
|
| 48 |
AgentRegistrationCredentialIssued as AgentRegistrationCredentialIssued,
|
| 49 |
)
|
|
|
|
| 240 |
from .authentication_radar_risk_detected_data import (
|
| 241 |
AuthenticationRadarRiskDetectedData as AuthenticationRadarRiskDetectedData,
|
| 242 |
)
|
|
|
|
| 243 |
from .authentication_reauthentication_succeeded import (
|
| 244 |
AuthenticationReauthenticationSucceeded as AuthenticationReauthenticationSucceeded,
|
| 245 |
)
|
|
|
|
| 314 |
from .connection_activated_data import (
|
| 315 |
ConnectionActivatedData as ConnectionActivatedData,
|
| 316 |
)
|
|
|
|
| 317 |
from .connection_activated_data_domain import (
|
| 318 |
ConnectionActivatedDataDomain as ConnectionActivatedDataDomain,
|
| 319 |
)
|
|
|
|
|
|
|
| 320 |
from .connection_deactivated import ConnectionDeactivated as ConnectionDeactivated
|
| 321 |
from .connection_deactivated_data import (
|
| 322 |
ConnectionDeactivatedData as ConnectionDeactivatedData,
|
| 323 |
)
|
|
|
|
| 324 |
from .connection_deactivated_data_domain import (
|
| 325 |
ConnectionDeactivatedDataDomain as ConnectionDeactivatedDataDomain,
|
| 326 |
)
|
|
|
|
|
|
|
| 327 |
from .connection_deleted import ConnectionDeleted as ConnectionDeleted
|
| 328 |
from .connection_deleted_data import ConnectionDeletedData as ConnectionDeletedData
|
|
|
|
|
|
|
| 329 |
from .connection_saml_certificate_renewal_required import (
|
| 330 |
ConnectionSAMLCertificateRenewalRequired as ConnectionSAMLCertificateRenewalRequired,
|
| 331 |
)
|
|
|
|
| 335 |
from .connection_saml_certificate_renewal_required_data_certificate import (
|
| 336 |
ConnectionSAMLCertificateRenewalRequiredDataCertificate as ConnectionSAMLCertificateRenewalRequiredDataCertificate,
|
| 337 |
)
|
|
|
|
| 338 |
from .connection_saml_certificate_renewal_required_data_connection import (
|
| 339 |
ConnectionSAMLCertificateRenewalRequiredDataConnection as ConnectionSAMLCertificateRenewalRequiredDataConnection,
|
| 340 |
)
|
|
|
|
| 347 |
from .connection_saml_certificate_renewed_data_certificate import (
|
| 348 |
ConnectionSAMLCertificateRenewedDataCertificate as ConnectionSAMLCertificateRenewedDataCertificate,
|
| 349 |
)
|
|
|
|
| 350 |
from .connection_saml_certificate_renewed_data_connection import (
|
| 351 |
ConnectionSAMLCertificateRenewedDataConnection as ConnectionSAMLCertificateRenewedDataConnection,
|
| 352 |
)
|
|
|
|
| 410 |
from .directory_type import DirectoryType as DirectoryType
|
| 411 |
from .directory_user import DirectoryUser as DirectoryUser
|
| 412 |
from .directory_user_email import DirectoryUserEmail as DirectoryUserEmail
|
|
|
|
| 413 |
from .directory_user_with_groups_state import (
|
| 414 |
DirectoryUserWithGroupsState as DirectoryUserWithGroupsState,
|
| 415 |
)
|
|
|
|
| 418 |
from .dsync_activated_data_domain import (
|
| 419 |
DsyncActivatedDataDomain as DsyncActivatedDataDomain,
|
| 420 |
)
|
|
|
|
|
|
|
| 421 |
from .dsync_deleted import DsyncDeleted as DsyncDeleted
|
| 422 |
from .dsync_deleted_data import DsyncDeletedData as DsyncDeletedData
|
|
|
|
|
|
|
| 423 |
from .dsync_group_created import DsyncGroupCreated as DsyncGroupCreated
|
| 424 |
from .dsync_group_deleted import DsyncGroupDeleted as DsyncGroupDeleted
|
| 425 |
from .dsync_group_updated import DsyncGroupUpdated as DsyncGroupUpdated
|
|
|
|
| 443 |
from .dsync_user_updated_data_email import (
|
| 444 |
DsyncUserUpdatedDataEmail as DsyncUserUpdatedDataEmail,
|
| 445 |
)
|
|
|
|
| 446 |
from .email_verification_created import (
|
| 447 |
EmailVerificationCreated as EmailVerificationCreated,
|
| 448 |
)
|
|
|
|
| 452 |
from .error_response import ErrorResponse as ErrorResponse
|
| 453 |
from .event_context import EventContext as EventContext
|
| 454 |
from .event_context_actor import EventContextActor as EventContextActor
|
|
|
|
| 455 |
from .event_context_google_analytics_session import (
|
| 456 |
EventContextGoogleAnalyticsSession as EventContextGoogleAnalyticsSession,
|
| 457 |
)
|
|
|
|
| 463 |
from .flag_created_context_actor import (
|
| 464 |
FlagCreatedContextActor as FlagCreatedContextActor,
|
| 465 |
)
|
|
|
|
| 466 |
from .flag_created_data import FlagCreatedData as FlagCreatedData
|
| 467 |
from .flag_created_data_owner import FlagCreatedDataOwner as FlagCreatedDataOwner
|
| 468 |
from .flag_deleted import FlagDeleted as FlagDeleted
|
|
|
|
| 470 |
from .flag_deleted_context_actor import (
|
| 471 |
FlagDeletedContextActor as FlagDeletedContextActor,
|
| 472 |
)
|
|
|
|
| 473 |
from .flag_deleted_data import FlagDeletedData as FlagDeletedData
|
| 474 |
from .flag_deleted_data_owner import FlagDeletedDataOwner as FlagDeletedDataOwner
|
| 475 |
from .flag_owner import FlagOwner as FlagOwner
|
| 476 |
from .flag_rule_updated import FlagRuleUpdated as FlagRuleUpdated
|
| 477 |
from .flag_rule_updated_context import FlagRuleUpdatedContext as FlagRuleUpdatedContext
|
|
|
|
| 478 |
from .flag_rule_updated_context_actor import (
|
| 479 |
FlagRuleUpdatedContextActor as FlagRuleUpdatedContextActor,
|
| 480 |
)
|
|
|
|
| 481 |
from .flag_rule_updated_context_configured_target import (
|
| 482 |
FlagRuleUpdatedContextConfiguredTarget as FlagRuleUpdatedContextConfiguredTarget,
|
| 483 |
)
|
|
|
|
| 493 |
from .flag_rule_updated_context_previous_attribute_context import (
|
| 494 |
FlagRuleUpdatedContextPreviousAttributeContext as FlagRuleUpdatedContextPreviousAttributeContext,
|
| 495 |
)
|
|
|
|
| 496 |
from .flag_rule_updated_context_previous_attribute_context_configured_target import (
|
| 497 |
FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget as FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget,
|
| 498 |
)
|
|
|
|
| 514 |
from .flag_updated_context_actor import (
|
| 515 |
FlagUpdatedContextActor as FlagUpdatedContextActor,
|
| 516 |
)
|
|
|
|
| 517 |
from .flag_updated_context_previous_attribute import (
|
| 518 |
FlagUpdatedContextPreviousAttribute as FlagUpdatedContextPreviousAttribute,
|
| 519 |
)
|
|
|
|
| 533 |
from .group_updated import GroupUpdated as GroupUpdated
|
| 534 |
from .invitation_accepted import InvitationAccepted as InvitationAccepted
|
| 535 |
from .invitation_accepted_data import InvitationAcceptedData as InvitationAcceptedData
|
|
|
|
| 536 |
from .invitation_created import InvitationCreated as InvitationCreated
|
| 537 |
from .invitation_created_data import InvitationCreatedData as InvitationCreatedData
|
|
|
|
| 538 |
from .invitation_resent import InvitationResent as InvitationResent
|
| 539 |
from .invitation_resent_data import InvitationResentData as InvitationResentData
|
|
|
|
| 540 |
from .invitation_revoked import InvitationRevoked as InvitationRevoked
|
| 541 |
from .invitation_revoked_data import InvitationRevokedData as InvitationRevokedData
|
|
|
|
| 542 |
from .invitation_state import InvitationState as InvitationState
|
| 543 |
from .list_metadata import ListMetadata as ListMetadata
|
| 544 |
from .magic_auth_created import MagicAuthCreated as MagicAuthCreated
|
|
|
|
| 550 |
from .organization_created_data_domain import (
|
| 551 |
OrganizationCreatedDataDomain as OrganizationCreatedDataDomain,
|
| 552 |
)
|
|
|
|
|
|
|
| 553 |
from .organization_deleted import OrganizationDeleted as OrganizationDeleted
|
| 554 |
from .organization_deleted_data import (
|
| 555 |
OrganizationDeletedData as OrganizationDeletedData,
|
|
|
|
| 557 |
from .organization_deleted_data_domain import (
|
| 558 |
OrganizationDeletedDataDomain as OrganizationDeletedDataDomain,
|
| 559 |
)
|
|
|
|
|
|
|
| 560 |
from .organization_domain import OrganizationDomain as OrganizationDomain
|
| 561 |
from .organization_domain_created import (
|
| 562 |
OrganizationDomainCreated as OrganizationDomainCreated,
|
|
|
|
| 564 |
from .organization_domain_created_data import (
|
| 565 |
OrganizationDomainCreatedData as OrganizationDomainCreatedData,
|
| 566 |
)
|
|
|
|
|
|
|
| 567 |
from .organization_domain_data_state import (
|
| 568 |
OrganizationDomainDataState as OrganizationDomainDataState,
|
| 569 |
)
|
|
|
|
| 573 |
from .organization_domain_deleted_data import (
|
| 574 |
OrganizationDomainDeletedData as OrganizationDomainDeletedData,
|
| 575 |
)
|
|
|
|
|
|
|
| 576 |
from .organization_domain_state import (
|
| 577 |
OrganizationDomainState as OrganizationDomainState,
|
| 578 |
)
|
|
|
|
| 582 |
from .organization_domain_updated_data import (
|
| 583 |
OrganizationDomainUpdatedData as OrganizationDomainUpdatedData,
|
| 584 |
)
|
|
|
|
|
|
|
| 585 |
from .organization_domain_verification_failed import (
|
| 586 |
OrganizationDomainVerificationFailed as OrganizationDomainVerificationFailed,
|
| 587 |
)
|
|
|
|
| 591 |
from .organization_domain_verification_failed_data_organization_domain import (
|
| 592 |
OrganizationDomainVerificationFailedDataOrganizationDomain as OrganizationDomainVerificationFailedDataOrganizationDomain,
|
| 593 |
)
|
|
|
|
|
|
|
|
|
|
| 594 |
from .organization_domain_verification_strategy import (
|
| 595 |
OrganizationDomainVerificationStrategy as OrganizationDomainVerificationStrategy,
|
| 596 |
)
|
|
|
|
| 600 |
from .organization_domain_verified_data import (
|
| 601 |
OrganizationDomainVerifiedData as OrganizationDomainVerifiedData,
|
| 602 |
)
|
|
|
|
|
|
|
| 603 |
from .organization_membership_created import (
|
| 604 |
OrganizationMembershipCreated as OrganizationMembershipCreated,
|
| 605 |
)
|
| 606 |
from .organization_membership_created_data import (
|
| 607 |
OrganizationMembershipCreatedData as OrganizationMembershipCreatedData,
|
| 608 |
)
|
|
|
|
| 609 |
from .organization_membership_deleted import (
|
| 610 |
OrganizationMembershipDeleted as OrganizationMembershipDeleted,
|
| 611 |
)
|
| 612 |
from .organization_membership_deleted_data import (
|
| 613 |
OrganizationMembershipDeletedData as OrganizationMembershipDeletedData,
|
| 614 |
)
|
|
|
|
| 615 |
from .organization_membership_status import (
|
| 616 |
OrganizationMembershipStatus as OrganizationMembershipStatus,
|
| 617 |
)
|
|
|
|
| 621 |
from .organization_membership_updated_data import (
|
| 622 |
OrganizationMembershipUpdatedData as OrganizationMembershipUpdatedData,
|
| 623 |
)
|
|
|
|
| 624 |
from .organization_role_created import (
|
| 625 |
OrganizationRoleCreated as OrganizationRoleCreated,
|
| 626 |
)
|
|
|
|
| 646 |
from .organization_updated_data_domain import (
|
| 647 |
OrganizationUpdatedDataDomain as OrganizationUpdatedDataDomain,
|
| 648 |
)
|
|
|
|
|
|
|
| 649 |
from .pagination_order import PaginationOrder as PaginationOrder
|
| 650 |
from .password_reset_created import PasswordResetCreated as PasswordResetCreated
|
| 651 |
from .password_reset_created_data import (
|
|
|
|
| 662 |
from .permission_updated import PermissionUpdated as PermissionUpdated
|
| 663 |
from .permission_updated_data import PermissionUpdatedData as PermissionUpdatedData
|
| 664 |
from .pipe_connected_account import PipeConnectedAccount as PipeConnectedAccount
|
|
|
|
| 665 |
from .pipes_connected_account_connected import (
|
| 666 |
PipesConnectedAccountConnected as PipesConnectedAccountConnected,
|
| 667 |
)
|
|
|
|
| 709 |
from .role_updated_data import RoleUpdatedData as RoleUpdatedData
|
| 710 |
from .session_created import SessionCreated as SessionCreated
|
| 711 |
from .session_created_data import SessionCreatedData as SessionCreatedData
|
|
|
|
| 712 |
from .session_created_data_impersonator import (
|
| 713 |
SessionCreatedDataImpersonator as SessionCreatedDataImpersonator,
|
| 714 |
)
|
|
|
|
| 715 |
from .session_revoked import SessionRevoked as SessionRevoked
|
| 716 |
from .session_revoked_data import SessionRevokedData as SessionRevokedData
|
|
|
|
| 717 |
from .session_revoked_data_impersonator import (
|
| 718 |
SessionRevokedDataImpersonator as SessionRevokedDataImpersonator,
|
| 719 |
)
|
|
|
|
| 720 |
from .slim_role import SlimRole as SlimRole
|
| 721 |
from .update_custom_provider_definition_authenticate_via import (
|
| 722 |
UpdateCustomProviderDefinitionAuthenticateVia as UpdateCustomProviderDefinitionAuthenticateVia,
|
|
|
|
| 772 |
from .vault_byok_key_deleted_data import (
|
| 773 |
VaultByokKeyDeletedData as VaultByokKeyDeletedData,
|
| 774 |
)
|
|
|
|
| 775 |
from .vault_byok_key_verification_completed import (
|
| 776 |
VaultByokKeyVerificationCompleted as VaultByokKeyVerificationCompleted,
|
| 777 |
)
|
|
|
|
| 780 |
)
|
| 781 |
from .vault_data_created import VaultDataCreated as VaultDataCreated
|
| 782 |
from .vault_data_created_data import VaultDataCreatedData as VaultDataCreatedData
|
|
|
|
| 783 |
from .vault_data_deleted import VaultDataDeleted as VaultDataDeleted
|
| 784 |
from .vault_data_deleted_data import VaultDataDeletedData as VaultDataDeletedData
|
|
|
|
| 785 |
from .vault_data_read import VaultDataRead as VaultDataRead
|
| 786 |
from .vault_data_read_data import VaultDataReadData as VaultDataReadData
|
|
|
|
| 787 |
from .vault_data_updated import VaultDataUpdated as VaultDataUpdated
|
| 788 |
from .vault_data_updated_data import VaultDataUpdatedData as VaultDataUpdatedData
|
|
|
|
| 789 |
from .vault_dek_decrypted import VaultDekDecrypted as VaultDekDecrypted
|
| 790 |
from .vault_dek_decrypted_data import VaultDekDecryptedData as VaultDekDecryptedData
|
|
|
|
| 791 |
from .vault_dek_read import VaultDekRead as VaultDekRead
|
| 792 |
from .vault_dek_read_data import VaultDekReadData as VaultDekReadData
|
|
|
|
| 793 |
from .vault_kek_created import VaultKekCreated as VaultKekCreated
|
| 794 |
from .vault_kek_created_data import VaultKekCreatedData as VaultKekCreatedData
|
|
|
|
| 795 |
from .vault_kek_deleted import VaultKekDeleted as VaultKekDeleted
|
| 796 |
from .vault_kek_deleted_data import VaultKekDeletedData as VaultKekDeletedData
|
|
|
|
| 797 |
from .vault_metadata_read import VaultMetadataRead as VaultMetadataRead
|
| 798 |
from .vault_metadata_read_data import VaultMetadataReadData as VaultMetadataReadData
|
|
|
|
| 799 |
from .vault_names_listed import VaultNamesListed as VaultNamesListed
|
| 800 |
from .vault_names_listed_data import VaultNamesListedData as VaultNamesListedData
|
|
|
|
| 801 |
from .waitlist_user import WaitlistUser as WaitlistUser
|
| 802 |
from .waitlist_user_approved import WaitlistUserApproved as WaitlistUserApproved
|
| 803 |
from .waitlist_user_created import WaitlistUserCreated as WaitlistUserCreated
|
| 804 |
from .waitlist_user_denied import WaitlistUserDenied as WaitlistUserDenied
|
|
|
|
| 805 |
from .webhook_endpoint_status import WebhookEndpointStatus as WebhookEndpointStatus
|
| 806 |
from .widget_session_token_scopes import (
|
| 807 |
WidgetSessionTokenScopes as WidgetSessionTokenScopes,
|
python/src/workos/common/models/waitlist_user.py|
@@ -16,29 +16,30 @@ from .waitlist_user_state import WaitlistUserState
|
|
| 16 |
class WaitlistUser:
|
| 17 |
"""Waitlist User model."""
|
| 18 |
|
| 19 |
-
object: Literal["waitlist_user"]
|
| 20 |
-
"""Distinguishes the Waitlist User object."""
|
| 21 |
id: str
|
| 22 |
-
"""The unique ID of the
|
| 23 |
email: str
|
| 24 |
-
"""The email address of the
|
| 25 |
state: WaitlistUserState
|
| 26 |
-
"""The state of the
|
| 27 |
approved_at: datetime | None
|
| 28 |
-
"""The timestamp when the
|
| 29 |
created_at: datetime
|
| 30 |
"""An ISO 8601 timestamp."""
|
| 31 |
updated_at: datetime
|
| 32 |
"""An ISO 8601 timestamp."""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
waitlist_id: str | None = None
|
| 34 |
-
"""The unique ID of the
|
| 35 |
|
| 36 |
@classmethod
|
| 37 |
def from_dict(cls, data: dict[str, Any]) -> WaitlistUser:
|
| 38 |
"""Deserialize from a dictionary."""
|
| 39 |
try:
|
| 40 |
return cls(
|
| 41 |
-
object=data.get("object", "waitlist_user"),
|
| 42 |
id=data["id"],
|
| 43 |
email=data["email"],
|
| 44 |
state=WaitlistUserState(data["state"]),
|
|
@@ -47,6 +48,8 @@ class WaitlistUser:
|
|
| 47 |
else None,
|
| 48 |
created_at=_parse_datetime(data["created_at"]),
|
| 49 |
updated_at=_parse_datetime(data["updated_at"]),
|
|
|
|
|
|
|
| 50 |
waitlist_id=data.get("waitlist_id"),
|
| 51 |
)
|
| 52 |
except (KeyError, ValueError) as e:
|
|
@@ -55,7 +58,6 @@ class WaitlistUser:
|
|
| 55 |
def to_dict(self) -> dict[str, Any]:
|
| 56 |
"""Serialize to a dictionary."""
|
| 57 |
result: dict[str, Any] = {}
|
| 58 |
-
result["object"] = self.object
|
| 59 |
result["id"] = self.id
|
| 60 |
result["email"] = self.email
|
| 61 |
result["state"] = (
|
|
@@ -67,6 +69,9 @@ class WaitlistUser:
|
|
| 67 |
result["approved_at"] = None
|
| 68 |
result["created_at"] = _format_datetime(self.created_at)
|
| 69 |
result["updated_at"] = _format_datetime(self.updated_at)
|
|
|
|
|
|
|
|
|
|
| 70 |
if self.waitlist_id is not None:
|
| 71 |
result["waitlist_id"] = self.waitlist_id
|
| 72 |
else:
|
|
|
|
| 16 |
class WaitlistUser:
|
| 17 |
"""Waitlist User model."""
|
| 18 |
|
|
|
|
|
|
|
| 19 |
id: str
|
| 20 |
+
"""The unique ID of the waitlist entry."""
|
| 21 |
email: str
|
| 22 |
+
"""The email address of the user on the waitlist."""
|
| 23 |
state: WaitlistUserState
|
| 24 |
+
"""The state of the waitlist entry."""
|
| 25 |
approved_at: datetime | None
|
| 26 |
+
"""The timestamp when the entry was approved, or null if not yet approved."""
|
| 27 |
created_at: datetime
|
| 28 |
"""An ISO 8601 timestamp."""
|
| 29 |
updated_at: datetime
|
| 30 |
"""An ISO 8601 timestamp."""
|
| 31 |
+
object: Literal["waitlist_user"]
|
| 32 |
+
"""Distinguishes the Waitlist User object."""
|
| 33 |
+
additional_fields: dict[str, str] | None = None
|
| 34 |
+
"""Additional fields submitted when the user joined the waitlist. Values are user-provided — treat them as untrusted input when rendering or exporting."""
|
| 35 |
waitlist_id: str | None = None
|
| 36 |
+
"""The unique ID of the waitlist the entry belongs to."""
|
| 37 |
|
| 38 |
@classmethod
|
| 39 |
def from_dict(cls, data: dict[str, Any]) -> WaitlistUser:
|
| 40 |
"""Deserialize from a dictionary."""
|
| 41 |
try:
|
| 42 |
return cls(
|
|
|
|
| 43 |
id=data["id"],
|
| 44 |
email=data["email"],
|
| 45 |
state=WaitlistUserState(data["state"]),
|
|
|
|
| 48 |
else None,
|
| 49 |
created_at=_parse_datetime(data["created_at"]),
|
| 50 |
updated_at=_parse_datetime(data["updated_at"]),
|
| 51 |
+
object=data.get("object", "waitlist_user"),
|
| 52 |
+
additional_fields=data.get("additional_fields"),
|
| 53 |
waitlist_id=data.get("waitlist_id"),
|
| 54 |
)
|
| 55 |
except (KeyError, ValueError) as e:
|
|
|
|
| 58 |
def to_dict(self) -> dict[str, Any]:
|
| 59 |
"""Serialize to a dictionary."""
|
| 60 |
result: dict[str, Any] = {}
|
|
|
|
| 61 |
result["id"] = self.id
|
| 62 |
result["email"] = self.email
|
| 63 |
result["state"] = (
|
|
|
|
| 69 |
result["approved_at"] = None
|
| 70 |
result["created_at"] = _format_datetime(self.created_at)
|
| 71 |
result["updated_at"] = _format_datetime(self.updated_at)
|
| 72 |
+
result["object"] = self.object
|
| 73 |
+
if self.additional_fields is not None:
|
| 74 |
+
result["additional_fields"] = self.additional_fields
|
| 75 |
if self.waitlist_id is not None:
|
| 76 |
result["waitlist_id"] = self.waitlist_id
|
| 77 |
else:
|
python/src/workos/organizations/_resource.py|
@@ -98,7 +98,7 @@ class Organizations:
|
|
| 98 |
Args:
|
| 99 |
name: The name of the organization.
|
| 100 |
allow_profiles_outside_organization: Whether the organization allows profiles from outside the organization to sign in.
|
| 101 |
-
domains: The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 102 |
domain_data: The domains associated with the organization, including verification state.
|
| 103 |
metadata: Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 104 |
external_id: An external identifier for the Organization.
|
|
@@ -451,7 +451,7 @@ class AsyncOrganizations:
|
|
| 451 |
Args:
|
| 452 |
name: The name of the organization.
|
| 453 |
allow_profiles_outside_organization: Whether the organization allows profiles from outside the organization to sign in.
|
| 454 |
-
domains: The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 455 |
domain_data: The domains associated with the organization, including verification state.
|
| 456 |
metadata: Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 457 |
external_id: An external identifier for the Organization.
|
|
|
|
| 98 |
Args:
|
| 99 |
name: The name of the organization.
|
| 100 |
allow_profiles_outside_organization: Whether the organization allows profiles from outside the organization to sign in.
|
| 101 |
+
domains: (deprecated) The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 102 |
domain_data: The domains associated with the organization, including verification state.
|
| 103 |
metadata: Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 104 |
external_id: An external identifier for the Organization.
|
|
|
|
| 451 |
Args:
|
| 452 |
name: The name of the organization.
|
| 453 |
allow_profiles_outside_organization: Whether the organization allows profiles from outside the organization to sign in.
|
| 454 |
+
domains: (deprecated) The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 455 |
domain_data: The domains associated with the organization, including verification state.
|
| 456 |
metadata: Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 457 |
external_id: An external identifier for the Organization.
|
python/src/workos/organizations/models/organization_input.py|
@@ -19,7 +19,9 @@ class OrganizationInput:
|
|
| 19 |
allow_profiles_outside_organization: bool | None = None
|
| 20 |
"""Whether the organization allows profiles from outside the organization to sign in."""
|
| 21 |
domains: list[str] | None = None
|
| 22 |
-
"""The domains associated with the organization. Deprecated in favor of `domain_data`.
|
|
|
|
|
|
|
| 23 |
domain_data: list[OrganizationDomainData] | None = None
|
| 24 |
"""The domains associated with the organization, including verification state."""
|
| 25 |
metadata: dict[str, str] | None = None
|
|
|
|
| 19 |
allow_profiles_outside_organization: bool | None = None
|
| 20 |
"""Whether the organization allows profiles from outside the organization to sign in."""
|
| 21 |
domains: list[str] | None = None
|
| 22 |
+
"""The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 23 |
+
|
| 24 |
+
.. deprecated:: This field is deprecated."""
|
| 25 |
domain_data: list[OrganizationDomainData] | None = None
|
| 26 |
"""The domains associated with the organization, including verification state."""
|
| 27 |
metadata: dict[str, str] | None = None
|
python/src/workos/organizations_it_contacts/__init__.py|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from ._resource import AsyncOrganizationsItContacts as AsyncOrganizationsItContacts
|
| 4 |
+
from ._resource import OrganizationsItContacts as OrganizationsItContacts
|
| 5 |
+
from .models import *
|
python/src/workos/organizations_it_contacts/_resource.py|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import TYPE_CHECKING, Any
|
| 6 |
+
|
| 7 |
+
if TYPE_CHECKING:
|
| 8 |
+
from .._client import AsyncWorkOSClient, WorkOSClient
|
| 9 |
+
|
| 10 |
+
from .._types import RequestOptions
|
| 11 |
+
from .models import ItContact, ItContactList
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class OrganizationsItContacts:
|
| 15 |
+
"""Organizations It Contacts API resources."""
|
| 16 |
+
|
| 17 |
+
def __init__(self, client: WorkOSClient) -> None:
|
| 18 |
+
self._client = client
|
| 19 |
+
|
| 20 |
+
def list_organization_it_contacts(
|
| 21 |
+
self,
|
| 22 |
+
organization_id: str,
|
| 23 |
+
*,
|
| 24 |
+
request_options: RequestOptions | None = None,
|
| 25 |
+
) -> ItContactList:
|
| 26 |
+
"""List IT contacts
|
| 27 |
+
|
| 28 |
+
Get the IT contacts for an organization.
|
| 29 |
+
|
| 30 |
+
Args:
|
| 31 |
+
organization_id: The ID of the organization.
|
| 32 |
+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 33 |
+
|
| 34 |
+
Returns:
|
| 35 |
+
ItContactList
|
| 36 |
+
|
| 37 |
+
Raises:
|
| 38 |
+
AuthorizationError: If the request is forbidden (403).
|
| 39 |
+
NotFoundError: If the resource is not found (404).
|
| 40 |
+
AuthenticationError: If the API key is invalid (401).
|
| 41 |
+
RateLimitExceededError: If rate limited (429).
|
| 42 |
+
ServerError: If the server returns a 5xx error.
|
| 43 |
+
"""
|
| 44 |
+
return self._client.request(
|
| 45 |
+
method="get",
|
| 46 |
+
path=("organizations", str(organization_id), "it_contacts"),
|
| 47 |
+
model=ItContactList,
|
| 48 |
+
request_options=request_options,
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
def create_organization_it_contact(
|
| 52 |
+
self,
|
| 53 |
+
organization_id: str,
|
| 54 |
+
*,
|
| 55 |
+
email: str,
|
| 56 |
+
request_options: RequestOptions | None = None,
|
| 57 |
+
) -> ItContact:
|
| 58 |
+
"""Create an IT contact
|
| 59 |
+
|
| 60 |
+
Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.
|
| 61 |
+
|
| 62 |
+
Args:
|
| 63 |
+
organization_id: The ID of the organization.
|
| 64 |
+
email: The email address of the IT contact.
|
| 65 |
+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 66 |
+
|
| 67 |
+
Returns:
|
| 68 |
+
ItContact
|
| 69 |
+
|
| 70 |
+
Raises:
|
| 71 |
+
AuthorizationError: If the request is forbidden (403).
|
| 72 |
+
NotFoundError: If the resource is not found (404).
|
| 73 |
+
ConflictError: If a conflict occurs (409).
|
| 74 |
+
UnprocessableEntityError: If the request data is unprocessable (422).
|
| 75 |
+
AuthenticationError: If the API key is invalid (401).
|
| 76 |
+
RateLimitExceededError: If rate limited (429).
|
| 77 |
+
ServerError: If the server returns a 5xx error.
|
| 78 |
+
"""
|
| 79 |
+
body: dict[str, Any] = {
|
| 80 |
+
"email": email,
|
| 81 |
+
}
|
| 82 |
+
return self._client.request(
|
| 83 |
+
method="post",
|
| 84 |
+
path=("organizations", str(organization_id), "it_contacts"),
|
| 85 |
+
body=body,
|
| 86 |
+
model=ItContact,
|
| 87 |
+
request_options=request_options,
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
def delete_organization_it_contact(
|
| 91 |
+
self,
|
| 92 |
+
organization_id: str,
|
| 93 |
+
contact_id: str,
|
| 94 |
+
*,
|
| 95 |
+
request_options: RequestOptions | None = None,
|
| 96 |
+
) -> None:
|
| 97 |
+
"""Delete an IT contact
|
| 98 |
+
|
| 99 |
+
Remove an IT contact from an organization.
|
| 100 |
+
|
| 101 |
+
Args:
|
| 102 |
+
organization_id: The ID of the organization.
|
| 103 |
+
contact_id: The ID of the IT contact.
|
| 104 |
+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 105 |
+
|
| 106 |
+
Raises:
|
| 107 |
+
AuthorizationError: If the request is forbidden (403).
|
| 108 |
+
NotFoundError: If the resource is not found (404).
|
| 109 |
+
AuthenticationError: If the API key is invalid (401).
|
| 110 |
+
RateLimitExceededError: If rate limited (429).
|
| 111 |
+
ServerError: If the server returns a 5xx error.
|
| 112 |
+
"""
|
| 113 |
+
self._client.request(
|
| 114 |
+
method="delete",
|
| 115 |
+
path=(
|
| 116 |
+
"organizations",
|
| 117 |
+
str(organization_id),
|
| 118 |
+
"it_contacts",
|
| 119 |
+
str(contact_id),
|
| 120 |
+
),
|
| 121 |
+
request_options=request_options,
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
class AsyncOrganizationsItContacts:
|
| 126 |
+
"""Organizations It Contacts API resources (async)."""
|
| 127 |
+
|
| 128 |
+
def __init__(self, client: AsyncWorkOSClient) -> None:
|
| 129 |
+
self._client = client
|
| 130 |
+
|
| 131 |
+
async def list_organization_it_contacts(
|
| 132 |
+
self,
|
| 133 |
+
organization_id: str,
|
| 134 |
+
*,
|
| 135 |
+
request_options: RequestOptions | None = None,
|
| 136 |
+
) -> ItContactList:
|
| 137 |
+
"""List IT contacts
|
| 138 |
+
|
| 139 |
+
Get the IT contacts for an organization.
|
| 140 |
+
|
| 141 |
+
Args:
|
| 142 |
+
organization_id: The ID of the organization.
|
| 143 |
+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 144 |
+
|
| 145 |
+
Returns:
|
| 146 |
+
ItContactList
|
| 147 |
+
|
| 148 |
+
Raises:
|
| 149 |
+
AuthorizationError: If the request is forbidden (403).
|
| 150 |
+
NotFoundError: If the resource is not found (404).
|
| 151 |
+
AuthenticationError: If the API key is invalid (401).
|
| 152 |
+
RateLimitExceededError: If rate limited (429).
|
| 153 |
+
ServerError: If the server returns a 5xx error.
|
| 154 |
+
"""
|
| 155 |
+
return await self._client.request(
|
| 156 |
+
method="get",
|
| 157 |
+
path=("organizations", str(organization_id), "it_contacts"),
|
| 158 |
+
model=ItContactList,
|
| 159 |
+
request_options=request_options,
|
| 160 |
+
)
|
| 161 |
+
|
| 162 |
+
async def create_organization_it_contact(
|
| 163 |
+
self,
|
| 164 |
+
organization_id: str,
|
| 165 |
+
*,
|
| 166 |
+
email: str,
|
| 167 |
+
request_options: RequestOptions | None = None,
|
| 168 |
+
) -> ItContact:
|
| 169 |
+
"""Create an IT contact
|
| 170 |
+
|
| 171 |
+
Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.
|
| 172 |
+
|
| 173 |
+
Args:
|
| 174 |
+
organization_id: The ID of the organization.
|
| 175 |
+
email: The email address of the IT contact.
|
| 176 |
+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 177 |
+
|
| 178 |
+
Returns:
|
| 179 |
+
ItContact
|
| 180 |
+
|
| 181 |
+
Raises:
|
| 182 |
+
AuthorizationError: If the request is forbidden (403).
|
| 183 |
+
NotFoundError: If the resource is not found (404).
|
| 184 |
+
ConflictError: If a conflict occurs (409).
|
| 185 |
+
UnprocessableEntityError: If the request data is unprocessable (422).
|
| 186 |
+
AuthenticationError: If the API key is invalid (401).
|
| 187 |
+
RateLimitExceededError: If rate limited (429).
|
| 188 |
+
ServerError: If the server returns a 5xx error.
|
| 189 |
+
"""
|
| 190 |
+
body: dict[str, Any] = {
|
| 191 |
+
"email": email,
|
| 192 |
+
}
|
| 193 |
+
return await self._client.request(
|
| 194 |
+
method="post",
|
| 195 |
+
path=("organizations", str(organization_id), "it_contacts"),
|
| 196 |
+
body=body,
|
| 197 |
+
model=ItContact,
|
| 198 |
+
request_options=request_options,
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
async def delete_organization_it_contact(
|
| 202 |
+
self,
|
| 203 |
+
organization_id: str,
|
| 204 |
+
contact_id: str,
|
| 205 |
+
*,
|
| 206 |
+
request_options: RequestOptions | None = None,
|
| 207 |
+
) -> None:
|
| 208 |
+
"""Delete an IT contact
|
| 209 |
+
|
| 210 |
+
Remove an IT contact from an organization.
|
| 211 |
+
|
| 212 |
+
Args:
|
| 213 |
+
organization_id: The ID of the organization.
|
| 214 |
+
contact_id: The ID of the IT contact.
|
| 215 |
+
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 216 |
+
|
| 217 |
+
Raises:
|
| 218 |
+
AuthorizationError: If the request is forbidden (403).
|
| 219 |
+
NotFoundError: If the resource is not found (404).
|
| 220 |
+
AuthenticationError: If the API key is invalid (401).
|
| 221 |
+
RateLimitExceededError: If rate limited (429).
|
| 222 |
+
ServerError: If the server returns a 5xx error.
|
| 223 |
+
"""
|
| 224 |
+
await self._client.request(
|
| 225 |
+
method="delete",
|
| 226 |
+
path=(
|
| 227 |
+
"organizations",
|
| 228 |
+
str(organization_id),
|
| 229 |
+
"it_contacts",
|
| 230 |
+
str(contact_id),
|
| 231 |
+
),
|
| 232 |
+
request_options=request_options,
|
| 233 |
+
)
|
python/src/workos/organizations_it_contacts/models/__init__.py|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from .create_it_contact import CreateItContact as CreateItContact
|
| 4 |
+
from .it_contact import ItContact as ItContact
|
| 5 |
+
from .it_contact_list import ItContactList as ItContactList
|
| 6 |
+
from .it_contact_list_list_metadata import (
|
| 7 |
+
ItContactListListMetadata as ItContactListListMetadata,
|
| 8 |
+
)
|
python/src/workos/organizations_it_contacts/models/create_it_contact.py|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass
|
| 6 |
+
from typing import Any
|
| 7 |
+
|
| 8 |
+
from workos._types import _raise_deserialize_error
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
@dataclass(slots=True)
|
| 12 |
+
class CreateItContact:
|
| 13 |
+
"""Create It Contact model."""
|
| 14 |
+
|
| 15 |
+
email: str
|
| 16 |
+
"""The email address of the IT contact."""
|
| 17 |
+
|
| 18 |
+
@classmethod
|
| 19 |
+
def from_dict(cls, data: dict[str, Any]) -> CreateItContact:
|
| 20 |
+
"""Deserialize from a dictionary."""
|
| 21 |
+
try:
|
| 22 |
+
return cls(
|
| 23 |
+
email=data["email"],
|
| 24 |
+
)
|
| 25 |
+
except (KeyError, ValueError) as e:
|
| 26 |
+
_raise_deserialize_error("CreateItContact", e)
|
| 27 |
+
|
| 28 |
+
def to_dict(self) -> dict[str, Any]:
|
| 29 |
+
"""Serialize to a dictionary."""
|
| 30 |
+
result: dict[str, Any] = {}
|
| 31 |
+
result["email"] = self.email
|
| 32 |
+
return result
|
python/src/workos/organizations_it_contacts/models/it_contact.py|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass
|
| 6 |
+
from datetime import datetime
|
| 7 |
+
from typing import Any, Literal
|
| 8 |
+
|
| 9 |
+
from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
@dataclass(slots=True)
|
| 13 |
+
class ItContact:
|
| 14 |
+
"""It Contact model."""
|
| 15 |
+
|
| 16 |
+
object: Literal["it_contact"]
|
| 17 |
+
"""The IT Contact object."""
|
| 18 |
+
id: str
|
| 19 |
+
"""The unique ID of the IT Contact."""
|
| 20 |
+
email: str
|
| 21 |
+
"""The email address of the IT Contact."""
|
| 22 |
+
created_at: datetime
|
| 23 |
+
"""An ISO 8601 timestamp."""
|
| 24 |
+
updated_at: datetime
|
| 25 |
+
"""An ISO 8601 timestamp."""
|
| 26 |
+
|
| 27 |
+
@classmethod
|
| 28 |
+
def from_dict(cls, data: dict[str, Any]) -> ItContact:
|
| 29 |
+
"""Deserialize from a dictionary."""
|
| 30 |
+
try:
|
| 31 |
+
return cls(
|
| 32 |
+
object=data.get("object", "it_contact"),
|
| 33 |
+
id=data["id"],
|
| 34 |
+
email=data["email"],
|
| 35 |
+
created_at=_parse_datetime(data["created_at"]),
|
| 36 |
+
updated_at=_parse_datetime(data["updated_at"]),
|
| 37 |
+
)
|
| 38 |
+
except (KeyError, ValueError) as e:
|
| 39 |
+
_raise_deserialize_error("ItContact", e)
|
| 40 |
+
|
| 41 |
+
def to_dict(self) -> dict[str, Any]:
|
| 42 |
+
"""Serialize to a dictionary."""
|
| 43 |
+
result: dict[str, Any] = {}
|
| 44 |
+
result["object"] = self.object
|
| 45 |
+
result["id"] = self.id
|
| 46 |
+
result["email"] = self.email
|
| 47 |
+
result["created_at"] = _format_datetime(self.created_at)
|
| 48 |
+
result["updated_at"] = _format_datetime(self.updated_at)
|
| 49 |
+
return result
|
python/src/workos/organizations_it_contacts/models/it_contact_list.py|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from dataclasses import dataclass
|
| 6 |
+
from typing import Any, Literal, cast
|
| 7 |
+
|
| 8 |
+
from workos._types import _raise_deserialize_error
|
| 9 |
+
|
| 10 |
+
from .it_contact import ItContact
|
| 11 |
+
from .it_contact_list_list_metadata import ItContactListListMetadata
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@dataclass(slots=True)
|
| 15 |
+
class ItContactList:
|
| 16 |
+
"""It Contact List model."""
|
| 17 |
+
|
| 18 |
+
object: Literal["list"]
|
| 19 |
+
"""Indicates this is a list response."""
|
| 20 |
+
data: list[ItContact]
|
| 21 |
+
"""The list of records for the current page."""
|
| 22 |
+
list_metadata: ItContactListListMetadata
|
| 23 |
+
"""Pagination cursors for navigating between pages of results."""
|
| 24 |
+
|
| 25 |
+
@classmethod
|
| 26 |
+
def from_dict(cls, data: dict[str, Any]) -> ItContactList:
|
| 27 |
+
"""Deserialize from a dictionary."""
|
| 28 |
+
try:
|
| 29 |
+
return cls(
|
| 30 |
+
object=data.get("object", "list"),
|
| 31 |
+
data=[
|
| 32 |
+
ItContact.from_dict(cast(dict[str, Any], item))
|
| 33 |
+
for item in cast(list[Any], data["data"])
|
| 34 |
+
],
|
| 35 |
+
list_metadata=ItContactListListMetadata.from_dict(
|
| 36 |
+
cast(dict[str, Any], data["list_metadata"])
|
| 37 |
+
),
|
| 38 |
+
)
|
| 39 |
+
except (KeyError, ValueError) as e:
|
| 40 |
+
_raise_deserialize_error("ItContactList", e)
|
| 41 |
+
|
| 42 |
+
def to_dict(self) -> dict[str, Any]:
|
| 43 |
+
"""Serialize to a dictionary."""
|
| 44 |
+
result: dict[str, Any] = {}
|
| 45 |
+
result["object"] = self.object
|
| 46 |
+
result["data"] = [item.to_dict() for item in self.data]
|
| 47 |
+
result["list_metadata"] = self.list_metadata.to_dict()
|
| 48 |
+
return result
|
python/src/workos/organizations_it_contacts/models/it_contact_list_list_metadata.py|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from typing import TypeAlias
|
| 4 |
+
|
| 5 |
+
from workos.common.models.authorization_permission_list_list_metadata import (
|
| 6 |
+
AuthorizationPermissionListListMetadata,
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
ItContactListListMetadata: TypeAlias = AuthorizationPermissionListListMetadata
|
python/src/workos/types/organizations_it_contacts/__init__.py|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from workos.organizations_it_contacts.models import *
|
python/src/workos/user_management/_resource.py|
@@ -1324,7 +1324,6 @@ class UserManagement:
|
|
| 1324 |
|
| 1325 |
Raises:
|
| 1326 |
NotFoundError: If the resource is not found (404).
|
| 1327 |
-
ConflictError: If a conflict occurs (409).
|
| 1328 |
AuthenticationError: If the API key is invalid (401).
|
| 1329 |
RateLimitExceededError: If rate limited (429).
|
| 1330 |
ServerError: If the server returns a 5xx error.
|
|
@@ -3692,7 +3691,6 @@ class AsyncUserManagement:
|
|
| 3692 |
|
| 3693 |
Raises:
|
| 3694 |
NotFoundError: If the resource is not found (404).
|
| 3695 |
-
ConflictError: If a conflict occurs (409).
|
| 3696 |
AuthenticationError: If the API key is invalid (401).
|
| 3697 |
RateLimitExceededError: If rate limited (429).
|
| 3698 |
ServerError: If the server returns a 5xx error.
|
|
|
|
| 1324 |
|
| 1325 |
Raises:
|
| 1326 |
NotFoundError: If the resource is not found (404).
|
|
|
|
| 1327 |
AuthenticationError: If the API key is invalid (401).
|
| 1328 |
RateLimitExceededError: If rate limited (429).
|
| 1329 |
ServerError: If the server returns a 5xx error.
|
|
|
|
| 3691 |
|
| 3692 |
Raises:
|
| 3693 |
NotFoundError: If the resource is not found (404).
|
|
|
|
| 3694 |
AuthenticationError: If the API key is invalid (401).
|
| 3695 |
RateLimitExceededError: If rate limited (429).
|
| 3696 |
ServerError: If the server returns a 5xx error.
|
python/src/workos/user_management/models/create_password_reset_token.py|
@@ -1,32 +1,7 @@
|
|
| 1 |
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
|
| 3 |
-
from
|
| 4 |
|
| 5 |
-
from
|
| 6 |
-
from typing import Any
|
| 7 |
|
| 8 |
-
from workos._types import _raise_deserialize_error
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
@dataclass(slots=True)
|
| 12 |
-
class CreatePasswordResetToken:
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
email: str
|
| 16 |
-
"""The email address of the user requesting a password reset."""
|
| 17 |
-
|
| 18 |
-
@classmethod
|
| 19 |
-
def from_dict(cls, data: dict[str, Any]) -> CreatePasswordResetToken:
|
| 20 |
-
"""Deserialize from a dictionary."""
|
| 21 |
-
try:
|
| 22 |
-
return cls(
|
| 23 |
-
email=data["email"],
|
| 24 |
-
)
|
| 25 |
-
except (KeyError, ValueError) as e:
|
| 26 |
-
_raise_deserialize_error("CreatePasswordResetToken", e)
|
| 27 |
-
|
| 28 |
-
def to_dict(self) -> dict[str, Any]:
|
| 29 |
-
"""Serialize to a dictionary."""
|
| 30 |
-
result: dict[str, Any] = {}
|
| 31 |
-
result["email"] = self.email
|
| 32 |
-
return result
|
|
|
|
| 1 |
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
|
| 3 |
+
from typing import TypeAlias
|
| 4 |
|
| 5 |
+
from workos.organizations_it_contacts.models.create_it_contact import CreateItContact
|
|
|
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
+
CreatePasswordResetToken: TypeAlias = CreateItContact
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
python/tests/fixtures/create_it_contact.json|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"email": "it-contact@example.com"
|
| 3 |
+
}
|
python/tests/fixtures/it_contact.json|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "it_contact",
|
| 3 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 4 |
+
"email": "it-contact@example.com",
|
| 5 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 6 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 7 |
+
}
|
python/tests/fixtures/it_contact_list.json|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "list",
|
| 3 |
+
"data": [
|
| 4 |
+
{
|
| 5 |
+
"object": "it_contact",
|
| 6 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 7 |
+
"email": "it-contact@example.com",
|
| 8 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 10 |
+
}
|
| 11 |
+
],
|
| 12 |
+
"list_metadata": {
|
| 13 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 14 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 15 |
+
}
|
| 16 |
+
}
|
python/tests/fixtures/it_contact_list_list_metadata.json|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 3 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 4 |
+
}
|
python/tests/fixtures/waitlist_user.json|
@@ -1,10 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
"object": "waitlist_user",
|
| 3 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 4 |
"email": "marcelina.davis@example.com",
|
| 5 |
"state": "pending",
|
| 6 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 7 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 10 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 3 |
"email": "marcelina.davis@example.com",
|
| 4 |
"state": "pending",
|
| 5 |
"approved_at": null,
|
| 6 |
+
"additional_fields": {
|
| 7 |
+
"company": "Example Corp"
|
| 8 |
+
},
|
| 9 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 10 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 11 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
+
"object": "waitlist_user"
|
| 13 |
}
|
python/tests/fixtures/waitlist_user_approved.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
python/tests/fixtures/waitlist_user_created.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
python/tests/fixtures/waitlist_user_denied.json|
@@ -3,14 +3,17 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": null,
|
|
|
|
|
|
|
|
|
|
| 11 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 12 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 14 |
},
|
| 15 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
"context": {
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": null,
|
| 10 |
+
"additional_fields": {
|
| 11 |
+
"company": "Example Corp"
|
| 12 |
+
},
|
| 13 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 15 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 16 |
+
"object": "waitlist_user"
|
| 17 |
},
|
| 18 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 19 |
"context": {
|
python/tests/test_common_models_round_trip.py|
@@ -719,34 +719,50 @@ class TestModelRoundTrip:
|
|
| 719 |
|
| 720 |
def test_waitlist_user_minimal_payload(self):
|
| 721 |
data = {
|
| 722 |
-
"object": "waitlist_user",
|
| 723 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 724 |
"email": "marcelina.davis@example.com",
|
| 725 |
"state": "pending",
|
| 726 |
"approved_at": None,
|
| 727 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 728 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 729 |
}
|
| 730 |
instance = WaitlistUser.from_dict(data)
|
| 731 |
serialized = instance.to_dict()
|
| 732 |
-
assert serialized["object"] == data["object"]
|
| 733 |
assert serialized["id"] == data["id"]
|
| 734 |
assert serialized["email"] == data["email"]
|
| 735 |
assert serialized["state"] == data["state"]
|
| 736 |
assert serialized["approved_at"] == data["approved_at"]
|
| 737 |
assert serialized["created_at"] == data["created_at"]
|
| 738 |
assert serialized["updated_at"] == data["updated_at"]
|
|
|
|
| 739 |
|
| 740 |
-
def
|
| 741 |
data = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 742 |
"object": "waitlist_user",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 743 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 744 |
"email": "marcelina.davis@example.com",
|
| 745 |
"state": "pending",
|
| 746 |
"approved_at": None,
|
|
|
|
| 747 |
"waitlist_id": None,
|
| 748 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 749 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 750 |
}
|
| 751 |
instance = WaitlistUser.from_dict(data)
|
| 752 |
serialized = instance.to_dict()
|
|
@@ -755,14 +771,15 @@ class TestModelRoundTrip:
|
|
| 755 |
|
| 756 |
def test_waitlist_user_round_trips_unknown_enum_values(self):
|
| 757 |
data = {
|
| 758 |
-
"object": "waitlist_user",
|
| 759 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 760 |
"email": "marcelina.davis@example.com",
|
| 761 |
"state": "unexpected_waitlist_user_state",
|
| 762 |
"approved_at": None,
|
|
|
|
| 763 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 764 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 765 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 766 |
}
|
| 767 |
instance = WaitlistUser.from_dict(data)
|
| 768 |
assert instance.to_dict() == data
|
|
@@ -13574,14 +13591,15 @@ class TestModelRoundTrip:
|
|
| 13574 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13575 |
"event": "waitlist_user.approved",
|
| 13576 |
"data": {
|
| 13577 |
-
"object": "waitlist_user",
|
| 13578 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13579 |
"email": "marcelina.davis@example.com",
|
| 13580 |
"state": "pending",
|
| 13581 |
"approved_at": None,
|
|
|
|
| 13582 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13583 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13584 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 13585 |
},
|
| 13586 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13587 |
}
|
|
@@ -13599,14 +13617,15 @@ class TestModelRoundTrip:
|
|
| 13599 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13600 |
"event": "waitlist_user.approved",
|
| 13601 |
"data": {
|
| 13602 |
-
"object": "waitlist_user",
|
| 13603 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13604 |
"email": "marcelina.davis@example.com",
|
| 13605 |
"state": "pending",
|
| 13606 |
"approved_at": None,
|
|
|
|
| 13607 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13608 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13609 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 13610 |
},
|
| 13611 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13612 |
}
|
|
@@ -13628,14 +13647,15 @@ class TestModelRoundTrip:
|
|
| 13628 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13629 |
"event": "waitlist_user.created",
|
| 13630 |
"data": {
|
| 13631 |
-
"object": "waitlist_user",
|
| 13632 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13633 |
"email": "marcelina.davis@example.com",
|
| 13634 |
"state": "pending",
|
| 13635 |
"approved_at": None,
|
|
|
|
| 13636 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13637 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13638 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 13639 |
},
|
| 13640 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13641 |
}
|
|
@@ -13653,14 +13673,15 @@ class TestModelRoundTrip:
|
|
| 13653 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13654 |
"event": "waitlist_user.created",
|
| 13655 |
"data": {
|
| 13656 |
-
"object": "waitlist_user",
|
| 13657 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13658 |
"email": "marcelina.davis@example.com",
|
| 13659 |
"state": "pending",
|
| 13660 |
"approved_at": None,
|
|
|
|
| 13661 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13662 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13663 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 13664 |
},
|
| 13665 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13666 |
}
|
|
@@ -13682,14 +13703,15 @@ class TestModelRoundTrip:
|
|
| 13682 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13683 |
"event": "waitlist_user.denied",
|
| 13684 |
"data": {
|
| 13685 |
-
"object": "waitlist_user",
|
| 13686 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13687 |
"email": "marcelina.davis@example.com",
|
| 13688 |
"state": "pending",
|
| 13689 |
"approved_at": None,
|
|
|
|
| 13690 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13691 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13692 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 13693 |
},
|
| 13694 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13695 |
}
|
|
@@ -13707,14 +13729,15 @@ class TestModelRoundTrip:
|
|
| 13707 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13708 |
"event": "waitlist_user.denied",
|
| 13709 |
"data": {
|
| 13710 |
-
"object": "waitlist_user",
|
| 13711 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13712 |
"email": "marcelina.davis@example.com",
|
| 13713 |
"state": "pending",
|
| 13714 |
"approved_at": None,
|
|
|
|
| 13715 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13716 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13717 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
|
|
|
| 13718 |
},
|
| 13719 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13720 |
}
|
|
|
|
| 719 |
|
| 720 |
def test_waitlist_user_minimal_payload(self):
|
| 721 |
data = {
|
|
|
|
| 722 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 723 |
"email": "marcelina.davis@example.com",
|
| 724 |
"state": "pending",
|
| 725 |
"approved_at": None,
|
| 726 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 727 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 728 |
+
"object": "waitlist_user",
|
| 729 |
}
|
| 730 |
instance = WaitlistUser.from_dict(data)
|
| 731 |
serialized = instance.to_dict()
|
|
|
|
| 732 |
assert serialized["id"] == data["id"]
|
| 733 |
assert serialized["email"] == data["email"]
|
| 734 |
assert serialized["state"] == data["state"]
|
| 735 |
assert serialized["approved_at"] == data["approved_at"]
|
| 736 |
assert serialized["created_at"] == data["created_at"]
|
| 737 |
assert serialized["updated_at"] == data["updated_at"]
|
| 738 |
+
assert serialized["object"] == data["object"]
|
| 739 |
|
| 740 |
+
def test_waitlist_user_omits_absent_optional_non_nullable_fields(self):
|
| 741 |
data = {
|
| 742 |
+
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 743 |
+
"email": "marcelina.davis@example.com",
|
| 744 |
+
"state": "pending",
|
| 745 |
+
"approved_at": None,
|
| 746 |
+
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 747 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 748 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 749 |
"object": "waitlist_user",
|
| 750 |
+
}
|
| 751 |
+
instance = WaitlistUser.from_dict(data)
|
| 752 |
+
serialized = instance.to_dict()
|
| 753 |
+
assert "additional_fields" not in serialized
|
| 754 |
+
|
| 755 |
+
def test_waitlist_user_preserves_nullable_fields(self):
|
| 756 |
+
data = {
|
| 757 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 758 |
"email": "marcelina.davis@example.com",
|
| 759 |
"state": "pending",
|
| 760 |
"approved_at": None,
|
| 761 |
+
"additional_fields": {"company": "Example Corp"},
|
| 762 |
"waitlist_id": None,
|
| 763 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 764 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 765 |
+
"object": "waitlist_user",
|
| 766 |
}
|
| 767 |
instance = WaitlistUser.from_dict(data)
|
| 768 |
serialized = instance.to_dict()
|
|
|
|
| 771 |
|
| 772 |
def test_waitlist_user_round_trips_unknown_enum_values(self):
|
| 773 |
data = {
|
|
|
|
| 774 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 775 |
"email": "marcelina.davis@example.com",
|
| 776 |
"state": "unexpected_waitlist_user_state",
|
| 777 |
"approved_at": None,
|
| 778 |
+
"additional_fields": {"company": "Example Corp"},
|
| 779 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 780 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 781 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 782 |
+
"object": "waitlist_user",
|
| 783 |
}
|
| 784 |
instance = WaitlistUser.from_dict(data)
|
| 785 |
assert instance.to_dict() == data
|
|
|
|
| 13591 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13592 |
"event": "waitlist_user.approved",
|
| 13593 |
"data": {
|
|
|
|
| 13594 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13595 |
"email": "marcelina.davis@example.com",
|
| 13596 |
"state": "pending",
|
| 13597 |
"approved_at": None,
|
| 13598 |
+
"additional_fields": {"company": "Example Corp"},
|
| 13599 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13600 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13601 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 13602 |
+
"object": "waitlist_user",
|
| 13603 |
},
|
| 13604 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13605 |
}
|
|
|
|
| 13617 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13618 |
"event": "waitlist_user.approved",
|
| 13619 |
"data": {
|
|
|
|
| 13620 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13621 |
"email": "marcelina.davis@example.com",
|
| 13622 |
"state": "pending",
|
| 13623 |
"approved_at": None,
|
| 13624 |
+
"additional_fields": {"company": "Example Corp"},
|
| 13625 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13626 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13627 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 13628 |
+
"object": "waitlist_user",
|
| 13629 |
},
|
| 13630 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13631 |
}
|
|
|
|
| 13647 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13648 |
"event": "waitlist_user.created",
|
| 13649 |
"data": {
|
|
|
|
| 13650 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13651 |
"email": "marcelina.davis@example.com",
|
| 13652 |
"state": "pending",
|
| 13653 |
"approved_at": None,
|
| 13654 |
+
"additional_fields": {"company": "Example Corp"},
|
| 13655 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13656 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13657 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 13658 |
+
"object": "waitlist_user",
|
| 13659 |
},
|
| 13660 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13661 |
}
|
|
|
|
| 13673 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13674 |
"event": "waitlist_user.created",
|
| 13675 |
"data": {
|
|
|
|
| 13676 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13677 |
"email": "marcelina.davis@example.com",
|
| 13678 |
"state": "pending",
|
| 13679 |
"approved_at": None,
|
| 13680 |
+
"additional_fields": {"company": "Example Corp"},
|
| 13681 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13682 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13683 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 13684 |
+
"object": "waitlist_user",
|
| 13685 |
},
|
| 13686 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13687 |
}
|
|
|
|
| 13703 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13704 |
"event": "waitlist_user.denied",
|
| 13705 |
"data": {
|
|
|
|
| 13706 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13707 |
"email": "marcelina.davis@example.com",
|
| 13708 |
"state": "pending",
|
| 13709 |
"approved_at": None,
|
| 13710 |
+
"additional_fields": {"company": "Example Corp"},
|
| 13711 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13712 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13713 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 13714 |
+
"object": "waitlist_user",
|
| 13715 |
},
|
| 13716 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13717 |
}
|
|
|
|
| 13729 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 13730 |
"event": "waitlist_user.denied",
|
| 13731 |
"data": {
|
|
|
|
| 13732 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13733 |
"email": "marcelina.davis@example.com",
|
| 13734 |
"state": "pending",
|
| 13735 |
"approved_at": None,
|
| 13736 |
+
"additional_fields": {"company": "Example Corp"},
|
| 13737 |
"waitlist_id": "waitlist_01E4ZCR3C56J083X43JQXF3JK5",
|
| 13738 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13739 |
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 13740 |
+
"object": "waitlist_user",
|
| 13741 |
},
|
| 13742 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 13743 |
}
|
python/tests/test_organizations_it_contacts.py|
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
import pytest
|
| 6 |
+
|
| 7 |
+
from tests.generated_helpers import load_fixture
|
| 8 |
+
from workos import AsyncWorkOSClient, WorkOSClient
|
| 9 |
+
from workos._errors import (
|
| 10 |
+
AuthenticationError,
|
| 11 |
+
BadRequestError,
|
| 12 |
+
NotFoundError,
|
| 13 |
+
RateLimitExceededError,
|
| 14 |
+
ServerError,
|
| 15 |
+
UnprocessableEntityError,
|
| 16 |
+
)
|
| 17 |
+
from workos.organizations_it_contacts.models import ItContact, ItContactList
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class TestOrganizationsItContacts:
|
| 21 |
+
def test_list_organization_it_contacts(self, workos, httpx_mock):
|
| 22 |
+
httpx_mock.add_response(
|
| 23 |
+
json=load_fixture("it_contact_list.json"),
|
| 24 |
+
)
|
| 25 |
+
result = workos.organizations_it_contacts.list_organization_it_contacts(
|
| 26 |
+
"test_organization_id"
|
| 27 |
+
)
|
| 28 |
+
assert isinstance(result, ItContactList)
|
| 29 |
+
assert result.object == "list"
|
| 30 |
+
request = httpx_mock.get_request()
|
| 31 |
+
assert request.method == "GET"
|
| 32 |
+
assert request.url.path.endswith(
|
| 33 |
+
"/organizations/test_organization_id/it_contacts"
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
def test_create_organization_it_contact(self, workos, httpx_mock):
|
| 37 |
+
httpx_mock.add_response(
|
| 38 |
+
json=load_fixture("it_contact.json"),
|
| 39 |
+
)
|
| 40 |
+
result = workos.organizations_it_contacts.create_organization_it_contact(
|
| 41 |
+
"test_organization_id", email="test_email"
|
| 42 |
+
)
|
| 43 |
+
assert isinstance(result, ItContact)
|
| 44 |
+
assert result.object == "it_contact"
|
| 45 |
+
assert result.id == "it_contact_01HXYZ123456789ABCDEFGHIJ"
|
| 46 |
+
request = httpx_mock.get_request()
|
| 47 |
+
assert request.method == "POST"
|
| 48 |
+
assert request.url.path.endswith(
|
| 49 |
+
"/organizations/test_organization_id/it_contacts"
|
| 50 |
+
)
|
| 51 |
+
body = json.loads(request.content)
|
| 52 |
+
assert body["email"] == "test_email"
|
| 53 |
+
|
| 54 |
+
def test_delete_organization_it_contact(self, workos, httpx_mock):
|
| 55 |
+
httpx_mock.add_response(status_code=204)
|
| 56 |
+
result = workos.organizations_it_contacts.delete_organization_it_contact(
|
| 57 |
+
"test_organization_id", "test_contact_id"
|
| 58 |
+
)
|
| 59 |
+
assert result is None
|
| 60 |
+
request = httpx_mock.get_request()
|
| 61 |
+
assert request.method == "DELETE"
|
| 62 |
+
assert request.url.path.endswith(
|
| 63 |
+
"/organizations/test_organization_id/it_contacts/test_contact_id"
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
def test_list_organization_it_contacts_with_request_options(
|
| 67 |
+
self, workos, httpx_mock
|
| 68 |
+
):
|
| 69 |
+
httpx_mock.add_response(json=load_fixture("it_contact_list.json"))
|
| 70 |
+
workos.organizations_it_contacts.list_organization_it_contacts(
|
| 71 |
+
"test_organization_id",
|
| 72 |
+
request_options={"extra_headers": {"X-Custom": "value"}},
|
| 73 |
+
)
|
| 74 |
+
request = httpx_mock.get_request()
|
| 75 |
+
assert request.headers["X-Custom"] == "value"
|
| 76 |
+
|
| 77 |
+
def test_list_organization_it_contacts_unauthorized(self, workos, httpx_mock):
|
| 78 |
+
httpx_mock.add_response(
|
| 79 |
+
status_code=401,
|
| 80 |
+
json={"message": "Unauthorized"},
|
| 81 |
+
)
|
| 82 |
+
with pytest.raises(AuthenticationError):
|
| 83 |
+
workos.organizations_it_contacts.list_organization_it_contacts(
|
| 84 |
+
"test_organization_id"
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
def test_list_organization_it_contacts_not_found(self, httpx_mock):
|
| 88 |
+
workos = WorkOSClient(
|
| 89 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 90 |
+
)
|
| 91 |
+
try:
|
| 92 |
+
httpx_mock.add_response(status_code=404, json={"message": "Not found"})
|
| 93 |
+
with pytest.raises(NotFoundError):
|
| 94 |
+
workos.organizations_it_contacts.list_organization_it_contacts(
|
| 95 |
+
"test_organization_id"
|
| 96 |
+
)
|
| 97 |
+
finally:
|
| 98 |
+
workos.close()
|
| 99 |
+
|
| 100 |
+
def test_list_organization_it_contacts_rate_limited(self, httpx_mock):
|
| 101 |
+
workos = WorkOSClient(
|
| 102 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 103 |
+
)
|
| 104 |
+
try:
|
| 105 |
+
httpx_mock.add_response(
|
| 106 |
+
status_code=429,
|
| 107 |
+
headers={"Retry-After": "0"},
|
| 108 |
+
json={"message": "Slow down"},
|
| 109 |
+
)
|
| 110 |
+
with pytest.raises(RateLimitExceededError):
|
| 111 |
+
workos.organizations_it_contacts.list_organization_it_contacts(
|
| 112 |
+
"test_organization_id"
|
| 113 |
+
)
|
| 114 |
+
finally:
|
| 115 |
+
workos.close()
|
| 116 |
+
|
| 117 |
+
def test_list_organization_it_contacts_server_error(self, httpx_mock):
|
| 118 |
+
workos = WorkOSClient(
|
| 119 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 120 |
+
)
|
| 121 |
+
try:
|
| 122 |
+
httpx_mock.add_response(status_code=500, json={"message": "Server error"})
|
| 123 |
+
with pytest.raises(ServerError):
|
| 124 |
+
workos.organizations_it_contacts.list_organization_it_contacts(
|
| 125 |
+
"test_organization_id"
|
| 126 |
+
)
|
| 127 |
+
finally:
|
| 128 |
+
workos.close()
|
| 129 |
+
|
| 130 |
+
def test_list_organization_it_contacts_bad_request(self, httpx_mock):
|
| 131 |
+
workos = WorkOSClient(
|
| 132 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 133 |
+
)
|
| 134 |
+
try:
|
| 135 |
+
httpx_mock.add_response(status_code=400, json={"message": "Bad request"})
|
| 136 |
+
with pytest.raises(BadRequestError):
|
| 137 |
+
workos.organizations_it_contacts.list_organization_it_contacts(
|
| 138 |
+
"test_organization_id"
|
| 139 |
+
)
|
| 140 |
+
finally:
|
| 141 |
+
workos.close()
|
| 142 |
+
|
| 143 |
+
def test_list_organization_it_contacts_unprocessable(self, httpx_mock):
|
| 144 |
+
workos = WorkOSClient(
|
| 145 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 146 |
+
)
|
| 147 |
+
try:
|
| 148 |
+
httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"})
|
| 149 |
+
with pytest.raises(UnprocessableEntityError):
|
| 150 |
+
workos.organizations_it_contacts.list_organization_it_contacts(
|
| 151 |
+
"test_organization_id"
|
| 152 |
+
)
|
| 153 |
+
finally:
|
| 154 |
+
workos.close()
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
class TestAsyncOrganizationsItContacts:
|
| 158 |
+
@pytest.mark.asyncio
|
| 159 |
+
async def test_list_organization_it_contacts(self, async_workos, httpx_mock):
|
| 160 |
+
httpx_mock.add_response(json=load_fixture("it_contact_list.json"))
|
| 161 |
+
result = (
|
| 162 |
+
await async_workos.organizations_it_contacts.list_organization_it_contacts(
|
| 163 |
+
"test_organization_id"
|
| 164 |
+
)
|
| 165 |
+
)
|
| 166 |
+
assert isinstance(result, ItContactList)
|
| 167 |
+
assert result.object == "list"
|
| 168 |
+
request = httpx_mock.get_request()
|
| 169 |
+
assert request.method == "GET"
|
| 170 |
+
assert request.url.path.endswith(
|
| 171 |
+
"/organizations/test_organization_id/it_contacts"
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
@pytest.mark.asyncio
|
| 175 |
+
async def test_create_organization_it_contact(self, async_workos, httpx_mock):
|
| 176 |
+
httpx_mock.add_response(json=load_fixture("it_contact.json"))
|
| 177 |
+
result = (
|
| 178 |
+
await async_workos.organizations_it_contacts.create_organization_it_contact(
|
| 179 |
+
"test_organization_id", email="test_email"
|
| 180 |
+
)
|
| 181 |
+
)
|
| 182 |
+
assert isinstance(result, ItContact)
|
| 183 |
+
assert result.object == "it_contact"
|
| 184 |
+
assert result.id == "it_contact_01HXYZ123456789ABCDEFGHIJ"
|
| 185 |
+
request = httpx_mock.get_request()
|
| 186 |
+
assert request.method == "POST"
|
| 187 |
+
assert request.url.path.endswith(
|
| 188 |
+
"/organizations/test_organization_id/it_contacts"
|
| 189 |
+
)
|
| 190 |
+
|
| 191 |
+
@pytest.mark.asyncio
|
| 192 |
+
async def test_delete_organization_it_contact(self, async_workos, httpx_mock):
|
| 193 |
+
httpx_mock.add_response(status_code=204)
|
| 194 |
+
result = (
|
| 195 |
+
await async_workos.organizations_it_contacts.delete_organization_it_contact(
|
| 196 |
+
"test_organization_id", "test_contact_id"
|
| 197 |
+
)
|
| 198 |
+
)
|
| 199 |
+
assert result is None
|
| 200 |
+
request = httpx_mock.get_request()
|
| 201 |
+
assert request.method == "DELETE"
|
| 202 |
+
assert request.url.path.endswith(
|
| 203 |
+
"/organizations/test_organization_id/it_contacts/test_contact_id"
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
@pytest.mark.asyncio
|
| 207 |
+
async def test_list_organization_it_contacts_with_request_options(
|
| 208 |
+
self, async_workos, httpx_mock
|
| 209 |
+
):
|
| 210 |
+
httpx_mock.add_response(json=load_fixture("it_contact_list.json"))
|
| 211 |
+
await async_workos.organizations_it_contacts.list_organization_it_contacts(
|
| 212 |
+
"test_organization_id",
|
| 213 |
+
request_options={"extra_headers": {"X-Custom": "value"}},
|
| 214 |
+
)
|
| 215 |
+
request = httpx_mock.get_request()
|
| 216 |
+
assert request.headers["X-Custom"] == "value"
|
| 217 |
+
|
| 218 |
+
@pytest.mark.asyncio
|
| 219 |
+
async def test_list_organization_it_contacts_unauthorized(
|
| 220 |
+
self, async_workos, httpx_mock
|
| 221 |
+
):
|
| 222 |
+
httpx_mock.add_response(status_code=401, json={"message": "Unauthorized"})
|
| 223 |
+
with pytest.raises(AuthenticationError):
|
| 224 |
+
await async_workos.organizations_it_contacts.list_organization_it_contacts(
|
| 225 |
+
"test_organization_id"
|
| 226 |
+
)
|
| 227 |
+
|
| 228 |
+
@pytest.mark.asyncio
|
| 229 |
+
async def test_list_organization_it_contacts_not_found(self, httpx_mock):
|
| 230 |
+
workos = AsyncWorkOSClient(
|
| 231 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 232 |
+
)
|
| 233 |
+
try:
|
| 234 |
+
httpx_mock.add_response(status_code=404, json={"message": "Not found"})
|
| 235 |
+
with pytest.raises(NotFoundError):
|
| 236 |
+
await workos.organizations_it_contacts.list_organization_it_contacts(
|
| 237 |
+
"test_organization_id"
|
| 238 |
+
)
|
| 239 |
+
finally:
|
| 240 |
+
await workos.close()
|
| 241 |
+
|
| 242 |
+
@pytest.mark.asyncio
|
| 243 |
+
async def test_list_organization_it_contacts_rate_limited(self, httpx_mock):
|
| 244 |
+
workos = AsyncWorkOSClient(
|
| 245 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 246 |
+
)
|
| 247 |
+
try:
|
| 248 |
+
httpx_mock.add_response(
|
| 249 |
+
status_code=429,
|
| 250 |
+
headers={"Retry-After": "0"},
|
| 251 |
+
json={"message": "Slow down"},
|
| 252 |
+
)
|
| 253 |
+
with pytest.raises(RateLimitExceededError):
|
| 254 |
+
await workos.organizations_it_contacts.list_organization_it_contacts(
|
| 255 |
+
"test_organization_id"
|
| 256 |
+
)
|
| 257 |
+
finally:
|
| 258 |
+
await workos.close()
|
| 259 |
+
|
| 260 |
+
@pytest.mark.asyncio
|
| 261 |
+
async def test_list_organization_it_contacts_server_error(self, httpx_mock):
|
| 262 |
+
workos = AsyncWorkOSClient(
|
| 263 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 264 |
+
)
|
| 265 |
+
try:
|
| 266 |
+
httpx_mock.add_response(status_code=500, json={"message": "Server error"})
|
| 267 |
+
with pytest.raises(ServerError):
|
| 268 |
+
await workos.organizations_it_contacts.list_organization_it_contacts(
|
| 269 |
+
"test_organization_id"
|
| 270 |
+
)
|
| 271 |
+
finally:
|
| 272 |
+
await workos.close()
|
| 273 |
+
|
| 274 |
+
@pytest.mark.asyncio
|
| 275 |
+
async def test_list_organization_it_contacts_bad_request(self, httpx_mock):
|
| 276 |
+
workos = AsyncWorkOSClient(
|
| 277 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 278 |
+
)
|
| 279 |
+
try:
|
| 280 |
+
httpx_mock.add_response(status_code=400, json={"message": "Bad request"})
|
| 281 |
+
with pytest.raises(BadRequestError):
|
| 282 |
+
await workos.organizations_it_contacts.list_organization_it_contacts(
|
| 283 |
+
"test_organization_id"
|
| 284 |
+
)
|
| 285 |
+
finally:
|
| 286 |
+
await workos.close()
|
| 287 |
+
|
| 288 |
+
@pytest.mark.asyncio
|
| 289 |
+
async def test_list_organization_it_contacts_unprocessable(self, httpx_mock):
|
| 290 |
+
workos = AsyncWorkOSClient(
|
| 291 |
+
api_key="sk_test_123", client_id="client_test", max_retries=0
|
| 292 |
+
)
|
| 293 |
+
try:
|
| 294 |
+
httpx_mock.add_response(status_code=422, json={"message": "Unprocessable"})
|
| 295 |
+
with pytest.raises(UnprocessableEntityError):
|
| 296 |
+
await workos.organizations_it_contacts.list_organization_it_contacts(
|
| 297 |
+
"test_organization_id"
|
| 298 |
+
)
|
| 299 |
+
finally:
|
| 300 |
+
await workos.close()
|
python/tests/test_organizations_it_contacts_models_round_trip.py|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
"""Model round-trip tests: from_dict(to_dict()) preserves data."""
|
| 4 |
+
|
| 5 |
+
from tests.generated_helpers import load_fixture
|
| 6 |
+
from workos.organizations_it_contacts.models import (
|
| 7 |
+
ItContact,
|
| 8 |
+
ItContactList,
|
| 9 |
+
ItContactListListMetadata,
|
| 10 |
+
)
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class TestModelRoundTrip:
|
| 14 |
+
def test_it_contact_round_trip(self):
|
| 15 |
+
data = load_fixture("it_contact.json")
|
| 16 |
+
instance = ItContact.from_dict(data)
|
| 17 |
+
serialized = instance.to_dict()
|
| 18 |
+
assert serialized == data
|
| 19 |
+
restored = ItContact.from_dict(serialized)
|
| 20 |
+
assert restored.to_dict() == serialized
|
| 21 |
+
|
| 22 |
+
def test_it_contact_minimal_payload(self):
|
| 23 |
+
data = {
|
| 24 |
+
"object": "it_contact",
|
| 25 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 26 |
+
"email": "it-contact@example.com",
|
| 27 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 28 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 29 |
+
}
|
| 30 |
+
instance = ItContact.from_dict(data)
|
| 31 |
+
serialized = instance.to_dict()
|
| 32 |
+
assert serialized["object"] == data["object"]
|
| 33 |
+
assert serialized["id"] == data["id"]
|
| 34 |
+
assert serialized["email"] == data["email"]
|
| 35 |
+
assert serialized["created_at"] == data["created_at"]
|
| 36 |
+
assert serialized["updated_at"] == data["updated_at"]
|
| 37 |
+
|
| 38 |
+
def test_it_contact_list_round_trip(self):
|
| 39 |
+
data = load_fixture("it_contact_list.json")
|
| 40 |
+
instance = ItContactList.from_dict(data)
|
| 41 |
+
serialized = instance.to_dict()
|
| 42 |
+
assert serialized == data
|
| 43 |
+
restored = ItContactList.from_dict(serialized)
|
| 44 |
+
assert restored.to_dict() == serialized
|
| 45 |
+
|
| 46 |
+
def test_it_contact_list_minimal_payload(self):
|
| 47 |
+
data = {
|
| 48 |
+
"object": "list",
|
| 49 |
+
"data": [
|
| 50 |
+
{
|
| 51 |
+
"object": "it_contact",
|
| 52 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 53 |
+
"email": "it-contact@example.com",
|
| 54 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 55 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 56 |
+
}
|
| 57 |
+
],
|
| 58 |
+
"list_metadata": {
|
| 59 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 60 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA",
|
| 61 |
+
},
|
| 62 |
+
}
|
| 63 |
+
instance = ItContactList.from_dict(data)
|
| 64 |
+
serialized = instance.to_dict()
|
| 65 |
+
assert serialized["object"] == data["object"]
|
| 66 |
+
assert serialized["data"] == data["data"]
|
| 67 |
+
assert serialized["list_metadata"] == data["list_metadata"]
|
| 68 |
+
|
| 69 |
+
def test_it_contact_list_list_metadata_round_trip(self):
|
| 70 |
+
data = load_fixture("it_contact_list_list_metadata.json")
|
| 71 |
+
instance = ItContactListListMetadata.from_dict(data)
|
| 72 |
+
serialized = instance.to_dict()
|
| 73 |
+
assert serialized == data
|
| 74 |
+
restored = ItContactListListMetadata.from_dict(serialized)
|
| 75 |
+
assert restored.to_dict() == serialized
|
| 76 |
+
|
| 77 |
+
def test_it_contact_list_list_metadata_minimal_payload(self):
|
| 78 |
+
data = {"before": None, "after": None}
|
| 79 |
+
instance = ItContactListListMetadata.from_dict(data)
|
| 80 |
+
serialized = instance.to_dict()
|
| 81 |
+
assert serialized["before"] == data["before"]
|
| 82 |
+
assert serialized["after"] == data["after"]
|
| 83 |
+
|
| 84 |
+
def test_it_contact_list_list_metadata_preserves_nullable_fields(self):
|
| 85 |
+
data = {"before": None, "after": None}
|
| 86 |
+
instance = ItContactListListMetadata.from_dict(data)
|
| 87 |
+
serialized = instance.to_dict()
|
| 88 |
+
assert serialized["before"] is None
|
| 89 |
+
assert serialized["after"] is None
|
All files in this language are hidden by the current filters.
code: 15 · tests: 3 · manifest: 1
ruby/.oagen-manifest.json|
@@ -257,6 +257,10 @@
|
|
| 257 |
"lib/workos/organizations/organization_updated_data_domain.rb",
|
| 258 |
"lib/workos/organizations/update_audit_logs_retention.rb",
|
| 259 |
"lib/workos/organizations/update_organization.rb",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
"lib/workos/pipes.rb",
|
| 261 |
"lib/workos/pipes/api_key_installation.rb",
|
| 262 |
"lib/workos/pipes/connected_account.rb",
|
|
@@ -892,6 +896,7 @@
|
|
| 892 |
"rbi/workos/create_group.rbi",
|
| 893 |
"rbi/workos/create_group_membership.rbi",
|
| 894 |
"rbi/workos/create_group_role_assignment.rbi",
|
|
|
|
| 895 |
"rbi/workos/create_m2m_application.rbi",
|
| 896 |
"rbi/workos/create_magic_code_and_return.rbi",
|
| 897 |
"rbi/workos/create_oauth_application.rbi",
|
|
@@ -1041,6 +1046,7 @@
|
|
| 1041 |
"rbi/workos/invitation_resent_data.rbi",
|
| 1042 |
"rbi/workos/invitation_revoked.rbi",
|
| 1043 |
"rbi/workos/invitation_revoked_data.rbi",
|
|
|
|
| 1044 |
"rbi/workos/jwks_response.rbi",
|
| 1045 |
"rbi/workos/jwks_response_keys.rbi",
|
| 1046 |
"rbi/workos/jwt_template_response.rbi",
|
|
@@ -1102,6 +1108,7 @@
|
|
| 1102 |
"rbi/workos/organization_updated_data.rbi",
|
| 1103 |
"rbi/workos/organization_updated_data_domain.rbi",
|
| 1104 |
"rbi/workos/organizations.rbi",
|
|
|
|
| 1105 |
"rbi/workos/password_reset.rbi",
|
| 1106 |
"rbi/workos/password_reset_created.rbi",
|
| 1107 |
"rbi/workos/password_reset_created_data.rbi",
|
|
@@ -1283,6 +1290,8 @@
|
|
| 1283 |
"test/workos/test_organization_membership_model_round_trip.rb",
|
| 1284 |
"test/workos/test_organization_membership_service.rb",
|
| 1285 |
"test/workos/test_organizations.rb",
|
|
|
|
|
|
|
| 1286 |
"test/workos/test_organizations_model_round_trip.rb",
|
| 1287 |
"test/workos/test_pipes.rb",
|
| 1288 |
"test/workos/test_pipes_model_round_trip.rb",
|
|
@@ -1603,6 +1612,10 @@
|
|
| 1603 |
"sdkMethod": "authorize_data_integration",
|
| 1604 |
"service": "pipes"
|
| 1605 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1606 |
"POST /data-integrations/{slug}/credentials": {
|
| 1607 |
"sdkMethod": "create_data_integration_credential",
|
| 1608 |
"service": "pipes"
|
|
@@ -1775,6 +1788,18 @@
|
|
| 1775 |
"sdkMethod": "list_authorized_applications",
|
| 1776 |
"service": "organizations"
|
| 1777 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1778 |
"POST /portal/generate_link": {
|
| 1779 |
"sdkMethod": "generate_link",
|
| 1780 |
"service": "admin_portal"
|
|
@@ -2194,10 +2219,6 @@
|
|
| 2194 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2195 |
"sdkMethod": "get_export",
|
| 2196 |
"service": "audit_logs"
|
| 2197 |
-
},
|
| 2198 |
-
"PUT /data-integrations/{slug}/client-credentials": {
|
| 2199 |
-
"sdkMethod": "update_data_integration_client_credentials",
|
| 2200 |
-
"service": "pipes"
|
| 2201 |
}
|
| 2202 |
}
|
| 2203 |
}
|
|
|
|
| 257 |
"lib/workos/organizations/organization_updated_data_domain.rb",
|
| 258 |
"lib/workos/organizations/update_audit_logs_retention.rb",
|
| 259 |
"lib/workos/organizations/update_organization.rb",
|
| 260 |
+
"lib/workos/organizations_it_contacts.rb",
|
| 261 |
+
"lib/workos/organizations_it_contacts/create_it_contact.rb",
|
| 262 |
+
"lib/workos/organizations_it_contacts/it_contact.rb",
|
| 263 |
+
"lib/workos/organizations_it_contacts/it_contact_list.rb",
|
| 264 |
"lib/workos/pipes.rb",
|
| 265 |
"lib/workos/pipes/api_key_installation.rb",
|
| 266 |
"lib/workos/pipes/connected_account.rb",
|
|
|
|
| 896 |
"rbi/workos/create_group.rbi",
|
| 897 |
"rbi/workos/create_group_membership.rbi",
|
| 898 |
"rbi/workos/create_group_role_assignment.rbi",
|
| 899 |
+
"rbi/workos/create_it_contact.rbi",
|
| 900 |
"rbi/workos/create_m2m_application.rbi",
|
| 901 |
"rbi/workos/create_magic_code_and_return.rbi",
|
| 902 |
"rbi/workos/create_oauth_application.rbi",
|
|
|
|
| 1046 |
"rbi/workos/invitation_resent_data.rbi",
|
| 1047 |
"rbi/workos/invitation_revoked.rbi",
|
| 1048 |
"rbi/workos/invitation_revoked_data.rbi",
|
| 1049 |
+
"rbi/workos/it_contact.rbi",
|
| 1050 |
"rbi/workos/jwks_response.rbi",
|
| 1051 |
"rbi/workos/jwks_response_keys.rbi",
|
| 1052 |
"rbi/workos/jwt_template_response.rbi",
|
|
|
|
| 1108 |
"rbi/workos/organization_updated_data.rbi",
|
| 1109 |
"rbi/workos/organization_updated_data_domain.rbi",
|
| 1110 |
"rbi/workos/organizations.rbi",
|
| 1111 |
+
"rbi/workos/organizations_it_contacts.rbi",
|
| 1112 |
"rbi/workos/password_reset.rbi",
|
| 1113 |
"rbi/workos/password_reset_created.rbi",
|
| 1114 |
"rbi/workos/password_reset_created_data.rbi",
|
|
|
|
| 1290 |
"test/workos/test_organization_membership_model_round_trip.rb",
|
| 1291 |
"test/workos/test_organization_membership_service.rb",
|
| 1292 |
"test/workos/test_organizations.rb",
|
| 1293 |
+
"test/workos/test_organizations_it_contacts.rb",
|
| 1294 |
+
"test/workos/test_organizations_it_contacts_model_round_trip.rb",
|
| 1295 |
"test/workos/test_organizations_model_round_trip.rb",
|
| 1296 |
"test/workos/test_pipes.rb",
|
| 1297 |
"test/workos/test_pipes_model_round_trip.rb",
|
|
|
|
| 1612 |
"sdkMethod": "authorize_data_integration",
|
| 1613 |
"service": "pipes"
|
| 1614 |
},
|
| 1615 |
+
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1616 |
+
"sdkMethod": "update_data_integration_client_credentials",
|
| 1617 |
+
"service": "pipes"
|
| 1618 |
+
},
|
| 1619 |
"POST /data-integrations/{slug}/credentials": {
|
| 1620 |
"sdkMethod": "create_data_integration_credential",
|
| 1621 |
"service": "pipes"
|
|
|
|
| 1788 |
"sdkMethod": "list_authorized_applications",
|
| 1789 |
"service": "organizations"
|
| 1790 |
},
|
| 1791 |
+
"GET /organizations/{organization_id}/it_contacts": {
|
| 1792 |
+
"sdkMethod": "list_organization_it_contacts",
|
| 1793 |
+
"service": "organizations_it_contacts"
|
| 1794 |
+
},
|
| 1795 |
+
"POST /organizations/{organization_id}/it_contacts": {
|
| 1796 |
+
"sdkMethod": "create_organization_it_contact",
|
| 1797 |
+
"service": "organizations_it_contacts"
|
| 1798 |
+
},
|
| 1799 |
+
"DELETE /organizations/{organization_id}/it_contacts/{contact_id}": {
|
| 1800 |
+
"sdkMethod": "delete_organization_it_contact",
|
| 1801 |
+
"service": "organizations_it_contacts"
|
| 1802 |
+
},
|
| 1803 |
"POST /portal/generate_link": {
|
| 1804 |
"sdkMethod": "generate_link",
|
| 1805 |
"service": "admin_portal"
|
|
|
|
| 2219 |
"GET /audit_logs/exports/{auditLogExportId}": {
|
| 2220 |
"sdkMethod": "get_export",
|
| 2221 |
"service": "audit_logs"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2222 |
}
|
| 2223 |
}
|
| 2224 |
}
|
ruby/lib/workos.rb|
@@ -35,6 +35,7 @@ loader.collapse("#{__dir__}/workos/multi_factor_auth")
|
|
| 35 |
loader.collapse("#{__dir__}/workos/organization_domains")
|
| 36 |
loader.collapse("#{__dir__}/workos/organization_membership")
|
| 37 |
loader.collapse("#{__dir__}/workos/organizations")
|
|
|
|
| 38 |
loader.collapse("#{__dir__}/workos/pipes")
|
| 39 |
loader.collapse("#{__dir__}/workos/pipes_provider")
|
| 40 |
loader.collapse("#{__dir__}/workos/radar")
|
|
|
|
| 35 |
loader.collapse("#{__dir__}/workos/organization_domains")
|
| 36 |
loader.collapse("#{__dir__}/workos/organization_membership")
|
| 37 |
loader.collapse("#{__dir__}/workos/organizations")
|
| 38 |
+
loader.collapse("#{__dir__}/workos/organizations_it_contacts")
|
| 39 |
loader.collapse("#{__dir__}/workos/pipes")
|
| 40 |
loader.collapse("#{__dir__}/workos/pipes_provider")
|
| 41 |
loader.collapse("#{__dir__}/workos/radar")
|
ruby/lib/workos/client.rb|
@@ -64,6 +64,10 @@ module WorkOS
|
|
| 64 |
@groups ||= WorkOS::Groups.new(self)
|
| 65 |
end
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
def admin_portal
|
| 68 |
@admin_portal ||= WorkOS::AdminPortal.new(self)
|
| 69 |
end
|
|
|
|
| 64 |
@groups ||= WorkOS::Groups.new(self)
|
| 65 |
end
|
| 66 |
|
| 67 |
+
def organizations_it_contacts
|
| 68 |
+
@organizations_it_contacts ||= WorkOS::OrganizationsItContacts.new(self)
|
| 69 |
+
end
|
| 70 |
+
|
| 71 |
def admin_portal
|
| 72 |
@admin_portal ||= WorkOS::AdminPortal.new(self)
|
| 73 |
end
|
ruby/lib/workos/organizations.rb|
@@ -65,7 +65,7 @@ module WorkOS
|
|
| 65 |
# Create an Organization
|
| 66 |
# @param name [String] The name of the organization.
|
| 67 |
# @param allow_profiles_outside_organization [Boolean, nil] Whether the organization allows profiles from outside the organization to sign in.
|
| 68 |
-
# @param domains [Array<String>, nil] The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 69 |
# @param domain_data [Array<WorkOS::OrganizationDomainData>, nil] The domains associated with the organization, including verification state.
|
| 70 |
# @param metadata [Hash{String => String}, nil] Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 71 |
# @param external_id [String, nil] An external identifier for the Organization.
|
|
|
|
| 65 |
# Create an Organization
|
| 66 |
# @param name [String] The name of the organization.
|
| 67 |
# @param allow_profiles_outside_organization [Boolean, nil] Whether the organization allows profiles from outside the organization to sign in.
|
| 68 |
+
# @param domains [Array<String>, nil] (deprecated) The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 69 |
# @param domain_data [Array<WorkOS::OrganizationDomainData>, nil] The domains associated with the organization, including verification state.
|
| 70 |
# @param metadata [Hash{String => String}, nil] Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization.
|
| 71 |
# @param external_id [String, nil] An external identifier for the Organization.
|
ruby/lib/workos/organizations/organization_input.rb|
@@ -13,14 +13,23 @@ module WorkOS
|
|
| 13 |
external_id: :external_id
|
| 14 |
}.freeze
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
attr_accessor \
|
| 17 |
:name,
|
| 18 |
:allow_profiles_outside_organization,
|
| 19 |
-
:domains,
|
| 20 |
:domain_data,
|
| 21 |
:metadata,
|
| 22 |
:external_id
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
def initialize(json)
|
| 25 |
hash = self.class.normalize(json)
|
| 26 |
@name = hash[:name]
|
|
|
|
| 13 |
external_id: :external_id
|
| 14 |
}.freeze
|
| 15 |
|
| 16 |
+
# @!attribute domains
|
| 17 |
+
# @deprecated The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 18 |
+
|
| 19 |
attr_accessor \
|
| 20 |
:name,
|
| 21 |
:allow_profiles_outside_organization,
|
|
|
|
| 22 |
:domain_data,
|
| 23 |
:metadata,
|
| 24 |
:external_id
|
| 25 |
|
| 26 |
+
def domains
|
| 27 |
+
warn "[DEPRECATION] `domains` is deprecated and will be removed in a future version.", uplevel: 1
|
| 28 |
+
@domains
|
| 29 |
+
end
|
| 30 |
+
|
| 31 |
+
attr_writer :domains
|
| 32 |
+
|
| 33 |
def initialize(json)
|
| 34 |
hash = self.class.normalize(json)
|
| 35 |
@name = hash[:name]
|
ruby/lib/workos/organizations_it_contacts.rb|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
require "json"
|
| 6 |
+
|
| 7 |
+
module WorkOS
|
| 8 |
+
class OrganizationsItContacts
|
| 9 |
+
def initialize(client)
|
| 10 |
+
@client = client
|
| 11 |
+
end
|
| 12 |
+
|
| 13 |
+
# List IT contacts
|
| 14 |
+
# @param organization_id [String] The ID of the organization.
|
| 15 |
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
| 16 |
+
# @return [WorkOS::Types::ListStruct<WorkOS::ItContact>]
|
| 17 |
+
def list_organization_it_contacts(
|
| 18 |
+
organization_id:,
|
| 19 |
+
request_options: {}
|
| 20 |
+
)
|
| 21 |
+
response = @client.request(
|
| 22 |
+
method: :get,
|
| 23 |
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts",
|
| 24 |
+
auth: true,
|
| 25 |
+
request_options: request_options
|
| 26 |
+
)
|
| 27 |
+
WorkOS::Types::ListStruct.from_response(
|
| 28 |
+
response,
|
| 29 |
+
model: WorkOS::ItContact,
|
| 30 |
+
filters: {organization_id: organization_id}
|
| 31 |
+
)
|
| 32 |
+
end
|
| 33 |
+
|
| 34 |
+
# Create an IT contact
|
| 35 |
+
# @param organization_id [String] The ID of the organization.
|
| 36 |
+
# @param email [String] The email address of the IT contact.
|
| 37 |
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
| 38 |
+
# @return [WorkOS::ItContact]
|
| 39 |
+
def create_organization_it_contact(
|
| 40 |
+
organization_id:,
|
| 41 |
+
email:,
|
| 42 |
+
request_options: {}
|
| 43 |
+
)
|
| 44 |
+
body = {
|
| 45 |
+
"email" => email
|
| 46 |
+
}
|
| 47 |
+
response = @client.request(
|
| 48 |
+
method: :post,
|
| 49 |
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts",
|
| 50 |
+
auth: true,
|
| 51 |
+
body: body,
|
| 52 |
+
request_options: request_options
|
| 53 |
+
)
|
| 54 |
+
result = WorkOS::ItContact.new(response.body)
|
| 55 |
+
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
| 56 |
+
result
|
| 57 |
+
end
|
| 58 |
+
|
| 59 |
+
# Delete an IT contact
|
| 60 |
+
# @param organization_id [String] The ID of the organization.
|
| 61 |
+
# @param contact_id [String] The ID of the IT contact.
|
| 62 |
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
| 63 |
+
# @return [void]
|
| 64 |
+
def delete_organization_it_contact(
|
| 65 |
+
organization_id:,
|
| 66 |
+
contact_id:,
|
| 67 |
+
request_options: {}
|
| 68 |
+
)
|
| 69 |
+
@client.request(
|
| 70 |
+
method: :delete,
|
| 71 |
+
path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/it_contacts/#{WorkOS::Util.encode_path(contact_id)}",
|
| 72 |
+
auth: true,
|
| 73 |
+
request_options: request_options
|
| 74 |
+
)
|
| 75 |
+
nil
|
| 76 |
+
end
|
| 77 |
+
end
|
| 78 |
+
end
|
ruby/lib/workos/organizations_it_contacts/create_it_contact.rb|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
module WorkOS
|
| 6 |
+
class CreateItContact < WorkOS::Types::BaseModel
|
| 7 |
+
HASH_ATTRS = {
|
| 8 |
+
email: :email
|
| 9 |
+
}.freeze
|
| 10 |
+
|
| 11 |
+
attr_accessor :email
|
| 12 |
+
|
| 13 |
+
def initialize(json)
|
| 14 |
+
hash = self.class.normalize(json)
|
| 15 |
+
@email = hash[:email]
|
| 16 |
+
end
|
| 17 |
+
end
|
| 18 |
+
end
|
ruby/lib/workos/organizations_it_contacts/it_contact.rb|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
module WorkOS
|
| 6 |
+
class ItContact < WorkOS::Types::BaseModel
|
| 7 |
+
HASH_ATTRS = {
|
| 8 |
+
object: :object,
|
| 9 |
+
id: :id,
|
| 10 |
+
email: :email,
|
| 11 |
+
created_at: :created_at,
|
| 12 |
+
updated_at: :updated_at
|
| 13 |
+
}.freeze
|
| 14 |
+
|
| 15 |
+
attr_accessor \
|
| 16 |
+
:object,
|
| 17 |
+
:id,
|
| 18 |
+
:email,
|
| 19 |
+
:created_at,
|
| 20 |
+
:updated_at
|
| 21 |
+
|
| 22 |
+
def initialize(json)
|
| 23 |
+
hash = self.class.normalize(json)
|
| 24 |
+
@object = hash[:object]
|
| 25 |
+
@id = hash[:id]
|
| 26 |
+
@email = hash[:email]
|
| 27 |
+
@created_at = hash[:created_at]
|
| 28 |
+
@updated_at = hash[:updated_at]
|
| 29 |
+
end
|
| 30 |
+
end
|
| 31 |
+
end
|
ruby/lib/workos/organizations_it_contacts/it_contact_list.rb|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
module WorkOS
|
| 6 |
+
class ItContactList < WorkOS::Types::BaseModel
|
| 7 |
+
HASH_ATTRS = {
|
| 8 |
+
object: :object,
|
| 9 |
+
data: :data,
|
| 10 |
+
list_metadata: :list_metadata
|
| 11 |
+
}.freeze
|
| 12 |
+
|
| 13 |
+
attr_accessor \
|
| 14 |
+
:object,
|
| 15 |
+
:data,
|
| 16 |
+
:list_metadata
|
| 17 |
+
|
| 18 |
+
def initialize(json)
|
| 19 |
+
hash = self.class.normalize(json)
|
| 20 |
+
@object = hash[:object]
|
| 21 |
+
@data = (hash[:data] || []).map { |item| item ? WorkOS::ItContact.new(item) : nil }
|
| 22 |
+
@list_metadata = hash[:list_metadata] ? WorkOS::ItContactListListMetadata.new(hash[:list_metadata]) : nil
|
| 23 |
+
end
|
| 24 |
+
end
|
| 25 |
+
end
|
ruby/lib/workos/user_management/create_password_reset_token.rb|
@@ -3,16 +3,5 @@
|
|
| 3 |
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
|
| 5 |
module WorkOS
|
| 6 |
-
|
| 7 |
-
HASH_ATTRS = {
|
| 8 |
-
email: :email
|
| 9 |
-
}.freeze
|
| 10 |
-
|
| 11 |
-
attr_accessor :email
|
| 12 |
-
|
| 13 |
-
def initialize(json)
|
| 14 |
-
hash = self.class.normalize(json)
|
| 15 |
-
@email = hash[:email]
|
| 16 |
-
end
|
| 17 |
-
end
|
| 18 |
end
|
|
|
|
| 3 |
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
|
| 5 |
module WorkOS
|
| 6 |
+
CreatePasswordResetToken = CreateItContact
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
end
|
ruby/rbi/workos/client.rbi|
@@ -54,6 +54,9 @@ module WorkOS
|
|
| 54 |
sig { returns(WorkOS::Groups) }
|
| 55 |
def groups; end
|
| 56 |
|
|
|
|
|
|
|
|
|
|
| 57 |
sig { returns(WorkOS::AdminPortal) }
|
| 58 |
def admin_portal; end
|
| 59 |
|
|
|
|
| 54 |
sig { returns(WorkOS::Groups) }
|
| 55 |
def groups; end
|
| 56 |
|
| 57 |
+
sig { returns(WorkOS::OrganizationsItContacts) }
|
| 58 |
+
def organizations_it_contacts; end
|
| 59 |
+
|
| 60 |
sig { returns(WorkOS::AdminPortal) }
|
| 61 |
def admin_portal; end
|
| 62 |
|
ruby/rbi/workos/create_it_contact.rbi|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
# typed: strong
|
| 6 |
+
|
| 7 |
+
module WorkOS
|
| 8 |
+
class CreateItContact
|
| 9 |
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
| 10 |
+
def initialize(json); end
|
| 11 |
+
|
| 12 |
+
sig { returns(String) }
|
| 13 |
+
def email; end
|
| 14 |
+
|
| 15 |
+
sig { params(value: String).returns(String) }
|
| 16 |
+
def email=(value); end
|
| 17 |
+
|
| 18 |
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
| 19 |
+
def to_h; end
|
| 20 |
+
|
| 21 |
+
sig { params(args: T.untyped).returns(String) }
|
| 22 |
+
def to_json(*args); end
|
| 23 |
+
end
|
| 24 |
+
end
|
ruby/rbi/workos/it_contact.rbi|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
# typed: strong
|
| 6 |
+
|
| 7 |
+
module WorkOS
|
| 8 |
+
class ItContact
|
| 9 |
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
| 10 |
+
def initialize(json); end
|
| 11 |
+
|
| 12 |
+
sig { returns(String) }
|
| 13 |
+
def object; end
|
| 14 |
+
|
| 15 |
+
sig { params(value: String).returns(String) }
|
| 16 |
+
def object=(value); end
|
| 17 |
+
|
| 18 |
+
sig { returns(String) }
|
| 19 |
+
def id; end
|
| 20 |
+
|
| 21 |
+
sig { params(value: String).returns(String) }
|
| 22 |
+
def id=(value); end
|
| 23 |
+
|
| 24 |
+
sig { returns(String) }
|
| 25 |
+
def email; end
|
| 26 |
+
|
| 27 |
+
sig { params(value: String).returns(String) }
|
| 28 |
+
def email=(value); end
|
| 29 |
+
|
| 30 |
+
sig { returns(String) }
|
| 31 |
+
def created_at; end
|
| 32 |
+
|
| 33 |
+
sig { params(value: String).returns(String) }
|
| 34 |
+
def created_at=(value); end
|
| 35 |
+
|
| 36 |
+
sig { returns(String) }
|
| 37 |
+
def updated_at; end
|
| 38 |
+
|
| 39 |
+
sig { params(value: String).returns(String) }
|
| 40 |
+
def updated_at=(value); end
|
| 41 |
+
|
| 42 |
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
| 43 |
+
def to_h; end
|
| 44 |
+
|
| 45 |
+
sig { params(args: T.untyped).returns(String) }
|
| 46 |
+
def to_json(*args); end
|
| 47 |
+
end
|
| 48 |
+
end
|
ruby/rbi/workos/organizations_it_contacts.rbi|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
# typed: strong
|
| 6 |
+
|
| 7 |
+
module WorkOS
|
| 8 |
+
class OrganizationsItContacts
|
| 9 |
+
sig { params(client: WorkOS::BaseClient).void }
|
| 10 |
+
def initialize(client); end
|
| 11 |
+
|
| 12 |
+
sig do
|
| 13 |
+
params(
|
| 14 |
+
organization_id: String,
|
| 15 |
+
request_options: T::Hash[Symbol, T.untyped]
|
| 16 |
+
).returns(WorkOS::Types::ListStruct)
|
| 17 |
+
end
|
| 18 |
+
def list_organization_it_contacts(organization_id:, request_options:); end
|
| 19 |
+
|
| 20 |
+
sig do
|
| 21 |
+
params(
|
| 22 |
+
organization_id: String,
|
| 23 |
+
email: String,
|
| 24 |
+
request_options: T::Hash[Symbol, T.untyped]
|
| 25 |
+
).returns(WorkOS::ItContact)
|
| 26 |
+
end
|
| 27 |
+
def create_organization_it_contact(organization_id:, email:, request_options:); end
|
| 28 |
+
|
| 29 |
+
sig do
|
| 30 |
+
params(
|
| 31 |
+
organization_id: String,
|
| 32 |
+
contact_id: String,
|
| 33 |
+
request_options: T::Hash[Symbol, T.untyped]
|
| 34 |
+
).returns(NilClass)
|
| 35 |
+
end
|
| 36 |
+
def delete_organization_it_contact(organization_id:, contact_id:, request_options:); end
|
| 37 |
+
|
| 38 |
+
end
|
| 39 |
+
end
|
ruby/rbi/workos/waitlist_user.rbi|
@@ -9,12 +9,6 @@ module WorkOS
|
|
| 9 |
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
| 10 |
def initialize(json); end
|
| 11 |
|
| 12 |
-
sig { returns(String) }
|
| 13 |
-
def object; end
|
| 14 |
-
|
| 15 |
-
sig { params(value: String).returns(String) }
|
| 16 |
-
def object=(value); end
|
| 17 |
-
|
| 18 |
sig { returns(String) }
|
| 19 |
def id; end
|
| 20 |
|
|
@@ -39,6 +33,12 @@ module WorkOS
|
|
| 39 |
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
| 40 |
def approved_at=(value); end
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
sig { returns(T.nilable(String)) }
|
| 43 |
def waitlist_id; end
|
| 44 |
|
|
@@ -57,6 +57,12 @@ module WorkOS
|
|
| 57 |
sig { params(value: String).returns(String) }
|
| 58 |
def updated_at=(value); end
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
sig { returns(T::Hash[Symbol, T.untyped]) }
|
| 61 |
def to_h; end
|
| 62 |
|
|
|
|
| 9 |
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
| 10 |
def initialize(json); end
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
sig { returns(String) }
|
| 13 |
def id; end
|
| 14 |
|
|
|
|
| 33 |
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
| 34 |
def approved_at=(value); end
|
| 35 |
|
| 36 |
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
| 37 |
+
def additional_fields; end
|
| 38 |
+
|
| 39 |
+
sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
|
| 40 |
+
def additional_fields=(value); end
|
| 41 |
+
|
| 42 |
sig { returns(T.nilable(String)) }
|
| 43 |
def waitlist_id; end
|
| 44 |
|
|
|
|
| 57 |
sig { params(value: String).returns(String) }
|
| 58 |
def updated_at=(value); end
|
| 59 |
|
| 60 |
+
sig { returns(String) }
|
| 61 |
+
def object; end
|
| 62 |
+
|
| 63 |
+
sig { params(value: String).returns(String) }
|
| 64 |
+
def object=(value); end
|
| 65 |
+
|
| 66 |
sig { returns(T::Hash[Symbol, T.untyped]) }
|
| 67 |
def to_h; end
|
| 68 |
|
ruby/test/workos/test_organizations_it_contacts.rb|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
require "test_helper"
|
| 6 |
+
|
| 7 |
+
class OrganizationsItContactsTest < Minitest::Test
|
| 8 |
+
include FixtureHelper
|
| 9 |
+
|
| 10 |
+
def setup
|
| 11 |
+
@client = WorkOS::Client.new(api_key: "sk_test_123")
|
| 12 |
+
end
|
| 13 |
+
|
| 14 |
+
def test_list_organization_it_contacts_returns_expected_result
|
| 15 |
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/it_contacts(\?|\z)})
|
| 16 |
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
| 17 |
+
result = @client.organizations_it_contacts.list_organization_it_contacts(organization_id: "stub")
|
| 18 |
+
assert_kind_of WorkOS::Types::ListStruct, result
|
| 19 |
+
end
|
| 20 |
+
|
| 21 |
+
def test_create_organization_it_contact_returns_expected_result
|
| 22 |
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/it_contacts(\?|\z)})
|
| 23 |
+
.to_return(body: "{}", status: 200)
|
| 24 |
+
result = @client.organizations_it_contacts.create_organization_it_contact(organization_id: "stub", email: "stub")
|
| 25 |
+
refute_nil result
|
| 26 |
+
end
|
| 27 |
+
|
| 28 |
+
def test_delete_organization_it_contact_returns_expected_result
|
| 29 |
+
stub_request(:delete, %r{\Ahttps://api\.workos\.com/organizations/stub/it_contacts/stub(\?|\z)})
|
| 30 |
+
.to_return(body: "{}", status: 200)
|
| 31 |
+
result = @client.organizations_it_contacts.delete_organization_it_contact(organization_id: "stub", contact_id: "stub")
|
| 32 |
+
assert_nil result
|
| 33 |
+
end
|
| 34 |
+
|
| 35 |
+
# Parameterized authentication error tests (one per endpoint).
|
| 36 |
+
[
|
| 37 |
+
{name: :list_organization_it_contacts, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/it_contacts(\?|\z)}, args: {organization_id: "stub"}},
|
| 38 |
+
{name: :create_organization_it_contact, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/it_contacts(\?|\z)}, args: {organization_id: "stub", email: "stub"}},
|
| 39 |
+
{name: :delete_organization_it_contact, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub/it_contacts/stub(\?|\z)}, args: {organization_id: "stub", contact_id: "stub"}}
|
| 40 |
+
].each do |spec|
|
| 41 |
+
define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do
|
| 42 |
+
stub_request(spec[:verb], spec[:url])
|
| 43 |
+
.to_return(body: '{"message": "Unauthorized"}', status: 401)
|
| 44 |
+
assert_raises(WorkOS::AuthenticationError) do
|
| 45 |
+
@client.organizations_it_contacts.send(spec[:name], **(spec[:args] || {}))
|
| 46 |
+
end
|
| 47 |
+
end
|
| 48 |
+
end
|
| 49 |
+
end
|
ruby/test/workos/test_organizations_it_contacts_model_round_trip.rb|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
require "test_helper"
|
| 6 |
+
|
| 7 |
+
class OrganizationsItContactsModelRoundTripTest < Minitest::Test
|
| 8 |
+
def test_create_it_contact_round_trip
|
| 9 |
+
fixture = {
|
| 10 |
+
"email" => "stub"
|
| 11 |
+
}
|
| 12 |
+
model = WorkOS::CreateItContact.new(fixture.to_json)
|
| 13 |
+
json = model.to_h
|
| 14 |
+
assert_kind_of Hash, json
|
| 15 |
+
assert_equal fixture["email"], json[:email]
|
| 16 |
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
| 17 |
+
end
|
| 18 |
+
|
| 19 |
+
def test_it_contact_round_trip
|
| 20 |
+
fixture = {
|
| 21 |
+
"object" => "it_contact",
|
| 22 |
+
"id" => "stub",
|
| 23 |
+
"email" => "stub",
|
| 24 |
+
"created_at" => "stub",
|
| 25 |
+
"updated_at" => "stub"
|
| 26 |
+
}
|
| 27 |
+
model = WorkOS::ItContact.new(fixture.to_json)
|
| 28 |
+
json = model.to_h
|
| 29 |
+
assert_kind_of Hash, json
|
| 30 |
+
assert_equal fixture["id"], json[:id]
|
| 31 |
+
assert_equal fixture["email"], json[:email]
|
| 32 |
+
assert_equal fixture["created_at"], json[:created_at]
|
| 33 |
+
assert_equal fixture["updated_at"], json[:updated_at]
|
| 34 |
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
| 35 |
+
end
|
| 36 |
+
end
|
All files in this language are hidden by the current filters.
code: 20 · tests: 0 · manifest: 1
rust/.oagen-manifest.json|
@@ -341,6 +341,7 @@
|
|
| 341 |
"src/models/create_group.rs",
|
| 342 |
"src/models/create_group_membership.rs",
|
| 343 |
"src/models/create_group_role_assignment.rs",
|
|
|
|
| 344 |
"src/models/create_m2m_application.rs",
|
| 345 |
"src/models/create_magic_code_and_return.rs",
|
| 346 |
"src/models/create_oauth_application.rs",
|
|
@@ -500,6 +501,9 @@
|
|
| 500 |
"src/models/invitation_resent_data.rs",
|
| 501 |
"src/models/invitation_revoked.rs",
|
| 502 |
"src/models/invitation_revoked_data.rs",
|
|
|
|
|
|
|
|
|
|
| 503 |
"src/models/jwks_response.rs",
|
| 504 |
"src/models/jwks_response_keys.rs",
|
| 505 |
"src/models/jwt_template_response.rs",
|
|
@@ -744,6 +748,7 @@
|
|
| 744 |
"src/resources/organization_domains.rs",
|
| 745 |
"src/resources/organization_membership.rs",
|
| 746 |
"src/resources/organizations.rs",
|
|
|
|
| 747 |
"src/resources/pipes.rs",
|
| 748 |
"src/resources/pipes_provider.rs",
|
| 749 |
"src/resources/radar.rs",
|
|
@@ -953,6 +958,7 @@
|
|
| 953 |
"tests/fixtures/create_group.json",
|
| 954 |
"tests/fixtures/create_group_membership.json",
|
| 955 |
"tests/fixtures/create_group_role_assignment.json",
|
|
|
|
| 956 |
"tests/fixtures/create_m2m_application.json",
|
| 957 |
"tests/fixtures/create_magic_code_and_return.json",
|
| 958 |
"tests/fixtures/create_oauth_application.json",
|
|
@@ -1112,6 +1118,9 @@
|
|
| 1112 |
"tests/fixtures/invitation_resent_data.json",
|
| 1113 |
"tests/fixtures/invitation_revoked.json",
|
| 1114 |
"tests/fixtures/invitation_revoked_data.json",
|
|
|
|
|
|
|
|
|
|
| 1115 |
"tests/fixtures/jwks_response.json",
|
| 1116 |
"tests/fixtures/jwks_response_keys.json",
|
| 1117 |
"tests/fixtures/jwt_template_response.json",
|
|
@@ -1343,6 +1352,7 @@
|
|
| 1343 |
"tests/multi_factor_auth_test.rs",
|
| 1344 |
"tests/organization_domains_test.rs",
|
| 1345 |
"tests/organization_membership_test.rs",
|
|
|
|
| 1346 |
"tests/organizations_test.rs",
|
| 1347 |
"tests/pipes_provider_test.rs",
|
| 1348 |
"tests/pipes_test.rs",
|
|
@@ -1674,6 +1684,10 @@
|
|
| 1674 |
"sdkMethod": "authorize_data_integration",
|
| 1675 |
"service": "pipes"
|
| 1676 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1677 |
"POST /data-integrations/{slug}/credentials": {
|
| 1678 |
"sdkMethod": "create_data_integration_credential",
|
| 1679 |
"service": "pipes"
|
|
@@ -1906,6 +1920,18 @@
|
|
| 1906 |
"sdkMethod": "delete_group_organization_membership",
|
| 1907 |
"service": "groups"
|
| 1908 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1909 |
"POST /portal/generate_link": {
|
| 1910 |
"sdkMethod": "generate_link",
|
| 1911 |
"service": "admin_portal"
|
|
@@ -2197,10 +2223,6 @@
|
|
| 2197 |
"POST /widgets/token": {
|
| 2198 |
"sdkMethod": "create_token",
|
| 2199 |
"service": "widgets"
|
| 2200 |
-
},
|
| 2201 |
-
"PUT /data-integrations/{slug}/client-credentials": {
|
| 2202 |
-
"sdkMethod": "update_data_integration_client_credentials",
|
| 2203 |
-
"service": "pipes"
|
| 2204 |
}
|
| 2205 |
}
|
| 2206 |
}
|
|
|
|
| 341 |
"src/models/create_group.rs",
|
| 342 |
"src/models/create_group_membership.rs",
|
| 343 |
"src/models/create_group_role_assignment.rs",
|
| 344 |
+
"src/models/create_it_contact.rs",
|
| 345 |
"src/models/create_m2m_application.rs",
|
| 346 |
"src/models/create_magic_code_and_return.rs",
|
| 347 |
"src/models/create_oauth_application.rs",
|
|
|
|
| 501 |
"src/models/invitation_resent_data.rs",
|
| 502 |
"src/models/invitation_revoked.rs",
|
| 503 |
"src/models/invitation_revoked_data.rs",
|
| 504 |
+
"src/models/it_contact.rs",
|
| 505 |
+
"src/models/it_contact_list.rs",
|
| 506 |
+
"src/models/it_contact_list_list_metadata.rs",
|
| 507 |
"src/models/jwks_response.rs",
|
| 508 |
"src/models/jwks_response_keys.rs",
|
| 509 |
"src/models/jwt_template_response.rs",
|
|
|
|
| 748 |
"src/resources/organization_domains.rs",
|
| 749 |
"src/resources/organization_membership.rs",
|
| 750 |
"src/resources/organizations.rs",
|
| 751 |
+
"src/resources/organizations_it_contacts.rs",
|
| 752 |
"src/resources/pipes.rs",
|
| 753 |
"src/resources/pipes_provider.rs",
|
| 754 |
"src/resources/radar.rs",
|
|
|
|
| 958 |
"tests/fixtures/create_group.json",
|
| 959 |
"tests/fixtures/create_group_membership.json",
|
| 960 |
"tests/fixtures/create_group_role_assignment.json",
|
| 961 |
+
"tests/fixtures/create_it_contact.json",
|
| 962 |
"tests/fixtures/create_m2m_application.json",
|
| 963 |
"tests/fixtures/create_magic_code_and_return.json",
|
| 964 |
"tests/fixtures/create_oauth_application.json",
|
|
|
|
| 1118 |
"tests/fixtures/invitation_resent_data.json",
|
| 1119 |
"tests/fixtures/invitation_revoked.json",
|
| 1120 |
"tests/fixtures/invitation_revoked_data.json",
|
| 1121 |
+
"tests/fixtures/it_contact.json",
|
| 1122 |
+
"tests/fixtures/it_contact_list.json",
|
| 1123 |
+
"tests/fixtures/it_contact_list_list_metadata.json",
|
| 1124 |
"tests/fixtures/jwks_response.json",
|
| 1125 |
"tests/fixtures/jwks_response_keys.json",
|
| 1126 |
"tests/fixtures/jwt_template_response.json",
|
|
|
|
| 1352 |
"tests/multi_factor_auth_test.rs",
|
| 1353 |
"tests/organization_domains_test.rs",
|
| 1354 |
"tests/organization_membership_test.rs",
|
| 1355 |
+
"tests/organizations_it_contacts_test.rs",
|
| 1356 |
"tests/organizations_test.rs",
|
| 1357 |
"tests/pipes_provider_test.rs",
|
| 1358 |
"tests/pipes_test.rs",
|
|
|
|
| 1684 |
"sdkMethod": "authorize_data_integration",
|
| 1685 |
"service": "pipes"
|
| 1686 |
},
|
| 1687 |
+
"PUT /data-integrations/{slug}/client-credentials": {
|
| 1688 |
+
"sdkMethod": "update_data_integration_client_credentials",
|
| 1689 |
+
"service": "pipes"
|
| 1690 |
+
},
|
| 1691 |
"POST /data-integrations/{slug}/credentials": {
|
| 1692 |
"sdkMethod": "create_data_integration_credential",
|
| 1693 |
"service": "pipes"
|
|
|
|
| 1920 |
"sdkMethod": "delete_group_organization_membership",
|
| 1921 |
"service": "groups"
|
| 1922 |
},
|
| 1923 |
+
"GET /organizations/{organization_id}/it_contacts": {
|
| 1924 |
+
"sdkMethod": "list_organization_it_contacts",
|
| 1925 |
+
"service": "organizations_it_contacts"
|
| 1926 |
+
},
|
| 1927 |
+
"POST /organizations/{organization_id}/it_contacts": {
|
| 1928 |
+
"sdkMethod": "create_organization_it_contact",
|
| 1929 |
+
"service": "organizations_it_contacts"
|
| 1930 |
+
},
|
| 1931 |
+
"DELETE /organizations/{organization_id}/it_contacts/{contact_id}": {
|
| 1932 |
+
"sdkMethod": "delete_organization_it_contact",
|
| 1933 |
+
"service": "organizations_it_contacts"
|
| 1934 |
+
},
|
| 1935 |
"POST /portal/generate_link": {
|
| 1936 |
"sdkMethod": "generate_link",
|
| 1937 |
"service": "admin_portal"
|
|
|
|
| 2223 |
"POST /widgets/token": {
|
| 2224 |
"sdkMethod": "create_token",
|
| 2225 |
"service": "widgets"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2226 |
}
|
| 2227 |
}
|
| 2228 |
}
|
rust/src/models/create_it_contact.rs|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
#[allow(unused_imports)]
|
| 4 |
+
use super::*;
|
| 5 |
+
#[allow(unused_imports)]
|
| 6 |
+
use crate::enums::*;
|
| 7 |
+
use serde::{Deserialize, Serialize};
|
| 8 |
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 9 |
+
pub struct CreateItContact {
|
| 10 |
+
/// The email address of the IT contact.
|
| 11 |
+
pub email: String,
|
| 12 |
+
}
|
rust/src/models/it_contact.rs|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
#[allow(unused_imports)]
|
| 4 |
+
use super::*;
|
| 5 |
+
#[allow(unused_imports)]
|
| 6 |
+
use crate::enums::*;
|
| 7 |
+
use serde::{Deserialize, Serialize};
|
| 8 |
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 9 |
+
pub struct ItContact {
|
| 10 |
+
/// The IT Contact object.
|
| 11 |
+
pub object: String,
|
| 12 |
+
/// The unique ID of the IT Contact.
|
| 13 |
+
pub id: String,
|
| 14 |
+
/// The email address of the IT Contact.
|
| 15 |
+
pub email: String,
|
| 16 |
+
/// An ISO 8601 timestamp.
|
| 17 |
+
pub created_at: String,
|
| 18 |
+
/// An ISO 8601 timestamp.
|
| 19 |
+
pub updated_at: String,
|
| 20 |
+
}
|
rust/src/models/it_contact_list.rs|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
#[allow(unused_imports)]
|
| 4 |
+
use super::*;
|
| 5 |
+
#[allow(unused_imports)]
|
| 6 |
+
use crate::enums::*;
|
| 7 |
+
use serde::{Deserialize, Serialize};
|
| 8 |
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 9 |
+
pub struct ItContactList {
|
| 10 |
+
/// Indicates this is a list response.
|
| 11 |
+
pub object: String,
|
| 12 |
+
/// The list of records for the current page.
|
| 13 |
+
pub data: Vec<ItContact>,
|
| 14 |
+
/// Pagination cursors for navigating between pages of results.
|
| 15 |
+
pub list_metadata: ItContactListListMetadata,
|
| 16 |
+
}
|
rust/src/models/it_contact_list_list_metadata.rs|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
#[allow(unused_imports)]
|
| 4 |
+
use super::*;
|
| 5 |
+
#[allow(unused_imports)]
|
| 6 |
+
use crate::enums::*;
|
| 7 |
+
use serde::{Deserialize, Serialize};
|
| 8 |
+
/// Pagination cursors for navigating between pages of results.
|
| 9 |
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 10 |
+
pub struct ItContactListListMetadata {
|
| 11 |
+
/// An object ID that defines your place in the list. When the ID is not present, you are at the start of the list.
|
| 12 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 13 |
+
pub before: Option<String>,
|
| 14 |
+
/// An object ID that defines your place in the list. When the ID is not present, you are at the end of the list.
|
| 15 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 16 |
+
pub after: Option<String>,
|
| 17 |
+
}
|
rust/src/models/mod.rs|
@@ -192,6 +192,7 @@ mod create_data_key_response;
|
|
| 192 |
mod create_group;
|
| 193 |
mod create_group_membership;
|
| 194 |
mod create_group_role_assignment;
|
|
|
|
| 195 |
mod create_m2m_application;
|
| 196 |
mod create_magic_code_and_return;
|
| 197 |
mod create_oauth_application;
|
|
@@ -351,6 +352,9 @@ mod invitation_resent;
|
|
| 351 |
mod invitation_resent_data;
|
| 352 |
mod invitation_revoked;
|
| 353 |
mod invitation_revoked_data;
|
|
|
|
|
|
|
|
|
|
| 354 |
mod jwks_response;
|
| 355 |
mod jwks_response_keys;
|
| 356 |
mod jwt_template_response;
|
|
@@ -771,6 +775,7 @@ pub use create_data_key_response::*;
|
|
| 771 |
pub use create_group::*;
|
| 772 |
pub use create_group_membership::*;
|
| 773 |
pub use create_group_role_assignment::*;
|
|
|
|
| 774 |
pub use create_m2m_application::*;
|
| 775 |
pub use create_magic_code_and_return::*;
|
| 776 |
pub use create_oauth_application::*;
|
|
@@ -930,6 +935,9 @@ pub use invitation_resent::*;
|
|
| 930 |
pub use invitation_resent_data::*;
|
| 931 |
pub use invitation_revoked::*;
|
| 932 |
pub use invitation_revoked_data::*;
|
|
|
|
|
|
|
|
|
|
| 933 |
pub use jwks_response::*;
|
| 934 |
pub use jwks_response_keys::*;
|
| 935 |
pub use jwt_template_response::*;
|
|
|
|
| 192 |
mod create_group;
|
| 193 |
mod create_group_membership;
|
| 194 |
mod create_group_role_assignment;
|
| 195 |
+
mod create_it_contact;
|
| 196 |
mod create_m2m_application;
|
| 197 |
mod create_magic_code_and_return;
|
| 198 |
mod create_oauth_application;
|
|
|
|
| 352 |
mod invitation_resent_data;
|
| 353 |
mod invitation_revoked;
|
| 354 |
mod invitation_revoked_data;
|
| 355 |
+
mod it_contact;
|
| 356 |
+
mod it_contact_list;
|
| 357 |
+
mod it_contact_list_list_metadata;
|
| 358 |
mod jwks_response;
|
| 359 |
mod jwks_response_keys;
|
| 360 |
mod jwt_template_response;
|
|
|
|
| 775 |
pub use create_group::*;
|
| 776 |
pub use create_group_membership::*;
|
| 777 |
pub use create_group_role_assignment::*;
|
| 778 |
+
pub use create_it_contact::*;
|
| 779 |
pub use create_m2m_application::*;
|
| 780 |
pub use create_magic_code_and_return::*;
|
| 781 |
pub use create_oauth_application::*;
|
|
|
|
| 935 |
pub use invitation_resent_data::*;
|
| 936 |
pub use invitation_revoked::*;
|
| 937 |
pub use invitation_revoked_data::*;
|
| 938 |
+
pub use it_contact::*;
|
| 939 |
+
pub use it_contact_list::*;
|
| 940 |
+
pub use it_contact_list_list_metadata::*;
|
| 941 |
pub use jwks_response::*;
|
| 942 |
pub use jwks_response_keys::*;
|
| 943 |
pub use jwt_template_response::*;
|
rust/src/models/organization_input.rs|
@@ -14,6 +14,7 @@ pub struct OrganizationInput {
|
|
| 14 |
pub allow_profiles_outside_organization: Option<bool>,
|
| 15 |
/// The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 16 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
|
|
|
| 17 |
pub domains: Option<Vec<String>>,
|
| 18 |
/// The domains associated with the organization, including verification state.
|
| 19 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
|
|
|
| 14 |
pub allow_profiles_outside_organization: Option<bool>,
|
| 15 |
/// The domains associated with the organization. Deprecated in favor of `domain_data`.
|
| 16 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 17 |
+
#[deprecated]
|
| 18 |
pub domains: Option<Vec<String>>,
|
| 19 |
/// The domains associated with the organization, including verification state.
|
| 20 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
rust/src/models/waitlist_user.rs|
@@ -7,22 +7,25 @@ use crate::enums::*;
|
|
| 7 |
use serde::{Deserialize, Serialize};
|
| 8 |
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 9 |
pub struct WaitlistUser {
|
| 10 |
-
/// Distinguishes the Waitlist User object.
|
| 11 |
-
pub object: String,
|
| 12 |
-
/// The unique ID of the
|
| 13 |
pub id: String,
|
| 14 |
-
/// The email address of the
|
| 15 |
pub email: String,
|
| 16 |
-
/// The state of the
|
| 17 |
pub state: WaitlistUserState,
|
| 18 |
-
/// The timestamp when the
|
| 19 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 20 |
pub approved_at: Option<String>,
|
|
|
|
|
|
|
|
|
|
| 21 |
-
/// The unique ID of the
|
| 22 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 23 |
pub waitlist_id: Option<String>,
|
| 24 |
/// An ISO 8601 timestamp.
|
| 25 |
pub created_at: String,
|
| 26 |
/// An ISO 8601 timestamp.
|
| 27 |
pub updated_at: String,
|
|
|
|
|
|
|
| 28 |
}
|
|
|
|
| 7 |
use serde::{Deserialize, Serialize};
|
| 8 |
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 9 |
pub struct WaitlistUser {
|
|
|
|
|
|
|
| 10 |
+
/// The unique ID of the waitlist entry.
|
| 11 |
pub id: String,
|
| 12 |
+
/// The email address of the user on the waitlist.
|
| 13 |
pub email: String,
|
| 14 |
+
/// The state of the waitlist entry.
|
| 15 |
pub state: WaitlistUserState,
|
| 16 |
+
/// The timestamp when the entry was approved, or null if not yet approved.
|
| 17 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 18 |
pub approved_at: Option<String>,
|
| 19 |
+
/// Additional fields submitted when the user joined the waitlist. Values are user-provided — treat them as untrusted input when rendering or exporting.
|
| 20 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 21 |
+
pub additional_fields: Option<std::collections::HashMap<String, String>>,
|
| 22 |
+
/// The unique ID of the waitlist the entry belongs to.
|
| 23 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 24 |
pub waitlist_id: Option<String>,
|
| 25 |
/// An ISO 8601 timestamp.
|
| 26 |
pub created_at: String,
|
| 27 |
/// An ISO 8601 timestamp.
|
| 28 |
pub updated_at: String,
|
| 29 |
+
/// Distinguishes the Waitlist User object.
|
| 30 |
+
pub object: String,
|
| 31 |
}
|
rust/src/resources/authorization.rs|
@@ -1261,7 +1261,7 @@ impl<'a> AuthorizationApi<'a> {
|
|
| 1261 |
|
| 1262 |
/// List effective permissions for an organization membership on a resource
|
| 1263 |
///
|
| 1264 |
-
/// Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources.
|
| 1265 |
pub async fn list_effective_permissions(
|
| 1266 |
&self,
|
| 1267 |
organization_membership_id: &str,
|
|
@@ -1330,7 +1330,7 @@ impl<'a> AuthorizationApi<'a> {
|
|
| 1330 |
|
| 1331 |
/// List effective permissions for an organization membership on a resource by external ID
|
| 1332 |
///
|
| 1333 |
-
/// Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources.
|
| 1334 |
pub async fn list_effective_permissions_by_external_id(
|
| 1335 |
&self,
|
| 1336 |
organization_membership_id: &str,
|
|
|
|
| 1261 |
|
| 1262 |
/// List effective permissions for an organization membership on a resource
|
| 1263 |
///
|
| 1264 |
+
/// Returns all permissions the organization membership effectively has on a resource, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 1265 |
pub async fn list_effective_permissions(
|
| 1266 |
&self,
|
| 1267 |
organization_membership_id: &str,
|
|
|
|
| 1330 |
|
| 1331 |
/// List effective permissions for an organization membership on a resource by external ID
|
| 1332 |
///
|
| 1333 |
+
/// Returns all permissions the organization membership effectively has on a resource identified by its external ID, including permissions inherited through roles assigned to ancestor resources. Results are not filtered by the resource type: a permission is returned whenever a check for it on this resource would be authorized, and each permission is labeled with the resource type it is declared on.
|
| 1334 |
pub async fn list_effective_permissions_by_external_id(
|
| 1335 |
&self,
|
| 1336 |
organization_membership_id: &str,
|
rust/src/resources/mod.rs|
@@ -15,6 +15,7 @@ pub mod multi_factor_auth;
|
|
| 15 |
pub mod organization_domains;
|
| 16 |
pub mod organization_membership;
|
| 17 |
pub mod organizations;
|
|
|
|
| 18 |
pub mod pipes;
|
| 19 |
pub mod pipes_provider;
|
| 20 |
pub mod radar;
|
|
@@ -39,6 +40,7 @@ pub use multi_factor_auth::MultiFactorAuthApi;
|
|
| 39 |
pub use organization_domains::OrganizationDomainsApi;
|
| 40 |
pub use organization_membership::OrganizationMembershipApi;
|
| 41 |
pub use organizations::OrganizationsApi;
|
|
|
|
| 42 |
pub use pipes::PipesApi;
|
| 43 |
pub use pipes_provider::PipesProviderApi;
|
| 44 |
pub use radar::RadarApi;
|
|
|
|
| 15 |
pub mod organization_domains;
|
| 16 |
pub mod organization_membership;
|
| 17 |
pub mod organizations;
|
| 18 |
+
pub mod organizations_it_contacts;
|
| 19 |
pub mod pipes;
|
| 20 |
pub mod pipes_provider;
|
| 21 |
pub mod radar;
|
|
|
|
| 40 |
pub use organization_domains::OrganizationDomainsApi;
|
| 41 |
pub use organization_membership::OrganizationMembershipApi;
|
| 42 |
pub use organizations::OrganizationsApi;
|
| 43 |
+
pub use organizations_it_contacts::OrganizationsItContactsApi;
|
| 44 |
pub use pipes::PipesApi;
|
| 45 |
pub use pipes_provider::PipesProviderApi;
|
| 46 |
pub use radar::RadarApi;
|
rust/src/resources/organizations_it_contacts.rs|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
use crate::client::Client;
|
| 4 |
+
#[allow(unused_imports)]
|
| 5 |
+
use crate::enums::*;
|
| 6 |
+
use crate::error::Error;
|
| 7 |
+
#[allow(unused_imports)]
|
| 8 |
+
use crate::models::*;
|
| 9 |
+
use serde::Serialize;
|
| 10 |
+
|
| 11 |
+
pub struct OrganizationsItContactsApi<'a> {
|
| 12 |
+
pub(crate) client: &'a Client,
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
#[derive(Debug, Clone, Serialize)]
|
| 16 |
+
pub struct CreateOrganizationItContactParams {
|
| 17 |
+
/// Request body sent with this call.
|
| 18 |
+
///
|
| 19 |
+
/// Required.
|
| 20 |
+
#[serde(skip)]
|
| 21 |
+
pub body: CreateItContact,
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
impl CreateOrganizationItContactParams {
|
| 25 |
+
/// Construct a new `CreateOrganizationItContactParams` with the required fields set.
|
| 26 |
+
#[allow(deprecated)]
|
| 27 |
+
pub fn new(body: CreateItContact) -> Self {
|
| 28 |
+
Self { body }
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
impl<'a> OrganizationsItContactsApi<'a> {
|
| 33 |
+
/// List IT contacts
|
| 34 |
+
///
|
| 35 |
+
/// Get the IT contacts for an organization.
|
| 36 |
+
pub async fn list_organization_it_contacts(
|
| 37 |
+
&self,
|
| 38 |
+
organization_id: &str,
|
| 39 |
+
) -> Result<ItContactList, Error> {
|
| 40 |
+
self.list_organization_it_contacts_with_options(organization_id, None)
|
| 41 |
+
.await
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
/// Variant of [`Self::list_organization_it_contacts`] that accepts per-request [`crate::RequestOptions`].
|
| 45 |
+
pub async fn list_organization_it_contacts_with_options(
|
| 46 |
+
&self,
|
| 47 |
+
organization_id: &str,
|
| 48 |
+
options: Option<&crate::RequestOptions>,
|
| 49 |
+
) -> Result<ItContactList, Error> {
|
| 50 |
+
let organization_id = crate::client::path_segment(organization_id);
|
| 51 |
+
let path = format!("/organizations/{organization_id}/it_contacts");
|
| 52 |
+
let method = http::Method::GET;
|
| 53 |
+
self.client
|
| 54 |
+
.request_with_query_opts(method, &path, &(), options)
|
| 55 |
+
.await
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
/// Create an IT contact
|
| 59 |
+
///
|
| 60 |
+
/// Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry.
|
| 61 |
+
pub async fn create_organization_it_contact(
|
| 62 |
+
&self,
|
| 63 |
+
organization_id: &str,
|
| 64 |
+
params: CreateOrganizationItContactParams,
|
| 65 |
+
) -> Result<ItContact, Error> {
|
| 66 |
+
self.create_organization_it_contact_with_options(organization_id, params, None)
|
| 67 |
+
.await
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/// Variant of [`Self::create_organization_it_contact`] that accepts per-request [`crate::RequestOptions`].
|
| 71 |
+
pub async fn create_organization_it_contact_with_options(
|
| 72 |
+
&self,
|
| 73 |
+
organization_id: &str,
|
| 74 |
+
params: CreateOrganizationItContactParams,
|
| 75 |
+
options: Option<&crate::RequestOptions>,
|
| 76 |
+
) -> Result<ItContact, Error> {
|
| 77 |
+
let organization_id = crate::client::path_segment(organization_id);
|
| 78 |
+
let path = format!("/organizations/{organization_id}/it_contacts");
|
| 79 |
+
let method = http::Method::POST;
|
| 80 |
+
self.client
|
| 81 |
+
.request_with_body_opts(method, &path, ¶ms, Some(¶ms.body), options)
|
| 82 |
+
.await
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
/// Delete an IT contact
|
| 86 |
+
///
|
| 87 |
+
/// Remove an IT contact from an organization.
|
| 88 |
+
pub async fn delete_organization_it_contact(
|
| 89 |
+
&self,
|
| 90 |
+
organization_id: &str,
|
| 91 |
+
contact_id: &str,
|
| 92 |
+
) -> Result<(), Error> {
|
| 93 |
+
self.delete_organization_it_contact_with_options(organization_id, contact_id, None)
|
| 94 |
+
.await
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
/// Variant of [`Self::delete_organization_it_contact`] that accepts per-request [`crate::RequestOptions`].
|
| 98 |
+
pub async fn delete_organization_it_contact_with_options(
|
| 99 |
+
&self,
|
| 100 |
+
organization_id: &str,
|
| 101 |
+
contact_id: &str,
|
| 102 |
+
options: Option<&crate::RequestOptions>,
|
| 103 |
+
) -> Result<(), Error> {
|
| 104 |
+
let organization_id = crate::client::path_segment(organization_id);
|
| 105 |
+
let contact_id = crate::client::path_segment(contact_id);
|
| 106 |
+
let path = format!("/organizations/{organization_id}/it_contacts/{contact_id}");
|
| 107 |
+
let method = http::Method::DELETE;
|
| 108 |
+
self.client
|
| 109 |
+
.request_with_query_opts_empty(method, &path, &(), options)
|
| 110 |
+
.await
|
| 111 |
+
}
|
| 112 |
+
}
|
rust/src/resources_api.rs|
@@ -16,6 +16,7 @@ use crate::resources::MultiFactorAuthApi;
|
|
| 16 |
use crate::resources::OrganizationDomainsApi;
|
| 17 |
use crate::resources::OrganizationMembershipApi;
|
| 18 |
use crate::resources::OrganizationsApi;
|
|
|
|
| 19 |
use crate::resources::PipesApi;
|
| 20 |
use crate::resources::PipesProviderApi;
|
| 21 |
use crate::resources::RadarApi;
|
|
@@ -101,6 +102,11 @@ impl Client {
|
|
| 101 |
OrganizationsApi { client: self }
|
| 102 |
}
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
/// Access the `pipes` resource.
|
| 105 |
pub fn pipes(&self) -> PipesApi<'_> {
|
| 106 |
PipesApi { client: self }
|
|
|
|
| 16 |
use crate::resources::OrganizationDomainsApi;
|
| 17 |
use crate::resources::OrganizationMembershipApi;
|
| 18 |
use crate::resources::OrganizationsApi;
|
| 19 |
+
use crate::resources::OrganizationsItContactsApi;
|
| 20 |
use crate::resources::PipesApi;
|
| 21 |
use crate::resources::PipesProviderApi;
|
| 22 |
use crate::resources::RadarApi;
|
|
|
|
| 102 |
OrganizationsApi { client: self }
|
| 103 |
}
|
| 104 |
|
| 105 |
+
/// Access the `organizations_it_contacts` resource.
|
| 106 |
+
pub fn organizations_it_contacts(&self) -> OrganizationsItContactsApi<'_> {
|
| 107 |
+
OrganizationsItContactsApi { client: self }
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
/// Access the `pipes` resource.
|
| 111 |
pub fn pipes(&self) -> PipesApi<'_> {
|
| 112 |
PipesApi { client: self }
|
rust/tests/fixtures/create_it_contact.json|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"email": "it-contact@example.com"
|
| 3 |
+
}
|
rust/tests/fixtures/it_contact.json|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "it_contact",
|
| 3 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 4 |
+
"email": "it-contact@example.com",
|
| 5 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 6 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 7 |
+
}
|
rust/tests/fixtures/it_contact_list.json|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"object": "list",
|
| 3 |
+
"data": [
|
| 4 |
+
{
|
| 5 |
+
"object": "it_contact",
|
| 6 |
+
"id": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 7 |
+
"email": "it-contact@example.com",
|
| 8 |
+
"created_at": "2026-01-15T12:00:00.000Z",
|
| 9 |
+
"updated_at": "2026-01-15T12:00:00.000Z"
|
| 10 |
+
}
|
| 11 |
+
],
|
| 12 |
+
"list_metadata": {
|
| 13 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 14 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 15 |
+
}
|
| 16 |
+
}
|
rust/tests/fixtures/it_contact_list_list_metadata.json|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"before": "it_contact_01HXYZ123456789ABCDEFGHIJ",
|
| 3 |
+
"after": "it_contact_01HXYZ987654321KJIHGFEDCBA"
|
| 4 |
+
}
|
rust/tests/fixtures/waitlist_user.json|
@@ -1,9 +1,9 @@
|
|
| 1 |
{
|
| 2 |
-
"object": "waitlist_user",
|
| 3 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 4 |
"email": "marcelina.davis@example.com",
|
| 5 |
"state": "pending",
|
| 6 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 7 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 8 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 9 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 3 |
"email": "marcelina.davis@example.com",
|
| 4 |
"state": "pending",
|
| 5 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 6 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 7 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 8 |
+
"object": "waitlist_user"
|
| 9 |
}
|
rust/tests/fixtures/waitlist_user_approved.json|
@@ -3,13 +3,13 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 11 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 13 |
},
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z"
|
| 15 |
}
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.approved",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 10 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 11 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
+
"object": "waitlist_user"
|
| 13 |
},
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z"
|
| 15 |
}
|
rust/tests/fixtures/waitlist_user_created.json|
@@ -3,13 +3,13 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 11 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 13 |
},
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z"
|
| 15 |
}
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.created",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 10 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 11 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
+
"object": "waitlist_user"
|
| 13 |
},
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z"
|
| 15 |
}
|
rust/tests/fixtures/waitlist_user_denied.json|
@@ -3,13 +3,13 @@
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
| 6 |
-
"object": "waitlist_user",
|
| 7 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 8 |
"email": "marcelina.davis@example.com",
|
| 9 |
"state": "pending",
|
| 10 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 11 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
-
"updated_at": "2026-01-15T12:00:00.000Z"
|
|
|
|
| 13 |
},
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z"
|
| 15 |
}
|
|
|
|
| 3 |
"id": "event_01EHZNVPK3SFK441A1RGBFSHRT",
|
| 4 |
"event": "waitlist_user.denied",
|
| 5 |
"data": {
|
|
|
|
| 6 |
"id": "wl_user_01E4ZCR3C56J083X43JQXF3JK5",
|
| 7 |
"email": "marcelina.davis@example.com",
|
| 8 |
"state": "pending",
|
| 9 |
"approved_at": "2023-01-01T00:00:00.000Z",
|
| 10 |
"created_at": "2026-01-15T12:00:00.000Z",
|
| 11 |
+
"updated_at": "2026-01-15T12:00:00.000Z",
|
| 12 |
+
"object": "waitlist_user"
|
| 13 |
},
|
| 14 |
"created_at": "2026-01-15T12:00:00.000Z"
|
| 15 |
}
|
rust/tests/organizations_it_contacts_test.rs|
@@ -0,0 +1,483 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
mod common;
|
| 4 |
+
|
| 5 |
+
use wiremock::matchers::{method, path as path_matcher};
|
| 6 |
+
use wiremock::{Mock, MockServer, ResponseTemplate};
|
| 7 |
+
use workos::Error;
|
| 8 |
+
|
| 9 |
+
#[tokio::test]
|
| 10 |
+
async fn organizations_it_contacts_list_organization_it_contacts_round_trip() {
|
| 11 |
+
let server = MockServer::start().await;
|
| 12 |
+
Mock::given(method("GET"))
|
| 13 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 14 |
+
.respond_with(
|
| 15 |
+
ResponseTemplate::new(200)
|
| 16 |
+
.set_body_string(include_str!("fixtures/it_contact_list.json")),
|
| 17 |
+
)
|
| 18 |
+
.expect(1)
|
| 19 |
+
.mount(&server)
|
| 20 |
+
.await;
|
| 21 |
+
let client = common::test_client(&server).await;
|
| 22 |
+
let _ = client
|
| 23 |
+
.organizations_it_contacts()
|
| 24 |
+
.list_organization_it_contacts("test_id")
|
| 25 |
+
.await;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
#[tokio::test]
|
| 29 |
+
async fn organizations_it_contacts_list_organization_it_contacts_unauthorized() {
|
| 30 |
+
let server = MockServer::start().await;
|
| 31 |
+
let template = ResponseTemplate::new(401).set_body_string("{\"message\":\"Unauthorized\"}");
|
| 32 |
+
Mock::given(method("GET"))
|
| 33 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 34 |
+
.respond_with(template)
|
| 35 |
+
.expect(1)
|
| 36 |
+
.mount(&server)
|
| 37 |
+
.await;
|
| 38 |
+
let client = common::test_client(&server).await;
|
| 39 |
+
let err = client
|
| 40 |
+
.organizations_it_contacts()
|
| 41 |
+
.list_organization_it_contacts("test_id")
|
| 42 |
+
.await
|
| 43 |
+
.expect_err("expected error");
|
| 44 |
+
let api = match &err {
|
| 45 |
+
Error::Api(api) => api.as_ref(),
|
| 46 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 47 |
+
};
|
| 48 |
+
assert_eq!(api.status, 401);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
#[tokio::test]
|
| 52 |
+
async fn organizations_it_contacts_list_organization_it_contacts_not_found() {
|
| 53 |
+
let server = MockServer::start().await;
|
| 54 |
+
let template = ResponseTemplate::new(404).set_body_string("{\"message\":\"Not found\"}");
|
| 55 |
+
Mock::given(method("GET"))
|
| 56 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 57 |
+
.respond_with(template)
|
| 58 |
+
.expect(1)
|
| 59 |
+
.mount(&server)
|
| 60 |
+
.await;
|
| 61 |
+
let client = common::test_client(&server).await;
|
| 62 |
+
let err = client
|
| 63 |
+
.organizations_it_contacts()
|
| 64 |
+
.list_organization_it_contacts("test_id")
|
| 65 |
+
.await
|
| 66 |
+
.expect_err("expected error");
|
| 67 |
+
let api = match &err {
|
| 68 |
+
Error::Api(api) => api.as_ref(),
|
| 69 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 70 |
+
};
|
| 71 |
+
assert_eq!(api.status, 404);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
#[tokio::test]
|
| 75 |
+
async fn organizations_it_contacts_list_organization_it_contacts_rate_limited() {
|
| 76 |
+
let server = MockServer::start().await;
|
| 77 |
+
let template = ResponseTemplate::new(429)
|
| 78 |
+
.insert_header("retry-after", "1")
|
| 79 |
+
.set_body_string("{\"message\":\"Slow down\"}");
|
| 80 |
+
Mock::given(method("GET"))
|
| 81 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 82 |
+
.respond_with(template)
|
| 83 |
+
.expect(1)
|
| 84 |
+
.mount(&server)
|
| 85 |
+
.await;
|
| 86 |
+
let client = common::test_client(&server).await;
|
| 87 |
+
let err = client
|
| 88 |
+
.organizations_it_contacts()
|
| 89 |
+
.list_organization_it_contacts("test_id")
|
| 90 |
+
.await
|
| 91 |
+
.expect_err("expected error");
|
| 92 |
+
let api = match &err {
|
| 93 |
+
Error::Api(api) => api.as_ref(),
|
| 94 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 95 |
+
};
|
| 96 |
+
assert_eq!(api.status, 429);
|
| 97 |
+
assert_eq!(api.retry_after, Some(std::time::Duration::from_secs(1)));
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
#[tokio::test]
|
| 101 |
+
async fn organizations_it_contacts_list_organization_it_contacts_server_error() {
|
| 102 |
+
let server = MockServer::start().await;
|
| 103 |
+
let template = ResponseTemplate::new(500).set_body_string("{\"message\":\"Internal error\"}");
|
| 104 |
+
Mock::given(method("GET"))
|
| 105 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 106 |
+
.respond_with(template)
|
| 107 |
+
.expect(1)
|
| 108 |
+
.mount(&server)
|
| 109 |
+
.await;
|
| 110 |
+
let client = common::test_client(&server).await;
|
| 111 |
+
let err = client
|
| 112 |
+
.organizations_it_contacts()
|
| 113 |
+
.list_organization_it_contacts("test_id")
|
| 114 |
+
.await
|
| 115 |
+
.expect_err("expected error");
|
| 116 |
+
let api = match &err {
|
| 117 |
+
Error::Api(api) => api.as_ref(),
|
| 118 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 119 |
+
};
|
| 120 |
+
assert_eq!(api.status, 500);
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
#[tokio::test]
|
| 124 |
+
async fn organizations_it_contacts_create_organization_it_contact_round_trip() {
|
| 125 |
+
let server = MockServer::start().await;
|
| 126 |
+
Mock::given(method("POST"))
|
| 127 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 128 |
+
.respond_with(
|
| 129 |
+
ResponseTemplate::new(200).set_body_string(include_str!("fixtures/it_contact.json")),
|
| 130 |
+
)
|
| 131 |
+
.expect(1)
|
| 132 |
+
.mount(&server)
|
| 133 |
+
.await;
|
| 134 |
+
let client = common::test_client(&server).await;
|
| 135 |
+
let _ = client
|
| 136 |
+
.organizations_it_contacts()
|
| 137 |
+
.create_organization_it_contact(
|
| 138 |
+
"test_id",
|
| 139 |
+
workos::organizations_it_contacts::CreateOrganizationItContactParams::new(
|
| 140 |
+
serde_json::from_str(include_str!("fixtures/create_it_contact.json"))
|
| 141 |
+
.expect("parse fixture for CreateItContact"),
|
| 142 |
+
),
|
| 143 |
+
)
|
| 144 |
+
.await;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
#[tokio::test]
|
| 148 |
+
async fn organizations_it_contacts_create_organization_it_contact_unauthorized() {
|
| 149 |
+
let server = MockServer::start().await;
|
| 150 |
+
let template = ResponseTemplate::new(401).set_body_string("{\"message\":\"Unauthorized\"}");
|
| 151 |
+
Mock::given(method("POST"))
|
| 152 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 153 |
+
.respond_with(template)
|
| 154 |
+
.expect(1)
|
| 155 |
+
.mount(&server)
|
| 156 |
+
.await;
|
| 157 |
+
let client = common::test_client(&server).await;
|
| 158 |
+
let err = client
|
| 159 |
+
.organizations_it_contacts()
|
| 160 |
+
.create_organization_it_contact(
|
| 161 |
+
"test_id",
|
| 162 |
+
workos::organizations_it_contacts::CreateOrganizationItContactParams::new(
|
| 163 |
+
serde_json::from_str(include_str!("fixtures/create_it_contact.json"))
|
| 164 |
+
.expect("parse fixture for CreateItContact"),
|
| 165 |
+
),
|
| 166 |
+
)
|
| 167 |
+
.await
|
| 168 |
+
.expect_err("expected error");
|
| 169 |
+
let api = match &err {
|
| 170 |
+
Error::Api(api) => api.as_ref(),
|
| 171 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 172 |
+
};
|
| 173 |
+
assert_eq!(api.status, 401);
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
#[tokio::test]
|
| 177 |
+
async fn organizations_it_contacts_create_organization_it_contact_not_found() {
|
| 178 |
+
let server = MockServer::start().await;
|
| 179 |
+
let template = ResponseTemplate::new(404).set_body_string("{\"message\":\"Not found\"}");
|
| 180 |
+
Mock::given(method("POST"))
|
| 181 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 182 |
+
.respond_with(template)
|
| 183 |
+
.expect(1)
|
| 184 |
+
.mount(&server)
|
| 185 |
+
.await;
|
| 186 |
+
let client = common::test_client(&server).await;
|
| 187 |
+
let err = client
|
| 188 |
+
.organizations_it_contacts()
|
| 189 |
+
.create_organization_it_contact(
|
| 190 |
+
"test_id",
|
| 191 |
+
workos::organizations_it_contacts::CreateOrganizationItContactParams::new(
|
| 192 |
+
serde_json::from_str(include_str!("fixtures/create_it_contact.json"))
|
| 193 |
+
.expect("parse fixture for CreateItContact"),
|
| 194 |
+
),
|
| 195 |
+
)
|
| 196 |
+
.await
|
| 197 |
+
.expect_err("expected error");
|
| 198 |
+
let api = match &err {
|
| 199 |
+
Error::Api(api) => api.as_ref(),
|
| 200 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 201 |
+
};
|
| 202 |
+
assert_eq!(api.status, 404);
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
#[tokio::test]
|
| 206 |
+
async fn organizations_it_contacts_create_organization_it_contact_rate_limited() {
|
| 207 |
+
let server = MockServer::start().await;
|
| 208 |
+
let template = ResponseTemplate::new(429)
|
| 209 |
+
.insert_header("retry-after", "1")
|
| 210 |
+
.set_body_string("{\"message\":\"Slow down\"}");
|
| 211 |
+
Mock::given(method("POST"))
|
| 212 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 213 |
+
.respond_with(template)
|
| 214 |
+
.expect(1)
|
| 215 |
+
.mount(&server)
|
| 216 |
+
.await;
|
| 217 |
+
let client = common::test_client(&server).await;
|
| 218 |
+
let err = client
|
| 219 |
+
.organizations_it_contacts()
|
| 220 |
+
.create_organization_it_contact(
|
| 221 |
+
"test_id",
|
| 222 |
+
workos::organizations_it_contacts::CreateOrganizationItContactParams::new(
|
| 223 |
+
serde_json::from_str(include_str!("fixtures/create_it_contact.json"))
|
| 224 |
+
.expect("parse fixture for CreateItContact"),
|
| 225 |
+
),
|
| 226 |
+
)
|
| 227 |
+
.await
|
| 228 |
+
.expect_err("expected error");
|
| 229 |
+
let api = match &err {
|
| 230 |
+
Error::Api(api) => api.as_ref(),
|
| 231 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 232 |
+
};
|
| 233 |
+
assert_eq!(api.status, 429);
|
| 234 |
+
assert_eq!(api.retry_after, Some(std::time::Duration::from_secs(1)));
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
#[tokio::test]
|
| 238 |
+
async fn organizations_it_contacts_create_organization_it_contact_server_error() {
|
| 239 |
+
let server = MockServer::start().await;
|
| 240 |
+
let template = ResponseTemplate::new(500).set_body_string("{\"message\":\"Internal error\"}");
|
| 241 |
+
Mock::given(method("POST"))
|
| 242 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 243 |
+
.respond_with(template)
|
| 244 |
+
.expect(1)
|
| 245 |
+
.mount(&server)
|
| 246 |
+
.await;
|
| 247 |
+
let client = common::test_client(&server).await;
|
| 248 |
+
let err = client
|
| 249 |
+
.organizations_it_contacts()
|
| 250 |
+
.create_organization_it_contact(
|
| 251 |
+
"test_id",
|
| 252 |
+
workos::organizations_it_contacts::CreateOrganizationItContactParams::new(
|
| 253 |
+
serde_json::from_str(include_str!("fixtures/create_it_contact.json"))
|
| 254 |
+
.expect("parse fixture for CreateItContact"),
|
| 255 |
+
),
|
| 256 |
+
)
|
| 257 |
+
.await
|
| 258 |
+
.expect_err("expected error");
|
| 259 |
+
let api = match &err {
|
| 260 |
+
Error::Api(api) => api.as_ref(),
|
| 261 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 262 |
+
};
|
| 263 |
+
assert_eq!(api.status, 500);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
#[tokio::test]
|
| 267 |
+
async fn organizations_it_contacts_create_organization_it_contact_bad_request() {
|
| 268 |
+
let server = MockServer::start().await;
|
| 269 |
+
let template = ResponseTemplate::new(400)
|
| 270 |
+
.set_body_string("{\"code\":\"validation_error\",\"message\":\"Bad request\"}");
|
| 271 |
+
Mock::given(method("POST"))
|
| 272 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 273 |
+
.respond_with(template)
|
| 274 |
+
.expect(1)
|
| 275 |
+
.mount(&server)
|
| 276 |
+
.await;
|
| 277 |
+
let client = common::test_client(&server).await;
|
| 278 |
+
let err = client
|
| 279 |
+
.organizations_it_contacts()
|
| 280 |
+
.create_organization_it_contact(
|
| 281 |
+
"test_id",
|
| 282 |
+
workos::organizations_it_contacts::CreateOrganizationItContactParams::new(
|
| 283 |
+
serde_json::from_str(include_str!("fixtures/create_it_contact.json"))
|
| 284 |
+
.expect("parse fixture for CreateItContact"),
|
| 285 |
+
),
|
| 286 |
+
)
|
| 287 |
+
.await
|
| 288 |
+
.expect_err("expected error");
|
| 289 |
+
let api = match &err {
|
| 290 |
+
Error::Api(api) => api.as_ref(),
|
| 291 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 292 |
+
};
|
| 293 |
+
assert_eq!(api.status, 400);
|
| 294 |
+
assert_eq!(api.code.as_deref(), Some("validation_error"));
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
#[tokio::test]
|
| 298 |
+
async fn organizations_it_contacts_create_organization_it_contact_unprocessable() {
|
| 299 |
+
let server = MockServer::start().await;
|
| 300 |
+
let template = ResponseTemplate::new(422).set_body_string("{\"message\":\"Unprocessable\"}");
|
| 301 |
+
Mock::given(method("POST"))
|
| 302 |
+
.and(path_matcher("/organizations/test_id/it_contacts"))
|
| 303 |
+
.respond_with(template)
|
| 304 |
+
.expect(1)
|
| 305 |
+
.mount(&server)
|
| 306 |
+
.await;
|
| 307 |
+
let client = common::test_client(&server).await;
|
| 308 |
+
let err = client
|
| 309 |
+
.organizations_it_contacts()
|
| 310 |
+
.create_organization_it_contact(
|
| 311 |
+
"test_id",
|
| 312 |
+
workos::organizations_it_contacts::CreateOrganizationItContactParams::new(
|
| 313 |
+
serde_json::from_str(include_str!("fixtures/create_it_contact.json"))
|
| 314 |
+
.expect("parse fixture for CreateItContact"),
|
| 315 |
+
),
|
| 316 |
+
)
|
| 317 |
+
.await
|
| 318 |
+
.expect_err("expected error");
|
| 319 |
+
let api = match &err {
|
| 320 |
+
Error::Api(api) => api.as_ref(),
|
| 321 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 322 |
+
};
|
| 323 |
+
assert_eq!(api.status, 422);
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
#[tokio::test]
|
| 327 |
+
async fn organizations_it_contacts_delete_organization_it_contact_round_trip() {
|
| 328 |
+
let server = MockServer::start().await;
|
| 329 |
+
Mock::given(method("DELETE"))
|
| 330 |
+
.and(path_matcher("/organizations/test_id/it_contacts/test_id"))
|
| 331 |
+
.respond_with(ResponseTemplate::new(200).set_body_string("{}"))
|
| 332 |
+
.expect(1)
|
| 333 |
+
.mount(&server)
|
| 334 |
+
.await;
|
| 335 |
+
let client = common::test_client(&server).await;
|
| 336 |
+
let _ = client
|
| 337 |
+
.organizations_it_contacts()
|
| 338 |
+
.delete_organization_it_contact("test_id", "test_id")
|
| 339 |
+
.await;
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
#[tokio::test]
|
| 343 |
+
async fn organizations_it_contacts_delete_organization_it_contact_unauthorized() {
|
| 344 |
+
let server = MockServer::start().await;
|
| 345 |
+
let template = ResponseTemplate::new(401).set_body_string("{\"message\":\"Unauthorized\"}");
|
| 346 |
+
Mock::given(method("DELETE"))
|
| 347 |
+
.and(path_matcher("/organizations/test_id/it_contacts/test_id"))
|
| 348 |
+
.respond_with(template)
|
| 349 |
+
.expect(1)
|
| 350 |
+
.mount(&server)
|
| 351 |
+
.await;
|
| 352 |
+
let client = common::test_client(&server).await;
|
| 353 |
+
let err = client
|
| 354 |
+
.organizations_it_contacts()
|
| 355 |
+
.delete_organization_it_contact("test_id", "test_id")
|
| 356 |
+
.await
|
| 357 |
+
.expect_err("expected error");
|
| 358 |
+
let api = match &err {
|
| 359 |
+
Error::Api(api) => api.as_ref(),
|
| 360 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 361 |
+
};
|
| 362 |
+
assert_eq!(api.status, 401);
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
#[tokio::test]
|
| 366 |
+
async fn organizations_it_contacts_delete_organization_it_contact_not_found() {
|
| 367 |
+
let server = MockServer::start().await;
|
| 368 |
+
let template = ResponseTemplate::new(404).set_body_string("{\"message\":\"Not found\"}");
|
| 369 |
+
Mock::given(method("DELETE"))
|
| 370 |
+
.and(path_matcher("/organizations/test_id/it_contacts/test_id"))
|
| 371 |
+
.respond_with(template)
|
| 372 |
+
.expect(1)
|
| 373 |
+
.mount(&server)
|
| 374 |
+
.await;
|
| 375 |
+
let client = common::test_client(&server).await;
|
| 376 |
+
let err = client
|
| 377 |
+
.organizations_it_contacts()
|
| 378 |
+
.delete_organization_it_contact("test_id", "test_id")
|
| 379 |
+
.await
|
| 380 |
+
.expect_err("expected error");
|
| 381 |
+
let api = match &err {
|
| 382 |
+
Error::Api(api) => api.as_ref(),
|
| 383 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 384 |
+
};
|
| 385 |
+
assert_eq!(api.status, 404);
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
#[tokio::test]
|
| 389 |
+
async fn organizations_it_contacts_delete_organization_it_contact_rate_limited() {
|
| 390 |
+
let server = MockServer::start().await;
|
| 391 |
+
let template = ResponseTemplate::new(429)
|
| 392 |
+
.insert_header("retry-after", "1")
|
| 393 |
+
.set_body_string("{\"message\":\"Slow down\"}");
|
| 394 |
+
Mock::given(method("DELETE"))
|
| 395 |
+
.and(path_matcher("/organizations/test_id/it_contacts/test_id"))
|
| 396 |
+
.respond_with(template)
|
| 397 |
+
.expect(1)
|
| 398 |
+
.mount(&server)
|
| 399 |
+
.await;
|
| 400 |
+
let client = common::test_client(&server).await;
|
| 401 |
+
let err = client
|
| 402 |
+
.organizations_it_contacts()
|
| 403 |
+
.delete_organization_it_contact("test_id", "test_id")
|
| 404 |
+
.await
|
| 405 |
+
.expect_err("expected error");
|
| 406 |
+
let api = match &err {
|
| 407 |
+
Error::Api(api) => api.as_ref(),
|
| 408 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 409 |
+
};
|
| 410 |
+
assert_eq!(api.status, 429);
|
| 411 |
+
assert_eq!(api.retry_after, Some(std::time::Duration::from_secs(1)));
|
| 412 |
+
}
|
| 413 |
+
|
| 414 |
+
#[tokio::test]
|
| 415 |
+
async fn organizations_it_contacts_delete_organization_it_contact_server_error() {
|
| 416 |
+
let server = MockServer::start().await;
|
| 417 |
+
let template = ResponseTemplate::new(500).set_body_string("{\"message\":\"Internal error\"}");
|
| 418 |
+
Mock::given(method("DELETE"))
|
| 419 |
+
.and(path_matcher("/organizations/test_id/it_contacts/test_id"))
|
| 420 |
+
.respond_with(template)
|
| 421 |
+
.expect(1)
|
| 422 |
+
.mount(&server)
|
| 423 |
+
.await;
|
| 424 |
+
let client = common::test_client(&server).await;
|
| 425 |
+
let err = client
|
| 426 |
+
.organizations_it_contacts()
|
| 427 |
+
.delete_organization_it_contact("test_id", "test_id")
|
| 428 |
+
.await
|
| 429 |
+
.expect_err("expected error");
|
| 430 |
+
let api = match &err {
|
| 431 |
+
Error::Api(api) => api.as_ref(),
|
| 432 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 433 |
+
};
|
| 434 |
+
assert_eq!(api.status, 500);
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
#[tokio::test]
|
| 438 |
+
async fn organizations_it_contacts_delete_organization_it_contact_bad_request() {
|
| 439 |
+
let server = MockServer::start().await;
|
| 440 |
+
let template = ResponseTemplate::new(400)
|
| 441 |
+
.set_body_string("{\"code\":\"validation_error\",\"message\":\"Bad request\"}");
|
| 442 |
+
Mock::given(method("DELETE"))
|
| 443 |
+
.and(path_matcher("/organizations/test_id/it_contacts/test_id"))
|
| 444 |
+
.respond_with(template)
|
| 445 |
+
.expect(1)
|
| 446 |
+
.mount(&server)
|
| 447 |
+
.await;
|
| 448 |
+
let client = common::test_client(&server).await;
|
| 449 |
+
let err = client
|
| 450 |
+
.organizations_it_contacts()
|
| 451 |
+
.delete_organization_it_contact("test_id", "test_id")
|
| 452 |
+
.await
|
| 453 |
+
.expect_err("expected error");
|
| 454 |
+
let api = match &err {
|
| 455 |
+
Error::Api(api) => api.as_ref(),
|
| 456 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 457 |
+
};
|
| 458 |
+
assert_eq!(api.status, 400);
|
| 459 |
+
assert_eq!(api.code.as_deref(), Some("validation_error"));
|
| 460 |
+
}
|
| 461 |
+
|
| 462 |
+
#[tokio::test]
|
| 463 |
+
async fn organizations_it_contacts_delete_organization_it_contact_unprocessable() {
|
| 464 |
+
let server = MockServer::start().await;
|
| 465 |
+
let template = ResponseTemplate::new(422).set_body_string("{\"message\":\"Unprocessable\"}");
|
| 466 |
+
Mock::given(method("DELETE"))
|
| 467 |
+
.and(path_matcher("/organizations/test_id/it_contacts/test_id"))
|
| 468 |
+
.respond_with(template)
|
| 469 |
+
.expect(1)
|
| 470 |
+
.mount(&server)
|
| 471 |
+
.await;
|
| 472 |
+
let client = common::test_client(&server).await;
|
| 473 |
+
let err = client
|
| 474 |
+
.organizations_it_contacts()
|
| 475 |
+
.delete_organization_it_contact("test_id", "test_id")
|
| 476 |
+
.await
|
| 477 |
+
.expect_err("expected error");
|
| 478 |
+
let api = match &err {
|
| 479 |
+
Error::Api(api) => api.as_ref(),
|
| 480 |
+
other => panic!("expected Error::Api, got {other:?}"),
|
| 481 |
+
};
|
| 482 |
+
assert_eq!(api.status, 422);
|
| 483 |
+
}
|
All files in this language are hidden by the current filters.