code: 4 ยท tests: 1 ยท manifest: 1
dotnet/.oagen-manifest.json|
@@ -1300,6 +1300,8 @@
|
|
| 1300 |
"test/WorkOSTests/testdata/organization_api_key_with_value_owner.json",
|
| 1301 |
"test/WorkOSTests/testdata/organization_authorized_connect_application_list_data.json",
|
| 1302 |
"test/WorkOSTests/testdata/organization_authorized_connect_application_list_data_nulls.json",
|
|
|
|
|
|
|
| 1303 |
"test/WorkOSTests/testdata/organization_created.json",
|
| 1304 |
"test/WorkOSTests/testdata/organization_created_data.json",
|
| 1305 |
"test/WorkOSTests/testdata/organization_created_data_domain.json",
|
|
|
|
| 1300 |
"test/WorkOSTests/testdata/organization_api_key_with_value_owner.json",
|
| 1301 |
"test/WorkOSTests/testdata/organization_authorized_connect_application_list_data.json",
|
| 1302 |
"test/WorkOSTests/testdata/organization_authorized_connect_application_list_data_nulls.json",
|
| 1303 |
+
"test/WorkOSTests/testdata/organization_connected_account.json",
|
| 1304 |
+
"test/WorkOSTests/testdata/organization_connected_account_nulls.json",
|
| 1305 |
"test/WorkOSTests/testdata/organization_created.json",
|
| 1306 |
"test/WorkOSTests/testdata/organization_created_data.json",
|
| 1307 |
"test/WorkOSTests/testdata/organization_created_data_domain.json",
|
dotnet/src/WorkOS.net/Services/Pipes/_interfaces/PipesOptions.cs|
@@ -231,6 +231,9 @@ namespace WorkOS
|
|
| 231 |
/// <summary>Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.</summary>
|
| 232 |
public ConnectedAccountInputState? State { get; set; }
|
| 233 |
|
|
|
|
|
|
|
|
|
|
| 234 |
}
|
| 235 |
|
| 236 |
/// <summary>Request options for <see cref="PipesService.UpdateOrganizationConnectedAccountAsync"/>: Update an organization connected account</summary>
|
|
@@ -251,6 +254,9 @@ namespace WorkOS
|
|
| 251 |
/// <summary>Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.</summary>
|
| 252 |
public ConnectedAccountInputState? State { get; set; }
|
| 253 |
|
|
|
|
|
|
|
|
|
|
| 254 |
/// <summary>Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.</summary>
|
| 255 |
public bool? SupportsMultipleConnections { get; set; }
|
| 256 |
|
|
|
|
| 231 |
/// <summary>Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.</summary>
|
| 232 |
public ConnectedAccountInputState? State { get; set; }
|
| 233 |
|
| 234 |
+
/// <summary>The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.</summary>
|
| 235 |
+
public string UserId { get; set; } = default!;
|
| 236 |
+
|
| 237 |
}
|
| 238 |
|
| 239 |
/// <summary>Request options for <see cref="PipesService.UpdateOrganizationConnectedAccountAsync"/>: Update an organization connected account</summary>
|
|
|
|
| 254 |
/// <summary>Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.</summary>
|
| 255 |
public ConnectedAccountInputState? State { get; set; }
|
| 256 |
|
| 257 |
+
/// <summary>The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.</summary>
|
| 258 |
+
public string UserId { get; set; } = default!;
|
| 259 |
+
|
| 260 |
/// <summary>Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.</summary>
|
| 261 |
public bool? SupportsMultipleConnections { get; set; }
|
| 262 |
|
dotnet/src/WorkOS.net/Services/UserManagement/_interfaces/UserManagementOptions.cs|
@@ -174,7 +174,7 @@ namespace WorkOS
|
|
| 174 |
/// <summary>Request options for <see cref="UserManagementService.CreateAsync"/>: Create a user</summary>
|
| 175 |
public class UserManagementCreateOptions : BaseOptions
|
| 176 |
{
|
| 177 |
-
/// <summary>The email address of the user.</summary>
|
| 178 |
public string Email { get; set; } = default!;
|
| 179 |
|
| 180 |
/// <summary>The first name of the user.</summary>
|
|
|
|
| 174 |
/// <summary>Request options for <see cref="UserManagementService.CreateAsync"/>: Create a user</summary>
|
| 175 |
public class UserManagementCreateOptions : BaseOptions
|
| 176 |
{
|
| 177 |
+
/// <summary>The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.</summary>
|
| 178 |
public string Email { get; set; } = default!;
|
| 179 |
|
| 180 |
/// <summary>The first name of the user.</summary>
|
dotnet/test/WorkOSTests/Tests/PipesServiceTest.cs|
@@ -224,12 +224,15 @@ namespace WorkOSTests
|
|
| 224 |
{
|
| 225 |
var fixture = System.IO.File.ReadAllText("testdata/connected_account.json");
|
| 226 |
this.httpMock.MockResponse(HttpMethod.Post, "/organizations/test_organization_id/connected_accounts/test_slug", HttpStatusCode.OK, fixture);
|
|
|
|
|
|
|
| 227 |
-
var result = await this.service.CreateOrganizationConnectedAccountAsync("test_organization_id", "test_slug",
|
| 228 |
Assert.NotNull(result);
|
| 229 |
Assert.Equal("data_installation_01EHZNVPK3SFK441A1RGBFSHRT", result.Id);
|
| 230 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.CreatedAt);
|
| 231 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.UpdatedAt);
|
| 232 |
this.httpMock.AssertRequestWasMade(HttpMethod.Post, "/organizations/test_organization_id/connected_accounts/test_slug");
|
|
|
|
| 233 |
}
|
| 234 |
|
| 235 |
[Fact]
|
|
@@ -237,12 +240,15 @@ namespace WorkOSTests
|
|
| 237 |
{
|
| 238 |
var fixture = System.IO.File.ReadAllText("testdata/connected_account.json");
|
| 239 |
this.httpMock.MockResponse(HttpMethod.Put, "/organizations/test_organization_id/connected_accounts/test_slug", HttpStatusCode.OK, fixture);
|
|
|
|
|
|
|
| 240 |
-
var result = await this.service.UpdateOrganizationConnectedAccountAsync("test_organization_id", "test_slug",
|
| 241 |
Assert.NotNull(result);
|
| 242 |
Assert.Equal("data_installation_01EHZNVPK3SFK441A1RGBFSHRT", result.Id);
|
| 243 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.CreatedAt);
|
| 244 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.UpdatedAt);
|
| 245 |
this.httpMock.AssertRequestWasMade(HttpMethod.Put, "/organizations/test_organization_id/connected_accounts/test_slug");
|
|
|
|
| 246 |
}
|
| 247 |
|
| 248 |
[Fact]
|
|
|
|
| 224 |
{
|
| 225 |
var fixture = System.IO.File.ReadAllText("testdata/connected_account.json");
|
| 226 |
this.httpMock.MockResponse(HttpMethod.Post, "/organizations/test_organization_id/connected_accounts/test_slug", HttpStatusCode.OK, fixture);
|
| 227 |
+
var options = new PipesCreateOrganizationConnectedAccountOptions();
|
| 228 |
+
options.UserId = "test_user_id";
|
| 229 |
+
var result = await this.service.CreateOrganizationConnectedAccountAsync("test_organization_id", "test_slug", options);
|
| 230 |
Assert.NotNull(result);
|
| 231 |
Assert.Equal("data_installation_01EHZNVPK3SFK441A1RGBFSHRT", result.Id);
|
| 232 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.CreatedAt);
|
| 233 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.UpdatedAt);
|
| 234 |
this.httpMock.AssertRequestWasMade(HttpMethod.Post, "/organizations/test_organization_id/connected_accounts/test_slug");
|
| 235 |
+
await this.httpMock.AssertRequestBodyContainsAsync("user_id", "test_user_id");
|
| 236 |
}
|
| 237 |
|
| 238 |
[Fact]
|
|
|
|
| 240 |
{
|
| 241 |
var fixture = System.IO.File.ReadAllText("testdata/connected_account.json");
|
| 242 |
this.httpMock.MockResponse(HttpMethod.Put, "/organizations/test_organization_id/connected_accounts/test_slug", HttpStatusCode.OK, fixture);
|
| 243 |
+
var options = new PipesUpdateOrganizationConnectedAccountOptions();
|
| 244 |
+
options.UserId = "test_user_id";
|
| 245 |
+
var result = await this.service.UpdateOrganizationConnectedAccountAsync("test_organization_id", "test_slug", options);
|
| 246 |
Assert.NotNull(result);
|
| 247 |
Assert.Equal("data_installation_01EHZNVPK3SFK441A1RGBFSHRT", result.Id);
|
| 248 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.CreatedAt);
|
| 249 |
Assert.Equal("2024-01-16T14:20:00.000Z", result.UpdatedAt);
|
| 250 |
this.httpMock.AssertRequestWasMade(HttpMethod.Put, "/organizations/test_organization_id/connected_accounts/test_slug");
|
| 251 |
+
await this.httpMock.AssertRequestBodyContainsAsync("user_id", "test_user_id");
|
| 252 |
}
|
| 253 |
|
| 254 |
[Fact]
|
dotnet/test/WorkOSTests/testdata/organization_connected_account.json|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"access_token": "gho_16C7e42F292c6912E7710c838347Ae178B4a",
|
| 3 |
+
"refresh_token": "ghr_xxxxxxxxxxxxxxxxxxxx",
|
| 4 |
+
"expires_at": "2025-12-31T23:59:59.000Z",
|
| 5 |
+
"scopes": [
|
| 6 |
+
"repo",
|
| 7 |
+
"user:email"
|
| 8 |
+
],
|
| 9 |
+
"state": "connected",
|
| 10 |
+
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT"
|
| 11 |
+
}
|
dotnet/test/WorkOSTests/testdata/organization_connected_account_nulls.json|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"access_token": null,
|
| 3 |
+
"refresh_token": null,
|
| 4 |
+
"expires_at": null,
|
| 5 |
+
"scopes": null,
|
| 6 |
+
"state": null,
|
| 7 |
+
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT"
|
| 8 |
+
}
|
All files in this language are hidden by the current filters.
code: 4 ยท tests: 0 ยท manifest: 1
go/.oagen-manifest.json|
@@ -427,6 +427,7 @@
|
|
| 427 |
"testdata/organization_api_key.json",
|
| 428 |
"testdata/organization_api_key_with_value.json",
|
| 429 |
"testdata/organization_authorized_connect_application_list_data.json",
|
|
|
|
| 430 |
"testdata/organization_created.json",
|
| 431 |
"testdata/organization_created_data.json",
|
| 432 |
"testdata/organization_deleted.json",
|
|
|
|
| 427 |
"testdata/organization_api_key.json",
|
| 428 |
"testdata/organization_api_key_with_value.json",
|
| 429 |
"testdata/organization_authorized_connect_application_list_data.json",
|
| 430 |
+
"testdata/organization_connected_account.json",
|
| 431 |
"testdata/organization_created.json",
|
| 432 |
"testdata/organization_created_data.json",
|
| 433 |
"testdata/organization_deleted.json",
|
go/enums.go|
@@ -125,6 +125,9 @@ type CreateDataIntegrationAuthMethods = ConnectedAccountAuthMethod
|
|
| 125 |
// UpdateCustomProviderDefinitionAuthenticateVia is an alias for CustomProviderDefinitionAuthenticateVia.
|
| 126 |
type UpdateCustomProviderDefinitionAuthenticateVia = CustomProviderDefinitionAuthenticateVia
|
| 127 |
|
|
|
|
|
|
|
|
|
|
| 128 |
// ConnectedAccountInputState represents connected account input state values.
|
| 129 |
type ConnectedAccountInputState string
|
| 130 |
|
|
|
|
| 125 |
// UpdateCustomProviderDefinitionAuthenticateVia is an alias for CustomProviderDefinitionAuthenticateVia.
|
| 126 |
type UpdateCustomProviderDefinitionAuthenticateVia = CustomProviderDefinitionAuthenticateVia
|
| 127 |
|
| 128 |
+
// OrganizationConnectedAccountState is an alias for ConnectedAccountInputState.
|
| 129 |
+
type OrganizationConnectedAccountState = ConnectedAccountInputState
|
| 130 |
+
|
| 131 |
// ConnectedAccountInputState represents connected account input state values.
|
| 132 |
type ConnectedAccountInputState string
|
| 133 |
|
go/pipes.go|
@@ -430,7 +430,9 @@ type PipesCreateOrganizationConnectedAccountParams struct {
|
|
| 430 |
// Scopes is the OAuth scopes granted for this connection.
|
| 431 |
Scopes []string `json:"scopes,omitempty" url:"-"`
|
| 432 |
// State is explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 433 |
-
State *
|
|
|
|
|
|
|
| 434 |
}
|
| 435 |
|
| 436 |
// CreateOrganizationConnectedAccount import an organization connected account
|
|
@@ -455,7 +457,9 @@ type PipesUpdateOrganizationConnectedAccountParams struct {
|
|
| 455 |
// Scopes is the OAuth scopes granted for this connection.
|
| 456 |
Scopes []string `json:"scopes,omitempty" url:"-"`
|
| 457 |
// State is explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 458 |
-
State *
|
|
|
|
|
|
|
| 459 |
// SupportsMultipleConnections is set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 460 |
SupportsMultipleConnections *bool `url:"supports_multiple_connections,omitempty" json:"-"`
|
| 461 |
// ConnectedAccountID is a [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
|
|
|
| 430 |
// Scopes is the OAuth scopes granted for this connection.
|
| 431 |
Scopes []string `json:"scopes,omitempty" url:"-"`
|
| 432 |
// State is explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 433 |
+
State *OrganizationConnectedAccountState `json:"state,omitempty" url:"-"`
|
| 434 |
+
// UserID is the [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 435 |
+
UserID string `json:"user_id" url:"-"`
|
| 436 |
}
|
| 437 |
|
| 438 |
// CreateOrganizationConnectedAccount import an organization connected account
|
|
|
|
| 457 |
// Scopes is the OAuth scopes granted for this connection.
|
| 458 |
Scopes []string `json:"scopes,omitempty" url:"-"`
|
| 459 |
// State is explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 460 |
+
State *OrganizationConnectedAccountState `json:"state,omitempty" url:"-"`
|
| 461 |
+
// UserID is the [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 462 |
+
UserID string `json:"user_id" url:"-"`
|
| 463 |
// SupportsMultipleConnections is set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 464 |
SupportsMultipleConnections *bool `url:"supports_multiple_connections,omitempty" json:"-"`
|
| 465 |
// ConnectedAccountID is a [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
go/testdata/organization_connected_account.json|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"access_token": "gho_16C7e42F292c6912E7710c838347Ae178B4a",
|
| 3 |
+
"refresh_token": "ghr_xxxxxxxxxxxxxxxxxxxx",
|
| 4 |
+
"expires_at": "2025-12-31T23:59:59.000Z",
|
| 5 |
+
"scopes": [
|
| 6 |
+
"repo",
|
| 7 |
+
"user:email"
|
| 8 |
+
],
|
| 9 |
+
"state": "connected",
|
| 10 |
+
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT"
|
| 11 |
+
}
|
go/user_management.go|
@@ -870,7 +870,7 @@ func (s *UserManagementService) List(ctx context.Context, params *UserManagement
|
|
| 870 |
|
| 871 |
// UserManagementCreateParams contains the parameters for Create.
|
| 872 |
type UserManagementCreateParams struct {
|
| 873 |
-
// Email is the email address of the user.
|
| 874 |
Email string `json:"email" url:"-"`
|
| 875 |
// FirstName is the first name of the user.
|
| 876 |
FirstName *string `json:"first_name,omitempty" url:"-"`
|
|
|
|
| 870 |
|
| 871 |
// UserManagementCreateParams contains the parameters for Create.
|
| 872 |
type UserManagementCreateParams struct {
|
| 873 |
+
// Email is the email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 874 |
Email string `json:"email" url:"-"`
|
| 875 |
// FirstName is the first name of the user.
|
| 876 |
FirstName *string `json:"first_name,omitempty" url:"-"`
|
All files in this language are hidden by the current filters.
code: 6 ยท tests: 0 ยท manifest: 1
ios/.oagen-manifest.json|
@@ -97,6 +97,7 @@
|
|
| 97 |
"Sources/WorkOS/Enums/InvitationRevokedDataState.swift",
|
| 98 |
"Sources/WorkOS/Enums/InvitationState.swift",
|
| 99 |
"Sources/WorkOS/Enums/InviteItContactIntents.swift",
|
|
|
|
| 100 |
"Sources/WorkOS/Enums/OrganizationCreatedDataDomainState.swift",
|
| 101 |
"Sources/WorkOS/Enums/OrganizationCreatedDataDomainVerificationStrategy.swift",
|
| 102 |
"Sources/WorkOS/Enums/OrganizationDeletedDataDomainState.swift",
|
|
@@ -610,6 +611,7 @@
|
|
| 610 |
"Sources/WorkOS/Models/OrganizationAuthorizedConnectApplicationList.swift",
|
| 611 |
"Sources/WorkOS/Models/OrganizationAuthorizedConnectApplicationListData.swift",
|
| 612 |
"Sources/WorkOS/Models/OrganizationAuthorizedConnectApplicationListListMetadata.swift",
|
|
|
|
| 613 |
"Sources/WorkOS/Models/OrganizationCreated.swift",
|
| 614 |
"Sources/WorkOS/Models/OrganizationCreatedData.swift",
|
| 615 |
"Sources/WorkOS/Models/OrganizationCreatedDataDomain.swift",
|
|
|
|
| 97 |
"Sources/WorkOS/Enums/InvitationRevokedDataState.swift",
|
| 98 |
"Sources/WorkOS/Enums/InvitationState.swift",
|
| 99 |
"Sources/WorkOS/Enums/InviteItContactIntents.swift",
|
| 100 |
+
"Sources/WorkOS/Enums/OrganizationConnectedAccountState.swift",
|
| 101 |
"Sources/WorkOS/Enums/OrganizationCreatedDataDomainState.swift",
|
| 102 |
"Sources/WorkOS/Enums/OrganizationCreatedDataDomainVerificationStrategy.swift",
|
| 103 |
"Sources/WorkOS/Enums/OrganizationDeletedDataDomainState.swift",
|
|
|
|
| 611 |
"Sources/WorkOS/Models/OrganizationAuthorizedConnectApplicationList.swift",
|
| 612 |
"Sources/WorkOS/Models/OrganizationAuthorizedConnectApplicationListData.swift",
|
| 613 |
"Sources/WorkOS/Models/OrganizationAuthorizedConnectApplicationListListMetadata.swift",
|
| 614 |
+
"Sources/WorkOS/Models/OrganizationConnectedAccount.swift",
|
| 615 |
"Sources/WorkOS/Models/OrganizationCreated.swift",
|
| 616 |
"Sources/WorkOS/Models/OrganizationCreatedData.swift",
|
| 617 |
"Sources/WorkOS/Models/OrganizationCreatedDataDomain.swift",
|
ios/Sources/WorkOS/Enums/OrganizationConnectedAccountState.swift|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
import Foundation
|
| 4 |
+
|
| 5 |
+
/// Enumeration of valid OrganizationConnectedAccountState values.
|
| 6 |
+
public enum OrganizationConnectedAccountState: RawRepresentable, Codable, Sendable, Hashable {
|
| 7 |
+
case connected
|
| 8 |
+
case needsReauthorization
|
| 9 |
+
/// A value not known at SDK generation time.
|
| 10 |
+
case unknown(String)
|
| 11 |
+
|
| 12 |
+
public init(rawValue: String) {
|
| 13 |
+
switch rawValue {
|
| 14 |
+
case "connected": self = .connected
|
| 15 |
+
case "needs_reauthorization": self = .needsReauthorization
|
| 16 |
+
default: self = .unknown(rawValue)
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
public var rawValue: String {
|
| 21 |
+
switch self {
|
| 22 |
+
case .connected: return "connected"
|
| 23 |
+
case .needsReauthorization: return "needs_reauthorization"
|
| 24 |
+
case .unknown(let value): return value
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
public init(from decoder: Decoder) throws {
|
| 29 |
+
let raw = try decoder.singleValueContainer().decode(String.self)
|
| 30 |
+
self.init(rawValue: raw)
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
public func encode(to encoder: Encoder) throws {
|
| 34 |
+
var container = encoder.singleValueContainer()
|
| 35 |
+
try container.encode(rawValue)
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
public static let allKnownCases: [OrganizationConnectedAccountState] = [
|
| 39 |
+
.connected,
|
| 40 |
+
.needsReauthorization,
|
| 41 |
+
]
|
| 42 |
+
}
|
ios/Sources/WorkOS/Models/CreateUser.swift|
@@ -3,7 +3,7 @@
|
|
| 3 |
import Foundation
|
| 4 |
|
| 5 |
public struct CreateUser: Codable, Sendable, Equatable {
|
| 6 |
-
/// The email address of the user.
|
| 7 |
public let email: String
|
| 8 |
/// The first name of the user.
|
| 9 |
public let firstName: String?
|
|
|
|
| 3 |
import Foundation
|
| 4 |
|
| 5 |
public struct CreateUser: Codable, Sendable, Equatable {
|
| 6 |
+
/// The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 7 |
public let email: String
|
| 8 |
/// The first name of the user.
|
| 9 |
public let firstName: String?
|
ios/Sources/WorkOS/Models/OrganizationConnectedAccount.swift|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
import Foundation
|
| 4 |
+
|
| 5 |
+
public struct OrganizationConnectedAccount: Codable, Sendable, Equatable {
|
| 6 |
+
/// The OAuth access token for the connected account.
|
| 7 |
+
public let accessToken: String?
|
| 8 |
+
/// The OAuth refresh token for the connected account.
|
| 9 |
+
public let refreshToken: String?
|
| 10 |
+
/// The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 11 |
+
public let expiresAt: Date?
|
| 12 |
+
/// The OAuth scopes granted for this connection.
|
| 13 |
+
public let scopes: [String]?
|
| 14 |
+
/// Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 15 |
+
public let state: OrganizationConnectedAccountState?
|
| 16 |
+
/// The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 17 |
+
public let userId: String
|
| 18 |
+
|
| 19 |
+
public init(
|
| 20 |
+
userId: String,
|
| 21 |
+
accessToken: String? = nil,
|
| 22 |
+
refreshToken: String? = nil,
|
| 23 |
+
expiresAt: Date? = nil,
|
| 24 |
+
scopes: [String]? = nil,
|
| 25 |
+
state: OrganizationConnectedAccountState? = nil
|
| 26 |
+
) {
|
| 27 |
+
self.accessToken = accessToken
|
| 28 |
+
self.refreshToken = refreshToken
|
| 29 |
+
self.expiresAt = expiresAt
|
| 30 |
+
self.scopes = scopes
|
| 31 |
+
self.state = state
|
| 32 |
+
self.userId = userId
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
private enum CodingKeys: String, CodingKey {
|
| 36 |
+
case accessToken = "access_token"
|
| 37 |
+
case refreshToken = "refresh_token"
|
| 38 |
+
case expiresAt = "expires_at"
|
| 39 |
+
case scopes
|
| 40 |
+
case state
|
| 41 |
+
case userId = "user_id"
|
| 42 |
+
}
|
| 43 |
+
}
|
ios/Sources/WorkOS/Resources/Pipes.swift|
@@ -530,6 +530,7 @@ public struct Pipes: Sendable {
|
|
| 530 |
/// - Parameter expiresAt: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 531 |
/// - Parameter scopes: The OAuth scopes granted for this connection.
|
| 532 |
/// - Parameter state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 533 |
/// - Parameter requestOptions: Per-request overrides (idempotency key, API key, headers, timeout).
|
| 534 |
public func createOrganizationConnectedAccount(
|
| 535 |
organizationId: String,
|
|
@@ -538,7 +539,8 @@ public struct Pipes: Sendable {
|
|
| 538 |
refreshToken: String? = nil,
|
| 539 |
expiresAt: Date? = nil,
|
| 540 |
scopes: [String]? = nil,
|
| 541 |
-
state:
|
|
|
|
| 542 |
requestOptions: RequestOptions? = nil
|
| 543 |
) async throws -> ConnectedAccount {
|
| 544 |
let path =
|
|
@@ -549,6 +551,7 @@ public struct Pipes: Sendable {
|
|
| 549 |
body.set("expires_at", expiresAt)
|
| 550 |
body.set("scopes", scopes)
|
| 551 |
body.set("state", state)
|
|
|
|
| 552 |
return try await transport.request(
|
| 553 |
method: "POST",
|
| 554 |
path: path,
|
|
@@ -570,6 +573,7 @@ public struct Pipes: Sendable {
|
|
| 570 |
/// - Parameter expiresAt: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 571 |
/// - Parameter scopes: The OAuth scopes granted for this connection.
|
| 572 |
/// - Parameter state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 573 |
/// - Parameter supportsMultipleConnections: Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 574 |
/// - Parameter connectedAccountId: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 575 |
/// - Parameter requestOptions: Per-request overrides (idempotency key, API key, headers, timeout).
|
|
@@ -580,7 +584,8 @@ public struct Pipes: Sendable {
|
|
| 580 |
refreshToken: String? = nil,
|
| 581 |
expiresAt: Date? = nil,
|
| 582 |
scopes: [String]? = nil,
|
| 583 |
-
state:
|
|
|
|
| 584 |
supportsMultipleConnections: Bool? = nil,
|
| 585 |
connectedAccountId: String? = nil,
|
| 586 |
requestOptions: RequestOptions? = nil
|
|
@@ -602,6 +607,7 @@ public struct Pipes: Sendable {
|
|
| 602 |
body.set("expires_at", expiresAt)
|
| 603 |
body.set("scopes", scopes)
|
| 604 |
body.set("state", state)
|
|
|
|
| 605 |
return try await transport.request(
|
| 606 |
method: "PUT",
|
| 607 |
path: path,
|
|
|
|
| 530 |
/// - Parameter expiresAt: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 531 |
/// - Parameter scopes: The OAuth scopes granted for this connection.
|
| 532 |
/// - Parameter state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 533 |
+
/// - Parameter userId: The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 534 |
/// - Parameter requestOptions: Per-request overrides (idempotency key, API key, headers, timeout).
|
| 535 |
public func createOrganizationConnectedAccount(
|
| 536 |
organizationId: String,
|
|
|
|
| 539 |
refreshToken: String? = nil,
|
| 540 |
expiresAt: Date? = nil,
|
| 541 |
scopes: [String]? = nil,
|
| 542 |
+
state: OrganizationConnectedAccountState? = nil,
|
| 543 |
+
userId: String,
|
| 544 |
requestOptions: RequestOptions? = nil
|
| 545 |
) async throws -> ConnectedAccount {
|
| 546 |
let path =
|
|
|
|
| 551 |
body.set("expires_at", expiresAt)
|
| 552 |
body.set("scopes", scopes)
|
| 553 |
body.set("state", state)
|
| 554 |
+
body.set("user_id", userId)
|
| 555 |
return try await transport.request(
|
| 556 |
method: "POST",
|
| 557 |
path: path,
|
|
|
|
| 573 |
/// - Parameter expiresAt: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 574 |
/// - Parameter scopes: The OAuth scopes granted for this connection.
|
| 575 |
/// - Parameter state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 576 |
+
/// - Parameter userId: The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 577 |
/// - Parameter supportsMultipleConnections: Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 578 |
/// - Parameter connectedAccountId: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 579 |
/// - Parameter requestOptions: Per-request overrides (idempotency key, API key, headers, timeout).
|
|
|
|
| 584 |
refreshToken: String? = nil,
|
| 585 |
expiresAt: Date? = nil,
|
| 586 |
scopes: [String]? = nil,
|
| 587 |
+
state: OrganizationConnectedAccountState? = nil,
|
| 588 |
+
userId: String,
|
| 589 |
supportsMultipleConnections: Bool? = nil,
|
| 590 |
connectedAccountId: String? = nil,
|
| 591 |
requestOptions: RequestOptions? = nil
|
|
|
|
| 607 |
body.set("expires_at", expiresAt)
|
| 608 |
body.set("scopes", scopes)
|
| 609 |
body.set("state", state)
|
| 610 |
+
body.set("user_id", userId)
|
| 611 |
return try await transport.request(
|
| 612 |
method: "PUT",
|
| 613 |
path: path,
|
ios/Sources/WorkOS/Resources/UserManagement.swift|
@@ -1007,7 +1007,7 @@ public struct UserManagement: Sendable {
|
|
| 1007 |
///
|
| 1008 |
/// Create a new user in the current environment.
|
| 1009 |
///
|
| 1010 |
-
/// - Parameter email: The email address of the user.
|
| 1011 |
/// - Parameter firstName: The first name of the user.
|
| 1012 |
/// - Parameter lastName: The last name of the user.
|
| 1013 |
/// - Parameter name: The user's full name.
|
|
|
|
| 1007 |
///
|
| 1008 |
/// Create a new user in the current environment.
|
| 1009 |
///
|
| 1010 |
+
/// - Parameter email: The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 1011 |
/// - Parameter firstName: The first name of the user.
|
| 1012 |
/// - Parameter lastName: The last name of the user.
|
| 1013 |
/// - Parameter name: The user's full name.
|
ios/Tests/WorkOSTests/PipesTests.swift|
@@ -223,13 +223,16 @@ import Testing
|
|
| 223 |
#"{"object":"connected_account","id":"data_installation_01EHZNVPK3SFK441A1RGBFSHRT","connection_role":"compatibility","account_identifier":"workspace_123","account_display_name":"Acme production","user_id":"user_01EHZNVPK3SFK441A1RGBFSHRT","organization_id":null,"scopes":["repo","user:email"],"auth_method":"oauth","api_key_last_4":null,"client_id":"3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc","client_secret_last_4":"cdef","config":{"instance_url":"https://example.my.salesforce.com"},"state":"connected","created_at":"2024-01-16T14:20:00.000Z","updated_at":"2024-01-16T14:20:00.000Z"}"#
|
| 224 |
)
|
| 225 |
let result = try await client.pipes.createOrganizationConnectedAccount(
|
| 226 |
-
organizationId: "sample-organization-id", slug: "sample-slug")
|
| 227 |
|
| 228 |
let request = try #require(recorder.lastRequest)
|
| 229 |
#expect(request.httpMethod == "POST")
|
| 230 |
#expect(
|
| 231 |
request.url?.path
|
| 232 |
== "/organizations/sample-organization-id/connected_accounts/sample-slug")
|
|
|
|
|
|
|
|
|
|
| 233 |
#expect(result.id == "data_installation_01EHZNVPK3SFK441A1RGBFSHRT")
|
| 234 |
}
|
| 235 |
|
|
@@ -239,13 +242,16 @@ import Testing
|
|
| 239 |
#"{"object":"connected_account","id":"data_installation_01EHZNVPK3SFK441A1RGBFSHRT","connection_role":"compatibility","account_identifier":"workspace_123","account_display_name":"Acme production","user_id":"user_01EHZNVPK3SFK441A1RGBFSHRT","organization_id":null,"scopes":["repo","user:email"],"auth_method":"oauth","api_key_last_4":null,"client_id":"3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc","client_secret_last_4":"cdef","config":{"instance_url":"https://example.my.salesforce.com"},"state":"connected","created_at":"2024-01-16T14:20:00.000Z","updated_at":"2024-01-16T14:20:00.000Z"}"#
|
| 240 |
)
|
| 241 |
let result = try await client.pipes.updateOrganizationConnectedAccount(
|
| 242 |
-
organizationId: "sample-organization-id", slug: "sample-slug")
|
| 243 |
|
| 244 |
let request = try #require(recorder.lastRequest)
|
| 245 |
#expect(request.httpMethod == "PUT")
|
| 246 |
#expect(
|
| 247 |
request.url?.path
|
| 248 |
== "/organizations/sample-organization-id/connected_accounts/sample-slug")
|
|
|
|
|
|
|
|
|
|
| 249 |
#expect(result.id == "data_installation_01EHZNVPK3SFK441A1RGBFSHRT")
|
| 250 |
}
|
|
|
|
| 223 |
#"{"object":"connected_account","id":"data_installation_01EHZNVPK3SFK441A1RGBFSHRT","connection_role":"compatibility","account_identifier":"workspace_123","account_display_name":"Acme production","user_id":"user_01EHZNVPK3SFK441A1RGBFSHRT","organization_id":null,"scopes":["repo","user:email"],"auth_method":"oauth","api_key_last_4":null,"client_id":"3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc","client_secret_last_4":"cdef","config":{"instance_url":"https://example.my.salesforce.com"},"state":"connected","created_at":"2024-01-16T14:20:00.000Z","updated_at":"2024-01-16T14:20:00.000Z"}"#
|
| 224 |
)
|
| 225 |
let result = try await client.pipes.createOrganizationConnectedAccount(
|
| 226 |
+
organizationId: "sample-organization-id", slug: "sample-slug", userId: "test_user_id")
|
| 227 |
|
| 228 |
let request = try #require(recorder.lastRequest)
|
| 229 |
#expect(request.httpMethod == "POST")
|
| 230 |
#expect(
|
| 231 |
request.url?.path
|
| 232 |
== "/organizations/sample-organization-id/connected_accounts/sample-slug")
|
| 233 |
+
let body = try #require(recorder.lastBody)
|
| 234 |
+
let json = try JSONSerialization.jsonObject(with: body) as? [String: Any]
|
| 235 |
+
#expect(json?["user_id"] != nil)
|
| 236 |
#expect(result.id == "data_installation_01EHZNVPK3SFK441A1RGBFSHRT")
|
| 237 |
}
|
| 238 |
|
|
|
|
| 242 |
#"{"object":"connected_account","id":"data_installation_01EHZNVPK3SFK441A1RGBFSHRT","connection_role":"compatibility","account_identifier":"workspace_123","account_display_name":"Acme production","user_id":"user_01EHZNVPK3SFK441A1RGBFSHRT","organization_id":null,"scopes":["repo","user:email"],"auth_method":"oauth","api_key_last_4":null,"client_id":"3MVG9dZJodJWxft2VoStSCVwPFsx0eDcpVc","client_secret_last_4":"cdef","config":{"instance_url":"https://example.my.salesforce.com"},"state":"connected","created_at":"2024-01-16T14:20:00.000Z","updated_at":"2024-01-16T14:20:00.000Z"}"#
|
| 243 |
)
|
| 244 |
let result = try await client.pipes.updateOrganizationConnectedAccount(
|
| 245 |
+
organizationId: "sample-organization-id", slug: "sample-slug", userId: "test_user_id")
|
| 246 |
|
| 247 |
let request = try #require(recorder.lastRequest)
|
| 248 |
#expect(request.httpMethod == "PUT")
|
| 249 |
#expect(
|
| 250 |
request.url?.path
|
| 251 |
== "/organizations/sample-organization-id/connected_accounts/sample-slug")
|
| 252 |
+
let body = try #require(recorder.lastBody)
|
| 253 |
+
let json = try JSONSerialization.jsonObject(with: body) as? [String: Any]
|
| 254 |
+
#expect(json?["user_id"] != nil)
|
| 255 |
#expect(result.id == "data_installation_01EHZNVPK3SFK441A1RGBFSHRT")
|
| 256 |
}
|
All files in this language are hidden by the current filters.
code: 5 ยท tests: 2 ยท manifest: 1
kotlin/.oagen-manifest.json|
@@ -413,6 +413,7 @@
|
|
| 413 |
"src/main/kotlin/com/workos/models/OrganizationApiKeyWithValue.kt",
|
| 414 |
"src/main/kotlin/com/workos/models/OrganizationApiKeyWithValueOwner.kt",
|
| 415 |
"src/main/kotlin/com/workos/models/OrganizationAuthorizedConnectApplicationListData.kt",
|
|
|
|
| 416 |
"src/main/kotlin/com/workos/models/OrganizationCreated.kt",
|
| 417 |
"src/main/kotlin/com/workos/models/OrganizationCreatedData.kt",
|
| 418 |
"src/main/kotlin/com/workos/models/OrganizationCreatedDataDomain.kt",
|
|
@@ -728,6 +729,7 @@
|
|
| 728 |
"src/main/kotlin/com/workos/types/InvitationRevokedDataState.kt",
|
| 729 |
"src/main/kotlin/com/workos/types/InvitationState.kt",
|
| 730 |
"src/main/kotlin/com/workos/types/InviteItContactIntents.kt",
|
|
|
|
| 731 |
"src/main/kotlin/com/workos/types/OrganizationCreatedDataDomainState.kt",
|
| 732 |
"src/main/kotlin/com/workos/types/OrganizationCreatedDataDomainVerificationStrategy.kt",
|
| 733 |
"src/main/kotlin/com/workos/types/OrganizationDeletedDataDomainState.kt",
|
|
|
|
| 413 |
"src/main/kotlin/com/workos/models/OrganizationApiKeyWithValue.kt",
|
| 414 |
"src/main/kotlin/com/workos/models/OrganizationApiKeyWithValueOwner.kt",
|
| 415 |
"src/main/kotlin/com/workos/models/OrganizationAuthorizedConnectApplicationListData.kt",
|
| 416 |
+
"src/main/kotlin/com/workos/models/OrganizationConnectedAccount.kt",
|
| 417 |
"src/main/kotlin/com/workos/models/OrganizationCreated.kt",
|
| 418 |
"src/main/kotlin/com/workos/models/OrganizationCreatedData.kt",
|
| 419 |
"src/main/kotlin/com/workos/models/OrganizationCreatedDataDomain.kt",
|
|
|
|
| 729 |
"src/main/kotlin/com/workos/types/InvitationRevokedDataState.kt",
|
| 730 |
"src/main/kotlin/com/workos/types/InvitationState.kt",
|
| 731 |
"src/main/kotlin/com/workos/types/InviteItContactIntents.kt",
|
| 732 |
+
"src/main/kotlin/com/workos/types/OrganizationConnectedAccountState.kt",
|
| 733 |
"src/main/kotlin/com/workos/types/OrganizationCreatedDataDomainState.kt",
|
| 734 |
"src/main/kotlin/com/workos/types/OrganizationCreatedDataDomainVerificationStrategy.kt",
|
| 735 |
"src/main/kotlin/com/workos/types/OrganizationDeletedDataDomainState.kt",
|
kotlin/src/main/kotlin/com/workos/models/CreateUser.kt|
@@ -8,7 +8,7 @@ import com.workos.types.CreateUserPasswordSaltPosition
|
|
| 8 |
|
| 9 |
/** CreateUser model. */
|
| 10 |
data class CreateUser(
|
| 11 |
-
/** The email address of the user. */
|
| 12 |
@JsonProperty("email")
|
| 13 |
val email: String,
|
| 14 |
|
|
|
|
| 8 |
|
| 9 |
/** CreateUser model. */
|
| 10 |
data class CreateUser(
|
| 11 |
+
/** The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it. */
|
| 12 |
@JsonProperty("email")
|
| 13 |
val email: String,
|
| 14 |
|
kotlin/src/main/kotlin/com/workos/models/OrganizationConnectedAccount.kt|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 com.workos.types.OrganizationConnectedAccountState
|
| 7 |
+
import java.time.OffsetDateTime
|
| 8 |
+
|
| 9 |
+
/** OrganizationConnectedAccount model. */
|
| 10 |
+
data class OrganizationConnectedAccount(
|
| 11 |
+
/** The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization. */
|
| 12 |
+
@JsonProperty("user_id")
|
| 13 |
+
val userId: String,
|
| 14 |
+
|
| 15 |
+
/** The OAuth access token for the connected account. */
|
| 16 |
+
@JsonProperty("access_token")
|
| 17 |
+
val accessToken: String? = null,
|
| 18 |
+
|
| 19 |
+
/** The OAuth refresh token for the connected account. */
|
| 20 |
+
@JsonProperty("refresh_token")
|
| 21 |
+
val refreshToken: String? = null,
|
| 22 |
+
|
| 23 |
+
/** The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. */
|
| 24 |
+
@JsonProperty("expires_at")
|
| 25 |
+
val expiresAt: OffsetDateTime? = null,
|
| 26 |
+
|
| 27 |
+
/** The OAuth scopes granted for this connection. */
|
| 28 |
+
@JsonProperty("scopes")
|
| 29 |
+
val scopes: List<String>? = null,
|
| 30 |
+
|
| 31 |
+
/** Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. */
|
| 32 |
+
@JsonProperty("state")
|
| 33 |
+
val state: OrganizationConnectedAccountState? = null
|
| 34 |
+
)
|
kotlin/src/main/kotlin/com/workos/pipes/Pipes.kt|
@@ -897,6 +897,7 @@ class Pipes(
|
|
| 897 |
*
|
| 898 |
* @param organizationId An [Organization](https://workos.com/docs/reference/organization) identifier.
|
| 899 |
* @param slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
|
|
|
|
| 900 |
* @param accessToken The OAuth access token for the connected account.
|
| 901 |
* @param refreshToken The OAuth refresh token for the connected account.
|
| 902 |
* @param expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
|
@@ -910,6 +911,7 @@ class Pipes(
|
|
| 910 |
fun createOrganizationConnectedAccount(
|
| 911 |
organizationId: String,
|
| 912 |
slug: String,
|
|
|
|
| 913 |
accessToken: String? = null,
|
| 914 |
refreshToken: String? = null,
|
| 915 |
expiresAt: OffsetDateTime? = null,
|
|
@@ -919,6 +921,7 @@ class Pipes(
|
|
| 919 |
): ConnectedAccount {
|
| 920 |
val body =
|
| 921 |
bodyOf(
|
|
|
|
| 922 |
"access_token" to accessToken,
|
| 923 |
"refresh_token" to refreshToken,
|
| 924 |
"expires_at" to expiresAt,
|
|
@@ -947,6 +950,7 @@ class Pipes(
|
|
| 947 |
suspend fun createOrganizationConnectedAccountSuspend(
|
| 948 |
organizationId: String,
|
| 949 |
slug: String,
|
|
|
|
| 950 |
accessToken: String? = null,
|
| 951 |
refreshToken: String? = null,
|
| 952 |
expiresAt: OffsetDateTime? = null,
|
|
@@ -955,7 +959,7 @@ class Pipes(
|
|
| 955 |
requestOptions: RequestOptions? = null
|
| 956 |
): ConnectedAccount =
|
| 957 |
withContext(Dispatchers.IO) {
|
| 958 |
-
createOrganizationConnectedAccount(organizationId, slug, accessToken, refreshToken, expiresAt, scopes, state, requestOptions)
|
| 959 |
}
|
| 960 |
|
| 961 |
/**
|
|
@@ -967,6 +971,7 @@ class Pipes(
|
|
| 967 |
* @param slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
|
| 968 |
* @param supportsMultipleConnections Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 969 |
* @param connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
|
|
|
| 970 |
* @param accessToken The OAuth access token for the connected account.
|
| 971 |
* @param refreshToken The OAuth refresh token for the connected account.
|
| 972 |
* @param expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
|
@@ -982,6 +987,7 @@ class Pipes(
|
|
| 982 |
slug: String,
|
| 983 |
supportsMultipleConnections: Boolean? = null,
|
| 984 |
connectedAccountId: String? = null,
|
|
|
|
| 985 |
accessToken: String? = null,
|
| 986 |
refreshToken: String? = null,
|
| 987 |
expiresAt: OffsetDateTime? = null,
|
|
@@ -994,6 +1000,7 @@ class Pipes(
|
|
| 994 |
params.addIfNotNull("connected_account_id", connectedAccountId)
|
| 995 |
val body =
|
| 996 |
bodyOf(
|
|
|
|
| 997 |
"access_token" to accessToken,
|
| 998 |
"refresh_token" to refreshToken,
|
| 999 |
"expires_at" to expiresAt,
|
|
@@ -1025,6 +1032,7 @@ class Pipes(
|
|
| 1025 |
slug: String,
|
| 1026 |
supportsMultipleConnections: Boolean? = null,
|
| 1027 |
connectedAccountId: String? = null,
|
|
|
|
| 1028 |
accessToken: String? = null,
|
| 1029 |
refreshToken: String? = null,
|
| 1030 |
expiresAt: OffsetDateTime? = null,
|
|
@@ -1038,6 +1046,7 @@ class Pipes(
|
|
| 1038 |
slug,
|
| 1039 |
supportsMultipleConnections,
|
| 1040 |
connectedAccountId,
|
|
|
|
| 1041 |
accessToken,
|
| 1042 |
refreshToken,
|
| 1043 |
expiresAt,
|
|
|
|
| 897 |
*
|
| 898 |
* @param organizationId An [Organization](https://workos.com/docs/reference/organization) identifier.
|
| 899 |
* @param slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
|
| 900 |
+
* @param userId The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 901 |
* @param accessToken The OAuth access token for the connected account.
|
| 902 |
* @param refreshToken The OAuth refresh token for the connected account.
|
| 903 |
* @param expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
|
|
|
| 911 |
fun createOrganizationConnectedAccount(
|
| 912 |
organizationId: String,
|
| 913 |
slug: String,
|
| 914 |
+
userId: String,
|
| 915 |
accessToken: String? = null,
|
| 916 |
refreshToken: String? = null,
|
| 917 |
expiresAt: OffsetDateTime? = null,
|
|
|
|
| 921 |
): ConnectedAccount {
|
| 922 |
val body =
|
| 923 |
bodyOf(
|
| 924 |
+
"user_id" to userId,
|
| 925 |
"access_token" to accessToken,
|
| 926 |
"refresh_token" to refreshToken,
|
| 927 |
"expires_at" to expiresAt,
|
|
|
|
| 950 |
suspend fun createOrganizationConnectedAccountSuspend(
|
| 951 |
organizationId: String,
|
| 952 |
slug: String,
|
| 953 |
+
userId: String,
|
| 954 |
accessToken: String? = null,
|
| 955 |
refreshToken: String? = null,
|
| 956 |
expiresAt: OffsetDateTime? = null,
|
|
|
|
| 959 |
requestOptions: RequestOptions? = null
|
| 960 |
): ConnectedAccount =
|
| 961 |
withContext(Dispatchers.IO) {
|
| 962 |
+
createOrganizationConnectedAccount(organizationId, slug, userId, accessToken, refreshToken, expiresAt, scopes, state, requestOptions)
|
| 963 |
}
|
| 964 |
|
| 965 |
/**
|
|
|
|
| 971 |
* @param slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`).
|
| 972 |
* @param supportsMultipleConnections Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 973 |
* @param connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 974 |
+
* @param userId The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 975 |
* @param accessToken The OAuth access token for the connected account.
|
| 976 |
* @param refreshToken The OAuth refresh token for the connected account.
|
| 977 |
* @param expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
|
|
|
| 987 |
slug: String,
|
| 988 |
supportsMultipleConnections: Boolean? = null,
|
| 989 |
connectedAccountId: String? = null,
|
| 990 |
+
userId: String,
|
| 991 |
accessToken: String? = null,
|
| 992 |
refreshToken: String? = null,
|
| 993 |
expiresAt: OffsetDateTime? = null,
|
|
|
|
| 1000 |
params.addIfNotNull("connected_account_id", connectedAccountId)
|
| 1001 |
val body =
|
| 1002 |
bodyOf(
|
| 1003 |
+
"user_id" to userId,
|
| 1004 |
"access_token" to accessToken,
|
| 1005 |
"refresh_token" to refreshToken,
|
| 1006 |
"expires_at" to expiresAt,
|
|
|
|
| 1032 |
slug: String,
|
| 1033 |
supportsMultipleConnections: Boolean? = null,
|
| 1034 |
connectedAccountId: String? = null,
|
| 1035 |
+
userId: String,
|
| 1036 |
accessToken: String? = null,
|
| 1037 |
refreshToken: String? = null,
|
| 1038 |
expiresAt: OffsetDateTime? = null,
|
|
|
|
| 1046 |
slug,
|
| 1047 |
supportsMultipleConnections,
|
| 1048 |
connectedAccountId,
|
| 1049 |
+
userId,
|
| 1050 |
accessToken,
|
| 1051 |
refreshToken,
|
| 1052 |
expiresAt,
|
kotlin/src/main/kotlin/com/workos/types/OrganizationConnectedAccountState.kt|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
package com.workos.types
|
| 4 |
+
|
| 5 |
+
/** Alias for [PipeConnectedAccountState]. */
|
| 6 |
+
typealias OrganizationConnectedAccountState = PipeConnectedAccountState
|
kotlin/src/main/kotlin/com/workos/usermanagement/UserManagement.kt|
@@ -1425,7 +1425,7 @@ class UserManagement(
|
|
| 1425 |
*
|
| 1426 |
* Create a new user in the current environment.
|
| 1427 |
*
|
| 1428 |
-
* @param email The email address of the user.
|
| 1429 |
* @param firstName The first name of the user.
|
| 1430 |
* @param lastName The last name of the user.
|
| 1431 |
* @param name The user's full name.
|
|
|
|
| 1425 |
*
|
| 1426 |
* Create a new user in the current environment.
|
| 1427 |
*
|
| 1428 |
+
* @param email The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 1429 |
* @param firstName The first name of the user.
|
| 1430 |
* @param lastName The last name of the user.
|
| 1431 |
* @param name The user's full name.
|
kotlin/src/test/kotlin/com/workos/models/GeneratedForwardCompatTest.kt|
@@ -4,7 +4,6 @@ package com.workos.models
|
|
| 4 |
|
| 5 |
import com.fasterxml.jackson.core.type.TypeReference
|
| 6 |
import com.workos.common.json.ObjectMapperFactory
|
| 7 |
-
import com.workos.types.ConnectedAccountInputState
|
| 8 |
import com.workos.types.CreateConnectionOidcOptionsIdTokenSignatureAlgorithm
|
| 9 |
import com.workos.types.CreateConnectionOidcOptionsTokenAuthenticationMethod
|
| 10 |
import com.workos.types.CreateDataIntegrationAuthMethods
|
|
@@ -12,6 +11,7 @@ import com.workos.types.CreateDataIntegrationOwnership
|
|
| 12 |
import com.workos.types.CustomProviderDefinitionAuthenticateVia
|
| 13 |
import com.workos.types.DataIntegrationCredentialsInputType
|
| 14 |
import com.workos.types.InviteItContactIntents
|
|
|
|
| 15 |
import com.workos.types.OrganizationDomainDataState
|
| 16 |
import com.workos.types.PaginationOrder
|
| 17 |
import com.workos.types.PatchConnectionOidcOptionsIdTokenSignatureAlgorithm
|
|
@@ -125,10 +125,10 @@ class GeneratedForwardCompatTest {
|
|
| 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
|
|
|
|
| 4 |
|
| 5 |
import com.fasterxml.jackson.core.type.TypeReference
|
| 6 |
import com.workos.common.json.ObjectMapperFactory
|
|
|
|
| 7 |
import com.workos.types.CreateConnectionOidcOptionsIdTokenSignatureAlgorithm
|
| 8 |
import com.workos.types.CreateConnectionOidcOptionsTokenAuthenticationMethod
|
| 9 |
import com.workos.types.CreateDataIntegrationAuthMethods
|
|
|
|
| 11 |
import com.workos.types.CustomProviderDefinitionAuthenticateVia
|
| 12 |
import com.workos.types.DataIntegrationCredentialsInputType
|
| 13 |
import com.workos.types.InviteItContactIntents
|
| 14 |
+
import com.workos.types.OrganizationConnectedAccountState
|
| 15 |
import com.workos.types.OrganizationDomainDataState
|
| 16 |
import com.workos.types.PaginationOrder
|
| 17 |
import com.workos.types.PatchConnectionOidcOptionsIdTokenSignatureAlgorithm
|
|
|
|
| 125 |
}
|
| 126 |
|
| 127 |
@Test
|
| 128 |
+
fun `unknown OrganizationConnectedAccountState 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__\"", OrganizationConnectedAccountState::class.java)
|
| 131 |
+
assertEquals(OrganizationConnectedAccountState.Unknown, parsed)
|
| 132 |
}
|
| 133 |
|
| 134 |
@Test
|
kotlin/src/test/kotlin/com/workos/pipes/PipesTest.kt|
@@ -251,12 +251,16 @@ class PipesTest : TestBase() {
|
|
| 251 |
"\"account_display_name\": null, \"user_id\": null, \"organization_id\": null, \"scopes\": [], \"state\": \"connected\", " +
|
| 252 |
"\"created_at\": \"sample\", \"updated_at\": \"sample\"}"
|
| 253 |
)
|
| 254 |
-
val result = api().createOrganizationConnectedAccount("sample-arg", "sample-arg")
|
| 255 |
assertNotNull(result)
|
| 256 |
assertEquals("connected_account", result.objectType)
|
| 257 |
assertEquals("sample", result.id)
|
| 258 |
assertEquals("sample", result.createdAt)
|
| 259 |
assertEquals("sample", result.updatedAt)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
}
|
| 261 |
|
| 262 |
@Test
|
|
@@ -269,12 +273,16 @@ class PipesTest : TestBase() {
|
|
| 269 |
"\"account_display_name\": null, \"user_id\": null, \"organization_id\": null, \"scopes\": [], \"state\": \"connected\", " +
|
| 270 |
"\"created_at\": \"sample\", \"updated_at\": \"sample\"}"
|
| 271 |
)
|
| 272 |
-
val result = api().updateOrganizationConnectedAccount("sample-arg", "sample-arg")
|
| 273 |
assertNotNull(result)
|
| 274 |
assertEquals("connected_account", result.objectType)
|
| 275 |
assertEquals("sample", result.id)
|
| 276 |
assertEquals("sample", result.createdAt)
|
| 277 |
assertEquals("sample", result.updatedAt)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
}
|
| 279 |
|
| 280 |
@Test
|
|
|
|
| 251 |
"\"account_display_name\": null, \"user_id\": null, \"organization_id\": null, \"scopes\": [], \"state\": \"connected\", " +
|
| 252 |
"\"created_at\": \"sample\", \"updated_at\": \"sample\"}"
|
| 253 |
)
|
| 254 |
+
val result = api().createOrganizationConnectedAccount("sample-arg", "sample-arg", "sample-arg")
|
| 255 |
assertNotNull(result)
|
| 256 |
assertEquals("connected_account", result.objectType)
|
| 257 |
assertEquals("sample", result.id)
|
| 258 |
assertEquals("sample", result.createdAt)
|
| 259 |
assertEquals("sample", result.updatedAt)
|
| 260 |
+
wireMockRule.verify(
|
| 261 |
+
postRequestedFor(urlPathMatching("/organizations/sample-arg/connected_accounts/sample-arg"))
|
| 262 |
+
.withRequestBody(matchingJsonPath("\$.user_id"))
|
| 263 |
+
)
|
| 264 |
}
|
| 265 |
|
| 266 |
@Test
|
|
|
|
| 273 |
"\"account_display_name\": null, \"user_id\": null, \"organization_id\": null, \"scopes\": [], \"state\": \"connected\", " +
|
| 274 |
"\"created_at\": \"sample\", \"updated_at\": \"sample\"}"
|
| 275 |
)
|
| 276 |
+
val result = api().updateOrganizationConnectedAccount("sample-arg", "sample-arg", "sample-arg")
|
| 277 |
assertNotNull(result)
|
| 278 |
assertEquals("connected_account", result.objectType)
|
| 279 |
assertEquals("sample", result.id)
|
| 280 |
assertEquals("sample", result.createdAt)
|
| 281 |
assertEquals("sample", result.updatedAt)
|
| 282 |
+
wireMockRule.verify(
|
| 283 |
+
putRequestedFor(urlPathMatching("/organizations/sample-arg/connected_accounts/sample-arg"))
|
| 284 |
+
.withRequestBody(matchingJsonPath("\$.user_id"))
|
| 285 |
+
)
|
| 286 |
}
|
| 287 |
|
| 288 |
@Test
|
All files in this language are hidden by the current filters.
code: 4 ยท tests: 2 ยท manifest: 1
php/.oagen-manifest.json|
@@ -447,6 +447,7 @@
|
|
| 447 |
"lib/Resource/OrganizationApiKeyWithValue.php",
|
| 448 |
"lib/Resource/OrganizationApiKeyWithValueOwner.php",
|
| 449 |
"lib/Resource/OrganizationAuthorizedConnectApplicationListData.php",
|
|
|
|
| 450 |
"lib/Resource/OrganizationCreated.php",
|
| 451 |
"lib/Resource/OrganizationCreatedData.php",
|
| 452 |
"lib/Resource/OrganizationCreatedDataDomain.php",
|
|
@@ -1166,6 +1167,7 @@
|
|
| 1166 |
"tests/Fixtures/organization_api_key_with_value.json",
|
| 1167 |
"tests/Fixtures/organization_api_key_with_value_owner.json",
|
| 1168 |
"tests/Fixtures/organization_authorized_connect_application_list_data.json",
|
|
|
|
| 1169 |
"tests/Fixtures/organization_created.json",
|
| 1170 |
"tests/Fixtures/organization_created_data.json",
|
| 1171 |
"tests/Fixtures/organization_created_data_domain.json",
|
|
|
|
| 447 |
"lib/Resource/OrganizationApiKeyWithValue.php",
|
| 448 |
"lib/Resource/OrganizationApiKeyWithValueOwner.php",
|
| 449 |
"lib/Resource/OrganizationAuthorizedConnectApplicationListData.php",
|
| 450 |
+
"lib/Resource/OrganizationConnectedAccount.php",
|
| 451 |
"lib/Resource/OrganizationCreated.php",
|
| 452 |
"lib/Resource/OrganizationCreatedData.php",
|
| 453 |
"lib/Resource/OrganizationCreatedDataDomain.php",
|
|
|
|
| 1167 |
"tests/Fixtures/organization_api_key_with_value.json",
|
| 1168 |
"tests/Fixtures/organization_api_key_with_value_owner.json",
|
| 1169 |
"tests/Fixtures/organization_authorized_connect_application_list_data.json",
|
| 1170 |
+
"tests/Fixtures/organization_connected_account.json",
|
| 1171 |
"tests/Fixtures/organization_created.json",
|
| 1172 |
"tests/Fixtures/organization_created_data.json",
|
| 1173 |
"tests/Fixtures/organization_created_data_domain.json",
|
php/lib/Resource/CreateUser.php|
@@ -11,7 +11,7 @@ readonly class CreateUser implements \JsonSerializable
|
|
| 11 |
use JsonSerializableTrait;
|
| 12 |
|
| 13 |
public function __construct(
|
| 14 |
-
/** The email address of the user. */
|
| 15 |
public string $email,
|
| 16 |
/** The first name of the user. */
|
| 17 |
public ?string $firstName = null,
|
|
|
|
| 11 |
use JsonSerializableTrait;
|
| 12 |
|
| 13 |
public function __construct(
|
| 14 |
+
/** The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it. */
|
| 15 |
public string $email,
|
| 16 |
/** The first name of the user. */
|
| 17 |
public ?string $firstName = null,
|
php/lib/Resource/OrganizationConnectedAccount.php|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 OrganizationConnectedAccount implements \JsonSerializable
|
| 10 |
+
{
|
| 11 |
+
use JsonSerializableTrait;
|
| 12 |
+
|
| 13 |
+
public function __construct(
|
| 14 |
+
/** The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization. */
|
| 15 |
+
public string $userId,
|
| 16 |
+
/** The OAuth access token for the connected account. */
|
| 17 |
+
public ?string $accessToken = null,
|
| 18 |
+
/** The OAuth refresh token for the connected account. */
|
| 19 |
+
public ?string $refreshToken = null,
|
| 20 |
+
/** The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. */
|
| 21 |
+
public ?\DateTimeImmutable $expiresAt = null,
|
| 22 |
+
/**
|
| 23 |
+
* The OAuth scopes granted for this connection.
|
| 24 |
+
* @var array<string>|null
|
| 25 |
+
*/
|
| 26 |
+
public ?array $scopes = null,
|
| 27 |
+
/** Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. */
|
| 28 |
+
public ?PipeConnectedAccountState $state = null,
|
| 29 |
+
) {
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
public static function fromArray(array $data): self
|
| 33 |
+
{
|
| 34 |
+
return new self(
|
| 35 |
+
userId: $data['user_id'],
|
| 36 |
+
accessToken: $data['access_token'] ?? null,
|
| 37 |
+
refreshToken: $data['refresh_token'] ?? null,
|
| 38 |
+
expiresAt: isset($data['expires_at']) ? new \DateTimeImmutable($data['expires_at']) : null,
|
| 39 |
+
scopes: $data['scopes'] ?? null,
|
| 40 |
+
state: isset($data['state']) ? PipeConnectedAccountState::from($data['state']) : null,
|
| 41 |
+
);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
public function toArray(): array
|
| 45 |
+
{
|
| 46 |
+
return [
|
| 47 |
+
'user_id' => $this->userId,
|
| 48 |
+
'access_token' => $this->accessToken,
|
| 49 |
+
'refresh_token' => $this->refreshToken,
|
| 50 |
+
'expires_at' => $this->expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 51 |
+
'scopes' => $this->scopes,
|
| 52 |
+
'state' => $this->state?->value,
|
| 53 |
+
];
|
| 54 |
+
}
|
| 55 |
+
}
|
php/lib/Service/Pipes.php|
@@ -505,12 +505,14 @@ class Pipes
|
|
| 505 |
* @param \DateTimeImmutable|null $expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 506 |
* @param array<string>|null $scopes The OAuth scopes granted for this connection.
|
| 507 |
* @param \WorkOS\Resource\PipeConnectedAccountState|null $state Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 508 |
* @return \WorkOS\Resource\ConnectedAccount
|
| 509 |
* @throws \WorkOS\Exception\WorkOSException
|
| 510 |
*/
|
| 511 |
public function createOrganizationConnectedAccount(
|
| 512 |
string $organizationId,
|
| 513 |
string $slug,
|
|
|
|
| 514 |
?string $accessToken = null,
|
| 515 |
?string $refreshToken = null,
|
| 516 |
?\DateTimeImmutable $expiresAt = null,
|
|
@@ -524,6 +526,7 @@ class Pipes
|
|
| 524 |
'expires_at' => $expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 525 |
'scopes' => $scopes,
|
| 526 |
'state' => $state?->value,
|
|
|
|
| 527 |
], fn ($v) => $v !== null);
|
| 528 |
$response = $this->client->request(
|
| 529 |
method: 'POST',
|
|
@@ -545,6 +548,7 @@ class Pipes
|
|
| 545 |
* @param \DateTimeImmutable|null $expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 546 |
* @param array<string>|null $scopes The OAuth scopes granted for this connection.
|
| 547 |
* @param \WorkOS\Resource\PipeConnectedAccountState|null $state Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 548 |
* @param bool|null $supportsMultipleConnections Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 549 |
* @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 550 |
* @return \WorkOS\Resource\ConnectedAccount
|
|
@@ -553,6 +557,7 @@ class Pipes
|
|
| 553 |
public function updateOrganizationConnectedAccount(
|
| 554 |
string $organizationId,
|
| 555 |
string $slug,
|
|
|
|
| 556 |
?string $accessToken = null,
|
| 557 |
?string $refreshToken = null,
|
| 558 |
?\DateTimeImmutable $expiresAt = null,
|
|
@@ -568,6 +573,7 @@ class Pipes
|
|
| 568 |
'expires_at' => $expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 569 |
'scopes' => $scopes,
|
| 570 |
'state' => $state?->value,
|
|
|
|
| 571 |
], fn ($v) => $v !== null);
|
| 572 |
$response = $this->client->request(
|
| 573 |
method: 'PUT',
|
|
|
|
| 505 |
* @param \DateTimeImmutable|null $expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 506 |
* @param array<string>|null $scopes The OAuth scopes granted for this connection.
|
| 507 |
* @param \WorkOS\Resource\PipeConnectedAccountState|null $state Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 508 |
+
* @param string $userId The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 509 |
* @return \WorkOS\Resource\ConnectedAccount
|
| 510 |
* @throws \WorkOS\Exception\WorkOSException
|
| 511 |
*/
|
| 512 |
public function createOrganizationConnectedAccount(
|
| 513 |
string $organizationId,
|
| 514 |
string $slug,
|
| 515 |
+
string $userId,
|
| 516 |
?string $accessToken = null,
|
| 517 |
?string $refreshToken = null,
|
| 518 |
?\DateTimeImmutable $expiresAt = null,
|
|
|
|
| 526 |
'expires_at' => $expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 527 |
'scopes' => $scopes,
|
| 528 |
'state' => $state?->value,
|
| 529 |
+
'user_id' => $userId,
|
| 530 |
], fn ($v) => $v !== null);
|
| 531 |
$response = $this->client->request(
|
| 532 |
method: 'POST',
|
|
|
|
| 548 |
* @param \DateTimeImmutable|null $expiresAt The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 549 |
* @param array<string>|null $scopes The OAuth scopes granted for this connection.
|
| 550 |
* @param \WorkOS\Resource\PipeConnectedAccountState|null $state Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 551 |
+
* @param string $userId The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 552 |
* @param bool|null $supportsMultipleConnections Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 553 |
* @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 554 |
* @return \WorkOS\Resource\ConnectedAccount
|
|
|
|
| 557 |
public function updateOrganizationConnectedAccount(
|
| 558 |
string $organizationId,
|
| 559 |
string $slug,
|
| 560 |
+
string $userId,
|
| 561 |
?string $accessToken = null,
|
| 562 |
?string $refreshToken = null,
|
| 563 |
?\DateTimeImmutable $expiresAt = null,
|
|
|
|
| 573 |
'expires_at' => $expiresAt?->format(\DateTimeInterface::RFC3339_EXTENDED),
|
| 574 |
'scopes' => $scopes,
|
| 575 |
'state' => $state?->value,
|
| 576 |
+
'user_id' => $userId,
|
| 577 |
], fn ($v) => $v !== null);
|
| 578 |
$response = $this->client->request(
|
| 579 |
method: 'PUT',
|
php/lib/Service/UserManagement.php|
@@ -921,7 +921,7 @@ class UserManagement
|
|
| 921 |
* Create a user
|
| 922 |
*
|
| 923 |
* Create a new user in the current environment.
|
| 924 |
-
* @param string $email The email address of the user.
|
| 925 |
* @param string|null $firstName The first name of the user.
|
| 926 |
* @param string|null $lastName The last name of the user.
|
| 927 |
* @param string|null $name The user's full name.
|
|
|
|
| 921 |
* Create a user
|
| 922 |
*
|
| 923 |
* Create a new user in the current environment.
|
| 924 |
+
* @param string $email The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 925 |
* @param string|null $firstName The first name of the user.
|
| 926 |
* @param string|null $lastName The last name of the user.
|
| 927 |
* @param string|null $name The user's full name.
|
php/tests/Fixtures/organization_connected_account.json|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"access_token": "gho_16C7e42F292c6912E7710c838347Ae178B4a",
|
| 3 |
+
"refresh_token": "ghr_xxxxxxxxxxxxxxxxxxxx",
|
| 4 |
+
"expires_at": "2025-12-31T23:59:59.000Z",
|
| 5 |
+
"scopes": [
|
| 6 |
+
"repo",
|
| 7 |
+
"user:email"
|
| 8 |
+
],
|
| 9 |
+
"state": "connected",
|
| 10 |
+
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT"
|
| 11 |
+
}
|
php/tests/Service/PipesTest.php|
@@ -216,7 +216,7 @@ class PipesTest extends TestCase
|
|
| 216 |
{
|
| 217 |
$fixture = $this->loadFixture('connected_account');
|
| 218 |
$client = $this->createMockClient([['status' => 200, 'body' => $fixture]]);
|
| 219 |
-
$result = $client->pipes()->createOrganizationConnectedAccount('test_organization_id', 'test_slug');
|
| 220 |
$this->assertInstanceOf(\WorkOS\Resource\ConnectedAccount::class, $result);
|
| 221 |
$this->assertSame($fixture['id'], $result->id);
|
| 222 |
$this->assertSame($fixture['created_at'], $result->createdAt);
|
|
@@ -224,13 +224,15 @@ class PipesTest extends TestCase
|
|
| 224 |
$request = $this->getLastRequest();
|
| 225 |
$this->assertSame('POST', $request->getMethod());
|
| 226 |
$this->assertStringEndsWith('organizations/test_organization_id/connected_accounts/test_slug', $request->getUri()->getPath());
|
|
|
|
|
|
|
| 227 |
}
|
| 228 |
|
| 229 |
public function testUpdateOrganizationConnectedAccount(): void
|
| 230 |
{
|
| 231 |
$fixture = $this->loadFixture('connected_account');
|
| 232 |
$client = $this->createMockClient([['status' => 200, 'body' => $fixture]]);
|
| 233 |
-
$result = $client->pipes()->updateOrganizationConnectedAccount('test_organization_id', 'test_slug');
|
| 234 |
$this->assertInstanceOf(\WorkOS\Resource\ConnectedAccount::class, $result);
|
| 235 |
$this->assertSame($fixture['id'], $result->id);
|
| 236 |
$this->assertSame($fixture['created_at'], $result->createdAt);
|
|
@@ -238,6 +240,8 @@ class PipesTest extends TestCase
|
|
| 238 |
$request = $this->getLastRequest();
|
| 239 |
$this->assertSame('PUT', $request->getMethod());
|
| 240 |
$this->assertStringEndsWith('organizations/test_organization_id/connected_accounts/test_slug', $request->getUri()->getPath());
|
|
|
|
|
|
|
| 241 |
}
|
| 242 |
|
| 243 |
public function testDeleteOrganizationConnectedAccount(): void
|
|
|
|
| 216 |
{
|
| 217 |
$fixture = $this->loadFixture('connected_account');
|
| 218 |
$client = $this->createMockClient([['status' => 200, 'body' => $fixture]]);
|
| 219 |
+
$result = $client->pipes()->createOrganizationConnectedAccount('test_organization_id', 'test_slug', userId: 'test_value');
|
| 220 |
$this->assertInstanceOf(\WorkOS\Resource\ConnectedAccount::class, $result);
|
| 221 |
$this->assertSame($fixture['id'], $result->id);
|
| 222 |
$this->assertSame($fixture['created_at'], $result->createdAt);
|
|
|
|
| 224 |
$request = $this->getLastRequest();
|
| 225 |
$this->assertSame('POST', $request->getMethod());
|
| 226 |
$this->assertStringEndsWith('organizations/test_organization_id/connected_accounts/test_slug', $request->getUri()->getPath());
|
| 227 |
+
$body = json_decode((string) $request->getBody(), true);
|
| 228 |
+
$this->assertSame('test_value', $body['user_id']);
|
| 229 |
}
|
| 230 |
|
| 231 |
public function testUpdateOrganizationConnectedAccount(): void
|
| 232 |
{
|
| 233 |
$fixture = $this->loadFixture('connected_account');
|
| 234 |
$client = $this->createMockClient([['status' => 200, 'body' => $fixture]]);
|
| 235 |
+
$result = $client->pipes()->updateOrganizationConnectedAccount('test_organization_id', 'test_slug', userId: 'test_value');
|
| 236 |
$this->assertInstanceOf(\WorkOS\Resource\ConnectedAccount::class, $result);
|
| 237 |
$this->assertSame($fixture['id'], $result->id);
|
| 238 |
$this->assertSame($fixture['created_at'], $result->createdAt);
|
|
|
|
| 240 |
$request = $this->getLastRequest();
|
| 241 |
$this->assertSame('PUT', $request->getMethod());
|
| 242 |
$this->assertStringEndsWith('organizations/test_organization_id/connected_accounts/test_slug', $request->getUri()->getPath());
|
| 243 |
+
$body = json_decode((string) $request->getBody(), true);
|
| 244 |
+
$this->assertSame('test_value', $body['user_id']);
|
| 245 |
}
|
| 246 |
|
| 247 |
public function testDeleteOrganizationConnectedAccount(): void
|
All files in this language are hidden by the current filters.
code: 9 ยท tests: 2 ยท manifest: 1
python/.oagen-manifest.json|
@@ -248,7 +248,6 @@
|
|
| 248 |
"src/workos/common/models/connected_account.py",
|
| 249 |
"src/workos/common/models/connected_account_auth_method.py",
|
| 250 |
"src/workos/common/models/connected_account_connection_role.py",
|
| 251 |
-
"src/workos/common/models/connected_account_input.py",
|
| 252 |
"src/workos/common/models/connected_account_input_state.py",
|
| 253 |
"src/workos/common/models/connected_account_state.py",
|
| 254 |
"src/workos/common/models/connection_activated.py",
|
|
@@ -421,6 +420,7 @@
|
|
| 421 |
"src/workos/common/models/list_metadata.py",
|
| 422 |
"src/workos/common/models/magic_auth_created.py",
|
| 423 |
"src/workos/common/models/magic_auth_created_data.py",
|
|
|
|
| 424 |
"src/workos/common/models/organization_created.py",
|
| 425 |
"src/workos/common/models/organization_created_data.py",
|
| 426 |
"src/workos/common/models/organization_created_data_domain.py",
|
|
@@ -696,6 +696,7 @@
|
|
| 696 |
"src/workos/pipes/_resource.py",
|
| 697 |
"src/workos/pipes/models/__init__.py",
|
| 698 |
"src/workos/pipes/models/api_key_installation.py",
|
|
|
|
| 699 |
"src/workos/pipes/models/create_data_integration.py",
|
| 700 |
"src/workos/pipes/models/custom_provider_definition.py",
|
| 701 |
"src/workos/pipes/models/data_integration.py",
|
|
@@ -713,6 +714,7 @@
|
|
| 713 |
"src/workos/pipes/models/data_integrations_upsert_api_key_request.py",
|
| 714 |
"src/workos/pipes/models/data_integrations_upsert_client_credentials_request.py",
|
| 715 |
"src/workos/pipes/models/data_integrations_vend_credentials_request.py",
|
|
|
|
| 716 |
"src/workos/pipes/models/pipes_ownership.py",
|
| 717 |
"src/workos/pipes/models/update_custom_provider_definition.py",
|
| 718 |
"src/workos/pipes/models/update_data_integration.py",
|
|
@@ -1326,6 +1328,7 @@
|
|
| 1326 |
"tests/fixtures/organization_api_key_with_value.json",
|
| 1327 |
"tests/fixtures/organization_api_key_with_value_owner.json",
|
| 1328 |
"tests/fixtures/organization_authorized_connect_application_list_data.json",
|
|
|
|
| 1329 |
"tests/fixtures/organization_created.json",
|
| 1330 |
"tests/fixtures/organization_created_data.json",
|
| 1331 |
"tests/fixtures/organization_created_data_domain.json",
|
|
|
|
| 248 |
"src/workos/common/models/connected_account.py",
|
| 249 |
"src/workos/common/models/connected_account_auth_method.py",
|
| 250 |
"src/workos/common/models/connected_account_connection_role.py",
|
|
|
|
| 251 |
"src/workos/common/models/connected_account_input_state.py",
|
| 252 |
"src/workos/common/models/connected_account_state.py",
|
| 253 |
"src/workos/common/models/connection_activated.py",
|
|
|
|
| 420 |
"src/workos/common/models/list_metadata.py",
|
| 421 |
"src/workos/common/models/magic_auth_created.py",
|
| 422 |
"src/workos/common/models/magic_auth_created_data.py",
|
| 423 |
+
"src/workos/common/models/organization_connected_account_state.py",
|
| 424 |
"src/workos/common/models/organization_created.py",
|
| 425 |
"src/workos/common/models/organization_created_data.py",
|
| 426 |
"src/workos/common/models/organization_created_data_domain.py",
|
|
|
|
| 696 |
"src/workos/pipes/_resource.py",
|
| 697 |
"src/workos/pipes/models/__init__.py",
|
| 698 |
"src/workos/pipes/models/api_key_installation.py",
|
| 699 |
+
"src/workos/pipes/models/connected_account_input.py",
|
| 700 |
"src/workos/pipes/models/create_data_integration.py",
|
| 701 |
"src/workos/pipes/models/custom_provider_definition.py",
|
| 702 |
"src/workos/pipes/models/data_integration.py",
|
|
|
|
| 714 |
"src/workos/pipes/models/data_integrations_upsert_api_key_request.py",
|
| 715 |
"src/workos/pipes/models/data_integrations_upsert_client_credentials_request.py",
|
| 716 |
"src/workos/pipes/models/data_integrations_vend_credentials_request.py",
|
| 717 |
+
"src/workos/pipes/models/organization_connected_account.py",
|
| 718 |
"src/workos/pipes/models/pipes_ownership.py",
|
| 719 |
"src/workos/pipes/models/update_custom_provider_definition.py",
|
| 720 |
"src/workos/pipes/models/update_data_integration.py",
|
|
|
|
| 1328 |
"tests/fixtures/organization_api_key_with_value.json",
|
| 1329 |
"tests/fixtures/organization_api_key_with_value_owner.json",
|
| 1330 |
"tests/fixtures/organization_authorized_connect_application_list_data.json",
|
| 1331 |
+
"tests/fixtures/organization_connected_account.json",
|
| 1332 |
"tests/fixtures/organization_created.json",
|
| 1333 |
"tests/fixtures/organization_created_data.json",
|
| 1334 |
"tests/fixtures/organization_created_data_domain.json",
|
python/src/workos/common/__init__.py|
@@ -221,7 +221,6 @@ from .models import ConnectApplicationVariant as ConnectApplicationVariant
|
|
| 221 |
from .models import ConnectedAccount as ConnectedAccount
|
| 222 |
from .models import ConnectedAccountAuthMethod as ConnectedAccountAuthMethod
|
| 223 |
from .models import ConnectedAccountConnectionRole as ConnectedAccountConnectionRole
|
| 224 |
-
from .models import ConnectedAccountInput as ConnectedAccountInput
|
| 225 |
from .models import ConnectedAccountInputState as ConnectedAccountInputState
|
| 226 |
from .models import ConnectedAccountState as ConnectedAccountState
|
| 227 |
from .models import ConnectionActivated as ConnectionActivated
|
|
@@ -447,6 +446,9 @@ from .models import InviteItContactIntents as InviteItContactIntents
|
|
| 447 |
from .models import ListMetadata as ListMetadata
|
| 448 |
from .models import MagicAuthCreated as MagicAuthCreated
|
| 449 |
from .models import MagicAuthCreatedData as MagicAuthCreatedData
|
|
|
|
|
|
|
|
|
|
| 450 |
from .models import OrganizationCreated as OrganizationCreated
|
| 451 |
from .models import OrganizationCreatedData as OrganizationCreatedData
|
| 452 |
from .models import OrganizationCreatedDataDomain as OrganizationCreatedDataDomain
|
|
|
|
| 221 |
from .models import ConnectedAccount as ConnectedAccount
|
| 222 |
from .models import ConnectedAccountAuthMethod as ConnectedAccountAuthMethod
|
| 223 |
from .models import ConnectedAccountConnectionRole as ConnectedAccountConnectionRole
|
|
|
|
| 224 |
from .models import ConnectedAccountInputState as ConnectedAccountInputState
|
| 225 |
from .models import ConnectedAccountState as ConnectedAccountState
|
| 226 |
from .models import ConnectionActivated as ConnectionActivated
|
|
|
|
| 446 |
from .models import ListMetadata as ListMetadata
|
| 447 |
from .models import MagicAuthCreated as MagicAuthCreated
|
| 448 |
from .models import MagicAuthCreatedData as MagicAuthCreatedData
|
| 449 |
+
from .models import (
|
| 450 |
+
OrganizationConnectedAccountState as OrganizationConnectedAccountState,
|
| 451 |
+
)
|
| 452 |
from .models import OrganizationCreated as OrganizationCreated
|
| 453 |
from .models import OrganizationCreatedData as OrganizationCreatedData
|
| 454 |
from .models import OrganizationCreatedDataDomain as OrganizationCreatedDataDomain
|
python/src/workos/common/models/__init__.py|
@@ -363,7 +363,6 @@ from .connected_account_auth_method import (
|
|
| 363 |
from .connected_account_connection_role import (
|
| 364 |
ConnectedAccountConnectionRole as ConnectedAccountConnectionRole,
|
| 365 |
)
|
| 366 |
-
from .connected_account_input import ConnectedAccountInput as ConnectedAccountInput
|
| 367 |
from .connected_account_input_state import (
|
| 368 |
ConnectedAccountInputState as ConnectedAccountInputState,
|
| 369 |
)
|
|
@@ -647,6 +646,9 @@ from .invite_it_contact_intents import InviteItContactIntents as InviteItContact
|
|
| 647 |
from .list_metadata import ListMetadata as ListMetadata
|
| 648 |
from .magic_auth_created import MagicAuthCreated as MagicAuthCreated
|
| 649 |
from .magic_auth_created_data import MagicAuthCreatedData as MagicAuthCreatedData
|
|
|
|
|
|
|
|
|
|
| 650 |
from .organization_created import OrganizationCreated as OrganizationCreated
|
| 651 |
from .organization_created_data import (
|
| 652 |
OrganizationCreatedData as OrganizationCreatedData,
|
|
|
|
| 363 |
from .connected_account_connection_role import (
|
| 364 |
ConnectedAccountConnectionRole as ConnectedAccountConnectionRole,
|
| 365 |
)
|
|
|
|
| 366 |
from .connected_account_input_state import (
|
| 367 |
ConnectedAccountInputState as ConnectedAccountInputState,
|
| 368 |
)
|
|
|
|
| 646 |
from .list_metadata import ListMetadata as ListMetadata
|
| 647 |
from .magic_auth_created import MagicAuthCreated as MagicAuthCreated
|
| 648 |
from .magic_auth_created_data import MagicAuthCreatedData as MagicAuthCreatedData
|
| 649 |
+
from .organization_connected_account_state import (
|
| 650 |
+
OrganizationConnectedAccountState as OrganizationConnectedAccountState,
|
| 651 |
+
)
|
| 652 |
from .organization_created import OrganizationCreated as OrganizationCreated
|
| 653 |
from .organization_created_data import (
|
| 654 |
OrganizationCreatedData as OrganizationCreatedData,
|
python/src/workos/common/models/organization_connected_account_state.py|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
from typing import TypeAlias
|
| 4 |
+
|
| 5 |
+
from .connected_account_input_state import ConnectedAccountInputState
|
| 6 |
+
|
| 7 |
+
OrganizationConnectedAccountState: TypeAlias = ConnectedAccountInputState
|
| 8 |
+
__all__ = ["OrganizationConnectedAccountState"]
|
python/src/workos/pipes/_resource.py|
@@ -35,6 +35,9 @@ from workos.common.models.data_integrations_upsert_client_credentials_request_co
|
|
| 35 |
from workos.common.models.data_integrations_vend_credentials_request_connection_owner import (
|
| 36 |
DataIntegrationsVendCredentialsRequestConnectionOwner,
|
| 37 |
)
|
|
|
|
|
|
|
|
|
|
| 38 |
from workos.common.models.pagination_order import PaginationOrder
|
| 39 |
|
| 40 |
from .._pagination import AsyncPage, SyncPage
|
|
@@ -788,11 +791,12 @@ class Pipes:
|
|
| 788 |
organization_id: str,
|
| 789 |
slug: str,
|
| 790 |
*,
|
|
|
|
| 791 |
access_token: str | None = None,
|
| 792 |
refresh_token: str | None = None,
|
| 793 |
expires_at: str | None = None,
|
| 794 |
scopes: list[str] | None = None,
|
| 795 |
-
state:
|
| 796 |
request_options: RequestOptions | None = None,
|
| 797 |
) -> ConnectedAccount:
|
| 798 |
"""Import an organization connected account
|
|
@@ -807,6 +811,7 @@ class Pipes:
|
|
| 807 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 808 |
scopes: The OAuth scopes granted for this connection.
|
| 809 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 810 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 811 |
|
| 812 |
Returns:
|
|
@@ -814,6 +819,7 @@ class Pipes:
|
|
| 814 |
|
| 815 |
Raises:
|
| 816 |
AuthenticationError: If the API key is invalid (401).
|
|
|
|
| 817 |
NotFoundError: If the resource is not found (404).
|
| 818 |
ConflictError: If a conflict occurs (409).
|
| 819 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
@@ -828,6 +834,7 @@ class Pipes:
|
|
| 828 |
"expires_at": expires_at,
|
| 829 |
"scopes": scopes,
|
| 830 |
"state": enum_value(state) if state is not None else None,
|
|
|
|
| 831 |
}.items()
|
| 832 |
if v is not None
|
| 833 |
}
|
|
@@ -849,11 +856,12 @@ class Pipes:
|
|
| 849 |
organization_id: str,
|
| 850 |
slug: str,
|
| 851 |
*,
|
|
|
|
| 852 |
access_token: str | None = None,
|
| 853 |
refresh_token: str | None = None,
|
| 854 |
expires_at: str | None = None,
|
| 855 |
scopes: list[str] | None = None,
|
| 856 |
-
state:
|
| 857 |
supports_multiple_connections: bool | None = None,
|
| 858 |
connected_account_id: str | None = None,
|
| 859 |
request_options: RequestOptions | None = None,
|
|
@@ -870,6 +878,7 @@ class Pipes:
|
|
| 870 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 871 |
scopes: The OAuth scopes granted for this connection.
|
| 872 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 873 |
supports_multiple_connections: Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 874 |
connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 875 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
|
@@ -880,6 +889,7 @@ class Pipes:
|
|
| 880 |
Raises:
|
| 881 |
BadRequestError: If the request is malformed (400).
|
| 882 |
AuthenticationError: If the API key is invalid (401).
|
|
|
|
| 883 |
NotFoundError: If the resource is not found (404).
|
| 884 |
ConflictError: If a conflict occurs (409).
|
| 885 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
@@ -894,6 +904,7 @@ class Pipes:
|
|
| 894 |
"expires_at": expires_at,
|
| 895 |
"scopes": scopes,
|
| 896 |
"state": enum_value(state) if state is not None else None,
|
|
|
|
| 897 |
}.items()
|
| 898 |
if v is not None
|
| 899 |
}
|
|
@@ -2046,11 +2057,12 @@ class AsyncPipes:
|
|
| 2046 |
organization_id: str,
|
| 2047 |
slug: str,
|
| 2048 |
*,
|
|
|
|
| 2049 |
access_token: str | None = None,
|
| 2050 |
refresh_token: str | None = None,
|
| 2051 |
expires_at: str | None = None,
|
| 2052 |
scopes: list[str] | None = None,
|
| 2053 |
-
state:
|
| 2054 |
request_options: RequestOptions | None = None,
|
| 2055 |
) -> ConnectedAccount:
|
| 2056 |
"""Import an organization connected account
|
|
@@ -2065,6 +2077,7 @@ class AsyncPipes:
|
|
| 2065 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 2066 |
scopes: The OAuth scopes granted for this connection.
|
| 2067 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 2068 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 2069 |
|
| 2070 |
Returns:
|
|
@@ -2072,6 +2085,7 @@ class AsyncPipes:
|
|
| 2072 |
|
| 2073 |
Raises:
|
| 2074 |
AuthenticationError: If the API key is invalid (401).
|
|
|
|
| 2075 |
NotFoundError: If the resource is not found (404).
|
| 2076 |
ConflictError: If a conflict occurs (409).
|
| 2077 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
@@ -2086,6 +2100,7 @@ class AsyncPipes:
|
|
| 2086 |
"expires_at": expires_at,
|
| 2087 |
"scopes": scopes,
|
| 2088 |
"state": enum_value(state) if state is not None else None,
|
|
|
|
| 2089 |
}.items()
|
| 2090 |
if v is not None
|
| 2091 |
}
|
|
@@ -2107,11 +2122,12 @@ class AsyncPipes:
|
|
| 2107 |
organization_id: str,
|
| 2108 |
slug: str,
|
| 2109 |
*,
|
|
|
|
| 2110 |
access_token: str | None = None,
|
| 2111 |
refresh_token: str | None = None,
|
| 2112 |
expires_at: str | None = None,
|
| 2113 |
scopes: list[str] | None = None,
|
| 2114 |
-
state:
|
| 2115 |
supports_multiple_connections: bool | None = None,
|
| 2116 |
connected_account_id: str | None = None,
|
| 2117 |
request_options: RequestOptions | None = None,
|
|
@@ -2128,6 +2144,7 @@ class AsyncPipes:
|
|
| 2128 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 2129 |
scopes: The OAuth scopes granted for this connection.
|
| 2130 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
|
|
|
| 2131 |
supports_multiple_connections: Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 2132 |
connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 2133 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
|
@@ -2138,6 +2155,7 @@ class AsyncPipes:
|
|
| 2138 |
Raises:
|
| 2139 |
BadRequestError: If the request is malformed (400).
|
| 2140 |
AuthenticationError: If the API key is invalid (401).
|
|
|
|
| 2141 |
NotFoundError: If the resource is not found (404).
|
| 2142 |
ConflictError: If a conflict occurs (409).
|
| 2143 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
@@ -2152,6 +2170,7 @@ class AsyncPipes:
|
|
| 2152 |
"expires_at": expires_at,
|
| 2153 |
"scopes": scopes,
|
| 2154 |
"state": enum_value(state) if state is not None else None,
|
|
|
|
| 2155 |
}.items()
|
| 2156 |
if v is not None
|
| 2157 |
}
|
|
|
|
| 35 |
from workos.common.models.data_integrations_vend_credentials_request_connection_owner import (
|
| 36 |
DataIntegrationsVendCredentialsRequestConnectionOwner,
|
| 37 |
)
|
| 38 |
+
from workos.common.models.organization_connected_account_state import (
|
| 39 |
+
OrganizationConnectedAccountState,
|
| 40 |
+
)
|
| 41 |
from workos.common.models.pagination_order import PaginationOrder
|
| 42 |
|
| 43 |
from .._pagination import AsyncPage, SyncPage
|
|
|
|
| 791 |
organization_id: str,
|
| 792 |
slug: str,
|
| 793 |
*,
|
| 794 |
+
user_id: str,
|
| 795 |
access_token: str | None = None,
|
| 796 |
refresh_token: str | None = None,
|
| 797 |
expires_at: str | None = None,
|
| 798 |
scopes: list[str] | None = None,
|
| 799 |
+
state: OrganizationConnectedAccountState | str | None = None,
|
| 800 |
request_options: RequestOptions | None = None,
|
| 801 |
) -> ConnectedAccount:
|
| 802 |
"""Import an organization connected account
|
|
|
|
| 811 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 812 |
scopes: The OAuth scopes granted for this connection.
|
| 813 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 814 |
+
user_id: The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 815 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 816 |
|
| 817 |
Returns:
|
|
|
|
| 819 |
|
| 820 |
Raises:
|
| 821 |
AuthenticationError: If the API key is invalid (401).
|
| 822 |
+
AuthorizationError: If the request is forbidden (403).
|
| 823 |
NotFoundError: If the resource is not found (404).
|
| 824 |
ConflictError: If a conflict occurs (409).
|
| 825 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
|
|
| 834 |
"expires_at": expires_at,
|
| 835 |
"scopes": scopes,
|
| 836 |
"state": enum_value(state) if state is not None else None,
|
| 837 |
+
"user_id": user_id,
|
| 838 |
}.items()
|
| 839 |
if v is not None
|
| 840 |
}
|
|
|
|
| 856 |
organization_id: str,
|
| 857 |
slug: str,
|
| 858 |
*,
|
| 859 |
+
user_id: str,
|
| 860 |
access_token: str | None = None,
|
| 861 |
refresh_token: str | None = None,
|
| 862 |
expires_at: str | None = None,
|
| 863 |
scopes: list[str] | None = None,
|
| 864 |
+
state: OrganizationConnectedAccountState | str | None = None,
|
| 865 |
supports_multiple_connections: bool | None = None,
|
| 866 |
connected_account_id: str | None = None,
|
| 867 |
request_options: RequestOptions | None = None,
|
|
|
|
| 878 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 879 |
scopes: The OAuth scopes granted for this connection.
|
| 880 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 881 |
+
user_id: The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 882 |
supports_multiple_connections: Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 883 |
connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 884 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
|
|
|
| 889 |
Raises:
|
| 890 |
BadRequestError: If the request is malformed (400).
|
| 891 |
AuthenticationError: If the API key is invalid (401).
|
| 892 |
+
AuthorizationError: If the request is forbidden (403).
|
| 893 |
NotFoundError: If the resource is not found (404).
|
| 894 |
ConflictError: If a conflict occurs (409).
|
| 895 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
|
|
| 904 |
"expires_at": expires_at,
|
| 905 |
"scopes": scopes,
|
| 906 |
"state": enum_value(state) if state is not None else None,
|
| 907 |
+
"user_id": user_id,
|
| 908 |
}.items()
|
| 909 |
if v is not None
|
| 910 |
}
|
|
|
|
| 2057 |
organization_id: str,
|
| 2058 |
slug: str,
|
| 2059 |
*,
|
| 2060 |
+
user_id: str,
|
| 2061 |
access_token: str | None = None,
|
| 2062 |
refresh_token: str | None = None,
|
| 2063 |
expires_at: str | None = None,
|
| 2064 |
scopes: list[str] | None = None,
|
| 2065 |
+
state: OrganizationConnectedAccountState | str | None = None,
|
| 2066 |
request_options: RequestOptions | None = None,
|
| 2067 |
) -> ConnectedAccount:
|
| 2068 |
"""Import an organization connected account
|
|
|
|
| 2077 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 2078 |
scopes: The OAuth scopes granted for this connection.
|
| 2079 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 2080 |
+
user_id: The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 2081 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
| 2082 |
|
| 2083 |
Returns:
|
|
|
|
| 2085 |
|
| 2086 |
Raises:
|
| 2087 |
AuthenticationError: If the API key is invalid (401).
|
| 2088 |
+
AuthorizationError: If the request is forbidden (403).
|
| 2089 |
NotFoundError: If the resource is not found (404).
|
| 2090 |
ConflictError: If a conflict occurs (409).
|
| 2091 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
|
|
| 2100 |
"expires_at": expires_at,
|
| 2101 |
"scopes": scopes,
|
| 2102 |
"state": enum_value(state) if state is not None else None,
|
| 2103 |
+
"user_id": user_id,
|
| 2104 |
}.items()
|
| 2105 |
if v is not None
|
| 2106 |
}
|
|
|
|
| 2122 |
organization_id: str,
|
| 2123 |
slug: str,
|
| 2124 |
*,
|
| 2125 |
+
user_id: str,
|
| 2126 |
access_token: str | None = None,
|
| 2127 |
refresh_token: str | None = None,
|
| 2128 |
expires_at: str | None = None,
|
| 2129 |
scopes: list[str] | None = None,
|
| 2130 |
+
state: OrganizationConnectedAccountState | str | None = None,
|
| 2131 |
supports_multiple_connections: bool | None = None,
|
| 2132 |
connected_account_id: str | None = None,
|
| 2133 |
request_options: RequestOptions | None = None,
|
|
|
|
| 2144 |
expires_at: The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 2145 |
scopes: The OAuth scopes granted for this connection.
|
| 2146 |
state: Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 2147 |
+
user_id: The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 2148 |
supports_multiple_connections: Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 2149 |
connected_account_id: A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 2150 |
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
|
|
|
|
| 2155 |
Raises:
|
| 2156 |
BadRequestError: If the request is malformed (400).
|
| 2157 |
AuthenticationError: If the API key is invalid (401).
|
| 2158 |
+
AuthorizationError: If the request is forbidden (403).
|
| 2159 |
NotFoundError: If the resource is not found (404).
|
| 2160 |
ConflictError: If a conflict occurs (409).
|
| 2161 |
UnprocessableEntityError: If the request data is unprocessable (422).
|
|
|
|
| 2170 |
"expires_at": expires_at,
|
| 2171 |
"scopes": scopes,
|
| 2172 |
"state": enum_value(state) if state is not None else None,
|
| 2173 |
+
"user_id": user_id,
|
| 2174 |
}.items()
|
| 2175 |
if v is not None
|
| 2176 |
}
|
python/src/workos/pipes/models/__init__.py|
@@ -1,9 +1,6 @@
|
|
| 1 |
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
|
| 3 |
from workos.common.models.connected_account import ConnectedAccount as ConnectedAccount
|
| 4 |
-
from workos.common.models.connected_account_input import (
|
| 5 |
-
ConnectedAccountInput as ConnectedAccountInput,
|
| 6 |
-
)
|
| 7 |
from workos.common.models.data_integrations_list_response import (
|
| 8 |
DataIntegrationsListResponse as DataIntegrationsListResponse,
|
| 9 |
)
|
|
@@ -15,6 +12,7 @@ from workos.common.models.data_integrations_list_response_data_connected_account
|
|
| 15 |
)
|
| 16 |
|
| 17 |
from .api_key_installation import ApiKeyInstallation as ApiKeyInstallation
|
|
|
|
| 18 |
from .create_data_integration import CreateDataIntegration as CreateDataIntegration
|
| 19 |
from .custom_provider_definition import (
|
| 20 |
CustomProviderDefinition as CustomProviderDefinition,
|
|
@@ -62,6 +60,9 @@ from .data_integrations_upsert_client_credentials_request import (
|
|
| 62 |
from .data_integrations_vend_credentials_request import (
|
| 63 |
DataIntegrationsVendCredentialsRequest as DataIntegrationsVendCredentialsRequest,
|
| 64 |
)
|
|
|
|
|
|
|
|
|
|
| 65 |
from .pipes_ownership import PipesOwnership as PipesOwnership
|
| 66 |
from .update_custom_provider_definition import (
|
| 67 |
UpdateCustomProviderDefinition as UpdateCustomProviderDefinition,
|
|
|
|
| 1 |
# This file is auto-generated by oagen. Do not edit.
|
| 2 |
|
| 3 |
from workos.common.models.connected_account import ConnectedAccount as ConnectedAccount
|
|
|
|
|
|
|
|
|
|
| 4 |
from workos.common.models.data_integrations_list_response import (
|
| 5 |
DataIntegrationsListResponse as DataIntegrationsListResponse,
|
| 6 |
)
|
|
|
|
| 12 |
)
|
| 13 |
|
| 14 |
from .api_key_installation import ApiKeyInstallation as ApiKeyInstallation
|
| 15 |
+
from .connected_account_input import ConnectedAccountInput as ConnectedAccountInput
|
| 16 |
from .create_data_integration import CreateDataIntegration as CreateDataIntegration
|
| 17 |
from .custom_provider_definition import (
|
| 18 |
CustomProviderDefinition as CustomProviderDefinition,
|
|
|
|
| 60 |
from .data_integrations_vend_credentials_request import (
|
| 61 |
DataIntegrationsVendCredentialsRequest as DataIntegrationsVendCredentialsRequest,
|
| 62 |
)
|
| 63 |
+
from .organization_connected_account import (
|
| 64 |
+
OrganizationConnectedAccount as OrganizationConnectedAccount,
|
| 65 |
+
)
|
| 66 |
from .pipes_ownership import PipesOwnership as PipesOwnership
|
| 67 |
from .update_custom_provider_definition import (
|
| 68 |
UpdateCustomProviderDefinition as UpdateCustomProviderDefinition,
|
python/src/workos/pipes/models/connected_account_input.py|
@@ -8,8 +8,9 @@ from enum import Enum
|
|
| 8 |
from typing import Any
|
| 9 |
|
| 10 |
from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error
|
| 11 |
-
|
| 12 |
-
from .connected_account_input_state import
|
|
|
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
@dataclass(slots=True)
|
|
|
|
| 8 |
from typing import Any
|
| 9 |
|
| 10 |
from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error
|
|
|
|
| 11 |
+
from workos.common.models.connected_account_input_state import (
|
| 12 |
+
ConnectedAccountInputState,
|
| 13 |
+
)
|
| 14 |
|
| 15 |
|
| 16 |
@dataclass(slots=True)
|
python/src/workos/pipes/models/organization_connected_account.py|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 enum import Enum
|
| 8 |
+
from typing import Any
|
| 9 |
+
|
| 10 |
+
from workos._types import _format_datetime, _parse_datetime, _raise_deserialize_error
|
| 11 |
+
from workos.common.models.organization_connected_account_state import (
|
| 12 |
+
OrganizationConnectedAccountState,
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
@dataclass(slots=True)
|
| 17 |
+
class OrganizationConnectedAccount:
|
| 18 |
+
"""Organization Connected Account model."""
|
| 19 |
+
|
| 20 |
+
user_id: str
|
| 21 |
+
"""The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization."""
|
| 22 |
+
access_token: str | None = None
|
| 23 |
+
"""The OAuth access token for the connected account."""
|
| 24 |
+
refresh_token: str | None = None
|
| 25 |
+
"""The OAuth refresh token for the connected account."""
|
| 26 |
+
expires_at: datetime | None = None
|
| 27 |
+
"""The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire."""
|
| 28 |
+
scopes: list[str] | None = None
|
| 29 |
+
"""The OAuth scopes granted for this connection."""
|
| 30 |
+
state: OrganizationConnectedAccountState | None = None
|
| 31 |
+
"""Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided."""
|
| 32 |
+
|
| 33 |
+
@classmethod
|
| 34 |
+
def from_dict(cls, data: dict[str, Any]) -> OrganizationConnectedAccount:
|
| 35 |
+
"""Deserialize from a dictionary."""
|
| 36 |
+
try:
|
| 37 |
+
return cls(
|
| 38 |
+
user_id=data["user_id"],
|
| 39 |
+
access_token=data.get("access_token"),
|
| 40 |
+
refresh_token=data.get("refresh_token"),
|
| 41 |
+
expires_at=_parse_datetime(_v_expires_at)
|
| 42 |
+
if (_v_expires_at := data.get("expires_at")) is not None
|
| 43 |
+
else None,
|
| 44 |
+
scopes=data.get("scopes"),
|
| 45 |
+
state=OrganizationConnectedAccountState(_v_state)
|
| 46 |
+
if (_v_state := data.get("state")) is not None
|
| 47 |
+
else None,
|
| 48 |
+
)
|
| 49 |
+
except (KeyError, ValueError) as e:
|
| 50 |
+
_raise_deserialize_error("OrganizationConnectedAccount", e)
|
| 51 |
+
|
| 52 |
+
def to_dict(self) -> dict[str, Any]:
|
| 53 |
+
"""Serialize to a dictionary."""
|
| 54 |
+
result: dict[str, Any] = {}
|
| 55 |
+
result["user_id"] = self.user_id
|
| 56 |
+
if self.access_token is not None:
|
| 57 |
+
result["access_token"] = self.access_token
|
| 58 |
+
if self.refresh_token is not None:
|
| 59 |
+
result["refresh_token"] = self.refresh_token
|
| 60 |
+
if self.expires_at is not None:
|
| 61 |
+
result["expires_at"] = _format_datetime(self.expires_at)
|
| 62 |
+
if self.scopes is not None:
|
| 63 |
+
result["scopes"] = self.scopes
|
| 64 |
+
if self.state is not None:
|
| 65 |
+
result["state"] = (
|
| 66 |
+
self.state.value if isinstance(self.state, Enum) else self.state
|
| 67 |
+
)
|
| 68 |
+
return result
|
python/src/workos/user_management/_resource.py|
@@ -1224,7 +1224,7 @@ class UserManagement:
|
|
| 1224 |
Create a new user in the current environment.
|
| 1225 |
|
| 1226 |
Args:
|
| 1227 |
-
email: The email address of the user.
|
| 1228 |
first_name: The first name of the user.
|
| 1229 |
last_name: The last name of the user.
|
| 1230 |
name: The user's full name.
|
|
@@ -3976,7 +3976,7 @@ class AsyncUserManagement:
|
|
| 3976 |
Create a new user in the current environment.
|
| 3977 |
|
| 3978 |
Args:
|
| 3979 |
-
email: The email address of the user.
|
| 3980 |
first_name: The first name of the user.
|
| 3981 |
last_name: The last name of the user.
|
| 3982 |
name: The user's full name.
|
|
|
|
| 1224 |
Create a new user in the current environment.
|
| 1225 |
|
| 1226 |
Args:
|
| 1227 |
+
email: The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 1228 |
first_name: The first name of the user.
|
| 1229 |
last_name: The last name of the user.
|
| 1230 |
name: The user's full name.
|
|
|
|
| 3976 |
Create a new user in the current environment.
|
| 3977 |
|
| 3978 |
Args:
|
| 3979 |
+
email: The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 3980 |
first_name: The first name of the user.
|
| 3981 |
last_name: The last name of the user.
|
| 3982 |
name: The user's full name.
|
python/src/workos/user_management/models/create_user.py|
@@ -20,7 +20,7 @@ class CreateUser:
|
|
| 20 |
"""Create User model."""
|
| 21 |
|
| 22 |
email: str
|
| 23 |
-
"""The email address of the user."""
|
| 24 |
first_name: str | None = None
|
| 25 |
"""The first name of the user."""
|
| 26 |
last_name: str | None = None
|
|
|
|
| 20 |
"""Create User model."""
|
| 21 |
|
| 22 |
email: str
|
| 23 |
+
"""The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it."""
|
| 24 |
first_name: str | None = None
|
| 25 |
"""The first name of the user."""
|
| 26 |
last_name: str | None = None
|
python/tests/fixtures/organization_connected_account.json|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"access_token": "gho_16C7e42F292c6912E7710c838347Ae178B4a",
|
| 3 |
+
"refresh_token": "ghr_xxxxxxxxxxxxxxxxxxxx",
|
| 4 |
+
"expires_at": "2025-12-31T23:59:59.000Z",
|
| 5 |
+
"scopes": [
|
| 6 |
+
"repo",
|
| 7 |
+
"user:email"
|
| 8 |
+
],
|
| 9 |
+
"state": "connected",
|
| 10 |
+
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT"
|
| 11 |
+
}
|
python/tests/test_pipes.py|
@@ -265,7 +265,7 @@ class TestPipes:
|
|
| 265 |
json=load_fixture("connected_account.json"),
|
| 266 |
)
|
| 267 |
result = workos.pipes.create_organization_connected_account(
|
| 268 |
-
"test_organization_id", "test_slug"
|
| 269 |
)
|
| 270 |
assert isinstance(result, ConnectedAccount)
|
| 271 |
assert result.object == "connected_account"
|
|
@@ -275,13 +275,15 @@ class TestPipes:
|
|
| 275 |
assert request.url.path.endswith(
|
| 276 |
"/organizations/test_organization_id/connected_accounts/test_slug"
|
| 277 |
)
|
|
|
|
|
|
|
| 278 |
|
| 279 |
def test_update_organization_connected_account(self, workos, httpx_mock):
|
| 280 |
httpx_mock.add_response(
|
| 281 |
json=load_fixture("connected_account.json"),
|
| 282 |
)
|
| 283 |
result = workos.pipes.update_organization_connected_account(
|
| 284 |
-
"test_organization_id", "test_slug"
|
| 285 |
)
|
| 286 |
assert isinstance(result, ConnectedAccount)
|
| 287 |
assert result.object == "connected_account"
|
|
@@ -291,6 +293,8 @@ class TestPipes:
|
|
| 291 |
assert request.url.path.endswith(
|
| 292 |
"/organizations/test_organization_id/connected_accounts/test_slug"
|
| 293 |
)
|
|
|
|
|
|
|
| 294 |
|
| 295 |
def test_update_organization_connected_account_encodes_query_params(
|
| 296 |
self, workos, httpx_mock
|
|
@@ -299,6 +303,7 @@ class TestPipes:
|
|
| 299 |
workos.pipes.update_organization_connected_account(
|
| 300 |
"test_organization_id",
|
| 301 |
"test_slug",
|
|
|
|
| 302 |
supports_multiple_connections=True,
|
| 303 |
connected_account_id="value connected_account_id/test",
|
| 304 |
)
|
|
@@ -817,7 +822,7 @@ class TestAsyncPipes:
|
|
| 817 |
):
|
| 818 |
httpx_mock.add_response(json=load_fixture("connected_account.json"))
|
| 819 |
result = await async_workos.pipes.create_organization_connected_account(
|
| 820 |
-
"test_organization_id", "test_slug"
|
| 821 |
)
|
| 822 |
assert isinstance(result, ConnectedAccount)
|
| 823 |
assert result.object == "connected_account"
|
|
@@ -834,7 +839,7 @@ class TestAsyncPipes:
|
|
| 834 |
):
|
| 835 |
httpx_mock.add_response(json=load_fixture("connected_account.json"))
|
| 836 |
result = await async_workos.pipes.update_organization_connected_account(
|
| 837 |
-
"test_organization_id", "test_slug"
|
| 838 |
)
|
| 839 |
assert isinstance(result, ConnectedAccount)
|
| 840 |
assert result.object == "connected_account"
|
|
@@ -853,6 +858,7 @@ class TestAsyncPipes:
|
|
| 853 |
await async_workos.pipes.update_organization_connected_account(
|
| 854 |
"test_organization_id",
|
| 855 |
"test_slug",
|
|
|
|
| 856 |
supports_multiple_connections=True,
|
| 857 |
connected_account_id="value connected_account_id/test",
|
| 858 |
)
|
|
|
|
| 265 |
json=load_fixture("connected_account.json"),
|
| 266 |
)
|
| 267 |
result = workos.pipes.create_organization_connected_account(
|
| 268 |
+
"test_organization_id", "test_slug", user_id="test_user_id"
|
| 269 |
)
|
| 270 |
assert isinstance(result, ConnectedAccount)
|
| 271 |
assert result.object == "connected_account"
|
|
|
|
| 275 |
assert request.url.path.endswith(
|
| 276 |
"/organizations/test_organization_id/connected_accounts/test_slug"
|
| 277 |
)
|
| 278 |
+
body = json.loads(request.content)
|
| 279 |
+
assert body["user_id"] == "test_user_id"
|
| 280 |
|
| 281 |
def test_update_organization_connected_account(self, workos, httpx_mock):
|
| 282 |
httpx_mock.add_response(
|
| 283 |
json=load_fixture("connected_account.json"),
|
| 284 |
)
|
| 285 |
result = workos.pipes.update_organization_connected_account(
|
| 286 |
+
"test_organization_id", "test_slug", user_id="test_user_id"
|
| 287 |
)
|
| 288 |
assert isinstance(result, ConnectedAccount)
|
| 289 |
assert result.object == "connected_account"
|
|
|
|
| 293 |
assert request.url.path.endswith(
|
| 294 |
"/organizations/test_organization_id/connected_accounts/test_slug"
|
| 295 |
)
|
| 296 |
+
body = json.loads(request.content)
|
| 297 |
+
assert body["user_id"] == "test_user_id"
|
| 298 |
|
| 299 |
def test_update_organization_connected_account_encodes_query_params(
|
| 300 |
self, workos, httpx_mock
|
|
|
|
| 303 |
workos.pipes.update_organization_connected_account(
|
| 304 |
"test_organization_id",
|
| 305 |
"test_slug",
|
| 306 |
+
user_id="test_user_id",
|
| 307 |
supports_multiple_connections=True,
|
| 308 |
connected_account_id="value connected_account_id/test",
|
| 309 |
)
|
|
|
|
| 822 |
):
|
| 823 |
httpx_mock.add_response(json=load_fixture("connected_account.json"))
|
| 824 |
result = await async_workos.pipes.create_organization_connected_account(
|
| 825 |
+
"test_organization_id", "test_slug", user_id="test_user_id"
|
| 826 |
)
|
| 827 |
assert isinstance(result, ConnectedAccount)
|
| 828 |
assert result.object == "connected_account"
|
|
|
|
| 839 |
):
|
| 840 |
httpx_mock.add_response(json=load_fixture("connected_account.json"))
|
| 841 |
result = await async_workos.pipes.update_organization_connected_account(
|
| 842 |
+
"test_organization_id", "test_slug", user_id="test_user_id"
|
| 843 |
)
|
| 844 |
assert isinstance(result, ConnectedAccount)
|
| 845 |
assert result.object == "connected_account"
|
|
|
|
| 858 |
await async_workos.pipes.update_organization_connected_account(
|
| 859 |
"test_organization_id",
|
| 860 |
"test_slug",
|
| 861 |
+
user_id="test_user_id",
|
| 862 |
supports_multiple_connections=True,
|
| 863 |
connected_account_id="value connected_account_id/test",
|
| 864 |
)
|
All files in this language are hidden by the current filters.
code: 6 ยท tests: 2 ยท manifest: 1
ruby/.oagen-manifest.json|
@@ -300,6 +300,7 @@
|
|
| 300 |
"lib/workos/pipes/data_integrations_upsert_api_key_request.rb",
|
| 301 |
"lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb",
|
| 302 |
"lib/workos/pipes/data_integrations_vend_credentials_request.rb",
|
|
|
|
| 303 |
"lib/workos/pipes/update_custom_provider_definition.rb",
|
| 304 |
"lib/workos/pipes/update_data_integration.rb",
|
| 305 |
"lib/workos/pipes_provider.rb",
|
|
@@ -537,6 +538,7 @@
|
|
| 537 |
"lib/workos/types/invitation_revoked_data_state.rb",
|
| 538 |
"lib/workos/types/invitation_state.rb",
|
| 539 |
"lib/workos/types/invite_it_contact_intents.rb",
|
|
|
|
| 540 |
"lib/workos/types/organization_created_data_domain_state.rb",
|
| 541 |
"lib/workos/types/organization_created_data_domain_verification_strategy.rb",
|
| 542 |
"lib/workos/types/organization_deleted_data_domain_state.rb",
|
|
@@ -1224,6 +1226,7 @@
|
|
| 1224 |
"rbi/workos/organization_api_key_with_value.rbi",
|
| 1225 |
"rbi/workos/organization_api_key_with_value_owner.rbi",
|
| 1226 |
"rbi/workos/organization_authorized_connect_application_list_data.rbi",
|
|
|
|
| 1227 |
"rbi/workos/organization_created.rbi",
|
| 1228 |
"rbi/workos/organization_created_data.rbi",
|
| 1229 |
"rbi/workos/organization_created_data_domain.rbi",
|
|
|
|
| 300 |
"lib/workos/pipes/data_integrations_upsert_api_key_request.rb",
|
| 301 |
"lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb",
|
| 302 |
"lib/workos/pipes/data_integrations_vend_credentials_request.rb",
|
| 303 |
+
"lib/workos/pipes/organization_connected_account.rb",
|
| 304 |
"lib/workos/pipes/update_custom_provider_definition.rb",
|
| 305 |
"lib/workos/pipes/update_data_integration.rb",
|
| 306 |
"lib/workos/pipes_provider.rb",
|
|
|
|
| 538 |
"lib/workos/types/invitation_revoked_data_state.rb",
|
| 539 |
"lib/workos/types/invitation_state.rb",
|
| 540 |
"lib/workos/types/invite_it_contact_intents.rb",
|
| 541 |
+
"lib/workos/types/organization_connected_account_state.rb",
|
| 542 |
"lib/workos/types/organization_created_data_domain_state.rb",
|
| 543 |
"lib/workos/types/organization_created_data_domain_verification_strategy.rb",
|
| 544 |
"lib/workos/types/organization_deleted_data_domain_state.rb",
|
|
|
|
| 1226 |
"rbi/workos/organization_api_key_with_value.rbi",
|
| 1227 |
"rbi/workos/organization_api_key_with_value_owner.rbi",
|
| 1228 |
"rbi/workos/organization_authorized_connect_application_list_data.rbi",
|
| 1229 |
+
"rbi/workos/organization_connected_account.rbi",
|
| 1230 |
"rbi/workos/organization_created.rbi",
|
| 1231 |
"rbi/workos/organization_created_data.rbi",
|
| 1232 |
"rbi/workos/organization_created_data_domain.rbi",
|
ruby/lib/workos/pipes.rb|
@@ -488,12 +488,14 @@ module WorkOS
|
|
| 488 |
# @param refresh_token [String, nil] The OAuth refresh token for the connected account.
|
| 489 |
# @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 490 |
# @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
|
| 491 |
-
# @param state [WorkOS::Types::
|
|
|
|
| 492 |
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
| 493 |
# @return [WorkOS::ConnectedAccount]
|
| 494 |
def create_organization_connected_account(
|
| 495 |
organization_id:,
|
| 496 |
slug:,
|
|
|
|
| 497 |
access_token: nil,
|
| 498 |
refresh_token: nil,
|
| 499 |
expires_at: nil,
|
|
@@ -506,7 +508,8 @@ module WorkOS
|
|
| 506 |
"refresh_token" => refresh_token,
|
| 507 |
"expires_at" => expires_at,
|
| 508 |
"scopes" => scopes,
|
| 509 |
-
"state" => state
|
|
|
|
| 510 |
}.compact
|
| 511 |
response = @client.request(
|
| 512 |
method: :post,
|
|
@@ -527,7 +530,8 @@ module WorkOS
|
|
| 527 |
# @param refresh_token [String, nil] The OAuth refresh token for the connected account.
|
| 528 |
# @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 529 |
# @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
|
| 530 |
-
# @param state [WorkOS::Types::
|
|
|
|
| 531 |
# @param supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 532 |
# @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 533 |
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -535,6 +539,7 @@ module WorkOS
|
|
| 535 |
def update_organization_connected_account(
|
| 536 |
organization_id:,
|
| 537 |
slug:,
|
|
|
|
| 538 |
access_token: nil,
|
| 539 |
refresh_token: nil,
|
| 540 |
expires_at: nil,
|
|
@@ -553,7 +558,8 @@ module WorkOS
|
|
| 553 |
"refresh_token" => refresh_token,
|
| 554 |
"expires_at" => expires_at,
|
| 555 |
"scopes" => scopes,
|
| 556 |
-
"state" => state
|
|
|
|
| 557 |
}.compact
|
| 558 |
response = @client.request(
|
| 559 |
method: :put,
|
|
|
|
| 488 |
# @param refresh_token [String, nil] The OAuth refresh token for the connected account.
|
| 489 |
# @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 490 |
# @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
|
| 491 |
+
# @param state [WorkOS::Types::OrganizationConnectedAccountState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 492 |
+
# @param user_id [String] The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 493 |
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
| 494 |
# @return [WorkOS::ConnectedAccount]
|
| 495 |
def create_organization_connected_account(
|
| 496 |
organization_id:,
|
| 497 |
slug:,
|
| 498 |
+
user_id:,
|
| 499 |
access_token: nil,
|
| 500 |
refresh_token: nil,
|
| 501 |
expires_at: nil,
|
|
|
|
| 508 |
"refresh_token" => refresh_token,
|
| 509 |
"expires_at" => expires_at,
|
| 510 |
"scopes" => scopes,
|
| 511 |
+
"state" => state,
|
| 512 |
+
"user_id" => user_id
|
| 513 |
}.compact
|
| 514 |
response = @client.request(
|
| 515 |
method: :post,
|
|
|
|
| 530 |
# @param refresh_token [String, nil] The OAuth refresh token for the connected account.
|
| 531 |
# @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 532 |
# @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
|
| 533 |
+
# @param state [WorkOS::Types::OrganizationConnectedAccountState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 534 |
+
# @param user_id [String] The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 535 |
# @param supports_multiple_connections [Boolean, nil] Set to `true` to use the plural connection contract. When omitted or `false`, only the compatibility connection is considered.
|
| 536 |
# @param connected_account_id [String, nil] A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update.
|
| 537 |
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
|
|
| 539 |
def update_organization_connected_account(
|
| 540 |
organization_id:,
|
| 541 |
slug:,
|
| 542 |
+
user_id:,
|
| 543 |
access_token: nil,
|
| 544 |
refresh_token: nil,
|
| 545 |
expires_at: nil,
|
|
|
|
| 558 |
"refresh_token" => refresh_token,
|
| 559 |
"expires_at" => expires_at,
|
| 560 |
"scopes" => scopes,
|
| 561 |
+
"state" => state,
|
| 562 |
+
"user_id" => user_id
|
| 563 |
}.compact
|
| 564 |
response = @client.request(
|
| 565 |
method: :put,
|
ruby/lib/workos/pipes/organization_connected_account.rb|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
module WorkOS
|
| 6 |
+
class OrganizationConnectedAccount < WorkOS::Types::BaseModel
|
| 7 |
+
HASH_ATTRS = {
|
| 8 |
+
access_token: :access_token,
|
| 9 |
+
refresh_token: :refresh_token,
|
| 10 |
+
expires_at: :expires_at,
|
| 11 |
+
scopes: :scopes,
|
| 12 |
+
state: :state,
|
| 13 |
+
user_id: :user_id
|
| 14 |
+
}.freeze
|
| 15 |
+
|
| 16 |
+
attr_accessor \
|
| 17 |
+
:access_token,
|
| 18 |
+
:refresh_token,
|
| 19 |
+
:expires_at,
|
| 20 |
+
:scopes,
|
| 21 |
+
:state,
|
| 22 |
+
:user_id
|
| 23 |
+
|
| 24 |
+
def initialize(json)
|
| 25 |
+
hash = self.class.normalize(json)
|
| 26 |
+
@access_token = hash[:access_token]
|
| 27 |
+
@refresh_token = hash[:refresh_token]
|
| 28 |
+
@expires_at = hash[:expires_at]
|
| 29 |
+
@scopes = hash[:scopes] || []
|
| 30 |
+
@state = hash[:state]
|
| 31 |
+
@user_id = hash[:user_id]
|
| 32 |
+
end
|
| 33 |
+
end
|
| 34 |
+
end
|
ruby/lib/workos/types/organization_connected_account_state.rb|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# frozen_string_literal: true
|
| 2 |
+
|
| 3 |
+
# This file is auto-generated by oagen. Do not edit.
|
| 4 |
+
|
| 5 |
+
module WorkOS
|
| 6 |
+
module Types
|
| 7 |
+
OrganizationConnectedAccountState = ConnectedAccountInputState
|
| 8 |
+
end
|
| 9 |
+
end
|
ruby/lib/workos/user_management.rb|
@@ -1003,7 +1003,7 @@ module WorkOS
|
|
| 1003 |
end
|
| 1004 |
|
| 1005 |
# Create a user
|
| 1006 |
-
# @param email [String] The email address of the user.
|
| 1007 |
# @param first_name [String, nil] The first name of the user.
|
| 1008 |
# @param last_name [String, nil] The last name of the user.
|
| 1009 |
# @param name [String, nil] The user's full name.
|
|
|
|
| 1003 |
end
|
| 1004 |
|
| 1005 |
# Create a user
|
| 1006 |
+
# @param email [String] The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 1007 |
# @param first_name [String, nil] The first name of the user.
|
| 1008 |
# @param last_name [String, nil] The last name of the user.
|
| 1009 |
# @param name [String, nil] The user's full name.
|
ruby/rbi/workos/organization_connected_account.rbi|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 OrganizationConnectedAccount
|
| 9 |
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
| 10 |
+
def initialize(json); end
|
| 11 |
+
|
| 12 |
+
sig { returns(T.nilable(String)) }
|
| 13 |
+
def access_token; end
|
| 14 |
+
|
| 15 |
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
| 16 |
+
def access_token=(value); end
|
| 17 |
+
|
| 18 |
+
sig { returns(T.nilable(String)) }
|
| 19 |
+
def refresh_token; end
|
| 20 |
+
|
| 21 |
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
| 22 |
+
def refresh_token=(value); end
|
| 23 |
+
|
| 24 |
+
sig { returns(T.nilable(String)) }
|
| 25 |
+
def expires_at; end
|
| 26 |
+
|
| 27 |
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
| 28 |
+
def expires_at=(value); end
|
| 29 |
+
|
| 30 |
+
sig { returns(T.nilable(T::Array[String])) }
|
| 31 |
+
def scopes; end
|
| 32 |
+
|
| 33 |
+
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
|
| 34 |
+
def scopes=(value); end
|
| 35 |
+
|
| 36 |
+
sig { returns(T.nilable(String)) }
|
| 37 |
+
def state; end
|
| 38 |
+
|
| 39 |
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
| 40 |
+
def state=(value); end
|
| 41 |
+
|
| 42 |
+
sig { returns(String) }
|
| 43 |
+
def user_id; end
|
| 44 |
+
|
| 45 |
+
sig { params(value: String).returns(String) }
|
| 46 |
+
def user_id=(value); end
|
| 47 |
+
|
| 48 |
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
| 49 |
+
def to_h; end
|
| 50 |
+
|
| 51 |
+
sig { params(args: T.untyped).returns(String) }
|
| 52 |
+
def to_json(*args); end
|
| 53 |
+
end
|
| 54 |
+
end
|
ruby/rbi/workos/pipes.rbi|
@@ -180,6 +180,7 @@ module WorkOS
|
|
| 180 |
params(
|
| 181 |
organization_id: String,
|
| 182 |
slug: String,
|
|
|
|
| 183 |
access_token: T.nilable(String),
|
| 184 |
refresh_token: T.nilable(String),
|
| 185 |
expires_at: T.nilable(String),
|
|
@@ -188,12 +189,13 @@ module WorkOS
|
|
| 188 |
request_options: T::Hash[Symbol, T.untyped]
|
| 189 |
).returns(WorkOS::ConnectedAccount)
|
| 190 |
end
|
| 191 |
-
def create_organization_connected_account(organization_id:, slug:, access_token:, refresh_token:, expires_at:, scopes:, state:, request_options:); end
|
| 192 |
|
| 193 |
sig do
|
| 194 |
params(
|
| 195 |
organization_id: String,
|
| 196 |
slug: String,
|
|
|
|
| 197 |
access_token: T.nilable(String),
|
| 198 |
refresh_token: T.nilable(String),
|
| 199 |
expires_at: T.nilable(String),
|
|
@@ -204,7 +206,7 @@ module WorkOS
|
|
| 204 |
request_options: T::Hash[Symbol, T.untyped]
|
| 205 |
).returns(WorkOS::ConnectedAccount)
|
| 206 |
end
|
| 207 |
-
def update_organization_connected_account(organization_id:, slug:, access_token:, refresh_token:, expires_at:, scopes:, state:, supports_multiple_connections:, connected_account_id:, request_options:); end
|
| 208 |
|
| 209 |
sig do
|
| 210 |
params(
|
|
|
|
| 180 |
params(
|
| 181 |
organization_id: String,
|
| 182 |
slug: String,
|
| 183 |
+
user_id: String,
|
| 184 |
access_token: T.nilable(String),
|
| 185 |
refresh_token: T.nilable(String),
|
| 186 |
expires_at: T.nilable(String),
|
|
|
|
| 189 |
request_options: T::Hash[Symbol, T.untyped]
|
| 190 |
).returns(WorkOS::ConnectedAccount)
|
| 191 |
end
|
| 192 |
+
def create_organization_connected_account(organization_id:, slug:, user_id:, access_token:, refresh_token:, expires_at:, scopes:, state:, request_options:); end
|
| 193 |
|
| 194 |
sig do
|
| 195 |
params(
|
| 196 |
organization_id: String,
|
| 197 |
slug: String,
|
| 198 |
+
user_id: String,
|
| 199 |
access_token: T.nilable(String),
|
| 200 |
refresh_token: T.nilable(String),
|
| 201 |
expires_at: T.nilable(String),
|
|
|
|
| 206 |
request_options: T::Hash[Symbol, T.untyped]
|
| 207 |
).returns(WorkOS::ConnectedAccount)
|
| 208 |
end
|
| 209 |
+
def update_organization_connected_account(organization_id:, slug:, user_id:, access_token:, refresh_token:, expires_at:, scopes:, state:, supports_multiple_connections:, connected_account_id:, request_options:); end
|
| 210 |
|
| 211 |
sig do
|
| 212 |
params(
|
ruby/test/workos/test_pipes.rb|
@@ -112,14 +112,14 @@ class PipesTest < Minitest::Test
|
|
| 112 |
def test_create_organization_connected_account_returns_expected_result
|
| 113 |
stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)})
|
| 114 |
.to_return(body: "{}", status: 200)
|
| 115 |
-
result = @client.pipes.create_organization_connected_account(organization_id: "stub", slug: "stub")
|
| 116 |
refute_nil result
|
| 117 |
end
|
| 118 |
|
| 119 |
def test_update_organization_connected_account_returns_expected_result
|
| 120 |
stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)})
|
| 121 |
.to_return(body: "{}", status: 200)
|
| 122 |
-
result = @client.pipes.update_organization_connected_account(organization_id: "stub", slug: "stub")
|
| 123 |
refute_nil result
|
| 124 |
end
|
| 125 |
|
|
@@ -188,8 +188,8 @@ class PipesTest < Minitest::Test
|
|
| 188 |
{name: :delete_data_integration_organization, verb: :delete, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/organization(\?|\z)}, args: {slug: "stub"}},
|
| 189 |
{name: :get_access_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {provider: "stub", user_id: "stub"}},
|
| 190 |
{name: :get_organization_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
| 191 |
-
{name: :create_organization_connected_account, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
| 192 |
-
{name: :update_organization_connected_account, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
| 193 |
{name: :delete_organization_connected_account, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
| 194 |
{name: :list_organization_data_providers, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_providers(\?|\z)}, args: {organization_id: "stub"}},
|
| 195 |
{name: :get_user_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}},
|
|
|
|
| 112 |
def test_create_organization_connected_account_returns_expected_result
|
| 113 |
stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)})
|
| 114 |
.to_return(body: "{}", status: 200)
|
| 115 |
+
result = @client.pipes.create_organization_connected_account(organization_id: "stub", slug: "stub", user_id: "stub")
|
| 116 |
refute_nil result
|
| 117 |
end
|
| 118 |
|
| 119 |
def test_update_organization_connected_account_returns_expected_result
|
| 120 |
stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)})
|
| 121 |
.to_return(body: "{}", status: 200)
|
| 122 |
+
result = @client.pipes.update_organization_connected_account(organization_id: "stub", slug: "stub", user_id: "stub")
|
| 123 |
refute_nil result
|
| 124 |
end
|
| 125 |
|
|
|
|
| 188 |
{name: :delete_data_integration_organization, verb: :delete, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/organization(\?|\z)}, args: {slug: "stub"}},
|
| 189 |
{name: :get_access_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {provider: "stub", user_id: "stub"}},
|
| 190 |
{name: :get_organization_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
| 191 |
+
{name: :create_organization_connected_account, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub", user_id: "stub"}},
|
| 192 |
+
{name: :update_organization_connected_account, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub", user_id: "stub"}},
|
| 193 |
{name: :delete_organization_connected_account, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub/connected_accounts/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}},
|
| 194 |
{name: :list_organization_data_providers, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_providers(\?|\z)}, args: {organization_id: "stub"}},
|
| 195 |
{name: :get_user_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}},
|
ruby/test/workos/test_pipes_model_round_trip.rb|
@@ -107,6 +107,22 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
| 107 |
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
| 108 |
end
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
def test_connected_account_input_round_trip
|
| 111 |
fixture = {
|
| 112 |
"access_token" => "stub",
|
|
|
|
| 107 |
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
| 108 |
end
|
| 109 |
|
| 110 |
+
def test_organization_connected_account_round_trip
|
| 111 |
+
fixture = {
|
| 112 |
+
"access_token" => "stub",
|
| 113 |
+
"refresh_token" => "stub",
|
| 114 |
+
"expires_at" => "stub",
|
| 115 |
+
"scopes" => [],
|
| 116 |
+
"state" => "stub",
|
| 117 |
+
"user_id" => "stub"
|
| 118 |
+
}
|
| 119 |
+
model = WorkOS::OrganizationConnectedAccount.new(fixture.to_json)
|
| 120 |
+
json = model.to_h
|
| 121 |
+
assert_kind_of Hash, json
|
| 122 |
+
assert_equal fixture["user_id"], json[:user_id]
|
| 123 |
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
| 124 |
+
end
|
| 125 |
+
|
| 126 |
def test_connected_account_input_round_trip
|
| 127 |
fixture = {
|
| 128 |
"access_token" => "stub",
|
All files in this language are hidden by the current filters.
code: 9 ยท tests: 0 ยท manifest: 1
rust/.oagen-manifest.json|
@@ -97,6 +97,7 @@
|
|
| 97 |
"src/enums/invitation_state.rs",
|
| 98 |
"src/enums/invite_it_contact_intents.rs",
|
| 99 |
"src/enums/mod.rs",
|
|
|
|
| 100 |
"src/enums/organization_created_data_domain_state.rs",
|
| 101 |
"src/enums/organization_created_data_domain_verification_strategy.rs",
|
| 102 |
"src/enums/organization_deleted_data_domain_state.rs",
|
|
@@ -612,6 +613,7 @@
|
|
| 612 |
"src/models/organization_authorized_connect_application_list.rs",
|
| 613 |
"src/models/organization_authorized_connect_application_list_data.rs",
|
| 614 |
"src/models/organization_authorized_connect_application_list_list_metadata.rs",
|
|
|
|
| 615 |
"src/models/organization_created.rs",
|
| 616 |
"src/models/organization_created_data.rs",
|
| 617 |
"src/models/organization_created_data_domain.rs",
|
|
@@ -1303,6 +1305,7 @@
|
|
| 1303 |
"tests/fixtures/organization_authorized_connect_application_list.json",
|
| 1304 |
"tests/fixtures/organization_authorized_connect_application_list_data.json",
|
| 1305 |
"tests/fixtures/organization_authorized_connect_application_list_list_metadata.json",
|
|
|
|
| 1306 |
"tests/fixtures/organization_created.json",
|
| 1307 |
"tests/fixtures/organization_created_data.json",
|
| 1308 |
"tests/fixtures/organization_created_data_domain.json",
|
|
|
|
| 97 |
"src/enums/invitation_state.rs",
|
| 98 |
"src/enums/invite_it_contact_intents.rs",
|
| 99 |
"src/enums/mod.rs",
|
| 100 |
+
"src/enums/organization_connected_account_state.rs",
|
| 101 |
"src/enums/organization_created_data_domain_state.rs",
|
| 102 |
"src/enums/organization_created_data_domain_verification_strategy.rs",
|
| 103 |
"src/enums/organization_deleted_data_domain_state.rs",
|
|
|
|
| 613 |
"src/models/organization_authorized_connect_application_list.rs",
|
| 614 |
"src/models/organization_authorized_connect_application_list_data.rs",
|
| 615 |
"src/models/organization_authorized_connect_application_list_list_metadata.rs",
|
| 616 |
+
"src/models/organization_connected_account.rs",
|
| 617 |
"src/models/organization_created.rs",
|
| 618 |
"src/models/organization_created_data.rs",
|
| 619 |
"src/models/organization_created_data_domain.rs",
|
|
|
|
| 1305 |
"tests/fixtures/organization_authorized_connect_application_list.json",
|
| 1306 |
"tests/fixtures/organization_authorized_connect_application_list_data.json",
|
| 1307 |
"tests/fixtures/organization_authorized_connect_application_list_list_metadata.json",
|
| 1308 |
+
"tests/fixtures/organization_connected_account.json",
|
| 1309 |
"tests/fixtures/organization_created.json",
|
| 1310 |
"tests/fixtures/organization_created_data.json",
|
| 1311 |
"tests/fixtures/organization_created_data_domain.json",
|
rust/src/enums/mod.rs|
@@ -94,6 +94,7 @@ pub mod invitation_resent_data_state;
|
|
| 94 |
pub mod invitation_revoked_data_state;
|
| 95 |
pub mod invitation_state;
|
| 96 |
pub mod invite_it_contact_intents;
|
|
|
|
| 97 |
pub mod organization_created_data_domain_state;
|
| 98 |
pub mod organization_created_data_domain_verification_strategy;
|
| 99 |
pub mod organization_deleted_data_domain_state;
|
|
@@ -275,6 +276,7 @@ pub use invitation_resent_data_state::*;
|
|
| 275 |
pub use invitation_revoked_data_state::*;
|
| 276 |
pub use invitation_state::*;
|
| 277 |
pub use invite_it_contact_intents::*;
|
|
|
|
| 278 |
pub use organization_created_data_domain_state::*;
|
| 279 |
pub use organization_created_data_domain_verification_strategy::*;
|
| 280 |
pub use organization_deleted_data_domain_state::*;
|
|
|
|
| 94 |
pub mod invitation_revoked_data_state;
|
| 95 |
pub mod invitation_state;
|
| 96 |
pub mod invite_it_contact_intents;
|
| 97 |
+
pub mod organization_connected_account_state;
|
| 98 |
pub mod organization_created_data_domain_state;
|
| 99 |
pub mod organization_created_data_domain_verification_strategy;
|
| 100 |
pub mod organization_deleted_data_domain_state;
|
|
|
|
| 276 |
pub use invitation_revoked_data_state::*;
|
| 277 |
pub use invitation_state::*;
|
| 278 |
pub use invite_it_contact_intents::*;
|
| 279 |
+
pub use organization_connected_account_state::*;
|
| 280 |
pub use organization_created_data_domain_state::*;
|
| 281 |
pub use organization_created_data_domain_verification_strategy::*;
|
| 282 |
pub use organization_deleted_data_domain_state::*;
|
rust/src/enums/organization_connected_account_state.rs|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is auto-generated by oagen. Do not edit.
|
| 2 |
+
|
| 3 |
+
use serde::{Deserialize, Serialize};
|
| 4 |
+
use std::fmt;
|
| 5 |
+
use std::str::FromStr;
|
| 6 |
+
|
| 7 |
+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
| 8 |
+
#[non_exhaustive]
|
| 9 |
+
pub enum OrganizationConnectedAccountState {
|
| 10 |
+
Connected,
|
| 11 |
+
NeedsReauthorization,
|
| 12 |
+
/// Wire value not recognized by this SDK version. The original
|
| 13 |
+
/// string is preserved verbatim. WorkOS may add new enum values
|
| 14 |
+
/// server-side; matching on this variant lets callers handle
|
| 15 |
+
/// forward-compatible values without panicking.
|
| 16 |
+
Unknown(String),
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
impl OrganizationConnectedAccountState {
|
| 20 |
+
/// Canonical wire string for this value. For [`Self::Unknown`] returns the
|
| 21 |
+
/// original wire value as received from the API.
|
| 22 |
+
#[allow(deprecated)]
|
| 23 |
+
pub fn as_str(&self) -> &str {
|
| 24 |
+
match self {
|
| 25 |
+
Self::Connected => "connected",
|
| 26 |
+
Self::NeedsReauthorization => "needs_reauthorization",
|
| 27 |
+
Self::Unknown(s) => s.as_str(),
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
impl fmt::Display for OrganizationConnectedAccountState {
|
| 33 |
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
| 34 |
+
f.write_str(self.as_str())
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
impl AsRef<str> for OrganizationConnectedAccountState {
|
| 39 |
+
fn as_ref(&self) -> &str {
|
| 40 |
+
self.as_str()
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
impl FromStr for OrganizationConnectedAccountState {
|
| 45 |
+
type Err = std::convert::Infallible;
|
| 46 |
+
#[allow(deprecated)]
|
| 47 |
+
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
| 48 |
+
Ok(match s {
|
| 49 |
+
"connected" => Self::Connected,
|
| 50 |
+
"needs_reauthorization" => Self::NeedsReauthorization,
|
| 51 |
+
other => Self::Unknown(other.to_string()),
|
| 52 |
+
})
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
impl From<String> for OrganizationConnectedAccountState {
|
| 57 |
+
fn from(s: String) -> Self {
|
| 58 |
+
// Reuse the original `String` allocation in the fallback branch.
|
| 59 |
+
match Self::from_str(&s) {
|
| 60 |
+
Ok(Self::Unknown(_)) => Self::Unknown(s),
|
| 61 |
+
Ok(other) => other,
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
impl From<&str> for OrganizationConnectedAccountState {
|
| 67 |
+
fn from(s: &str) -> Self {
|
| 68 |
+
Self::from_str(s).unwrap_or_else(|_| Self::Unknown(s.to_string()))
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
impl Serialize for OrganizationConnectedAccountState {
|
| 73 |
+
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
| 74 |
+
serializer.serialize_str(self.as_str())
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
impl<'de> Deserialize<'de> for OrganizationConnectedAccountState {
|
| 79 |
+
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
| 80 |
+
let s = String::deserialize(deserializer)?;
|
| 81 |
+
Ok(Self::from(s))
|
| 82 |
+
}
|
| 83 |
+
}
|
rust/src/models/create_user.rs|
@@ -7,7 +7,7 @@ use crate::enums::*;
|
|
| 7 |
use serde::{Deserialize, Serialize};
|
| 8 |
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 9 |
pub struct CreateUser {
|
| 10 |
-
/// The email address of the user.
|
| 11 |
pub email: String,
|
| 12 |
/// The first name of the user.
|
| 13 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
|
|
|
| 7 |
use serde::{Deserialize, Serialize};
|
| 8 |
#[derive(Debug, Clone, Serialize, Deserialize)]
|
| 9 |
pub struct CreateUser {
|
| 10 |
+
/// The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 11 |
pub email: String,
|
| 12 |
/// The first name of the user.
|
| 13 |
#[serde(skip_serializing_if = "Option::is_none", default)]
|
rust/src/models/mod.rs|
@@ -428,6 +428,7 @@ mod organization_api_key_with_value_owner;
|
|
| 428 |
mod organization_authorized_connect_application_list;
|
| 429 |
mod organization_authorized_connect_application_list_data;
|
| 430 |
mod organization_authorized_connect_application_list_list_metadata;
|
|
|
|
| 431 |
mod organization_created;
|
| 432 |
mod organization_created_data;
|
| 433 |
mod organization_created_data_domain;
|
|
@@ -1086,6 +1087,7 @@ pub use organization_api_key_with_value_owner::*;
|
|
| 1086 |
pub use organization_authorized_connect_application_list::*;
|
| 1087 |
pub use organization_authorized_connect_application_list_data::*;
|
| 1088 |
pub use organization_authorized_connect_application_list_list_metadata::*;
|
|
|
|
| 1089 |
pub use organization_created::*;
|
| 1090 |
pub use organization_created_data::*;
|
| 1091 |
pub use organization_created_data_domain::*;
|
|
|
|
| 428 |
mod organization_authorized_connect_application_list;
|
| 429 |
mod organization_authorized_connect_application_list_data;
|
| 430 |
mod organization_authorized_connect_application_list_list_metadata;
|
| 431 |
+
mod organization_connected_account;
|
| 432 |
mod organization_created;
|
| 433 |
mod organization_created_data;
|
| 434 |
mod organization_created_data_domain;
|
|
|
|
| 1087 |
pub use organization_authorized_connect_application_list::*;
|
| 1088 |
pub use organization_authorized_connect_application_list_data::*;
|
| 1089 |
pub use organization_authorized_connect_application_list_list_metadata::*;
|
| 1090 |
+
pub use organization_connected_account::*;
|
| 1091 |
pub use organization_created::*;
|
| 1092 |
pub use organization_created_data::*;
|
| 1093 |
pub use organization_created_data_domain::*;
|
rust/src/models/organization_connected_account.rs|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 OrganizationConnectedAccount {
|
| 10 |
+
/// The OAuth access token for the connected account.
|
| 11 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 12 |
+
pub access_token: Option<crate::SecretString>,
|
| 13 |
+
/// The OAuth refresh token for the connected account.
|
| 14 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 15 |
+
pub refresh_token: Option<crate::SecretString>,
|
| 16 |
+
/// The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
|
| 17 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 18 |
+
pub expires_at: Option<String>,
|
| 19 |
+
/// The OAuth scopes granted for this connection.
|
| 20 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 21 |
+
pub scopes: Option<Vec<String>>,
|
| 22 |
+
/// Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
|
| 23 |
+
#[serde(skip_serializing_if = "Option::is_none", default)]
|
| 24 |
+
pub state: Option<OrganizationConnectedAccountState>,
|
| 25 |
+
/// The [User](https://workos.com/docs/reference/authkit/user) identifier of the organization member on whose behalf the connected account is being imported or updated. The user must be an active member of the organization.
|
| 26 |
+
pub user_id: String,
|
| 27 |
+
}
|
rust/src/resources/pipes.rs|
@@ -200,13 +200,13 @@ pub struct CreateOrganizationConnectedAccountParams {
|
|
| 200 |
///
|
| 201 |
/// Required.
|
| 202 |
#[serde(skip)]
|
| 203 |
-
pub body:
|
| 204 |
}
|
| 205 |
|
| 206 |
impl CreateOrganizationConnectedAccountParams {
|
| 207 |
/// Construct a new `CreateOrganizationConnectedAccountParams` with the required fields set.
|
| 208 |
#[allow(deprecated)]
|
| 209 |
-
pub fn new(body:
|
| 210 |
Self { body }
|
| 211 |
}
|
| 212 |
}
|
|
@@ -223,13 +223,13 @@ pub struct UpdateOrganizationConnectedAccountParams {
|
|
| 223 |
///
|
| 224 |
/// Required.
|
| 225 |
#[serde(skip)]
|
| 226 |
-
pub body:
|
| 227 |
}
|
| 228 |
|
| 229 |
impl UpdateOrganizationConnectedAccountParams {
|
| 230 |
/// Construct a new `UpdateOrganizationConnectedAccountParams` with the required fields set.
|
| 231 |
#[allow(deprecated)]
|
| 232 |
-
pub fn new(body:
|
| 233 |
Self {
|
| 234 |
supports_multiple_connections: Default::default(),
|
| 235 |
connected_account_id: Default::default(),
|
|
|
|
| 200 |
///
|
| 201 |
/// Required.
|
| 202 |
#[serde(skip)]
|
| 203 |
+
pub body: OrganizationConnectedAccount,
|
| 204 |
}
|
| 205 |
|
| 206 |
impl CreateOrganizationConnectedAccountParams {
|
| 207 |
/// Construct a new `CreateOrganizationConnectedAccountParams` with the required fields set.
|
| 208 |
#[allow(deprecated)]
|
| 209 |
+
pub fn new(body: OrganizationConnectedAccount) -> Self {
|
| 210 |
Self { body }
|
| 211 |
}
|
| 212 |
}
|
|
|
|
| 223 |
///
|
| 224 |
/// Required.
|
| 225 |
#[serde(skip)]
|
| 226 |
+
pub body: OrganizationConnectedAccount,
|
| 227 |
}
|
| 228 |
|
| 229 |
impl UpdateOrganizationConnectedAccountParams {
|
| 230 |
/// Construct a new `UpdateOrganizationConnectedAccountParams` with the required fields set.
|
| 231 |
#[allow(deprecated)]
|
| 232 |
+
pub fn new(body: OrganizationConnectedAccount) -> Self {
|
| 233 |
Self {
|
| 234 |
supports_multiple_connections: Default::default(),
|
| 235 |
connected_account_id: Default::default(),
|
rust/src/resources/user_management.rs|
@@ -28,7 +28,7 @@ pub enum Password {
|
|
| 28 |
|
| 29 |
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
| 30 |
pub struct CreateUserParamsBody {
|
| 31 |
-
/// The email address of the user.
|
| 32 |
///
|
| 33 |
/// Required.
|
| 34 |
pub email: String,
|
|
|
|
| 28 |
|
| 29 |
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
| 30 |
pub struct CreateUserParamsBody {
|
| 31 |
+
/// The email address of the user. WorkOS trims whitespace and converts the address to lowercase before storing it.
|
| 32 |
///
|
| 33 |
/// Required.
|
| 34 |
pub email: String,
|
rust/tests/fixtures/organization_connected_account.json|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT"
|
| 3 |
+
}
|
rust/tests/pipes_test.rs|
@@ -2519,7 +2519,8 @@ async fn pipes_create_organization_connected_account_round_trip() {
|
|
| 2519 |
"test_id",
|
| 2520 |
"test_id",
|
| 2521 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2522 |
-
serde_json::from_str("
|
|
|
|
| 2523 |
),
|
| 2524 |
)
|
| 2525 |
.await;
|
|
@@ -2544,7 +2545,8 @@ async fn pipes_create_organization_connected_account_unauthorized() {
|
|
| 2544 |
"test_id",
|
| 2545 |
"test_id",
|
| 2546 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2547 |
-
serde_json::from_str("
|
|
|
|
| 2548 |
),
|
| 2549 |
)
|
| 2550 |
.await
|
|
@@ -2575,7 +2577,8 @@ async fn pipes_create_organization_connected_account_not_found() {
|
|
| 2575 |
"test_id",
|
| 2576 |
"test_id",
|
| 2577 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2578 |
-
serde_json::from_str("
|
|
|
|
| 2579 |
),
|
| 2580 |
)
|
| 2581 |
.await
|
|
@@ -2608,7 +2611,8 @@ async fn pipes_create_organization_connected_account_rate_limited() {
|
|
| 2608 |
"test_id",
|
| 2609 |
"test_id",
|
| 2610 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2611 |
-
serde_json::from_str("
|
|
|
|
| 2612 |
),
|
| 2613 |
)
|
| 2614 |
.await
|
|
@@ -2640,7 +2644,8 @@ async fn pipes_create_organization_connected_account_server_error() {
|
|
| 2640 |
"test_id",
|
| 2641 |
"test_id",
|
| 2642 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2643 |
-
serde_json::from_str("
|
|
|
|
| 2644 |
),
|
| 2645 |
)
|
| 2646 |
.await
|
|
@@ -2672,7 +2677,8 @@ async fn pipes_create_organization_connected_account_bad_request() {
|
|
| 2672 |
"test_id",
|
| 2673 |
"test_id",
|
| 2674 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2675 |
-
serde_json::from_str("
|
|
|
|
| 2676 |
),
|
| 2677 |
)
|
| 2678 |
.await
|
|
@@ -2704,7 +2710,8 @@ async fn pipes_create_organization_connected_account_unprocessable() {
|
|
| 2704 |
"test_id",
|
| 2705 |
"test_id",
|
| 2706 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2707 |
-
serde_json::from_str("
|
|
|
|
| 2708 |
),
|
| 2709 |
)
|
| 2710 |
.await
|
|
@@ -2737,7 +2744,8 @@ async fn pipes_update_organization_connected_account_round_trip() {
|
|
| 2737 |
"test_id",
|
| 2738 |
"test_id",
|
| 2739 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2740 |
-
serde_json::from_str("
|
|
|
|
| 2741 |
),
|
| 2742 |
)
|
| 2743 |
.await;
|
|
@@ -2762,7 +2770,8 @@ async fn pipes_update_organization_connected_account_unauthorized() {
|
|
| 2762 |
"test_id",
|
| 2763 |
"test_id",
|
| 2764 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2765 |
-
serde_json::from_str("
|
|
|
|
| 2766 |
),
|
| 2767 |
)
|
| 2768 |
.await
|
|
@@ -2793,7 +2802,8 @@ async fn pipes_update_organization_connected_account_not_found() {
|
|
| 2793 |
"test_id",
|
| 2794 |
"test_id",
|
| 2795 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2796 |
-
serde_json::from_str("
|
|
|
|
| 2797 |
),
|
| 2798 |
)
|
| 2799 |
.await
|
|
@@ -2826,7 +2836,8 @@ async fn pipes_update_organization_connected_account_rate_limited() {
|
|
| 2826 |
"test_id",
|
| 2827 |
"test_id",
|
| 2828 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2829 |
-
serde_json::from_str("
|
|
|
|
| 2830 |
),
|
| 2831 |
)
|
| 2832 |
.await
|
|
@@ -2858,7 +2869,8 @@ async fn pipes_update_organization_connected_account_server_error() {
|
|
| 2858 |
"test_id",
|
| 2859 |
"test_id",
|
| 2860 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2861 |
-
serde_json::from_str("
|
|
|
|
| 2862 |
),
|
| 2863 |
)
|
| 2864 |
.await
|
|
@@ -2890,7 +2902,8 @@ async fn pipes_update_organization_connected_account_bad_request() {
|
|
| 2890 |
"test_id",
|
| 2891 |
"test_id",
|
| 2892 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2893 |
-
serde_json::from_str("
|
|
|
|
| 2894 |
),
|
| 2895 |
)
|
| 2896 |
.await
|
|
@@ -2922,7 +2935,8 @@ async fn pipes_update_organization_connected_account_unprocessable() {
|
|
| 2922 |
"test_id",
|
| 2923 |
"test_id",
|
| 2924 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2925 |
-
serde_json::from_str("
|
|
|
|
| 2926 |
),
|
| 2927 |
)
|
| 2928 |
.await
|
|
|
|
| 2519 |
"test_id",
|
| 2520 |
"test_id",
|
| 2521 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2522 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2523 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2524 |
),
|
| 2525 |
)
|
| 2526 |
.await;
|
|
|
|
| 2545 |
"test_id",
|
| 2546 |
"test_id",
|
| 2547 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2548 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2549 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2550 |
),
|
| 2551 |
)
|
| 2552 |
.await
|
|
|
|
| 2577 |
"test_id",
|
| 2578 |
"test_id",
|
| 2579 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2580 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2581 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2582 |
),
|
| 2583 |
)
|
| 2584 |
.await
|
|
|
|
| 2611 |
"test_id",
|
| 2612 |
"test_id",
|
| 2613 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2614 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2615 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2616 |
),
|
| 2617 |
)
|
| 2618 |
.await
|
|
|
|
| 2644 |
"test_id",
|
| 2645 |
"test_id",
|
| 2646 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2647 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2648 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2649 |
),
|
| 2650 |
)
|
| 2651 |
.await
|
|
|
|
| 2677 |
"test_id",
|
| 2678 |
"test_id",
|
| 2679 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2680 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2681 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2682 |
),
|
| 2683 |
)
|
| 2684 |
.await
|
|
|
|
| 2710 |
"test_id",
|
| 2711 |
"test_id",
|
| 2712 |
workos::pipes::CreateOrganizationConnectedAccountParams::new(
|
| 2713 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2714 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2715 |
),
|
| 2716 |
)
|
| 2717 |
.await
|
|
|
|
| 2744 |
"test_id",
|
| 2745 |
"test_id",
|
| 2746 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2747 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2748 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2749 |
),
|
| 2750 |
)
|
| 2751 |
.await;
|
|
|
|
| 2770 |
"test_id",
|
| 2771 |
"test_id",
|
| 2772 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2773 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2774 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2775 |
),
|
| 2776 |
)
|
| 2777 |
.await
|
|
|
|
| 2802 |
"test_id",
|
| 2803 |
"test_id",
|
| 2804 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2805 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2806 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2807 |
),
|
| 2808 |
)
|
| 2809 |
.await
|
|
|
|
| 2836 |
"test_id",
|
| 2837 |
"test_id",
|
| 2838 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2839 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2840 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2841 |
),
|
| 2842 |
)
|
| 2843 |
.await
|
|
|
|
| 2869 |
"test_id",
|
| 2870 |
"test_id",
|
| 2871 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2872 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2873 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2874 |
),
|
| 2875 |
)
|
| 2876 |
.await
|
|
|
|
| 2902 |
"test_id",
|
| 2903 |
"test_id",
|
| 2904 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2905 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2906 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2907 |
),
|
| 2908 |
)
|
| 2909 |
.await
|
|
|
|
| 2935 |
"test_id",
|
| 2936 |
"test_id",
|
| 2937 |
workos::pipes::UpdateOrganizationConnectedAccountParams::new(
|
| 2938 |
+
serde_json::from_str(include_str!("fixtures/organization_connected_account.json"))
|
| 2939 |
+
.expect("parse fixture for OrganizationConnectedAccount"),
|
| 2940 |
),
|
| 2941 |
)
|
| 2942 |
.await
|
All files in this language are hidden by the current filters.