speakeasy_client_sdk_ruby 4.0.8 → 4.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/speakeasy_client_sdk/auth.rb +37 -0
- data/lib/speakeasy_client_sdk/models/operations/getaccesstoken_request.rb +24 -0
- data/lib/speakeasy_client_sdk/models/operations/getaccesstoken_response.rb +36 -0
- data/lib/speakeasy_client_sdk/models/operations.rb +2 -0
- data/lib/speakeasy_client_sdk/models/shared/accessdetails.rb +5 -2
- data/lib/speakeasy_client_sdk/models/shared/accesstoken.rb +33 -0
- data/lib/speakeasy_client_sdk/models/shared/claims.rb +20 -0
- data/lib/speakeasy_client_sdk/models/shared/targetsdk.rb +6 -3
- data/lib/speakeasy_client_sdk/models/shared/user.rb +39 -0
- data/lib/speakeasy_client_sdk/models/shared/workspaces.rb +20 -0
- data/lib/speakeasy_client_sdk/models/shared.rb +4 -0
- data/lib/speakeasy_client_sdk/sdk.rb +12 -19
- data/lib/speakeasy_client_sdk/sdkconfiguration.rb +11 -13
- data/lib/speakeasy_client_sdk_ruby.rb +5 -4
- 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: bd74cbe9c8b15e9124d00754db7384100004d76c12b61959dfaa7160f3a9b298
|
4
|
+
data.tar.gz: fb91f73ab2a212fa095acd54ba5354e79b5186bf79b2628b34d119c2cadf389d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaae19810161a09c7b52b0332b58c9ea9a642e97f55ba039ad39ec27b5b879ff1caa6d62f314f1d267707af7f0b20b25bd9cec37d1fbce5126dc95fd85bb047a
|
7
|
+
data.tar.gz: c9fc5ac250e508a21f5f5dcfc4f86da2f7f72a688f6856068d4a2cab7cc40f3b4a4c0cd74238b79c729fd15fb1e9ca89df2474470fa1613bcc269aac302e1277
|
@@ -19,6 +19,43 @@ module SpeakeasyClientSDK
|
|
19
19
|
end
|
20
20
|
|
21
21
|
|
22
|
+
sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetAccessTokenRequest)).returns(::SpeakeasyClientSDK::Operations::GetAccessTokenResponse) }
|
23
|
+
def get_access_token(request)
|
24
|
+
# get_access_token - Get or refresh an access token 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/auth/access_token"
|
28
|
+
headers = {}
|
29
|
+
query_params = Utils.get_query_params(::SpeakeasyClientSDK::Operations::GetAccessTokenRequest, request, @sdk_configuration.globals)
|
30
|
+
headers['Accept'] = 'application/json'
|
31
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
32
|
+
|
33
|
+
r = @sdk_configuration.client.get(url) do |req|
|
34
|
+
req.headers = headers
|
35
|
+
req.params = query_params
|
36
|
+
end
|
37
|
+
|
38
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
39
|
+
|
40
|
+
res = ::SpeakeasyClientSDK::Operations::GetAccessTokenResponse.new(
|
41
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
42
|
+
)
|
43
|
+
if r.status == 200
|
44
|
+
if Utils.match_content_type(content_type, 'application/json')
|
45
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::AccessToken)
|
46
|
+
res.access_token = out
|
47
|
+
end
|
48
|
+
else
|
49
|
+
|
50
|
+
if Utils.match_content_type(content_type, 'application/json')
|
51
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Error)
|
52
|
+
res.error = out
|
53
|
+
end
|
54
|
+
end
|
55
|
+
res
|
56
|
+
end
|
57
|
+
|
58
|
+
|
22
59
|
sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetWorkspaceAccessRequest)).returns(::SpeakeasyClientSDK::Operations::GetWorkspaceAccessResponse) }
|
23
60
|
def get_workspace_access(request)
|
24
61
|
# get_workspace_access - Get access allowances for a particular workspace
|
@@ -0,0 +1,24 @@
|
|
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 GetAccessTokenRequest < ::SpeakeasyClientSDK::Utils::FieldAugmented
|
12
|
+
extend T::Sig
|
13
|
+
|
14
|
+
# The workspace ID
|
15
|
+
field :workspace_id, ::String, { 'query_param': { 'field_name': 'workspace_id', 'style': 'form', 'explode': true } }
|
16
|
+
|
17
|
+
|
18
|
+
sig { params(workspace_id: ::String).void }
|
19
|
+
def initialize(workspace_id: nil)
|
20
|
+
@workspace_id = workspace_id
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,36 @@
|
|
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 GetAccessTokenResponse < ::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 :access_token, T.nilable(::SpeakeasyClientSDK::Shared::AccessToken)
|
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, access_token: T.nilable(::SpeakeasyClientSDK::Shared::AccessToken), error: T.nilable(::SpeakeasyClientSDK::Shared::Error)).void }
|
27
|
+
def initialize(content_type: nil, raw_response: nil, status_code: nil, access_token: nil, error: nil)
|
28
|
+
@content_type = content_type
|
29
|
+
@raw_response = raw_response
|
30
|
+
@status_code = status_code
|
31
|
+
@access_token = access_token
|
32
|
+
@error = error
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -59,6 +59,8 @@ module SpeakeasyClientSDK
|
|
59
59
|
autoload :RegisterSchemaRequestBody, 'speakeasy_client_sdk/models/operations/registerschema_requestbody.rb'
|
60
60
|
autoload :RegisterSchemaRequest, 'speakeasy_client_sdk/models/operations/registerschema_request.rb'
|
61
61
|
autoload :RegisterSchemaResponse, 'speakeasy_client_sdk/models/operations/registerschema_response.rb'
|
62
|
+
autoload :GetAccessTokenRequest, 'speakeasy_client_sdk/models/operations/getaccesstoken_request.rb'
|
63
|
+
autoload :GetAccessTokenResponse, 'speakeasy_client_sdk/models/operations/getaccesstoken_response.rb'
|
62
64
|
autoload :GetWorkspaceAccessRequest, 'speakeasy_client_sdk/models/operations/getworkspaceaccess_request.rb'
|
63
65
|
autoload :GetWorkspaceAccessResponse, 'speakeasy_client_sdk/models/operations/getworkspaceaccess_response.rb'
|
64
66
|
autoload :ValidateApiKeyResponse, 'speakeasy_client_sdk/models/operations/validateapikey_response.rb'
|
@@ -14,10 +14,13 @@ module SpeakeasyClientSDK
|
|
14
14
|
|
15
15
|
field :generation_allowed, T::Boolean, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('generation_allowed') } }
|
16
16
|
|
17
|
+
field :message, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('message') } }
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
|
20
|
+
sig { params(generation_allowed: T::Boolean, message: ::String).void }
|
21
|
+
def initialize(generation_allowed: nil, message: nil)
|
20
22
|
@generation_allowed = generation_allowed
|
23
|
+
@message = message
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
@@ -0,0 +1,33 @@
|
|
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
|
+
# An AccessToken is a token that can be used to authenticate with the Speakeasy API.
|
11
|
+
class AccessToken < ::SpeakeasyClientSDK::Utils::FieldAugmented
|
12
|
+
extend T::Sig
|
13
|
+
|
14
|
+
|
15
|
+
field :access_token, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('access_token') } }
|
16
|
+
|
17
|
+
field :claims, ::SpeakeasyClientSDK::Shared::Claims, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('claims') } }
|
18
|
+
|
19
|
+
field :user, ::SpeakeasyClientSDK::Shared::User, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('user') } }
|
20
|
+
|
21
|
+
field :workspaces, T.nilable(T::Array[::SpeakeasyClientSDK::Shared::Workspaces]), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('workspaces') } }
|
22
|
+
|
23
|
+
|
24
|
+
sig { params(access_token: ::String, claims: ::SpeakeasyClientSDK::Shared::Claims, user: ::SpeakeasyClientSDK::Shared::User, workspaces: T.nilable(T::Array[::SpeakeasyClientSDK::Shared::Workspaces])).void }
|
25
|
+
def initialize(access_token: nil, claims: nil, user: nil, workspaces: nil)
|
26
|
+
@access_token = access_token
|
27
|
+
@claims = claims
|
28
|
+
@user = user
|
29
|
+
@workspaces = workspaces
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,20 @@
|
|
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
|
+
|
11
|
+
class Claims < ::SpeakeasyClientSDK::Utils::FieldAugmented
|
12
|
+
extend T::Sig
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
def initialize; end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -13,7 +13,7 @@ module SpeakeasyClientSDK
|
|
13
13
|
|
14
14
|
# gen.lock ID (expected to be a uuid). The same as `id`. A unique identifier for the target.
|
15
15
|
field :generate_gen_lock_id, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('generate_gen_lock_id') } }
|
16
|
-
#
|
16
|
+
# eg `typescript`, `terraform`, `python`
|
17
17
|
field :generate_target, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('generate_target') } }
|
18
18
|
# Unique identifier of the target the same as `generate_gen_lock_id`
|
19
19
|
field :id, ::String, { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('id') } }
|
@@ -27,6 +27,8 @@ module SpeakeasyClientSDK
|
|
27
27
|
field :generate_config_post_version, T.nilable(::String), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('generate_config_post_version') } }
|
28
28
|
# Indicates whether the target was considered published.
|
29
29
|
field :generate_published, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('generate_published') } }
|
30
|
+
# The name of the target as defined by the user.
|
31
|
+
field :generate_target_name, T.nilable(::String), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('generate_target_name') } }
|
30
32
|
# The version of the Speakeasy generator for this target eg v2 of the typescript generator.
|
31
33
|
field :generate_target_version, T.nilable(::String), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('generate_target_version') } }
|
32
34
|
# GitHub organization of the action.
|
@@ -55,8 +57,8 @@ module SpeakeasyClientSDK
|
|
55
57
|
field :success, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('success') } }
|
56
58
|
|
57
59
|
|
58
|
-
sig { params(generate_gen_lock_id: ::String, generate_target: ::String, id: ::String, last_event_created_at: ::DateTime, last_event_id: ::String, commit_head: T.nilable(::String), generate_config_post_version: T.nilable(::String), generate_published: T.nilable(T::Boolean), generate_target_version: T.nilable(::String), gh_action_organization: T.nilable(::String), gh_action_repository: T.nilable(::String), gh_action_run_link: T.nilable(::String), gh_action_version: T.nilable(::String), git_relative_cwd: T.nilable(::String), git_remote_default_owner: T.nilable(::String), git_remote_default_repo: T.nilable(::String), git_user_email: T.nilable(::String), git_user_name: T.nilable(::String), hostname: T.nilable(::String), repo_label: T.nilable(::String), success: T.nilable(T::Boolean)).void }
|
59
|
-
def initialize(generate_gen_lock_id: nil, generate_target: nil, id: nil, last_event_created_at: nil, last_event_id: nil, commit_head: nil, generate_config_post_version: nil, generate_published: nil, generate_target_version: nil, gh_action_organization: nil, gh_action_repository: nil, gh_action_run_link: nil, gh_action_version: nil, git_relative_cwd: nil, git_remote_default_owner: nil, git_remote_default_repo: nil, git_user_email: nil, git_user_name: nil, hostname: nil, repo_label: nil, success: nil)
|
60
|
+
sig { params(generate_gen_lock_id: ::String, generate_target: ::String, id: ::String, last_event_created_at: ::DateTime, last_event_id: ::String, commit_head: T.nilable(::String), generate_config_post_version: T.nilable(::String), generate_published: T.nilable(T::Boolean), generate_target_name: T.nilable(::String), generate_target_version: T.nilable(::String), gh_action_organization: T.nilable(::String), gh_action_repository: T.nilable(::String), gh_action_run_link: T.nilable(::String), gh_action_version: T.nilable(::String), git_relative_cwd: T.nilable(::String), git_remote_default_owner: T.nilable(::String), git_remote_default_repo: T.nilable(::String), git_user_email: T.nilable(::String), git_user_name: T.nilable(::String), hostname: T.nilable(::String), repo_label: T.nilable(::String), success: T.nilable(T::Boolean)).void }
|
61
|
+
def initialize(generate_gen_lock_id: nil, generate_target: nil, id: nil, last_event_created_at: nil, last_event_id: nil, commit_head: nil, generate_config_post_version: nil, generate_published: nil, generate_target_name: nil, generate_target_version: nil, gh_action_organization: nil, gh_action_repository: nil, gh_action_run_link: nil, gh_action_version: nil, git_relative_cwd: nil, git_remote_default_owner: nil, git_remote_default_repo: nil, git_user_email: nil, git_user_name: nil, hostname: nil, repo_label: nil, success: nil)
|
60
62
|
@generate_gen_lock_id = generate_gen_lock_id
|
61
63
|
@generate_target = generate_target
|
62
64
|
@id = id
|
@@ -65,6 +67,7 @@ module SpeakeasyClientSDK
|
|
65
67
|
@commit_head = commit_head
|
66
68
|
@generate_config_post_version = generate_config_post_version
|
67
69
|
@generate_published = generate_published
|
70
|
+
@generate_target_name = generate_target_name
|
68
71
|
@generate_target_version = generate_target_version
|
69
72
|
@gh_action_organization = gh_action_organization
|
70
73
|
@gh_action_repository = gh_action_repository
|
@@ -0,0 +1,39 @@
|
|
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
|
+
|
11
|
+
class User < ::SpeakeasyClientSDK::Utils::FieldAugmented
|
12
|
+
extend T::Sig
|
13
|
+
|
14
|
+
|
15
|
+
field :admin, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('admin') } }
|
16
|
+
|
17
|
+
field :created_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('created_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
|
18
|
+
|
19
|
+
field :display_name, T.nilable(::String), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('display_name') } }
|
20
|
+
|
21
|
+
field :email, T.nilable(::String), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('email') } }
|
22
|
+
|
23
|
+
field :email_verified, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('email_verified') } }
|
24
|
+
|
25
|
+
field :id, T.nilable(::String), { 'format_json': { 'letter_case': ::SpeakeasyClientSDK::Utils.field_name('id') } }
|
26
|
+
|
27
|
+
|
28
|
+
sig { params(admin: T.nilable(T::Boolean), created_at: T.nilable(::DateTime), display_name: T.nilable(::String), email: T.nilable(::String), email_verified: T.nilable(T::Boolean), id: T.nilable(::String)).void }
|
29
|
+
def initialize(admin: nil, created_at: nil, display_name: nil, email: nil, email_verified: nil, id: nil)
|
30
|
+
@admin = admin
|
31
|
+
@created_at = created_at
|
32
|
+
@display_name = display_name
|
33
|
+
@email = email
|
34
|
+
@email_verified = email_verified
|
35
|
+
@id = id
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,20 @@
|
|
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
|
+
|
11
|
+
class Workspaces < ::SpeakeasyClientSDK::Utils::FieldAugmented
|
12
|
+
extend T::Sig
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
def initialize; end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -16,6 +16,10 @@ module SpeakeasyClientSDK
|
|
16
16
|
autoload :Schema, 'speakeasy_client_sdk/models/shared/schema.rb'
|
17
17
|
autoload :ValueChange, 'speakeasy_client_sdk/models/shared/valuechange.rb'
|
18
18
|
autoload :SchemaDiff, 'speakeasy_client_sdk/models/shared/schemadiff.rb'
|
19
|
+
autoload :Claims, 'speakeasy_client_sdk/models/shared/claims.rb'
|
20
|
+
autoload :User, 'speakeasy_client_sdk/models/shared/user.rb'
|
21
|
+
autoload :Workspaces, 'speakeasy_client_sdk/models/shared/workspaces.rb'
|
22
|
+
autoload :AccessToken, 'speakeasy_client_sdk/models/shared/accesstoken.rb'
|
19
23
|
autoload :AccessDetails, 'speakeasy_client_sdk/models/shared/accessdetails.rb'
|
20
24
|
autoload :AccountType, 'speakeasy_client_sdk/models/shared/account_type.rb'
|
21
25
|
autoload :ApiKeyDetails, 'speakeasy_client_sdk/models/shared/apikeydetails.rb'
|
@@ -6,6 +6,7 @@
|
|
6
6
|
require 'faraday'
|
7
7
|
require 'faraday/multipart'
|
8
8
|
require 'sorbet-runtime'
|
9
|
+
|
9
10
|
module SpeakeasyClientSDK
|
10
11
|
extend T::Sig
|
11
12
|
|
@@ -14,13 +15,11 @@ module SpeakeasyClientSDK
|
|
14
15
|
|
15
16
|
attr_accessor :apis, :api_endpoints, :metadata, :schemas, :auth, :requests, :embeds, :events
|
16
17
|
|
17
|
-
attr_accessor :security, :language, :sdk_version, :gen_version
|
18
|
-
|
19
18
|
sig do
|
20
19
|
params(client: Faraday::Request,
|
21
20
|
security: T.nilable(Shared::Security),
|
22
21
|
workspace_id: ::String,
|
23
|
-
server:
|
22
|
+
server: T.nilable(Symbol),
|
24
23
|
server_url: String,
|
25
24
|
url_params: T::Hash[Symbol, String]).void
|
26
25
|
end
|
@@ -35,9 +34,9 @@ module SpeakeasyClientSDK
|
|
35
34
|
# @param [Faraday::Request] client The faraday HTTP client to use for all operations
|
36
35
|
# @param [Shared::Security] security The security details required for authentication
|
37
36
|
# @param [::String] workspace_id: Configures the workspace_id parameter for all supported operations
|
38
|
-
# @param [
|
39
|
-
# @param [String] server_url The server URL to use for all operations
|
40
|
-
# @param [Hash
|
37
|
+
# @param [::Symbol] server The server identifier to use for all operations
|
38
|
+
# @param [::String] server_url The server URL to use for all operations
|
39
|
+
# @param [::Hash<::Symbol, ::String>] url_params Parameters to optionally template the server URL with
|
41
40
|
|
42
41
|
if client.nil?
|
43
42
|
client = Faraday.new(request: {
|
@@ -53,9 +52,7 @@ module SpeakeasyClientSDK
|
|
53
52
|
server_url = Utils.template_url(server_url, url_params)
|
54
53
|
end
|
55
54
|
end
|
56
|
-
server = SERVER_PROD if server.nil?
|
57
55
|
|
58
|
-
|
59
56
|
globals = {
|
60
57
|
'parameters': {
|
61
58
|
'queryParam': {
|
@@ -70,25 +67,21 @@ module SpeakeasyClientSDK
|
|
70
67
|
init_sdks
|
71
68
|
end
|
72
69
|
|
73
|
-
sig { params(
|
74
|
-
def config_server_url(
|
75
|
-
|
76
|
-
@server_url = Utils.template_url(@server_url, params)
|
77
|
-
end
|
70
|
+
sig { params(server_url: String).void }
|
71
|
+
def config_server_url(server_url)
|
72
|
+
@sdk_configuration.server_url = server_url
|
78
73
|
init_sdks
|
79
74
|
end
|
80
75
|
|
81
|
-
sig { params(server:
|
82
|
-
def config_server(
|
83
|
-
raise StandardError,
|
84
|
-
|
85
|
-
config_server_url(params)
|
76
|
+
sig { params(server: Symbol).void }
|
77
|
+
def config_server(server)
|
78
|
+
raise StandardError, "Invalid server \"#{server}\"" if !SERVERS.key?(server)
|
79
|
+
@sdk_configuration.server = server
|
86
80
|
init_sdks
|
87
81
|
end
|
88
82
|
|
89
83
|
sig { params(security: ::SpeakeasyClientSDK::Shared::Security).void }
|
90
84
|
def config_security(security)
|
91
|
-
@security = security
|
92
85
|
@sdk_configuration.security = security
|
93
86
|
end
|
94
87
|
|
@@ -10,20 +10,19 @@ require 'sorbet-runtime'
|
|
10
10
|
module SpeakeasyClientSDK
|
11
11
|
extend T::Sig
|
12
12
|
|
13
|
-
|
14
|
-
SERVER_PROD = 'prod'
|
13
|
+
SERVER_PROD = :prod
|
15
14
|
SERVERS = {
|
16
|
-
|
15
|
+
prod: 'https://api.prod.speakeasyapi.dev',
|
17
16
|
}.freeze
|
18
17
|
# Contains the list of servers available to the SDK
|
19
18
|
|
20
|
-
|
21
19
|
class SDKConfiguration < ::SpeakeasyClientSDK::Utils::FieldAugmented
|
22
20
|
extend T::Sig
|
23
21
|
|
24
22
|
field :client, T.nilable(Faraday::Connection)
|
25
|
-
field :security, Shared::Security
|
23
|
+
field :security, T.nilable(::SpeakeasyClientSDK::Shared::Security)
|
26
24
|
field :server_url, T.nilable(String)
|
25
|
+
field :server, Symbol
|
27
26
|
field :globals, Hash[Symbol, Hash[Symbol, Hash[Symbol, Object]]]
|
28
27
|
field :language, String
|
29
28
|
field :openapi_doc_version, String
|
@@ -32,25 +31,24 @@ module SpeakeasyClientSDK
|
|
32
31
|
field :user_agent, String
|
33
32
|
|
34
33
|
|
35
|
-
sig { params(client: Faraday::Connection, security: T.nilable(Shared::Security), server_url: T.nilable(String),
|
36
|
-
def initialize(client, security, server_url,
|
34
|
+
sig { params(client: Faraday::Connection, security: T.nilable(::SpeakeasyClientSDK::Shared::Security), server_url: T.nilable(String), server: T.nilable(Symbol), globals: T::Hash[Symbol, T::Hash[Symbol, T::Hash[Symbol, Object]]]).void }
|
35
|
+
def initialize(client, security, server_url, server, globals)
|
37
36
|
@client = client
|
38
37
|
@server_url = server_url
|
39
|
-
@server =
|
38
|
+
@server = server.nil? ? SERVER_PROD : server
|
39
|
+
raise StandardError, "Invalid server \"#{server}\"" if !SERVERS.key?(@server)
|
40
40
|
@security = security
|
41
41
|
@globals = globals.nil? ? {} : globals
|
42
42
|
@language = 'ruby'
|
43
43
|
@openapi_doc_version = '0.4.0'
|
44
|
-
@sdk_version = '4.0.
|
45
|
-
@gen_version = '2.
|
46
|
-
@user_agent = 'speakeasy-sdk/ruby 4.0.
|
44
|
+
@sdk_version = '4.0.10'
|
45
|
+
@gen_version = '2.275.4'
|
46
|
+
@user_agent = 'speakeasy-sdk/ruby 4.0.10 2.275.4 0.4.0 speakeasy_client_sdk_ruby'
|
47
47
|
end
|
48
48
|
|
49
49
|
sig { returns([String, T::Hash[Symbol, String]]) }
|
50
50
|
def get_server_details
|
51
51
|
return [@server_url.delete_suffix('/'), {}] if !@server_url.nil?
|
52
|
-
@server = SERVER_PROD if @server.nil?
|
53
|
-
|
54
52
|
[SERVERS[@server], {}]
|
55
53
|
end
|
56
54
|
end
|
@@ -3,12 +3,8 @@
|
|
3
3
|
# typed: true
|
4
4
|
# frozen_string_literal: true
|
5
5
|
|
6
|
-
require_relative 'speakeasy_client_sdk/utils/t'
|
7
|
-
require_relative 'speakeasy_client_sdk/utils/utils'
|
8
|
-
require_relative 'speakeasy_client_sdk/utils/metadata_fields'
|
9
6
|
module SpeakeasyClientSDK
|
10
7
|
autoload :SDK, 'speakeasy_client_sdk/sdk'
|
11
|
-
autoload :SDKConfiguration, 'speakeasy_client_sdk/sdkconfiguration'
|
12
8
|
autoload :Shared, 'speakeasy_client_sdk/models/shared'
|
13
9
|
autoload :Operations, 'speakeasy_client_sdk/models/operations'
|
14
10
|
autoload :Apis, 'speakeasy_client_sdk/apis'
|
@@ -20,3 +16,8 @@ module SpeakeasyClientSDK
|
|
20
16
|
autoload :Embeds, 'speakeasy_client_sdk/embeds'
|
21
17
|
autoload :Events, 'speakeasy_client_sdk/events'
|
22
18
|
end
|
19
|
+
|
20
|
+
require_relative 'speakeasy_client_sdk/utils/t'
|
21
|
+
require_relative 'speakeasy_client_sdk/utils/utils'
|
22
|
+
require_relative 'speakeasy_client_sdk/utils/metadata_fields'
|
23
|
+
require_relative 'speakeasy_client_sdk/sdkconfiguration'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speakeasy_client_sdk_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Speakeasy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -174,6 +174,8 @@ files:
|
|
174
174
|
- lib/speakeasy_client_sdk/models/operations/generatepostmancollectionforapiendpoint_response.rb
|
175
175
|
- lib/speakeasy_client_sdk/models/operations/generaterequestpostmancollection_request.rb
|
176
176
|
- lib/speakeasy_client_sdk/models/operations/generaterequestpostmancollection_response.rb
|
177
|
+
- lib/speakeasy_client_sdk/models/operations/getaccesstoken_request.rb
|
178
|
+
- lib/speakeasy_client_sdk/models/operations/getaccesstoken_response.rb
|
177
179
|
- lib/speakeasy_client_sdk/models/operations/getallapiendpoints_request.rb
|
178
180
|
- lib/speakeasy_client_sdk/models/operations/getallapiendpoints_response.rb
|
179
181
|
- lib/speakeasy_client_sdk/models/operations/getallapiversions_request.rb
|
@@ -225,6 +227,7 @@ files:
|
|
225
227
|
- lib/speakeasy_client_sdk/models/operations/validateapikey_response.rb
|
226
228
|
- lib/speakeasy_client_sdk/models/shared.rb
|
227
229
|
- lib/speakeasy_client_sdk/models/shared/accessdetails.rb
|
230
|
+
- lib/speakeasy_client_sdk/models/shared/accesstoken.rb
|
228
231
|
- lib/speakeasy_client_sdk/models/shared/account_type.rb
|
229
232
|
- lib/speakeasy_client_sdk/models/shared/api.rb
|
230
233
|
- lib/speakeasy_client_sdk/models/shared/api_input.rb
|
@@ -232,6 +235,7 @@ files:
|
|
232
235
|
- lib/speakeasy_client_sdk/models/shared/apiendpoint_input.rb
|
233
236
|
- lib/speakeasy_client_sdk/models/shared/apikeydetails.rb
|
234
237
|
- lib/speakeasy_client_sdk/models/shared/boundedrequest.rb
|
238
|
+
- lib/speakeasy_client_sdk/models/shared/claims.rb
|
235
239
|
- lib/speakeasy_client_sdk/models/shared/clievent.rb
|
236
240
|
- lib/speakeasy_client_sdk/models/shared/embedaccesstokenresponse.rb
|
237
241
|
- lib/speakeasy_client_sdk/models/shared/embedtoken.rb
|
@@ -247,9 +251,11 @@ files:
|
|
247
251
|
- lib/speakeasy_client_sdk/models/shared/security.rb
|
248
252
|
- lib/speakeasy_client_sdk/models/shared/targetsdk.rb
|
249
253
|
- lib/speakeasy_client_sdk/models/shared/unboundedrequest.rb
|
254
|
+
- lib/speakeasy_client_sdk/models/shared/user.rb
|
250
255
|
- lib/speakeasy_client_sdk/models/shared/valuechange.rb
|
251
256
|
- lib/speakeasy_client_sdk/models/shared/versionmetadata.rb
|
252
257
|
- lib/speakeasy_client_sdk/models/shared/versionmetadata_input.rb
|
258
|
+
- lib/speakeasy_client_sdk/models/shared/workspaces.rb
|
253
259
|
- lib/speakeasy_client_sdk/requests.rb
|
254
260
|
- lib/speakeasy_client_sdk/schemas.rb
|
255
261
|
- lib/speakeasy_client_sdk/sdk.rb
|