speakeasy_client_sdk_ruby 4.0.4 → 4.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44a858b1211d85cbf93e6ea1d3d1ade3324685bfdffbd47a61280417fa251d07
4
- data.tar.gz: 179e08d1bb3f6de3d68181d8d68a57e9d315851af0c26e21c050f5b62757fdc6
3
+ metadata.gz: 2e07d745f43fb772387d21197644f1ee5fe0e7e6b676b4129fd5be2db622fd81
4
+ data.tar.gz: a3d5ded5488fed665588ed7e833fa0b340c165b09e94864fb68087520c61bef1
5
5
  SHA512:
6
- metadata.gz: 34c65d514707101e3cb1bd21f8fd9e89d1f54bcb9e8e4f15a2efc9232a71c301a9f5e69a89e4bf756710b6850b9fde8eb506e692ac0fe2ee0c539a14eb84dd94
7
- data.tar.gz: 12e1c3c98dbf565930a898405c1ab4e3f48e38e511d654a71d195cb82ce01e1da0029e30fb9493d8ef3841d30d661f72dafc3265831cc423e08de7ecabf6d4d2
6
+ metadata.gz: 33dcdcd58bfd8d10be5626e3823078f2a7e95390c078ede84081eafc4c9ce3b337c946cccb50ebb9f7457ba8e528d2320030b4d549776e06618a1f1866806963
7
+ data.tar.gz: be08182f5bc031896ffbb075c923ae4a75356b36e00e1b90fba79f81d4f2b8d66695e11a99e6a3bcbf11cd11daf413991b381a2786dd52194bf8b3f437231374
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteApiEndpointRequest)).returns(Utils::FieldAugmented) }
22
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteApiEndpointRequest)).returns(::SpeakeasyClientSDK::Operations::DeleteApiEndpointResponse) }
23
23
  def delete_api_endpoint(request)
24
24
  # delete_api_endpoint - Delete an ApiEndpoint.
25
25
  # Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore).
@@ -58,7 +58,7 @@ module SpeakeasyClientSDK
58
58
  end
59
59
 
60
60
 
61
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::FindApiEndpointRequest)).returns(Utils::FieldAugmented) }
61
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::FindApiEndpointRequest)).returns(::SpeakeasyClientSDK::Operations::FindApiEndpointResponse) }
62
62
  def find_api_endpoint(request)
63
63
  # find_api_endpoint - Find an ApiEndpoint via its displayName.
64
64
  # Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema).
@@ -102,7 +102,7 @@ module SpeakeasyClientSDK
102
102
  end
103
103
 
104
104
 
105
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GenerateOpenApiSpecForApiEndpointRequest)).returns(Utils::FieldAugmented) }
105
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GenerateOpenApiSpecForApiEndpointRequest)).returns(::SpeakeasyClientSDK::Operations::GenerateOpenApiSpecForApiEndpointResponse) }
106
106
  def generate_open_api_spec_for_api_endpoint(request)
107
107
  # generate_open_api_spec_for_api_endpoint - Generate an OpenAPI specification for a particular ApiEndpoint.
108
108
  # This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document.
@@ -146,7 +146,7 @@ module SpeakeasyClientSDK
146
146
  end
147
147
 
148
148
 
149
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GeneratePostmanCollectionForApiEndpointRequest)).returns(Utils::FieldAugmented) }
149
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GeneratePostmanCollectionForApiEndpointRequest)).returns(::SpeakeasyClientSDK::Operations::GeneratePostmanCollectionForApiEndpointResponse) }
150
150
  def generate_postman_collection_for_api_endpoint(request)
151
151
  # generate_postman_collection_for_api_endpoint - Generate a Postman collection for a particular ApiEndpoint.
152
152
  # Generates a postman collection that allows the endpoint to be called from postman variables produced for any path/query/header parameters included in the OpenAPI document.
@@ -187,7 +187,7 @@ module SpeakeasyClientSDK
187
187
  end
188
188
 
189
189
 
190
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetAllApiEndpointsRequest)).returns(Utils::FieldAugmented) }
190
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetAllApiEndpointsRequest)).returns(::SpeakeasyClientSDK::Operations::GetAllApiEndpointsResponse) }
191
191
  def get_all_api_endpoints(request)
192
192
  # get_all_api_endpoints - Get all Api endpoints for a particular apiID.
193
193
  url, params = @sdk_configuration.get_server_details
@@ -229,7 +229,7 @@ module SpeakeasyClientSDK
229
229
  end
