cadenya 0.46.0 → 0.48.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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/client.rb +10 -2
  5. data/lib/cadenya/models/account_info.rb +5 -4
  6. data/lib/cadenya/models/api_key.rb +33 -4
  7. data/lib/cadenya/models/api_key_create_params.rb +8 -12
  8. data/lib/cadenya/models/api_key_delete_params.rb +7 -1
  9. data/lib/cadenya/models/api_key_disable_params.rb +26 -0
  10. data/lib/cadenya/models/api_key_enable_params.rb +26 -0
  11. data/lib/cadenya/models/api_key_info.rb +1 -21
  12. data/lib/cadenya/models/api_key_list_params.rb +8 -1
  13. data/lib/cadenya/models/api_key_retrieve_params.rb +7 -1
  14. data/lib/cadenya/models/api_key_rotate_params.rb +7 -1
  15. data/lib/cadenya/models/api_key_spec.rb +2 -2
  16. data/lib/cadenya/models/api_key_update_params.rb +8 -1
  17. data/lib/cadenya/models/global_api_key_disable_params.rb +14 -0
  18. data/lib/cadenya/models/global_api_key_enable_params.rb +14 -0
  19. data/lib/cadenya/models/global_api_key_retrieve_params.rb +14 -0
  20. data/lib/cadenya/models/global_api_key_rotate_params.rb +14 -0
  21. data/lib/cadenya/models.rb +12 -2
  22. data/lib/cadenya/resources/api_keys.rb +116 -38
  23. data/lib/cadenya/resources/global_api_key.rb +93 -0
  24. data/lib/cadenya/version.rb +1 -1
  25. data/lib/cadenya.rb +7 -4
  26. data/rbi/cadenya/client.rbi +9 -2
  27. data/rbi/cadenya/models/account_info.rbi +8 -6
  28. data/rbi/cadenya/models/api_key.rbi +37 -3
  29. data/rbi/cadenya/models/api_key_create_params.rbi +6 -13
  30. data/rbi/cadenya/models/api_key_delete_params.rbi +10 -2
  31. data/rbi/cadenya/models/api_key_disable_params.rbi +43 -0
  32. data/rbi/cadenya/models/api_key_enable_params.rbi +43 -0
  33. data/rbi/cadenya/models/api_key_info.rbi +3 -39
  34. data/rbi/cadenya/models/api_key_list_params.rbi +6 -0
  35. data/rbi/cadenya/models/api_key_retrieve_params.rbi +10 -2
  36. data/rbi/cadenya/models/api_key_rotate_params.rbi +10 -2
  37. data/rbi/cadenya/models/api_key_spec.rbi +2 -2
  38. data/rbi/cadenya/models/api_key_update_params.rbi +6 -0
  39. data/rbi/cadenya/models/global_api_key_disable_params.rbi +27 -0
  40. data/rbi/cadenya/models/global_api_key_enable_params.rbi +27 -0
  41. data/rbi/cadenya/models/global_api_key_retrieve_params.rbi +27 -0
  42. data/rbi/cadenya/models/global_api_key_rotate_params.rbi +27 -0
  43. data/rbi/cadenya/models.rbi +12 -2
  44. data/rbi/cadenya/resources/api_keys.rbi +64 -20
  45. data/rbi/cadenya/resources/global_api_key.rbi +55 -0
  46. data/sig/cadenya/client.rbs +2 -0
  47. data/sig/cadenya/models/api_key.rbs +17 -0
  48. data/sig/cadenya/models/api_key_create_params.rbs +6 -8
  49. data/sig/cadenya/models/api_key_delete_params.rbs +10 -2
  50. data/sig/cadenya/models/api_key_disable_params.rbs +28 -0
  51. data/sig/cadenya/models/api_key_enable_params.rbs +28 -0
  52. data/sig/cadenya/models/api_key_info.rbs +3 -26
  53. data/sig/cadenya/models/api_key_list_params.rbs +5 -0
  54. data/sig/cadenya/models/api_key_retrieve_params.rbs +10 -2
  55. data/sig/cadenya/models/api_key_rotate_params.rbs +10 -2
  56. data/sig/cadenya/models/api_key_update_params.rbs +5 -0
  57. data/sig/cadenya/models/global_api_key_disable_params.rbs +15 -0
  58. data/sig/cadenya/models/global_api_key_enable_params.rbs +15 -0
  59. data/sig/cadenya/models/global_api_key_retrieve_params.rbs +15 -0
  60. data/sig/cadenya/models/global_api_key_rotate_params.rbs +15 -0
  61. data/sig/cadenya/models.rbs +12 -2
  62. data/sig/cadenya/resources/api_keys.rbs +22 -4
  63. data/sig/cadenya/resources/global_api_key.rbs +15 -0
  64. metadata +23 -14
  65. data/lib/cadenya/models/api_keys/access_add_params.rb +0 -31
  66. data/lib/cadenya/models/api_keys/access_list_params.rb +0 -52
  67. data/lib/cadenya/models/api_keys/access_remove_params.rb +0 -28
  68. data/lib/cadenya/resources/api_keys/access.rb +0 -105
  69. data/rbi/cadenya/models/api_keys/access_add_params.rbi +0 -54
  70. data/rbi/cadenya/models/api_keys/access_list_params.rbi +0 -83
  71. data/rbi/cadenya/models/api_keys/access_remove_params.rbi +0 -48
  72. data/rbi/cadenya/resources/api_keys/access.rbi +0 -78
  73. data/sig/cadenya/models/api_keys/access_add_params.rbs +0 -32
  74. data/sig/cadenya/models/api_keys/access_list_params.rbs +0 -44
  75. data/sig/cadenya/models/api_keys/access_remove_params.rbs +0 -30
  76. data/sig/cadenya/resources/api_keys/access.rbs +0 -29
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Cadenya
4
- module Models
5
- module APIKeys
6
- # @see Cadenya::Resources::APIKeys::Access#list
7
- class AccessListParams < Cadenya::Internal::Type::BaseModel
8
- extend Cadenya::Internal::Type::RequestParameters::Converter
9
- include Cadenya::Internal::Type::RequestParameters
10
-
11
- # @!attribute id
12
- #
13
- # @return [String]
14
- required :id, String
15
-
16
- # @!attribute cursor
17
- # Pagination cursor from previous response.
18
- #
19
- # @return [String, nil]
20
- optional :cursor, String
21
-
22
- # @!attribute labels
23
- # Filters by metadata labels. Comma-separated key=value pairs, e.g.
24
- # "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
25
- # semantics).
26
- #
27
- # @return [String, nil]
28
- optional :labels, String
29
-
30
- # @!attribute limit
31
- # Maximum number of results to return.
32
- #
33
- # @return [Integer, nil]
34
- optional :limit, Integer
35
-
36
- # @!method initialize(id:, cursor: nil, labels: nil, limit: nil, request_options: {})
37
- # Some parameter documentations has been truncated, see
38
- # {Cadenya::Models::APIKeys::AccessListParams} for more details.
39
- #
40
- # @param id [String]
41
- #
42
- # @param cursor [String] Pagination cursor from previous response.
43
- #
44
- # @param labels [String] Filters by metadata labels. Comma-separated key=value pairs,
45
- #
46
- # @param limit [Integer] Maximum number of results to return.
47
- #
48
- # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
49
- end
50
- end
51
- end
52
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Cadenya
4
- module Models
5
- module APIKeys
6
- # @see Cadenya::Resources::APIKeys::Access#remove
7
- class AccessRemoveParams < Cadenya::Internal::Type::BaseModel
8
- extend Cadenya::Internal::Type::RequestParameters::Converter
9
- include Cadenya::Internal::Type::RequestParameters
10
-
11
- # @!attribute id
12
- #
13
- # @return [String]
14
- required :id, String
15
-
16
- # @!attribute workspace_id
17
- #
18
- # @return [String]
19
- required :workspace_id, String
20
-
21
- # @!method initialize(id:, workspace_id:, request_options: {})
22
- # @param id [String]
23
- # @param workspace_id [String]
24
- # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}]
25
- end
26
- end
27
- end
28
- end
@@ -1,105 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Cadenya
4
- module Resources
5
- class APIKeys
6
- # Issue, rotate, and revoke API keys for the account, and grant or revoke each
7
- # key's access to individual workspaces.
8
- class Access
9
- # Some parameter documentations has been truncated, see
10
- # {Cadenya::Models::APIKeys::AccessListParams} for more details.
11
- #
12
- # Lists the workspaces this API key has access to. Cursor-paginated.
13
- #
14
- # @overload list(id, cursor: nil, labels: nil, limit: nil, request_options: {})
15
- #
16
- # @param id [String] The API key whose workspace associations will be listed.
17
- #
18
- # @param cursor [String] Pagination cursor from previous response.
19
- #
20
- # @param labels [String] Filters by metadata labels. Comma-separated key=value pairs,
21
- #
22
- # @param limit [Integer] Maximum number of results to return.
23
- #
24
- # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
25
- #
26
- # @return [Cadenya::Internal::CursorPagination<Cadenya::Models::Workspace>]
27
- #
28
- # @see Cadenya::Models::APIKeys::AccessListParams
29
- def list(id, params = {})
30
- parsed, options = Cadenya::APIKeys::AccessListParams.dump_request(params)
31
- query = Cadenya::Internal::Util.encode_query_params(parsed)
32
- @client.request(
33
- method: :get,
34
- path: ["v1/account/api_keys/%1$s/workspaces", id],
35
- query: query,
36
- page: Cadenya::Internal::CursorPagination,
37
- model: Cadenya::Workspace,
38
- options: options
39
- )
40
- end
41
-
42
- # Grants this API key access to the specified workspace. Idempotent — adding an
43
- # already-associated workspace is a no-op. Returns the updated API key with
44
- # refreshed workspace preview and total.
45
- #
46
- # @overload add(id, workspace_id: nil, request_options: {})
47
- #
48
- # @param id [String] The API key being granted workspace access.
49
- #
50
- # @param workspace_id [String] The workspace to grant access to.
51
- #
52
- # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
53
- #
54
- # @return [Cadenya::Models::APIKey]
55
- #
56
- # @see Cadenya::Models::APIKeys::AccessAddParams
57
- def add(id, params = {})
58
- parsed, options = Cadenya::APIKeys::AccessAddParams.dump_request(params)
59
- @client.request(
60
- method: :post,
61
- path: ["v1/account/api_keys/%1$s/workspaces", id],
62
- body: parsed,
63
- model: Cadenya::APIKey,
64
- options: options
65
- )
66
- end
67
-
68
- # Revokes this API key's access to the specified workspace. Idempotent. A key may
69
- # have zero workspaces and remains valid.
70
- #
71
- # @overload remove(workspace_id, id:, request_options: {})
72
- #
73
- # @param workspace_id [String] The workspace whose access is being revoked (path).
74
- #
75
- # @param id [String] The API key losing workspace access (path).
76
- #
77
- # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
78
- #
79
- # @return [nil]
80
- #
81
- # @see Cadenya::Models::APIKeys::AccessRemoveParams
82
- def remove(workspace_id, params)
83
- parsed, options = Cadenya::APIKeys::AccessRemoveParams.dump_request(params)
84
- id =
85
- parsed.delete(:id) do
86
- raise ArgumentError.new("missing required path argument #{_1}")
87
- end
88
- @client.request(
89
- method: :delete,
90
- path: ["v1/account/api_keys/%1$s/workspaces/%2$s", id, workspace_id],
91
- model: NilClass,
92
- options: options
93
- )
94
- end
95
-
96
- # @api private
97
- #
98
- # @param client [Cadenya::Client]
99
- def initialize(client:)
100
- @client = client
101
- end
102
- end
103
- end
104
- end
105
- end
@@ -1,54 +0,0 @@
1
- # typed: strong
2
-
3
- module Cadenya
4
- module Models
5
- module APIKeys
6
- class AccessAddParams < Cadenya::Internal::Type::BaseModel
7
- extend Cadenya::Internal::Type::RequestParameters::Converter
8
- include Cadenya::Internal::Type::RequestParameters
9
-
10
- OrHash =
11
- T.type_alias do
12
- T.any(Cadenya::APIKeys::AccessAddParams, Cadenya::Internal::AnyHash)
13
- end
14
-
15
- sig { returns(String) }
16
- attr_accessor :id
17
-
18
- # The workspace to grant access to.
19
- sig { returns(T.nilable(String)) }
20
- attr_reader :workspace_id
21
-
22
- sig { params(workspace_id: String).void }
23
- attr_writer :workspace_id
24
-
25
- sig do
26
- params(
27
- id: String,
28
- workspace_id: String,
29
- request_options: Cadenya::RequestOptions::OrHash
30
- ).returns(T.attached_class)
31
- end
32
- def self.new(
33
- id:,
34
- # The workspace to grant access to.
35
- workspace_id: nil,
36
- request_options: {}
37
- )
38
- end
39
-
40
- sig do
41
- override.returns(
42
- {
43
- id: String,
44
- workspace_id: String,
45
- request_options: Cadenya::RequestOptions
46
- }
47
- )
48
- end
49
- def to_hash
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,83 +0,0 @@
1
- # typed: strong
2
-
3
- module Cadenya
4
- module Models
5
- module APIKeys
6
- class AccessListParams < Cadenya::Internal::Type::BaseModel
7
- extend Cadenya::Internal::Type::RequestParameters::Converter
8
- include Cadenya::Internal::Type::RequestParameters
9
-
10
- OrHash =
11
- T.type_alias do
12
- T.any(
13
- Cadenya::APIKeys::AccessListParams,
14
- Cadenya::Internal::AnyHash
15
- )
16
- end
17
-
18
- sig { returns(String) }
19
- attr_accessor :id
20
-
21
- # Pagination cursor from previous response.
22
- sig { returns(T.nilable(String)) }
23
- attr_reader :cursor
24
-
25
- sig { params(cursor: String).void }
26
- attr_writer :cursor
27
-
28
- # Filters by metadata labels. Comma-separated key=value pairs, e.g.
29
- # "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
30
- # semantics).
31
- sig { returns(T.nilable(String)) }
32
- attr_reader :labels
33
-
34
- sig { params(labels: String).void }
35
- attr_writer :labels
36
-
37
- # Maximum number of results to return.
38
- sig { returns(T.nilable(Integer)) }
39
- attr_reader :limit
40
-
41
- sig { params(limit: Integer).void }
42
- attr_writer :limit
43
-
44
- sig do
45
- params(
46
- id: String,
47
- cursor: String,
48
- labels: String,
49
- limit: Integer,
50
- request_options: Cadenya::RequestOptions::OrHash
51
- ).returns(T.attached_class)
52
- end
53
- def self.new(
54
- id:,
55
- # Pagination cursor from previous response.
56
- cursor: nil,
57
- # Filters by metadata labels. Comma-separated key=value pairs, e.g.
58
- # "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
59
- # semantics).
60
- labels: nil,
61
- # Maximum number of results to return.
62
- limit: nil,
63
- request_options: {}
64
- )
65
- end
66
-
67
- sig do
68
- override.returns(
69
- {
70
- id: String,
71
- cursor: String,
72
- labels: String,
73
- limit: Integer,
74
- request_options: Cadenya::RequestOptions
75
- }
76
- )
77
- end
78
- def to_hash
79
- end
80
- end
81
- end
82
- end
83
- end
@@ -1,48 +0,0 @@
1
- # typed: strong
2
-
3
- module Cadenya
4
- module Models
5
- module APIKeys
6
- class AccessRemoveParams < Cadenya::Internal::Type::BaseModel
7
- extend Cadenya::Internal::Type::RequestParameters::Converter
8
- include Cadenya::Internal::Type::RequestParameters
9
-
10
- OrHash =
11
- T.type_alias do
12
- T.any(
13
- Cadenya::APIKeys::AccessRemoveParams,
14
- Cadenya::Internal::AnyHash
15
- )
16
- end
17
-
18
- sig { returns(String) }
19
- attr_accessor :id
20
-
21
- sig { returns(String) }
22
- attr_accessor :workspace_id
23
-
24
- sig do
25
- params(
26
- id: String,
27
- workspace_id: String,
28
- request_options: Cadenya::RequestOptions::OrHash
29
- ).returns(T.attached_class)
30
- end
31
- def self.new(id:, workspace_id:, request_options: {})
32
- end
33
-
34
- sig do
35
- override.returns(
36
- {
37
- id: String,
38
- workspace_id: String,
39
- request_options: Cadenya::RequestOptions
40
- }
41
- )
42
- end
43
- def to_hash
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,78 +0,0 @@
1
- # typed: strong
2
-
3
- module Cadenya
4
- module Resources
5
- class APIKeys
6
- # Issue, rotate, and revoke API keys for the account, and grant or revoke each
7
- # key's access to individual workspaces.
8
- class Access
9
- # Lists the workspaces this API key has access to. Cursor-paginated.
10
- sig do
11
- params(
12
- id: String,
13
- cursor: String,
14
- labels: String,
15
- limit: Integer,
16
- request_options: Cadenya::RequestOptions::OrHash
17
- ).returns(Cadenya::Internal::CursorPagination[Cadenya::Workspace])
18
- end
19
- def list(
20
- # The API key whose workspace associations will be listed.
21
- id,
22
- # Pagination cursor from previous response.
23
- cursor: nil,
24
- # Filters by metadata labels. Comma-separated key=value pairs, e.g.
25
- # "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
26
- # semantics).
27
- labels: nil,
28
- # Maximum number of results to return.
29
- limit: nil,
30
- request_options: {}
31
- )
32
- end
33
-
34
- # Grants this API key access to the specified workspace. Idempotent — adding an
35
- # already-associated workspace is a no-op. Returns the updated API key with
36
- # refreshed workspace preview and total.
37
- sig do
38
- params(
39
- id: String,
40
- workspace_id: String,
41
- request_options: Cadenya::RequestOptions::OrHash
42
- ).returns(Cadenya::APIKey)
43
- end
44
- def add(
45
- # The API key being granted workspace access.
46
- id,
47
- # The workspace to grant access to.
48
- workspace_id: nil,
49
- request_options: {}
50
- )
51
- end
52
-
53
- # Revokes this API key's access to the specified workspace. Idempotent. A key may
54
- # have zero workspaces and remains valid.
55
- sig do
56
- params(
57
- workspace_id: String,
58
- id: String,
59
- request_options: Cadenya::RequestOptions::OrHash
60
- ).void
61
- end
62
- def remove(
63
- # The workspace whose access is being revoked (path).
64
- workspace_id,
65
- # The API key losing workspace access (path).
66
- id:,
67
- request_options: {}
68
- )
69
- end
70
-
71
- # @api private
72
- sig { params(client: Cadenya::Client).returns(T.attached_class) }
73
- def self.new(client:)
74
- end
75
- end
76
- end
77
- end
78
- end
@@ -1,32 +0,0 @@
1
- module Cadenya
2
- module Models
3
- module APIKeys
4
- type access_add_params =
5
- { id: String, workspace_id: String }
6
- & Cadenya::Internal::Type::request_parameters
7
-
8
- class AccessAddParams < Cadenya::Internal::Type::BaseModel
9
- extend Cadenya::Internal::Type::RequestParameters::Converter
10
- include Cadenya::Internal::Type::RequestParameters
11
-
12
- attr_accessor id: String
13
-
14
- attr_reader workspace_id: String?
15
-
16
- def workspace_id=: (String) -> String
17
-
18
- def initialize: (
19
- id: String,
20
- ?workspace_id: String,
21
- ?request_options: Cadenya::request_opts
22
- ) -> void
23
-
24
- def to_hash: -> {
25
- id: String,
26
- workspace_id: String,
27
- request_options: Cadenya::RequestOptions
28
- }
29
- end
30
- end
31
- end
32
- end
@@ -1,44 +0,0 @@
1
- module Cadenya
2
- module Models
3
- module APIKeys
4
- type access_list_params =
5
- { id: String, cursor: String, labels: String, limit: Integer }
6
- & Cadenya::Internal::Type::request_parameters
7
-
8
- class AccessListParams < Cadenya::Internal::Type::BaseModel
9
- extend Cadenya::Internal::Type::RequestParameters::Converter
10
- include Cadenya::Internal::Type::RequestParameters
11
-
12
- attr_accessor id: String
13
-
14
- attr_reader cursor: String?
15
-
16
- def cursor=: (String) -> String
17
-
18
- attr_reader labels: String?
19
-
20
- def labels=: (String) -> String
21
-
22
- attr_reader limit: Integer?
23
-
24
- def limit=: (Integer) -> Integer
25
-
26
- def initialize: (
27
- id: String,
28
- ?cursor: String,
29
- ?labels: String,
30
- ?limit: Integer,
31
- ?request_options: Cadenya::request_opts
32
- ) -> void
33
-
34
- def to_hash: -> {
35
- id: String,
36
- cursor: String,
37
- labels: String,
38
- limit: Integer,
39
- request_options: Cadenya::RequestOptions
40
- }
41
- end
42
- end
43
- end
44
- end
@@ -1,30 +0,0 @@
1
- module Cadenya
2
- module Models
3
- module APIKeys
4
- type access_remove_params =
5
- { id: String, workspace_id: String }
6
- & Cadenya::Internal::Type::request_parameters
7
-
8
- class AccessRemoveParams < Cadenya::Internal::Type::BaseModel
9
- extend Cadenya::Internal::Type::RequestParameters::Converter
10
- include Cadenya::Internal::Type::RequestParameters
11
-
12
- attr_accessor id: String
13
-
14
- attr_accessor workspace_id: String
15
-
16
- def initialize: (
17
- id: String,
18
- workspace_id: String,
19
- ?request_options: Cadenya::request_opts
20
- ) -> void
21
-
22
- def to_hash: -> {
23
- id: String,
24
- workspace_id: String,
25
- request_options: Cadenya::RequestOptions
26
- }
27
- end
28
- end
29
- end
30
- end
@@ -1,29 +0,0 @@
1
- module Cadenya
2
- module Resources
3
- class APIKeys
4
- class Access
5
- def list: (
6
- String id,
7
- ?cursor: String,
8
- ?labels: String,
9
- ?limit: Integer,
10
- ?request_options: Cadenya::request_opts
11
- ) -> Cadenya::Internal::CursorPagination[Cadenya::Workspace]
12
-
13
- def add: (
14
- String id,
15
- ?workspace_id: String,
16
- ?request_options: Cadenya::request_opts
17
- ) -> Cadenya::APIKey
18
-
19
- def remove: (
20
- String workspace_id,
21
- id: String,
22
- ?request_options: Cadenya::request_opts
23
- ) -> nil
24
-
25
- def initialize: (client: Cadenya::Client) -> void
26
- end
27
- end
28
- end
29
- end