speakeasy_client_sdk_ruby 3.0.0 → 4.0.1

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/speakeasy_client_sdk/apiendpoints.rb +18 -10
  3. data/lib/speakeasy_client_sdk/apis.rb +14 -9
  4. data/lib/speakeasy_client_sdk/auth.rb +57 -0
  5. data/lib/speakeasy_client_sdk/embeds.rb +4 -3
  6. data/lib/speakeasy_client_sdk/events.rb +69 -0
  7. data/lib/speakeasy_client_sdk/metadata.rb +7 -4
  8. data/lib/speakeasy_client_sdk/models/operations/getallapiendpoints_response.rb +4 -4
  9. data/lib/speakeasy_client_sdk/models/operations/getallapiversions_response.rb +4 -4
  10. data/lib/speakeasy_client_sdk/models/operations/getallforversionapiendpoints_response.rb +4 -4
  11. data/lib/speakeasy_client_sdk/models/operations/getapis_response.rb +4 -4
  12. data/lib/speakeasy_client_sdk/models/operations/getvalidembedaccesstokens_response.rb +4 -4
  13. data/lib/speakeasy_client_sdk/models/operations/getversionmetadata_response.rb +5 -5
  14. data/lib/speakeasy_client_sdk/models/operations/postworkspaceevents_request.rb +27 -0
  15. data/lib/speakeasy_client_sdk/models/operations/{upsertplugin_response.rb → postworkspaceevents_response.rb} +4 -7
  16. data/lib/speakeasy_client_sdk/models/operations/queryeventlog_response.rb +4 -4
  17. data/lib/speakeasy_client_sdk/models/operations/validateapikey_response.rb +5 -2
  18. data/lib/speakeasy_client_sdk/models/operations.rb +3 -5
  19. data/lib/speakeasy_client_sdk/models/shared/apikeydetails.rb +24 -0
  20. data/lib/speakeasy_client_sdk/models/shared/clievent.rb +156 -0
  21. data/lib/speakeasy_client_sdk/models/shared/generate_bump_type.rb +22 -0
  22. data/lib/speakeasy_client_sdk/models/shared/interaction_type.rb +19 -0
  23. data/lib/speakeasy_client_sdk/models/shared.rb +4 -1
  24. data/lib/speakeasy_client_sdk/requests.rb +6 -4
  25. data/lib/speakeasy_client_sdk/schemas.rb +16 -8
  26. data/lib/speakeasy_client_sdk/sdk.rb +17 -36
  27. data/lib/speakeasy_client_sdk/sdkconfiguration.rb +9 -6
  28. data/lib/speakeasy_client_sdk/utils/utils.rb +2 -2
  29. data/lib/speakeasy_client_sdk_ruby.rb +2 -1
  30. metadata +10 -8
  31. data/lib/speakeasy_client_sdk/models/operations/getplugins_response.rb +0 -36
  32. data/lib/speakeasy_client_sdk/models/operations/runplugin_request.rb +0 -27
  33. data/lib/speakeasy_client_sdk/models/operations/runplugin_response.rb +0 -36
  34. data/lib/speakeasy_client_sdk/models/shared/plugin.rb +0 -42
  35. data/lib/speakeasy_client_sdk/plugins.rb +0 -146
