clerk-sdk-ruby 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/clerk/models/operations/replaceorganizationmetadata_request.rb +36 -0
- data/lib/clerk/models/operations/replaceorganizationmetadata_request.rbi +15 -0
- data/lib/clerk/models/operations/replaceorganizationmetadata_requestbody.rb +38 -0
- data/lib/clerk/models/operations/replaceorganizationmetadata_requestbody.rbi +15 -0
- data/lib/clerk/models/operations/replaceorganizationmetadata_response.rb +44 -0
- data/lib/clerk/models/operations/replaceorganizationmetadata_response.rbi +19 -0
- data/lib/clerk/models/operations/updateorganization_requestbody.rb +1 -9
- data/lib/clerk/models/operations/updateorganization_requestbody.rbi +0 -4
- data/lib/clerk/models/operations/updateuser_requestbody.rb +3 -22
- data/lib/clerk/models/operations/updateuser_requestbody.rbi +0 -6
- data/lib/clerk/models/operations.rb +3 -0
- data/lib/clerk/organizations.rb +166 -1
- data/lib/clerk/sdkconfiguration.rb +4 -4
- data/lib/clerk/users.rb +5 -8
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1cb206c0b36bb99754e05283da6b0b64e592384617d463519736f37c53f02dbc
|
|
4
|
+
data.tar.gz: 399156622260d6f1cd42ba74faa7d5733320670fe8c5605eae2528198675a2b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 00e453889b77cc1026d00adb46c69c48cf60b83b9d27674477dc1c0cac8b644cb4ab9e0f24d76460a55e2506aa2dbacac1ed7fcdec89008f92ab6085152d946b
|
|
7
|
+
data.tar.gz: 8f6bb3a5b265ec8d80915b7e4f7c2400c90f0ca46c43008035191834405ca84c914aa5942f4325f7bb7a2297c9c6a1deeb877b1ba1dfa6e07a685106381f856e
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: false
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Clerk
|
|
8
|
+
module Models
|
|
9
|
+
module Operations
|
|
10
|
+
|
|
11
|
+
class ReplaceOrganizationMetadataRequest
|
|
12
|
+
|
|
13
|
+
include Crystalline::MetadataFields
|
|
14
|
+
|
|
15
|
+
# The ID of the organization whose metadata will be replaced
|
|
16
|
+
field :organization_id, ::String, { 'path_param': { 'field_name': 'organization_id', 'style': 'simple', 'explode': false } }
|
|
17
|
+
|
|
18
|
+
field :body, Models::Operations::ReplaceOrganizationMetadataRequestBody, { 'request': { 'media_type': 'application/json' } }
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def initialize(organization_id:, body:)
|
|
22
|
+
@organization_id = organization_id
|
|
23
|
+
@body = body
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def ==(other)
|
|
28
|
+
return false unless other.is_a? self.class
|
|
29
|
+
return false unless @organization_id == other.organization_id
|
|
30
|
+
return false unless @body == other.body
|
|
31
|
+
true
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# typed: false
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Clerk::Models::Operations::ReplaceOrganizationMetadataRequest
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Clerk::Models::Operations::ReplaceOrganizationMetadataRequest
|
|
11
|
+
def organization_id(); end
|
|
12
|
+
def organization_id=(str_); end
|
|
13
|
+
def body(); end
|
|
14
|
+
def body=(str_); end
|
|
15
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: false
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Clerk
|
|
8
|
+
module Models
|
|
9
|
+
module Operations
|
|
10
|
+
|
|
11
|
+
class ReplaceOrganizationMetadataRequestBody
|
|
12
|
+
|
|
13
|
+
include Crystalline::MetadataFields
|
|
14
|
+
|
|
15
|
+
# Metadata saved on the organization, that is visible to both your frontend and backend.
|
|
16
|
+
# The existing value will be replaced entirely with the new object.
|
|
17
|
+
field :public_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('public_metadata') } }
|
|
18
|
+
# Metadata saved on the organization that is only visible to your backend.
|
|
19
|
+
# The existing value will be replaced entirely with the new object.
|
|
20
|
+
field :private_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('private_metadata') } }
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def initialize(public_metadata: nil, private_metadata: nil)
|
|
24
|
+
@public_metadata = public_metadata
|
|
25
|
+
@private_metadata = private_metadata
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def ==(other)
|
|
30
|
+
return false unless other.is_a? self.class
|
|
31
|
+
return false unless @public_metadata == other.public_metadata
|
|
32
|
+
return false unless @private_metadata == other.private_metadata
|
|
33
|
+
true
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# typed: false
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Clerk::Models::Operations::ReplaceOrganizationMetadataRequestBody
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Clerk::Models::Operations::ReplaceOrganizationMetadataRequestBody
|
|
11
|
+
def public_metadata(); end
|
|
12
|
+
def public_metadata=(str_); end
|
|
13
|
+
def private_metadata(); end
|
|
14
|
+
def private_metadata=(str_); end
|
|
15
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: false
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Clerk
|
|
8
|
+
module Models
|
|
9
|
+
module Operations
|
|
10
|
+
|
|
11
|
+
class ReplaceOrganizationMetadataResponse
|
|
12
|
+
|
|
13
|
+
include Crystalline::MetadataFields
|
|
14
|
+
|
|
15
|
+
# HTTP response content type for this operation
|
|
16
|
+
field :content_type, ::String
|
|
17
|
+
# HTTP response status code for this operation
|
|
18
|
+
field :status_code, ::Integer
|
|
19
|
+
# Raw HTTP response; suitable for custom response parsing
|
|
20
|
+
field :raw_response, ::Faraday::Response
|
|
21
|
+
# An organization
|
|
22
|
+
field :organization, Crystalline::Nilable.new(Models::Components::Organization)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def initialize(content_type:, status_code:, raw_response:, organization: nil)
|
|
26
|
+
@content_type = content_type
|
|
27
|
+
@status_code = status_code
|
|
28
|
+
@raw_response = raw_response
|
|
29
|
+
@organization = organization
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def ==(other)
|
|
34
|
+
return false unless other.is_a? self.class
|
|
35
|
+
return false unless @content_type == other.content_type
|
|
36
|
+
return false unless @status_code == other.status_code
|
|
37
|
+
return false unless @raw_response == other.raw_response
|
|
38
|
+
return false unless @organization == other.organization
|
|
39
|
+
true
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typed: false
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Clerk::Models::Operations::ReplaceOrganizationMetadataResponse
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Clerk::Models::Operations::ReplaceOrganizationMetadataResponse
|
|
11
|
+
def content_type(); end
|
|
12
|
+
def content_type=(str_); end
|
|
13
|
+
def status_code(); end
|
|
14
|
+
def status_code=(str_); end
|
|
15
|
+
def raw_response(); end
|
|
16
|
+
def raw_response=(str_); end
|
|
17
|
+
def organization(); end
|
|
18
|
+
def organization=(str_); end
|
|
19
|
+
end
|
|
@@ -12,10 +12,6 @@ module Clerk
|
|
|
12
12
|
|
|
13
13
|
include Crystalline::MetadataFields
|
|
14
14
|
|
|
15
|
-
# Metadata saved on the organization, that is visible to both your frontend and backend.
|
|
16
|
-
field :public_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('public_metadata') } }
|
|
17
|
-
# Metadata saved on the organization that is only visible to your backend.
|
|
18
|
-
field :private_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('private_metadata') } }
|
|
19
15
|
# The new name of the organization.
|
|
20
16
|
# May not contain URLs or HTML.
|
|
21
17
|
# Max length: 256
|
|
@@ -32,9 +28,7 @@ module Clerk
|
|
|
32
28
|
field :role_set_key, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('role_set_key') } }
|
|
33
29
|
|
|
34
30
|
|
|
35
|
-
def initialize(
|
|
36
|
-
@public_metadata = public_metadata
|
|
37
|
-
@private_metadata = private_metadata
|
|
31
|
+
def initialize(name: nil, slug: nil, max_allowed_memberships: nil, admin_delete_enabled: nil, created_at: nil, role_set_key: nil)
|
|
38
32
|
@name = name
|
|
39
33
|
@slug = slug
|
|
40
34
|
@max_allowed_memberships = max_allowed_memberships
|
|
@@ -46,8 +40,6 @@ module Clerk
|
|
|
46
40
|
|
|
47
41
|
def ==(other)
|
|
48
42
|
return false unless other.is_a? self.class
|
|
49
|
-
return false unless @public_metadata == other.public_metadata
|
|
50
|
-
return false unless @private_metadata == other.private_metadata
|
|
51
43
|
return false unless @name == other.name
|
|
52
44
|
return false unless @slug == other.slug
|
|
53
45
|
return false unless @max_allowed_memberships == other.max_allowed_memberships
|
|
@@ -8,10 +8,6 @@ end
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class Clerk::Models::Operations::UpdateOrganizationRequestBody
|
|
11
|
-
def public_metadata(); end
|
|
12
|
-
def public_metadata=(str_); end
|
|
13
|
-
def private_metadata(); end
|
|
14
|
-
def private_metadata=(str_); end
|
|
15
11
|
def name(); end
|
|
16
12
|
def name=(str_); end
|
|
17
13
|
def slug(); end
|
|
@@ -27,7 +27,6 @@ module Clerk
|
|
|
27
27
|
# Each of the supported hashers expects the incoming digest to be in a particular format. See the [Clerk docs](https://clerk.com/docs/references/backend/user/create-user) for more information.
|
|
28
28
|
field :password_hasher, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('password_hasher') } }
|
|
29
29
|
# If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them.
|
|
30
|
-
# You must provide the backup codes in plain format or the corresponding bcrypt digest.
|
|
31
30
|
field :backup_codes, Crystalline::Nilable.new(Crystalline::Array.new(::String)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('backup_codes') } }
|
|
32
31
|
# The ID of the user as used in your external systems or your previous authentication solution.
|
|
33
32
|
# Must be unique across your instance.
|
|
@@ -60,30 +59,18 @@ module Clerk
|
|
|
60
59
|
# Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`.
|
|
61
60
|
field :sign_out_of_other_sessions, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('sign_out_of_other_sessions') } }
|
|
62
61
|
# In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it.
|
|
63
|
-
# Please note that currently the supported options are:
|
|
64
|
-
# * Period: 30 seconds
|
|
65
|
-
# * Code length: 6 digits
|
|
66
|
-
# * Algorithm: SHA1
|
|
67
62
|
field :totp_secret, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('totp_secret') } }
|
|
68
|
-
# Metadata saved on the user, that is visible to both your Frontend and Backend APIs
|
|
69
|
-
field :public_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('public_metadata') } }
|
|
70
|
-
# Metadata saved on the user, that is only visible to your Backend API
|
|
71
|
-
field :private_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('private_metadata') } }
|
|
72
|
-
# Metadata saved on the user, that can be updated from both the Frontend and Backend APIs.
|
|
73
|
-
# Note: Since this data can be modified from the frontend, it is not guaranteed to be safe.
|
|
74
|
-
field :unsafe_metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('unsafe_metadata') } }
|
|
75
63
|
# If true, the user can delete themselves with the Frontend API.
|
|
76
64
|
field :delete_self_enabled, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('delete_self_enabled') } }
|
|
77
65
|
# If true, the user can create organizations with the Frontend API.
|
|
78
66
|
field :create_organization_enabled, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('create_organization_enabled') } }
|
|
79
|
-
# A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format
|
|
67
|
+
# A custom timestamp denoting _when_ the user accepted legal requirements, specified in RFC3339 format.
|
|
80
68
|
field :legal_accepted_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('legal_accepted_at') } }
|
|
81
69
|
# When set to `true` all legal checks are skipped.
|
|
82
|
-
# It is not recommended to skip legal checks unless you are migrating a user to Clerk.
|
|
83
70
|
field :skip_legal_checks, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('skip_legal_checks') } }
|
|
84
71
|
# The maximum number of organizations the user can create. 0 means unlimited.
|
|
85
72
|
field :create_organizations_limit, Crystalline::Nilable.new(::Integer), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('create_organizations_limit') } }
|
|
86
|
-
# A custom date/time denoting _when_ the user signed up to the application
|
|
73
|
+
# A custom date/time denoting _when_ the user signed up to the application.
|
|
87
74
|
field :created_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('created_at') } }
|
|
88
75
|
# When set to `true`, the user will bypass client trust checks during sign-in.
|
|
89
76
|
field :bypass_client_trust, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('bypass_client_trust') } }
|
|
@@ -92,7 +79,7 @@ module Clerk
|
|
|
92
79
|
field :notify_primary_email_address_changed, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::Clerk::Utils.field_name('notify_primary_email_address_changed') } }
|
|
93
80
|
|
|
94
81
|
|
|
95
|
-
def initialize(password_digest: nil, password_hasher: nil, backup_codes: nil, external_id: nil, first_name: nil, last_name: nil, locale: nil, primary_email_address_id: nil, primary_phone_number_id: nil, primary_web3_wallet_id: nil, username: nil, profile_image_id: nil, password: nil, skip_password_checks: nil, sign_out_of_other_sessions: nil, totp_secret: nil,
|
|
82
|
+
def initialize(password_digest: nil, password_hasher: nil, backup_codes: nil, external_id: nil, first_name: nil, last_name: nil, locale: nil, primary_email_address_id: nil, primary_phone_number_id: nil, primary_web3_wallet_id: nil, username: nil, profile_image_id: nil, password: nil, skip_password_checks: nil, sign_out_of_other_sessions: nil, totp_secret: nil, delete_self_enabled: nil, create_organization_enabled: nil, legal_accepted_at: nil, skip_legal_checks: nil, create_organizations_limit: nil, created_at: nil, bypass_client_trust: nil, notify_primary_email_address_changed: false)
|
|
96
83
|
@password_digest = password_digest
|
|
97
84
|
@password_hasher = password_hasher
|
|
98
85
|
@backup_codes = backup_codes
|
|
@@ -109,9 +96,6 @@ module Clerk
|
|
|
109
96
|
@skip_password_checks = skip_password_checks
|
|
110
97
|
@sign_out_of_other_sessions = sign_out_of_other_sessions
|
|
111
98
|
@totp_secret = totp_secret
|
|
112
|
-
@public_metadata = public_metadata
|
|
113
|
-
@private_metadata = private_metadata
|
|
114
|
-
@unsafe_metadata = unsafe_metadata
|
|
115
99
|
@delete_self_enabled = delete_self_enabled
|
|
116
100
|
@create_organization_enabled = create_organization_enabled
|
|
117
101
|
@legal_accepted_at = legal_accepted_at
|
|
@@ -141,9 +125,6 @@ module Clerk
|
|
|
141
125
|
return false unless @skip_password_checks == other.skip_password_checks
|
|
142
126
|
return false unless @sign_out_of_other_sessions == other.sign_out_of_other_sessions
|
|
143
127
|
return false unless @totp_secret == other.totp_secret
|
|
144
|
-
return false unless @public_metadata == other.public_metadata
|
|
145
|
-
return false unless @private_metadata == other.private_metadata
|
|
146
|
-
return false unless @unsafe_metadata == other.unsafe_metadata
|
|
147
128
|
return false unless @delete_self_enabled == other.delete_self_enabled
|
|
148
129
|
return false unless @create_organization_enabled == other.create_organization_enabled
|
|
149
130
|
return false unless @legal_accepted_at == other.legal_accepted_at
|
|
@@ -40,12 +40,6 @@ class Clerk::Models::Operations::UpdateUserRequestBody
|
|
|
40
40
|
def sign_out_of_other_sessions=(str_); end
|
|
41
41
|
def totp_secret(); end
|
|
42
42
|
def totp_secret=(str_); end
|
|
43
|
-
def public_metadata(); end
|
|
44
|
-
def public_metadata=(str_); end
|
|
45
|
-
def private_metadata(); end
|
|
46
|
-
def private_metadata=(str_); end
|
|
47
|
-
def unsafe_metadata(); end
|
|
48
|
-
def unsafe_metadata=(str_); end
|
|
49
43
|
def delete_self_enabled(); end
|
|
50
44
|
def delete_self_enabled=(str_); end
|
|
51
45
|
def create_organization_enabled(); end
|
|
@@ -334,6 +334,9 @@ module Clerk
|
|
|
334
334
|
autoload :RejectWaitlistEntryResponse, 'clerk/models/operations/rejectwaitlistentry_response.rb'
|
|
335
335
|
autoload :RemovePermissionFromOrganizationRoleRequest, 'clerk/models/operations/removepermissionfromorganizationrole_request.rb'
|
|
336
336
|
autoload :RemovePermissionFromOrganizationRoleResponse, 'clerk/models/operations/removepermissionfromorganizationrole_response.rb'
|
|
337
|
+
autoload :ReplaceOrganizationMetadataRequestBody, 'clerk/models/operations/replaceorganizationmetadata_requestbody.rb'
|
|
338
|
+
autoload :ReplaceOrganizationMetadataRequest, 'clerk/models/operations/replaceorganizationmetadata_request.rb'
|
|
339
|
+
autoload :ReplaceOrganizationMetadataResponse, 'clerk/models/operations/replaceorganizationmetadata_response.rb'
|
|
337
340
|
autoload :ReplaceRoleInRoleSetRequestBody, 'clerk/models/operations/replaceroleinroleset_requestbody.rb'
|
|
338
341
|
autoload :ReplaceRoleInRoleSetRequest, 'clerk/models/operations/replaceroleinroleset_request.rb'
|
|
339
342
|
autoload :ReplaceRoleInRoleSetResponse, 'clerk/models/operations/replaceroleinroleset_response.rb'
|
data/lib/clerk/organizations.rb
CHANGED
|
@@ -488,7 +488,10 @@ module Clerk
|
|
|
488
488
|
|
|
489
489
|
def update(body:, organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
490
490
|
# update - Update an organization
|
|
491
|
-
# Updates an existing organization
|
|
491
|
+
# Updates an existing organization.
|
|
492
|
+
#
|
|
493
|
+
# As of API version 2026-05-12, this endpoint no longer accepts `public_metadata` or `private_metadata`.
|
|
494
|
+
# Use `PATCH /v1/organizations/{organization_id}/metadata` to merge updates into existing metadata, or `PUT /v1/organizations/{organization_id}/metadata` to replace a metadata field entirely.
|
|
492
495
|
request = Models::Operations::UpdateOrganizationRequest.new(
|
|
493
496
|
organization_id: organization_id,
|
|
494
497
|
body: body
|
|
@@ -952,6 +955,168 @@ module Clerk
|
|
|
952
955
|
|
|
953
956
|
|
|
954
957
|
|
|
958
|
+
def replace_metadata(body:, organization_id:, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
959
|
+
# replace_metadata - Replace metadata for an organization
|
|
960
|
+
# Replace an organization's metadata attributes with the provided values.
|
|
961
|
+
# Unlike `PATCH /v1/organizations/{organization_id}/metadata` (merge semantics), this
|
|
962
|
+
# endpoint replaces the supplied metadata fields entirely — the prior contents of each
|
|
963
|
+
# supplied field are discarded. Fields omitted from the request body are left unchanged.
|
|
964
|
+
# Prefer the `PATCH` endpoint for partial updates. Use `PUT` only when you explicitly
|
|
965
|
+
# intend to overwrite a metadata field wholesale.
|
|
966
|
+
request = Models::Operations::ReplaceOrganizationMetadataRequest.new(
|
|
967
|
+
organization_id: organization_id,
|
|
968
|
+
body: body
|
|
969
|
+
)
|
|
970
|
+
url, params = @sdk_configuration.get_server_details
|
|
971
|
+
base_url = Utils.template_url(url, params)
|
|
972
|
+
url = Utils.generate_url(
|
|
973
|
+
Models::Operations::ReplaceOrganizationMetadataRequest,
|
|
974
|
+
base_url,
|
|
975
|
+
'/organizations/{organization_id}/metadata',
|
|
976
|
+
request
|
|
977
|
+
)
|
|
978
|
+
headers = {}
|
|
979
|
+
|
|
980
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
981
|
+
headers['content-type'] = req_content_type
|
|
982
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
983
|
+
|
|
984
|
+
if form && !form.empty?
|
|
985
|
+
body = Utils.encode_form(form)
|
|
986
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
987
|
+
body = URI.encode_www_form(data)
|
|
988
|
+
else
|
|
989
|
+
body = data
|
|
990
|
+
end
|
|
991
|
+
headers['Accept'] = 'application/json'
|
|
992
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
993
|
+
retries ||= @sdk_configuration.retry_config
|
|
994
|
+
retries ||= Utils::RetryConfig.new(
|
|
995
|
+
backoff: Utils::BackoffStrategy.new(
|
|
996
|
+
exponent: 1.5,
|
|
997
|
+
initial_interval: 500,
|
|
998
|
+
max_elapsed_time: 3_600_000,
|
|
999
|
+
max_interval: 60_000
|
|
1000
|
+
),
|
|
1001
|
+
retry_connection_errors: true,
|
|
1002
|
+
strategy: 'backoff'
|
|
1003
|
+
)
|
|
1004
|
+
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
|
1005
|
+
retry_options[:retry_statuses] = [500, 501, 502, 503, 504, 505]
|
|
1006
|
+
|
|
1007
|
+
security = @sdk_configuration.security_source&.call
|
|
1008
|
+
|
|
1009
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
1010
|
+
timeout ||= @sdk_configuration.timeout
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
connection = @sdk_configuration.client.dup
|
|
1014
|
+
connection.request :retry, retry_options
|
|
1015
|
+
|
|
1016
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
1017
|
+
config: @sdk_configuration,
|
|
1018
|
+
base_url: base_url,
|
|
1019
|
+
oauth2_scopes: nil,
|
|
1020
|
+
operation_id: 'ReplaceOrganizationMetadata',
|
|
1021
|
+
security_source: @sdk_configuration.security_source
|
|
1022
|
+
)
|
|
1023
|
+
|
|
1024
|
+
error = nil
|
|
1025
|
+
http_response = nil
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
begin
|
|
1029
|
+
http_response = connection.put(url) do |req|
|
|
1030
|
+
req.body = body
|
|
1031
|
+
req.headers.merge!(headers)
|
|
1032
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
1033
|
+
Utils.configure_request_security(req, security)
|
|
1034
|
+
http_headers&.each do |key, value|
|
|
1035
|
+
req.headers[key.to_s] = value
|
|
1036
|
+
end
|
|
1037
|
+
|
|
1038
|
+
@sdk_configuration.hooks.before_request(
|
|
1039
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
1040
|
+
hook_ctx: hook_ctx
|
|
1041
|
+
),
|
|
1042
|
+
request: req
|
|
1043
|
+
)
|
|
1044
|
+
end
|
|
1045
|
+
rescue StandardError => e
|
|
1046
|
+
error = e
|
|
1047
|
+
ensure
|
|
1048
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
1049
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
1050
|
+
error: error,
|
|
1051
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
1052
|
+
hook_ctx: hook_ctx
|
|
1053
|
+
),
|
|
1054
|
+
response: http_response
|
|
1055
|
+
)
|
|
1056
|
+
else
|
|
1057
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1058
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1059
|
+
hook_ctx: hook_ctx
|
|
1060
|
+
),
|
|
1061
|
+
response: http_response
|
|
1062
|
+
)
|
|
1063
|
+
end
|
|
1064
|
+
|
|
1065
|
+
if http_response.nil?
|
|
1066
|
+
raise error if !error.nil?
|
|
1067
|
+
raise 'no response'
|
|
1068
|
+
end
|
|
1069
|
+
end
|
|
1070
|
+
|
|
1071
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
1072
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
1073
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1074
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1075
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1076
|
+
hook_ctx: hook_ctx
|
|
1077
|
+
),
|
|
1078
|
+
response: http_response
|
|
1079
|
+
)
|
|
1080
|
+
response_data = http_response.env.response_body
|
|
1081
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Organization)
|
|
1082
|
+
response = Models::Operations::ReplaceOrganizationMetadataResponse.new(
|
|
1083
|
+
status_code: http_response.status,
|
|
1084
|
+
content_type: content_type,
|
|
1085
|
+
raw_response: http_response,
|
|
1086
|
+
organization: obj
|
|
1087
|
+
)
|
|
1088
|
+
|
|
1089
|
+
return response
|
|
1090
|
+
else
|
|
1091
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
1092
|
+
end
|
|
1093
|
+
elsif Utils.match_status_code(http_response.status, ['400', '401', '404', '422'])
|
|
1094
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
1095
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
1096
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
1097
|
+
hook_ctx: hook_ctx
|
|
1098
|
+
),
|
|
1099
|
+
response: http_response
|
|
1100
|
+
)
|
|
1101
|
+
response_data = http_response.env.response_body
|
|
1102
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ClerkErrors)
|
|
1103
|
+
obj.raw_response = http_response
|
|
1104
|
+
raise obj
|
|
1105
|
+
else
|
|
1106
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
1107
|
+
end
|
|
1108
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
1109
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1110
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
1111
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1112
|
+
else
|
|
1113
|
+
raise ::Clerk::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
1114
|
+
|
|
1115
|
+
end
|
|
1116
|
+
end
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
|
|
955
1120
|
def upload_logo(organization_id:, body: nil, retries: nil, timeout_ms: nil, http_headers: nil)
|
|
956
1121
|
# upload_logo - Upload a logo for the organization
|
|
957
1122
|
# Set or replace an organization's logo, by uploading an image file.
|
|
@@ -75,10 +75,10 @@ module Clerk
|
|
|
75
75
|
@security_source = -> { Models::Components::Security.new(bearer_auth: bearer_auth) }
|
|
76
76
|
end
|
|
77
77
|
@language = 'ruby'
|
|
78
|
-
@openapi_doc_version = '
|
|
79
|
-
@sdk_version = '
|
|
80
|
-
@gen_version = '2.
|
|
81
|
-
@user_agent = 'speakeasy-sdk/ruby
|
|
78
|
+
@openapi_doc_version = '2026-05-12'
|
|
79
|
+
@sdk_version = '7.0.0'
|
|
80
|
+
@gen_version = '2.903.0'
|
|
81
|
+
@user_agent = 'speakeasy-sdk/ruby 7.0.0 2.903.0 2026-05-12 clerk-sdk-ruby'
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
|
data/lib/clerk/users.rb
CHANGED
|
@@ -624,12 +624,9 @@ module Clerk
|
|
|
624
624
|
# Both IDs should correspond to verified identifications that belong to the user.
|
|
625
625
|
#
|
|
626
626
|
# You can remove a user's username by setting the username attribute to null or the blank string "".
|
|
627
|
-
# This is a destructive action; the identification will be deleted forever.
|
|
628
|
-
# Usernames can be removed only if they are optional in your instance settings and there's at least one other identifier which can be used for authentication.
|
|
629
627
|
#
|
|
630
|
-
#
|
|
631
|
-
#
|
|
632
|
-
# You can also choose to sign the user out of all their active sessions on any device once the password is updated. Just set `sign_out_of_other_sessions` to `true`.
|
|
628
|
+
# As of API version 2026-05-12, this endpoint no longer accepts `public_metadata`, `private_metadata`, or `unsafe_metadata`.
|
|
629
|
+
# Use `PATCH /v1/users/{user_id}/metadata` to merge updates into existing metadata, or `PUT /v1/users/{user_id}/metadata` to replace a metadata field entirely.
|
|
633
630
|
request = Models::Operations::UpdateUserRequest.new(
|
|
634
631
|
user_id: user_id,
|
|
635
632
|
body: body
|
|
@@ -2270,12 +2267,12 @@ module Clerk
|
|
|
2270
2267
|
# Replace a user's metadata attributes with the provided values.
|
|
2271
2268
|
#
|
|
2272
2269
|
# Unlike `PATCH /v1/users/{user_id}/metadata` (merge semantics), this endpoint
|
|
2273
|
-
# replaces the supplied metadata
|
|
2274
|
-
# supplied
|
|
2270
|
+
# replaces the supplied metadata fields entirely — the prior contents of each
|
|
2271
|
+
# supplied field are discarded. Fields omitted from the request body are
|
|
2275
2272
|
# left unchanged.
|
|
2276
2273
|
#
|
|
2277
2274
|
# Prefer the `PATCH` endpoint for partial updates. Use `PUT` only when you
|
|
2278
|
-
# explicitly intend to overwrite a metadata
|
|
2275
|
+
# explicitly intend to overwrite a metadata field wholesale.
|
|
2279
2276
|
request = Models::Operations::ReplaceUserMetadataRequest.new(
|
|
2280
2277
|
user_id: user_id,
|
|
2281
2278
|
body: body
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: clerk-sdk-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 7.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Speakeasy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -2065,6 +2065,12 @@ files:
|
|
|
2065
2065
|
- lib/clerk/models/operations/removepermissionfromorganizationrole_request.rbi
|
|
2066
2066
|
- lib/clerk/models/operations/removepermissionfromorganizationrole_response.rb
|
|
2067
2067
|
- lib/clerk/models/operations/removepermissionfromorganizationrole_response.rbi
|
|
2068
|
+
- lib/clerk/models/operations/replaceorganizationmetadata_request.rb
|
|
2069
|
+
- lib/clerk/models/operations/replaceorganizationmetadata_request.rbi
|
|
2070
|
+
- lib/clerk/models/operations/replaceorganizationmetadata_requestbody.rb
|
|
2071
|
+
- lib/clerk/models/operations/replaceorganizationmetadata_requestbody.rbi
|
|
2072
|
+
- lib/clerk/models/operations/replaceorganizationmetadata_response.rb
|
|
2073
|
+
- lib/clerk/models/operations/replaceorganizationmetadata_response.rbi
|
|
2068
2074
|
- lib/clerk/models/operations/replaceroleinroleset_request.rb
|
|
2069
2075
|
- lib/clerk/models/operations/replaceroleinroleset_request.rbi
|
|
2070
2076
|
- lib/clerk/models/operations/replaceroleinroleset_requestbody.rb
|