230
230
 
231
231
 
232
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetAllForVersionApiEndpointsRequest)).returns(Utils::FieldAugmented) }
232
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetAllForVersionApiEndpointsRequest)).returns(::SpeakeasyClientSDK::Operations::GetAllForVersionApiEndpointsResponse) }
233
233
  def get_all_for_version_api_endpoints(request)
234
234
  # get_all_for_version_api_endpoints - Get all ApiEndpoints for a particular apiID and versionID.
235
235
  url, params = @sdk_configuration.get_server_details
@@ -271,7 +271,7 @@ module SpeakeasyClientSDK
271
271
  end
272
272
 
273
273
 
274
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetApiEndpointRequest)).returns(Utils::FieldAugmented) }
274
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetApiEndpointRequest)).returns(::SpeakeasyClientSDK::Operations::GetApiEndpointResponse) }
275
275
  def get_api_endpoint(request)
276
276
  # get_api_endpoint - Get an ApiEndpoint.
277
277
  url, params = @sdk_configuration.get_server_details
@@ -313,7 +313,7 @@ module SpeakeasyClientSDK
313
313
  end
314
314
 
315
315
 
316
- sig { params(request: ::SpeakeasyClientSDK::Operations::UpsertApiEndpointRequest).returns(Utils::FieldAugmented) }
316
+ sig { params(request: ::SpeakeasyClientSDK::Operations::UpsertApiEndpointRequest).returns(::SpeakeasyClientSDK::Operations::UpsertApiEndpointResponse) }
317
317
  def upsert_api_endpoint(request)
318
318
  # upsert_api_endpoint - Upsert an ApiEndpoint.
319
319
  # Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated.
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteApiRequest)).returns(Utils::FieldAugmented) }
22
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteApiRequest)).returns(::SpeakeasyClientSDK::Operations::DeleteApiResponse) }
23
23
  def delete_api(request)
24
24
  # delete_api - Delete an Api.
25
25
  # Delete a particular version of an Api. The will also delete all associated ApiEndpoints, Metadata, Schemas & Request Logs (if using a Postgres datastore).
@@ -58,7 +58,7 @@ module SpeakeasyClientSDK
58
58
  end
59
59
 
60
60
 
61
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GenerateOpenApiSpecRequest)).returns(Utils::FieldAugmented) }
61
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GenerateOpenApiSpecRequest)).returns(::SpeakeasyClientSDK::Operations::GenerateOpenApiSpecResponse) }
62
62
  def generate_open_api_spec(request)
63
63
  # generate_open_api_spec - Generate an OpenAPI specification for a particular Api.
64
64
  # This endpoint will generate any missing operations in any registered OpenAPI document if the operation does not already exist in the document.
@@ -102,7 +102,7 @@ module SpeakeasyClientSDK
102
102
  end
103
103
 
104
104
 
105
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GeneratePostmanCollectionRequest)).returns(Utils::FieldAugmented) }
105
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GeneratePostmanCollectionRequest)).returns(::SpeakeasyClientSDK::Operations::GeneratePostmanCollectionResponse) }
106
106
  def generate_postman_collection(request)
107
107
  # generate_postman_collection - Generate a Postman collection for a particular Api.
108
108
  # Generates a postman collection containing all endpoints for a particular API. Includes variables produced for any path/query/header parameters included in the OpenAPI document.
@@ -143,7 +143,7 @@ module SpeakeasyClientSDK
143
143
  end
144
144
 
145
145
 
146
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetAllApiVersionsRequest)).returns(Utils::FieldAugmented) }
146
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetAllApiVersionsRequest)).returns(::SpeakeasyClientSDK::Operations::GetAllApiVersionsResponse) }
147
147
  def get_all_api_versions(request)
148
148
  # get_all_api_versions - Get all Api versions for a particular ApiEndpoint.
149
149
  # Get all Api versions for a particular ApiEndpoint.
@@ -189,7 +189,7 @@ module SpeakeasyClientSDK
189
189
  end
190
190
 
191
191
 
192
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetApisRequest)).returns(Utils::FieldAugmented) }
192
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetApisRequest)).returns(::SpeakeasyClientSDK::Operations::GetApisResponse) }
193
193
  def get_apis(request)
194
194
  # get_apis - Get a list of Apis for a given workspace
195
195
  # Get a list of all Apis and their versions for a given workspace.
@@ -229,7 +229,7 @@ module SpeakeasyClientSDK
229
229
  end