@@ -1,36 +0,0 @@
1
- # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
-
3
- # typed: true
4
- # frozen_string_literal: true
5
-
6
-
7
- module SpeakeasyClientSDK
8
- module Operations
9
-
10
-
11
- class GetPluginsResponse < ::SpeakeasyClientSDK::Utils::FieldAugmented
12
- extend T::Sig
13
-
14
- # HTTP response content type for this operation
15
- field :content_type, ::String
16
- # Raw HTTP response; suitable for custom response parsing
17
- field :raw_response, ::Faraday::Response
18
- # HTTP response status code for this operation
19
- field :status_code, ::Integer
20
- # OK
21
- field :classes, T.nilable(T::Array[::SpeakeasyClientSDK::Shared::Plugin])
22
- # Default error response
23
- field :error, T.nilable(::SpeakeasyClientSDK::Shared::Error)
24
-
25
-
26
- sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, classes: T.nilable(T::Array[::SpeakeasyClientSDK::Shared::Plugin]), error: T.nilable(::SpeakeasyClientSDK::Shared::Error)).void }
27
- def initialize(content_type: nil, raw_response: nil, status_code: nil, classes: nil, error: nil)
28
- @content_type = content_type
29
- @raw_response = raw_response
30
- @status_code = status_code
31
- @classes = classes
32
- @error = error
33
- end
34
- end
35
- end
36
- end
@@ -1,27 +0,0 @@
1
- # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
-
3
- # typed: true
4
- # frozen_string_literal: true
5
-
6
-
7
- module SpeakeasyClientSDK
8
- module Operations
9
-
10
-
11
- class RunPluginRequest < ::SpeakeasyClientSDK::Utils::FieldAugmented
12
- extend T::Sig
13
-
14
- # The ID of the plugin to run.
15
- field :plugin_id, ::String, { 'path_param': { 'field_name': 'pluginID', 'style': 'simple', 'explode': false } }
16
- # The filter to apply to the query.
17
- field :filters, T.nilable(::SpeakeasyClientSDK::Shared::Filters), { 'query_param': { 'field_name': 'filters', 'serialization': 'json' } }
18
-
19
-
20
- sig { params(plugin_id: ::String, filters: T.nilable(::SpeakeasyClientSDK::Shared::Filters)).void }
21
- def initialize(plugin_id: nil, filters: nil)
22
- @plugin_id = plugin_id
23
- @filters = filters
24
- end
25
- end
26
- end
27
- end
@@ -1,36 +0,0 @@
1
- # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
-
3
- # typed: true
4
- # frozen_string_literal: true
5
-
6
-
7
- module SpeakeasyClientSDK
8
- module Operations
9
-
10
-
11
- class RunPluginResponse < ::SpeakeasyClientSDK::Utils::FieldAugmented
12
- extend T::Sig
13
-
14
- # HTTP response content type for this operation
15
- field :content_type, ::String
16
- # Raw HTTP response; suitable for custom response parsing
17
- field :raw_response, ::Faraday::Response
18
- # HTTP response status code for this operation
19
- field :status_code, ::Integer
20
- # OK
21
- field :classes, T.nilable(T::Array[::SpeakeasyClientSDK::Shared::BoundedRequest])
22
- # Default error response
23
- field :error, T.nilable(::SpeakeasyClientSDK::Shared::Error)
24
-
25
-
26
- sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, classes: T.nilable(T::Array[::SpeakeasyClientSDK::Shared::BoundedRequest]), error: T.nilable(::SpeakeasyClientSDK::Shared::Error)).void }
27
- def initialize(content_type: nil, raw_response: nil, status_code: nil, classes: nil, error: nil)
28
- @content_type = content_type
29
- @raw_response = raw_response
30
- @status_code = status_code
31
- @classes = classes
32
- @error = error
33
- end
34
- end
35
- end
36
- end
@@ -1,42 +0,0 @@
1
- # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
-
3
- # typed: true
4
- # frozen_string_literal: true
5
-
6
-
7
- module SpeakeasyClientSDK
8
- module Shared
9
-
10
- # A plugin is a short script that is run against ingested requests
11
- class Plugin < ::SpeakeasyClientSDK::Utils::FieldAugmented
12
- extend T::Sig
13
-
14
-
15
- field :code, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('code') } }
16
-
17
- field :plugin_id, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('plugin_id') } }
18
-
19
- field :title, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('title') } }
20
-
21
- field :workspace_id, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('workspace_id') } }
22
-
23
- field :created_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('created_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
24
-
25
- field :eval_hash, T.nilable(::String), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('eval_hash') } }
26
-
27
- field :updated_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('updated_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
28
-
29
-
30
- sig { params(code: ::String, plugin_id: ::String, title: ::String, workspace_id: ::String, created_at: T.nilable(::DateTime), eval_hash: T.nilable(::String), updated_at: T.nilable(::DateTime)).void }
31
- def initialize(code: nil, plugin_id: nil, title: nil, workspace_id: nil, created_at: nil, eval_hash: nil, updated_at: nil)
32
- @code = code
33
- @plugin_id = plugin_id
34
- @title = title
35
- @workspace_id = workspace_id
36
- @created_at = created_at
37
- @eval_hash = eval_hash
38
- @updated_at = updated_at
39
- end
40
- end
41
- end
42
- end
@@ -1,146 +0,0 @@
1
- # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
-
3
- # typed: true
4
- # frozen_string_literal: true
5
-
6
- require 'faraday'
7
- require 'faraday/multipart'
8
- require 'sorbet-runtime'
9
-
10
- module SpeakeasyClientSDK
11
- extend T::Sig
12
- class Plugins
13
- extend T::Sig
14
- # REST APIs for managing and running plugins
15
-
16
- sig { params(sdk_config: SDKConfiguration).void }
17
- def initialize(sdk_config)
18
- @sdk_configuration = sdk_config
19
- end
20
-
21
-
22
- sig { returns(::SpeakeasyClientSDK::Utils::FieldAugmented) }
23
- def get_plugins
24
- # get_plugins - Get all plugins for the current workspace.
25
- url, params = @sdk_configuration.get_server_details
26
- base_url = Utils.template_url(url, params)
27
- url = "#{base_url}/v1/plugins"
28
- headers = {}
29
- headers['Accept'] = 'application/json'
30
- headers['user-agent'] = @sdk_configuration.user_agent
31
-
32
- r = @sdk_configuration.client.get(url) do |req|
33
- req.headers = headers
34
- Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
35
- end
36
-
37
- content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
38
-
39
- res = ::SpeakeasyClientSDK::Operations::GetPluginsResponse.new(
40
- status_code: r.status, content_type: content_type, raw_response: r
41
- )
42
- if r.status == 200
43
- if Utils.match_content_type(content_type, 'application/json')
44
- out = Utils.unmarshal_complex(r.env.response_body, T::Array[::SpeakeasyClientSDK::Shared::Plugin])
45
- res.classes = out
46
- end
47
- else
48
-
49
- if Utils.match_content_type(content_type, 'application/json')
50
- out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Error)
51
- res.error = out
52
- end
53
- end
54
- res
55
- end
56
-
57
-
58
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::RunPluginRequest)).returns(Utils::FieldAugmented) }
59
- def run_plugin(request)
60
- # run_plugin - Run a plugin
61
- url, params = @sdk_configuration.get_server_details
62
- base_url = Utils.template_url(url, params)
63
- url = Utils.generate_url(
64
- ::SpeakeasyClientSDK::Operations::RunPluginRequest,
65
- base_url,
66
- '/v1/plugins/{pluginID}',
67
- request
68
- )
69
- headers = {}
70
- query_params = Utils.get_query_params(::SpeakeasyClientSDK::Operations::RunPluginRequest, request)
71
- headers['Accept'] = 'application/json'
72
- headers['user-agent'] = @sdk_configuration.user_agent
73
-
74
- r = @sdk_configuration.client.post(url) do |req|
75
- req.headers = headers
76
- req.params = query_params
77
- Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
78
- end
79
-
80
- content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
81
-
82
- res = ::SpeakeasyClientSDK::Operations::RunPluginResponse.new(
83
- status_code: r.status, content_type: content_type, raw_response: r
84
- )
85
- if r.status == 200
86
- if Utils.match_content_type(content_type, 'application/json')
87
- out = Utils.unmarshal_complex(r.env.response_body, T::Array[::SpeakeasyClientSDK::Shared::BoundedRequest])
88
- res.classes = out
89
- end
90
- else
91
-
92
- if Utils.match_content_type(content_type, 'application/json')
93
- out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Error)
94
- res.error = out
95
- end
96
- end
97
- res
98
- end
99
-
100
-
101
- sig { params(request: ::SpeakeasyClientSDK::Shared::Plugin).returns(Utils::FieldAugmented) }
102
- def upsert_plugin(request)
103
- # upsert_plugin - Upsert a plugin
104
- url, params = @sdk_configuration.get_server_details
105
- base_url = Utils.template_url(url, params)
106
- url = "#{base_url}/v1/plugins"
107
- headers = {}
108
- req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
109
- headers['content-type'] = req_content_type
110
- raise StandardError, 'request body is required' if data.nil? && form.nil?
111
- headers['Accept'] = 'application/json'
112
- headers['user-agent'] = @sdk_configuration.user_agent
113
-
114
- r = @sdk_configuration.client.put(url) do |req|
115
- req.headers = headers
116
- Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
117
- if form
118
- req.body = Utils.encode_form(form)
119
- elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
120
- req.body = URI.encode_www_form(data)
121
- else
122
- req.body = data
123
- end
124
- end
125
-
126
- content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
127
-
128
- res = ::SpeakeasyClientSDK::Operations::UpsertPluginResponse.new(
129
- status_code: r.status, content_type: content_type, raw_response: r
130
- )
131
- if r.status == 200
132
- if Utils.match_content_type(content_type, 'application/json')
133
- out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Plugin)
134
- res.plugin = out
135
- end
136
- else
137
-
138
- if Utils.match_content_type(content_type, 'application/json')
139
- out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Error)
140
- res.error = out
141
- end
142
- end
143
- res
144
- end
145
- end
146
- end