Skip to content

Commit acf83ea

Browse files
feat(generated): Changes to events and pipes (#533)
Co-authored-by: workos-sdk-automation[bot] <255426317+workos-sdk-automation[bot]@users.noreply.github.com>
1 parent d05559a commit acf83ea

46 files changed

Lines changed: 621 additions & 61 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
* [#533](https://github.com/workos/workos-ruby/pull/533) feat(generated)!: regenerate from spec (2 changes)
2+
3+
**⚠️ Breaking**
4+
* **[events](https://workos.com/docs/reference/events)**:
5+
* Changed required status for parameter `Events.list.events`
6+
7+
**Features**
8+
* **[groups](https://workos.com/docs/reference/groups)**:
9+
* Added parameter `Groups.list.search`
10+
* **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
11+
* Added `client_id` to `ConnectedAccount`
12+
* Added `client_secret_last_4` to `ConnectedAccount`
13+
* Added `config` to `ConnectedAccount`
14+
* **[pipes](https://workos.com/docs/reference/pipes)**:
15+
* Added `client_id` to `DataIntegrationsListResponseDataConnectedAccount`
16+
* Added `client_secret_last_4` to `DataIntegrationsListResponseDataConnectedAccount`
17+
* Added `config` to `DataIntegrationsListResponseDataConnectedAccount`
18+
* Changed errors for endpoint `POST /data-integrations/{slug}/credentials`
19+
* Made `CustomProviderDefinition.authorization_url` optional
20+
* Made `CustomProviderDefinition.token_url` optional
21+
* Added model `DataIntegrationsUpsertClientCredentialsRequest`
22+
* Added `client_credentials` to `CreateDataIntegrationAuthMethods`
23+
* Added endpoint `PUT /data-integrations/{slug}/client-credentials`
24+
* **[sso](https://workos.com/docs/reference/sso)**:
25+
* Added `XOAuth` to `ConnectionType`
26+
* Added `XOAuth` to `ProfileConnectionType`
27+
* Added `XOAuth` to `ConnectionsConnectionType`
28+
* Added `GrokOAuth` to `ConnectionType`
29+
* Added `GrokOAuth` to `ProfileConnectionType`
30+
* Added `GrokOAuth` to `ConnectionsConnectionType`
31+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
32+
* Changed errors for endpoint `DELETE /user_management/users/{id}`
33+
* Added `password_salt_position` to `CreateUser`
34+
* Added `password_salt_position` to `UpdateUser`
35+
* Made `RadarSmsChallengeCodeSessionAuthenticateRequest.verification_id` optional
36+
* Made `RadarSmsChallengeCodeSessionAuthenticateRequest.phone_number` optional
37+
* Added enum `CreateUserPasswordSaltPosition`
38+
* Added enum `UpdateUserPasswordSaltPosition`
39+
* Added `XOAuth` to `AuthenticateResponseAuthenticationMethod`
40+
* Added `XOAuth` to `UserIdentitiesGetItemProvider`
41+
* Added `GrokOAuth` to `AuthenticateResponseAuthenticationMethod`
42+
* Added `GrokOAuth` to `UserIdentitiesGetItemProvider`
43+
* **[webhooks](https://workos.com/docs/reference/webhooks)**:
44+
* Added `agent.registration.refreshed` to `CreateWebhookEndpointEvents`
45+
* Added `agent.registration.refreshed` to `UpdateWebhookEndpointEvents`
46+
47+
**Fixes**
48+
* **[pipes](https://workos.com/docs/reference/pipes)**:
49+
* Changed the type of `DataIntegration.credentials`
50+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
51+
* Changed errors for endpoint `POST /user_management/authenticate`
52+
* Changed errors for endpoint `POST /user_management/users`
53+
* Changed errors for endpoint `PUT /user_management/users/{id}`

.last-synced-sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ae3ebbb08d9b4bf9b2391558e820b7eb6f511fb9
1+
a07d8e7988d035c2d727787f18f64d71b4b89a84

.oagen-manifest.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@
279279
"lib/workos/pipes/data_integrations_list_response_data.rb",
280280
"lib/workos/pipes/data_integrations_list_response_data_connected_account.rb",
281281
"lib/workos/pipes/data_integrations_upsert_api_key_request.rb",
282+
"lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb",
282283
"lib/workos/pipes/data_integrations_vend_credentials_request.rb",
283284
"lib/workos/pipes/update_custom_provider_definition.rb",
284285
"lib/workos/pipes/update_data_integration.rb",
@@ -312,6 +313,8 @@
312313
"lib/workos/shared/agent_registration_expired_data.rb",
313314
"lib/workos/shared/agent_registration_organization_switched.rb",
314315
"lib/workos/shared/agent_registration_organization_switched_data.rb",
316+
"lib/workos/shared/agent_registration_refreshed.rb",
317+
"lib/workos/shared/agent_registration_refreshed_data.rb",
315318
"lib/workos/shared/agent_registration_revoked.rb",
316319
"lib/workos/shared/agent_registration_revoked_data.rb",
317320
"lib/workos/shared/auth_method_mismatch_error.rb",
@@ -405,6 +408,7 @@
405408
"lib/workos/types/create_data_integration_auth_methods.rb",
406409
"lib/workos/types/create_user_invite_options_locale.rb",
407410
"lib/workos/types/create_user_password_hash_type.rb",
411+
"lib/workos/types/create_user_password_salt_position.rb",
408412
"lib/workos/types/create_webhook_endpoint_events.rb",
409413
"lib/workos/types/custom_provider_definition_authenticate_via.rb",
410414
"lib/workos/types/data_integration_access_token_response_error.rb",
@@ -484,6 +488,7 @@
484488
"lib/workos/types/sso_provider.rb",
485489
"lib/workos/types/update_custom_provider_definition_authenticate_via.rb",
486490
"lib/workos/types/update_user_password_hash_type.rb",
491+
"lib/workos/types/update_user_password_salt_position.rb",
487492
"lib/workos/types/update_webhook_endpoint_events.rb",
488493
"lib/workos/types/update_webhook_endpoint_status.rb",
489494
"lib/workos/types/user_identities_get_item_provider.rb",
@@ -732,6 +737,8 @@
732737
"rbi/workos/agent_registration_expired_data.rbi",
733738
"rbi/workos/agent_registration_organization_switched.rbi",
734739
"rbi/workos/agent_registration_organization_switched_data.rbi",
740+
"rbi/workos/agent_registration_refreshed.rbi",
741+
"rbi/workos/agent_registration_refreshed_data.rbi",
735742
"rbi/workos/agent_registration_revoked.rbi",
736743
"rbi/workos/agent_registration_revoked_data.rbi",
737744
"rbi/workos/agents.rbi",
@@ -921,6 +928,7 @@
921928
"rbi/workos/data_integrations_list_response_data.rbi",
922929
"rbi/workos/data_integrations_list_response_data_connected_account.rbi",
923930
"rbi/workos/data_integrations_upsert_api_key_request.rbi",
931+
"rbi/workos/data_integrations_upsert_client_credentials_request.rbi",
924932
"rbi/workos/data_integrations_vend_credentials_request.rbi",
925933
"rbi/workos/decrypt_request.rbi",
926934
"rbi/workos/decrypt_response.rbi",
@@ -2186,6 +2194,10 @@
21862194
"GET /audit_logs/exports/{auditLogExportId}": {
21872195
"sdkMethod": "get_export",
21882196
"service": "audit_logs"
2197+
},
2198+
"PUT /data-integrations/{slug}/client-credentials": {
2199+
"sdkMethod": "update_data_integration_client_credentials",
2200+
"service": "pipes"
21892201
}
21902202
}
21912203
}

lib/workos/connect.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def create_application(
135135
result
136136
end
137137

138-
# Create oauth application.
138+
# Create OAuth application.
139139
# @param name [String]
140140
# @param is_first_party [Boolean]
141141
# @param description [String, nil]
@@ -175,7 +175,7 @@ def create_oauth_application(
175175
WorkOS::ConnectApplication.new(response.body)
176176
end
177177

178-
# Create m2m application.
178+
# Create M2M application.
179179
# @param name [String]
180180
# @param organization_id [String]
181181
# @param description [String, nil]

lib/workos/events.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ def initialize(client)
1515
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
1616
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
1717
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
18-
# @param events [Array<String>, nil] Filter events by one or more event types (e.g. `dsync.user.created`).
18+
# @param events [Array<String>] Filter events by one or more event types (e.g. `dsync.user.created`).
1919
# @param range_start [String, nil] ISO-8601 date string to filter events created after this date.
2020
# @param range_end [String, nil] ISO-8601 date string to filter events created before this date.
2121
# @param organization_id [String, nil] Filter events by the [Organization](https://workos.com/docs/reference/organization) that the event is associated with.
2222
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
2323
# @return [WorkOS::Types::ListStruct<WorkOS::EventSchema>]
2424
def list_events(
25+
events:,
2526
before: nil,
2627
after: nil,
2728
limit: 10,
2829
order: "desc",
29-
events: nil,
3030
range_start: nil,
3131
range_end: nil,
3232
organization_id: nil,

lib/workos/groups.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def initialize(client)
1616
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
1717
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
1818
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
19+
# @param search [String, nil] Search groups by name or by group ID.
1920
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
2021
# @return [WorkOS::Types::ListStruct<WorkOS::Group>]
2122
def list_organization_groups(
@@ -24,13 +25,15 @@ def list_organization_groups(
2425
after: nil,
2526
limit: 10,
2627
order: "desc",
28+
search: nil,
2729
request_options: {}
2830
)
2931
params = {
3032
"before" => before,
3133
"after" => after,
3234
"limit" => limit,
33-
"order" => order
35+
"order" => order,
36+
"search" => search
3437
}.compact
3538
response = @client.request(
3639
method: :get,
@@ -46,13 +49,14 @@ def list_organization_groups(
4649
after: cursor,
4750
limit: limit,
4851
order: order,
52+
search: search,
4953
request_options: request_options
5054
)
5155
}
5256
WorkOS::Types::ListStruct.from_response(
5357
response,
5458
model: WorkOS::Group,
55-
filters: {organization_id: organization_id, before: before, limit: limit, order: order},
59+
filters: {organization_id: organization_id, before: before, limit: limit, order: order, search: search},
5660
fetch_next: fetch_next
5761
)
5862
end

lib/workos/pipes.rb

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def list_data_integrations(
5959
# @param description [String, nil] An optional description of the Data Integration.
6060
# @param enabled [Boolean, nil] Whether the Data Integration is enabled. Defaults to `false`.
6161
# @param scopes [Array<String>, nil] The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted.
62-
# @param auth_methods [Array<WorkOS::Types::CreateDataIntegrationAuthMethods>, nil] How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request).
63-
# @param config [Hash{String => String}, nil] Provider-specific config values (e.g. a Snowflake `account_identifier`), keyed by the config field. Only fields the built-in provider declares are accepted.
62+
# @param auth_methods [Array<WorkOS::Types::CreateDataIntegrationAuthMethods>, nil] How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request). Use `["client_credentials"]` to declare a client-credentials integration; `credentials` is likewise not required and client credentials are supplied per-tenant.
63+
# @param config [Hash{String => String}, nil] Provider-specific config values (e.g. a Snowflake `account`), keyed by the config field. Only fields the built-in provider declares are accepted.
6464
# @param credentials [WorkOS::DataIntegrationCredentialsInput, nil] The OAuth credentials to configure for the Data Integration. Required for OAuth integrations; omit when `auth_methods` is `["api_key"]`.
6565
# @param api_key [WorkOS::ApiKeyInstallation, nil] An optional API key to install for the first tenant on an `api_key` integration. Omit to declare a keyless integration; tenants can be added later via the per-installation API key path.
6666
# @param custom_provider [WorkOS::CustomProviderDefinition, nil] The OAuth definition for a custom provider. Supply this to define a custom provider; omit it to create an integration for a built-in provider.
@@ -242,6 +242,43 @@ def authorize_data_integration(
242242
result
243243
end
244244

245+
# Upsert client credentials for a connected account
246+
# @param slug [String] The identifier of the integration.
247+
# @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.
248+
# @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization.
249+
# @param client_id [String] The OAuth client ID to store for this integration.
250+
# @param client_secret [String] The OAuth client secret to store for this integration.
251+
# @param config [Hash{String => String}, nil] Provider-specific configuration values collected for this installation, keyed by the provider's config field descriptors.
252+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
253+
# @return [WorkOS::ConnectedAccount]
254+
def update_data_integration_client_credentials(
255+
slug:,
256+
user_id:,
257+
client_id:,
258+
client_secret:,
259+
organization_id: nil,
260+
config: nil,
261+
request_options: {}
262+
)
263+
body = {
264+
"user_id" => user_id,
265+
"organization_id" => organization_id,
266+
"client_id" => client_id,
267+
"client_secret" => client_secret,
268+
"config" => config
269+
}.compact
270+
response = @client.request(
271+
method: :put,
272+
path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/client-credentials",
273+
auth: true,
274+
body: body,
275+
request_options: request_options
276+
)
277+
result = WorkOS::ConnectedAccount.new(response.body)
278+
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
279+
result
280+
end
281+
245282
# Vend credentials for a connected account
246283
# @param slug [String] The identifier of the integration.
247284
# @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier.

lib/workos/pipes/connected_account.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class ConnectedAccount < WorkOS::Types::BaseModel
1212
scopes: :scopes,
1313
auth_method: :auth_method,
1414
api_key_last_4: :api_key_last_4,
15+
client_id: :client_id,
16+
client_secret_last_4: :client_secret_last_4,
17+
config: :config,
1518
state: :state,
1619
created_at: :created_at,
1720
updated_at: :updated_at
@@ -25,6 +28,9 @@ class ConnectedAccount < WorkOS::Types::BaseModel
2528
:scopes,
2629
:auth_method,
2730
:api_key_last_4,
31+
:client_id,
32+
:client_secret_last_4,
33+
:config,
2834
:state,
2935
:created_at,
3036
:updated_at
@@ -38,6 +44,9 @@ def initialize(json)
3844
@scopes = hash[:scopes] || []
3945
@auth_method = hash[:auth_method]
4046
@api_key_last_4 = hash[:api_key_last_4]
47+
@client_id = hash[:client_id]
48+
@client_secret_last_4 = hash[:client_secret_last_4]
49+
@config = hash[:config] || {}
4150
@state = hash[:state]
4251
@created_at = hash[:created_at]
4352
@updated_at = hash[:updated_at]

lib/workos/pipes/data_integrations_list_response_data_connected_account.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class DataIntegrationsListResponseDataConnectedAccount < WorkOS::Types::BaseMode
1212
scopes: :scopes,
1313
auth_method: :auth_method,
1414
api_key_last_4: :api_key_last_4,
15+
client_id: :client_id,
16+
client_secret_last_4: :client_secret_last_4,
17+
config: :config,
1518
state: :state,
1619
created_at: :created_at,
1720
updated_at: :updated_at,
@@ -29,6 +32,9 @@ class DataIntegrationsListResponseDataConnectedAccount < WorkOS::Types::BaseMode
2932
:scopes,
3033
:auth_method,
3134
:api_key_last_4,
35+
:client_id,
36+
:client_secret_last_4,
37+
:config,
3238
:state,
3339
:created_at,
3440
:updated_at
@@ -49,6 +55,9 @@ def initialize(json)
4955
@scopes = hash[:scopes] || []
5056
@auth_method = hash[:auth_method]
5157
@api_key_last_4 = hash[:api_key_last_4]
58+
@client_id = hash[:client_id]
59+
@client_secret_last_4 = hash[:client_secret_last_4]
60+
@config = hash[:config] || {}
5261
@state = hash[:state]
5362
@created_at = hash[:created_at]
5463
@updated_at = hash[:updated_at]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# frozen_string_literal: true
2+
3+
# This file is auto-generated by oagen. Do not edit.
4+
5+
module WorkOS
6+
class DataIntegrationsUpsertClientCredentialsRequest < WorkOS::Types::BaseModel
7+
HASH_ATTRS = {
8+
user_id: :user_id,
9+
organization_id: :organization_id,
10+
client_id: :client_id,
11+
client_secret: :client_secret,
12+
config: :config
13+
}.freeze
14+
15+
attr_accessor \
16+
:user_id,
17+
:organization_id,
18+
:client_id,
19+
:client_secret,
20+
:config
21+
22+
def initialize(json)
23+
hash = self.class.normalize(json)
24+
@user_id = hash[:user_id]
25+
@organization_id = hash[:organization_id]
26+
@client_id = hash[:client_id]
27+
@client_secret = hash[:client_secret]
28+
@config = hash[:config] || {}
29+
end
30+
end
31+
end

0 commit comments

Comments
 (0)