230
230
 
231
231
 
232
- sig { params(request: ::SpeakeasyClientSDK::Operations::UpsertApiRequest).returns(Utils::FieldAugmented) }
232
+ sig { params(request: ::SpeakeasyClientSDK::Operations::UpsertApiRequest).returns(::SpeakeasyClientSDK::Operations::UpsertApiResponse) }
233
233
  def upsert_api(request)
234
234
  # upsert_api - Upsert an Api
235
235
  # Upsert an Api. If the Api does not exist, it will be created.
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetWorkspaceAccessRequest)).returns(Utils::FieldAugmented) }
22
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetWorkspaceAccessRequest)).returns(::SpeakeasyClientSDK::Operations::GetWorkspaceAccessResponse) }
23
23
  def get_workspace_access(request)
24
24
  # get_workspace_access - Get access allowances for a particular workspace
25
25
  # Checks if generation is permitted for a particular run of the CLI
@@ -57,7 +57,7 @@ module SpeakeasyClientSDK
57
57
  end
58
58
 
59
59
 
60
- sig { returns(::SpeakeasyClientSDK::Utils::FieldAugmented) }
60
+ sig { returns(::SpeakeasyClientSDK::Operations::ValidateApiKeyResponse) }
61
61
  def validate_api_key
62
62
  # validate_api_key - Validate the current api key.
63
63
  url, params = @sdk_configuration.get_server_details
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetEmbedAccessTokenRequest)).returns(Utils::FieldAugmented) }
22
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetEmbedAccessTokenRequest)).returns(::SpeakeasyClientSDK::Operations::GetEmbedAccessTokenResponse) }
23
23
  def get_embed_access_token(request)
24
24
  # get_embed_access_token - Get an embed access token for the current workspace.
25
25
  # Returns an embed access token for the current workspace. This can be used to authenticate access to externally embedded content.
@@ -59,7 +59,7 @@ module SpeakeasyClientSDK
59
59
  end
60
60
 
61
61
 
62
- sig { returns(::SpeakeasyClientSDK::Utils::FieldAugmented) }
62
+ sig { returns(::SpeakeasyClientSDK::Operations::GetValidEmbedAccessTokensResponse) }
63
63
  def get_valid_embed_access_tokens
64
64
  # get_valid_embed_access_tokens - Get all valid embed access tokens for the current workspace.
65
65
  url, params = @sdk_configuration.get_server_details
@@ -95,7 +95,7 @@ module SpeakeasyClientSDK
95
95
  end
96
96
 
97
97
 
98
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::RevokeEmbedAccessTokenRequest)).returns(Utils::FieldAugmented) }
98
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::RevokeEmbedAccessTokenRequest)).returns(::SpeakeasyClientSDK::Operations::RevokeEmbedAccessTokenResponse) }
99
99
  def revoke_embed_access_token(request)
100
100
  # revoke_embed_access_token - Revoke an embed access EmbedToken.
101
101
  url, params = @sdk_configuration.get_server_details
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: ::SpeakeasyClientSDK::Operations::PostWorkspaceEventsRequest).returns(Utils::FieldAugmented) }
22
+ sig { params(request: ::SpeakeasyClientSDK::Operations::PostWorkspaceEventsRequest).returns(::SpeakeasyClientSDK::Operations::PostWorkspaceEventsResponse) }
23
23
  def post_workspace_events(request)
24
24
  # post_workspace_events - Post events for a specific workspace
25
25
  # Sends an array of events to be stored for a particular workspace.
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteVersionMetadataRequest)).returns(Utils::FieldAugmented) }
22
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteVersionMetadataRequest)).returns(::SpeakeasyClientSDK::Operations::DeleteVersionMetadataResponse) }
23
23
  def delete_version_metadata(request)
24
24
  # delete_version_metadata - Delete metadata for a particular apiID and versionID.
25
25
  url, params = @sdk_configuration.get_server_details
@@ -57,7 +57,7 @@ module SpeakeasyClientSDK
57
57
  end
58
58
 
59
59
 
60
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetVersionMetadataRequest)).returns(Utils::FieldAugmented) }
60
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetVersionMetadataRequest)).returns(::SpeakeasyClientSDK::Operations::GetVersionMetadataResponse) }
61
61
  def get_version_metadata(request)
62
62
  # get_version_metadata - Get all metadata for a particular apiID and versionID.
63
63
  url, params = @sdk_configuration.get_server_details
