Skip to content

Latest commit

 

History

History
376 lines (235 loc) · 17.1 KB

File metadata and controls

376 lines (235 loc) · 17.1 KB

Schemas

Overview

REST APIs for managing Schema entities

Available Operations

delete_schema

Delete a particular schema revision for an Api.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::DeleteSchemaRequest.new(
  api_id: "<value>",
  revision_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.delete_schema(req)

if res.status_code == 200
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::DeleteSchemaRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::DeleteSchemaResponse)

download_schema

Download the latest schema for a particular apiID.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::DownloadSchemaRequest.new(
  api_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.download_schema(req)

if ! res.two_hundred_application_json_schema.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::DownloadSchemaRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::DownloadSchemaResponse)

download_schema_revision

Download a particular schema revision for an Api.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::DownloadSchemaRevisionRequest.new(
  api_id: "<value>",
  revision_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.download_schema_revision(req)

if ! res.two_hundred_application_json_schema.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::DownloadSchemaRevisionRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::DownloadSchemaRevisionResponse)

get_schema

Returns information about the last uploaded schema for a particular API version. This won't include the schema itself, that can be retrieved via the downloadSchema operation.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::GetSchemaRequest.new(
  api_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.get_schema(req)

if ! res.schema.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::GetSchemaRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaResponse)

get_schema_diff

Get a diff of two schema revisions for an Api.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::GetSchemaDiffRequest.new(
  api_id: "<value>",
  base_revision_id: "<value>",
  target_revision_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.get_schema_diff(req)

if ! res.schema_diff.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::GetSchemaDiffRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaDiffResponse)

get_schema_revision

Returns information about the last uploaded schema for a particular schema revision. This won't include the schema itself, that can be retrieved via the downloadSchema operation.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::GetSchemaRevisionRequest.new(
  api_id: "<value>",
  revision_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.get_schema_revision(req)

if ! res.schema.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::GetSchemaRevisionRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::GetSchemaRevisionResponse)

get_schemas

Returns information the schemas associated with a particular apiID. This won't include the schemas themselves, they can be retrieved via the downloadSchema operation.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::GetSchemasRequest.new(
  api_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.get_schemas(req)

if ! res.classes.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::GetSchemasRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::GetSchemasResponse)

register_schema

Allows uploading a schema for a particular API version. This will be used to populate ApiEndpoints and used as a base for any schema generation if present.

Example Usage

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::RegisterSchemaRequest.new(
  request_body: ::SpeakeasyClientSDK::Operations::RegisterSchemaRequestBody.new(
    file: ::SpeakeasyClientSDK::Operations::RegisterSchemaFile.new(
      content: "0xCAFCA03e0e".encode(),
      file_name: "your_file_here",
    ),
  ),
  api_id: "<value>",
  version_id: "<value>",
)
    
res = s.schemas.register_schema(req)

if res.status_code == 200
  # handle response
end

Parameters

Parameter Type Required Description
request ::SpeakeasyClientSDK::Operations::RegisterSchemaRequest ✔️ The request object to use for the request.

Response

T.nilable(::SpeakeasyClientSDK::Operations::RegisterSchemaResponse)