REST APIs for managing ApiEndpoint entities
- get_all - Get all ApiEndpoints for a particular apiID and versionID.
- find - Find an ApiEndpoint via its displayName.
- delete - Delete an ApiEndpoint.
- get - Get an ApiEndpoint.
- upsert - Upsert an ApiEndpoint.
- generate_open_api_spec - Generate an OpenAPI specification for a particular ApiEndpoint.
- generate_postman_collection - Generate a Postman collection for a particular ApiEndpoint.
Get all ApiEndpoints for a particular apiID and versionID.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.api_endpoints.get_all(api_id="<id>", version_id="<id>")
if ! res.api_endpoints.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to retrieve ApiEndpoints for. |
version_id |
::String | ✔️ | The version ID of the Api to retrieve ApiEndpoints for. |
T.nilable(::OpenApiSDK::Operations::GetAllForVersionApiEndpointsResponse)
Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema). This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.api_endpoints.find(api_id="<id>", version_id="<id>", display_name="Aliyah.Weimann41")
if ! res.api_endpoint.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api the ApiEndpoint belongs to. |
version_id |
::String | ✔️ | The version ID of the Api the ApiEndpoint belongs to. |
display_name |
::String | ✔️ | The displayName of the ApiEndpoint to find (set by operationId from OpenAPI schema). |
T.nilable(::OpenApiSDK::Operations::FindApiEndpointResponse)
Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore).
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.api_endpoints.delete(api_id="<id>", version_id="<id>", api_endpoint_id="<id>")
if res.status_code == 200
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api the ApiEndpoint belongs to. |
version_id |
::String | ✔️ | The version ID of the Api the ApiEndpoint belongs to. |
api_endpoint_id |
::String | ✔️ | The ID of the ApiEndpoint to delete. |
T.nilable(::OpenApiSDK::Operations::DeleteApiEndpointResponse)
Get an ApiEndpoint.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.api_endpoints.get(api_id="<id>", version_id="<id>", api_endpoint_id="<id>")
if ! res.api_endpoint.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api the ApiEndpoint belongs to. |
version_id |
::String | ✔️ | The version ID of the Api the ApiEndpoint belongs to. |
api_endpoint_id |
::String | ✔️ | The ID of the ApiEndpoint to retrieve. |
T.nilable(::OpenApiSDK::Operations::GetApiEndpointResponse)
Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.api_endpoints.upsert(api_id="<id>", version_id="<id>", api_endpoint_id="<id>", api_endpoint=::OpenApiSDK::Shared::ApiEndpointInput.new(
api_endpoint_id: "<id>",
description: "curiously painfully proliferate awful bump without fly",
display_name: "Dorian_Mertz62",
method: "<value>",
path: "/usr/libexec",
version_id: "<id>",
))
if ! res.api_endpoint.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api the ApiEndpoint belongs to. |
version_id |
::String | ✔️ | The version ID of the Api the ApiEndpoint belongs to. |
api_endpoint_id |
::String | ✔️ | The ID of the ApiEndpoint to upsert. |
api_endpoint |
::OpenApiSDK::Shared::ApiEndpointInput | ✔️ | A JSON representation of the ApiEndpoint to upsert. |
T.nilable(::OpenApiSDK::Operations::UpsertApiEndpointResponse)
This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document. Returns the original document and the newly generated document allowing a diff to be performed to see what has changed.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.api_endpoints.generate_open_api_spec(api_id="<id>", version_id="<id>", api_endpoint_id="<id>")
if ! res.generate_open_api_spec_diff.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to generate an OpenAPI specification for. |
version_id |
::String | ✔️ | The version ID of the Api to generate an OpenAPI specification for. |
api_endpoint_id |
::String | ✔️ | The ID of the ApiEndpoint to generate an OpenAPI specification for. |
T.nilable(::OpenApiSDK::Operations::GenerateOpenApiSpecForApiEndpointResponse)
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.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.api_endpoints.generate_postman_collection(api_id="<id>", version_id="<id>", api_endpoint_id="<id>")
if ! res.postman_collection.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
api_id |
::String | ✔️ | The ID of the Api to generate a Postman collection for. |
version_id |
::String | ✔️ | The version ID of the Api to generate a Postman collection for. |
api_endpoint_id |
::String | ✔️ | The ID of the ApiEndpoint to generate a Postman collection for. |
T.nilable(::OpenApiSDK::Operations::GeneratePostmanCollectionForApiEndpointResponse)