@@ -99,7 +99,7 @@ module SpeakeasyClientSDK
99
99
  end
100
100
 
101
101
 
102
- sig { params(request: ::SpeakeasyClientSDK::Operations::InsertVersionMetadataRequest).returns(Utils::FieldAugmented) }
102
+ sig { params(request: ::SpeakeasyClientSDK::Operations::InsertVersionMetadataRequest).returns(::SpeakeasyClientSDK::Operations::InsertVersionMetadataResponse) }
103
103
  def insert_version_metadata(request)
104
104
  # insert_version_metadata - Insert metadata for a particular apiID and versionID.
105
105
  url, params = @sdk_configuration.get_server_details
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GenerateRequestPostmanCollectionRequest)).returns(Utils::FieldAugmented) }
22
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GenerateRequestPostmanCollectionRequest)).returns(::SpeakeasyClientSDK::Operations::GenerateRequestPostmanCollectionResponse) }
23
23
  def generate_request_postman_collection(request)
24
24
  # generate_request_postman_collection - Generate a Postman collection for a particular request.
25
25
  # Generates a Postman collection for a particular request.
@@ -61,7 +61,7 @@ module SpeakeasyClientSDK
61
61
  end
62
62
 
63
63
 
64
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetRequestFromEventLogRequest)).returns(Utils::FieldAugmented) }
64
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetRequestFromEventLogRequest)).returns(::SpeakeasyClientSDK::Operations::GetRequestFromEventLogResponse) }
65
65
  def get_request_from_event_log(request)
66
66
  # get_request_from_event_log - Get information about a particular request.
67
67
  url, params = @sdk_configuration.get_server_details
@@ -103,7 +103,7 @@ module SpeakeasyClientSDK
103
103
  end
104
104
 
105
105
 
106
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::QueryEventLogRequest)).returns(Utils::FieldAugmented) }
106
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::QueryEventLogRequest)).returns(::SpeakeasyClientSDK::Operations::QueryEventLogResponse) }
107
107
  def query_event_log(request)
108
108
  # query_event_log - Query the event log to retrieve a list of requests.
109
109
  # Supports retrieving a list of request captured by the SDK for this workspace.
@@ -19,7 +19,7 @@ module SpeakeasyClientSDK
19
19
  end
20
20
 
21
21
 
22
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteSchemaRequest)).returns(Utils::FieldAugmented) }
22
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DeleteSchemaRequest)).returns(::SpeakeasyClientSDK::Operations::DeleteSchemaResponse) }
23
23
  def delete_schema(request)
24
24
  # delete_schema - Delete a particular schema revision for an Api.
25
25
  url, params = @sdk_configuration.get_server_details
@@ -57,7 +57,7 @@ module SpeakeasyClientSDK
57
57
  end
58
58
 
59
59
 
60
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DownloadSchemaRequest)).returns(Utils::FieldAugmented) }
60
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DownloadSchemaRequest)).returns(::SpeakeasyClientSDK::Operations::DownloadSchemaResponse) }
61
61
  def download_schema(request)
62
62
  # download_schema - Download the latest schema for a particular apiID.
63
63
  url, params = @sdk_configuration.get_server_details
@@ -99,7 +99,7 @@ module SpeakeasyClientSDK
99
99
  end
100
100
 
101
101
 
102
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DownloadSchemaRevisionRequest)).returns(Utils::FieldAugmented) }
102
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::DownloadSchemaRevisionRequest)).returns(::SpeakeasyClientSDK::Operations::DownloadSchemaRevisionResponse) }
103
103
  def download_schema_revision(request)
104
104
  # download_schema_revision - Download a particular schema revision for an Api.
105
105
  url, params = @sdk_configuration.get_server_details
@@ -141,7 +141,7 @@ module SpeakeasyClientSDK
141
141
  end
142
142
 
143
143
 
144
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaRequest)).returns(Utils::FieldAugmented) }
144
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaRequest)).returns(::SpeakeasyClientSDK::Operations::GetSchemaResponse) }
145
145
  def get_schema(request)
146
146
  # get_schema - Get information about the latest schema.
147
147
  # Returns information about the last uploaded schema for a particular API version.
@@ -185,7 +185,7 @@ module SpeakeasyClientSDK
185
185
  end
186
186
 
187
187
 
188
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaDiffRequest)).returns(Utils::FieldAugmented) }
188
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaDiffRequest)).returns(::SpeakeasyClientSDK::Operations::GetSchemaDiffResponse) }
189
189
  def get_schema_diff(request)
190
190
  # get_schema_diff - Get a diff of two schema revisions for an Api.
191
191
  url, params = @sdk_configuration.get_server_details
@@ -227,7 +227,7 @@ module SpeakeasyClientSDK
227
227
  end
228
228
 
229
229
 
230
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaRevisionRequest)).returns(Utils::FieldAugmented) }
230
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaRevisionRequest)).returns(::SpeakeasyClientSDK::Operations::GetSchemaRevisionResponse) }
231
231
  def get_schema_revision(request)
232
232
  # get_schema_revision - Get information about a particular schema revision for an Api.
233
233
  # Returns information about the last uploaded schema for a particular schema revision.
@@ -271,7 +271,7 @@ module SpeakeasyClientSDK
271
271
  end
272
272
 
273
273
 
274
- sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemasRequest)).returns(Utils::FieldAugmented) }
274
+ sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetSchemasRequest)).returns(::SpeakeasyClientSDK::Operations::GetSchemasResponse) }
275
275
  def get_schemas(request)
276
276
  # get_schemas - Get information about all schemas associated with a particular apiID.
277
277
  # Returns information the schemas associated with a particular apiID.
@@ -315,7 +315,7 @@ module SpeakeasyClientSDK
315
315
  end
316
316
 
317
317
 
318
- sig { params(request: ::SpeakeasyClientSDK::Operations::RegisterSchemaRequest).returns(Utils::FieldAugmented) }
318
+ sig { params(request: ::SpeakeasyClientSDK::Operations::RegisterSchemaRequest).returns(::SpeakeasyClientSDK::Operations::RegisterSchemaResponse) }
319
319
  def register_schema(request)
320
320
  # register_schema - Register a schema.
321
321
  # Allows uploading a schema for a particular API version.
@@ -41,9 +41,9 @@ module SpeakeasyClientSDK
41
41
  @globals = globals.nil? ? {} : globals
42
42
  @language = 'ruby'
43
43
  @openapi_doc_version = '0.4.0'
44
- @sdk_version = '4.0.4'
45
- @gen_version = '2.262.2'
46
- @user_agent = 'speakeasy-sdk/ruby 4.0.4 2.262.2 0.4.0 speakeasy_client_sdk_ruby'
44
+ @sdk_version = '4.0.5'
45
+ @gen_version = '2.263.3'
46
+ @user_agent = 'speakeasy-sdk/ruby 4.0.5 2.263.3 0.4.0 speakeasy_client_sdk_ruby'
47
47
  end
48
48
 
49
49
  sig { returns([String, T::Hash[Symbol, String]]) }
@@ -62,28 +62,24 @@ module SpeakeasyClientSDK
62
62
  end
63
63
  fields.each do |field|
64
64
  field_type = field.type
65
- if field.type.respond_to?(:types) && field.type.types.length == 2
66
- type2 = field.type.types[1]
67
- if type2.raw_type == NilClass
68
- field_type = field.type.types[0]
69
- field_type = field_type.raw_type if field_type.respond_to? :raw_type
70
- end
65
+ if T.nilable? field_type
66
+ field_type = T.nilable_of(field_type)
71
67
  end
72
68
 
73
-
74
69
  key = "#{field.name}="
75
70
  lookup = field.metadata.fetch(:format_json, {}).fetch(:letter_case, nil).call
76
71
  value = d[lookup]
77
72
  next if value.nil?
78
73
 
79
- if field_type.to_s.start_with? 'T::Array'
80
- inner_type = field_type.type.raw_type
74
+ if T.arr? field_type
75
+ inner_type = T.arr_of(field_type)
81
76
  unmarshalled_array = value.map { |f| unmarshal_single(inner_type, f) }
82
77
  to_build.send(key, unmarshalled_array)
83
- elsif field_type.to_s.start_with? 'T::Hash'
84
- _, val_type = field_type.type.types
78
+ elsif T.hash? field_type
79
+ val_type = T.hash_of(field_type)
80
+
85
81
  # rubocop:disable Style/HashTransformValues
86
- unmarshalled_hash = value.map { |k, v| [k, unmarshal_single(val_type.raw_type, v)] }.to_h
82
+ unmarshalled_hash = value.map { |k, v| [k, unmarshal_single(val_type, v)] }.to_h
87
83
  # rubocop:enable Style/HashTransformValues
88
84
  to_build.send(key, unmarshalled_hash)
89
85
  else
@@ -0,0 +1,59 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+ module T
7
+ def self.arr?(t)
8
+ if t.respond_to? :underlying_class
9
+ return t.underlying_class == ::Array
10
+ end
11
+ false
12
+ end
13
+
14
+ def self.arr_of(t)
15
+ get_raw_type(t.type)
16
+ end
17
+
18
+ def self.hash?(t)
19
+ if t.respond_to? :underlying_class
20
+ return t.underlying_class == ::Hash
21
+ end
22
+ false
23
+ end
24
+
25
+ def self.hash_of(t)
26
+ get_raw_type(t.values)
27
+ end
28
+
29
+ def self.nilable?(t)
30
+ t.respond_to? :unwrap_nilable
31
+ end
32
+
33
+ def self.nilable_of(t)
34
+ if t.respond_to? :unwrap_nilable
35
+ return simplify_type t.unwrap_nilable
36
+ end
37
+ nil
38
+ end
39
+
40
+ def self.simplifiable?(t)
41
+ return t.is_a? T::Types::Simple
42
+ end
43
+
44
+ def self.simplify_type(t)
45
+ if t.is_a? T::Types::Simple
46
+ return t.raw_type
47
+ end
48
+ t
49
+ end
50
+
51
+ def self.get_raw_type(t)
52
+ if t.respond_to? :raw_type
53
+ return t.raw_type
54
+ elsif t.respond_to? :raw_a
55
+ return T::Boolean if t.raw_a in [TrueClass, FalseClass]
56
+ end
57
+ t
58
+ end
59
+ end
@@ -742,7 +742,7 @@ module SpeakeasyClientSDK
742
742
  end
743
743
  end
744
744
 
745
- sig { params(data: String, type: Object).returns(Object) }
745
+ sig { params(data: Object, type: Object).returns(Object) }
746
746
  def self.unmarshal_complex(data, type)
747
747
  begin
748
748
  value = unmarshal_json(JSON.parse(data), type)
@@ -754,20 +754,15 @@ module SpeakeasyClientSDK
754
754
 
755
755
  sig { params(data: Object, type: Object).returns(Object) }
756
756
  def self.unmarshal_json(data, type)
757
+ if T.simplifiable? type
758
+ type = T.simplify_type type
759
+ end
757
760
  if type.respond_to? :unmarshal_json
758
761
  type.unmarshal_json(data)
759
- elsif type.to_s.start_with? 'T::Array'
760
- if type.type.respond_to? :raw_type
761
- data.map { |v| Utils.unmarshal_complex(v, type.type.raw_type) }
762
- else
763
- data.map { |v| Utils.unmarshal_complex(v, type.type) }
764
- end
765
- elsif type.to_s.start_with? 'T::Hash'
766
- if type.type.types[1].respond_to? :raw_type
767
- data.transform_values { |v| Utils.unmarshal_complex(v, type.type.types[1].raw_type) }
768
- else
769
- data.transform_values { |v| Utils.unmarshal_complex(v, type.type.types[1]) }
770
- end
762
+ elsif T.arr? type
763
+ data.map { |v| Utils.unmarshal_complex(v, T.arr_of(type)) }
764
+ elsif T.hash? type
765
+ data.transform_values { |v| Utils.unmarshal_complex(v, T.hash_of(type)) }
771
766
  else
772
767
  data
773
768
  end
@@ -3,6 +3,7 @@
3
3
  # typed: true
4
4
  # frozen_string_literal: true
5
5
 
6
+ require_relative 'speakeasy_client_sdk/utils/t'
6
7
  require_relative 'speakeasy_client_sdk/utils/utils'
7
8
  require_relative 'speakeasy_client_sdk/utils/metadata_fields'
8
9
  module SpeakeasyClientSDK
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
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Speakeasy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-17 00:00:00.000000000 Z
11
+ date: 2024-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -250,6 +250,7 @@ files:
250
250
  - lib/speakeasy_client_sdk/sdk.rb
251
251
  - lib/speakeasy_client_sdk/sdkconfiguration.rb
252
252
  - lib/speakeasy_client_sdk/utils/metadata_fields.rb
253
+ - lib/speakeasy_client_sdk/utils/t.rb
253
254
  - lib/speakeasy_client_sdk/utils/utils.rb
254
255
  - lib/speakeasy_client_sdk_ruby.rb
255
256
  homepage: https://github.com/speakeasy-api/speakeasy-client-sdk-ruby.git