Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate python and typescript SDKs #6

Merged
merged 7 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .konfig/changesets/fancy-kiwis-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
python: major
typescript: minor
---

regenerate sdks
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023- Konfig, Inc. (https://konfigthis.com)
Copyright (c) 2024- Konfig, Inc. (https://konfigthis.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# workflows-sdks

|Language|Version|Package Manager|Documentation|Source|
|Language|Version|Package Manager|README|Source|
|-|-|-|-|-|
|Python|1.0.1|[PyPI](https://pypi.org/project/leap-workflows-python-sdk/1.0.1)|[Documentation](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/python/blob//README.md)|[Source](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/python)|
|TypeScript|1.0.1|[npm](https://www.npmjs.com/package/@leap-ai/workflows/v/1.0.1)|[Documentation](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/typescript/blob//README.md)|[Source](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/typescript)|
|Python|1.0.1|[PyPI](https://pypi.org/project/leap-workflows-python-sdk/1.0.1)|[README](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/python#readme)|[Source](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/python)|
|TypeScript|1.0.1|[npm](https://www.npmjs.com/package/@leap-ai/workflows/v/1.0.1)|[README](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/typescript#readme)|[Source](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/typescript)|
6 changes: 3 additions & 3 deletions STATISTICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

| SDK Name | Lines of Code |
| -------- | ------------- |
| python | 10417 |
| typescript | 4344 |
| **Total** | 14761 |
| python | 11867 |
| typescript | 8370 |
| **Total** | 20237 |
Binary file added header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions konfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ outputDirectory: /tmp/leap-workflows-sdks-out
specRemotePath: https://api.workflows.tryleap.ai/api-json
specPath: api-fixed.json
specInputPath: api.json
readmeHeader:
image: header.png
title: Leap Workflows
url: https://www.tryleap.ai/
portal:
favicon: favicon.jpg
primaryColor: "#008ae6"
Expand All @@ -29,7 +33,6 @@ generators:
projectName: leap-workflows-python-sdk
outputDirectory: sdks/python
clientName: Leap
useAiohttp3_8: true
pypiApiTokenEnvironmentVariable: PYPI_TOKEN_1
git:
userId: leap-ai
Expand All @@ -38,7 +41,6 @@ generators:
version: 1.0.1
npmName: "@leap-ai/workflows"
outputDirectory: sdks/typescript
useAxios0_27_2: true
clientName: Leap
git:
userId: leap-ai
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/.konfig/generate-id.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cfeadf6a-e56f-4946-a89c-2dc1bd4b865b
4f71f80b-914e-45bb-9c44-75bad0032568
1 change: 1 addition & 0 deletions sdks/python/.konfigignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/test_simple.py
9 changes: 9 additions & 0 deletions sdks/python/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"python.testing.pytestArgs": [],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
2 changes: 1 addition & 1 deletion sdks/python/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023- Konfig, Inc. (https://konfigthis.com)
Copyright (c) 2024- Konfig, Inc. (https://konfigthis.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
130 changes: 75 additions & 55 deletions sdks/python/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
# leap-workflows-python-sdk
<div align="center">

[![Visit Leap Workflows](https://raw.githubusercontent.com/leap-ai/workflows-sdks/HEAD/sdks/python/header.png)](https://www.tryleap.ai/)

# Leap Workflows<a id="leap-workflows"></a>

The Leap Workflows API allows developers to run workflows, fetch workflow runs, and provide other utility functions related to workflow runs. Please use the X-Api-Key for authenticated requests.


[![PyPI](https://img.shields.io/badge/PyPI-v1.0.1-blue)](https://pypi.org/project/leap-workflows-python-sdk/1.0.1)
[![GitHub last commit](https://img.shields.io/github/last-commit/leap-ai/workflows-sdks.svg)](https://github.com/leap-ai/workflows-sdks/commits)
[![README.md](https://img.shields.io/badge/README-Click%20Here-green)](https://github.com/leap-ai/workflows-sdks/tree/main/sdks/python#readme)
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://tryleap.ai/)

## Table of Contents
</div>

## Table of Contents<a id="table-of-contents"></a>

<!-- toc -->

- [Requirements](#requirements)
- [Installing](#installing)
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Async](#async)
- [Raw HTTP Response](#raw-http-response)
- [Reference](#reference)
* [`leap.workflow_runs.get_workflow_run`](#leapworkflow_runsget_workflow_run)
* [`leap.workflow_runs.workflow`](#leapworkflow_runsworkflow)

<!-- tocstop -->

## Requirements
## Requirements<a id="requirements"></a>

Python >=3.7

## Installing
## Installation<a id="installation"></a>

```sh
pip install leap-workflows-python-sdk==1.0.1
```

## Getting Started
## Getting Started<a id="getting-started"></a>

```python
from pprint import pprint
Expand All @@ -47,20 +53,7 @@ try:
get_workflow_run_response = leap.workflow_runs.get_workflow_run(
workflow_run_id="rnp_x3p27VQk6MyJfLe",
)
pprint(get_workflow_run_response.body)
pprint(get_workflow_run_response.body["id"])
pprint(get_workflow_run_response.body["version_id"])
pprint(get_workflow_run_response.body["status"])
pprint(get_workflow_run_response.body["created_at"])
pprint(get_workflow_run_response.body["started_at"])
pprint(get_workflow_run_response.body["ended_at"])
pprint(get_workflow_run_response.body["workflow_id"])
pprint(get_workflow_run_response.body["error"])
pprint(get_workflow_run_response.body["input"])
pprint(get_workflow_run_response.body["output"])
pprint(get_workflow_run_response.headers)
pprint(get_workflow_run_response.status)
pprint(get_workflow_run_response.round_trip_time)
print(get_workflow_run_response)
except ApiException as e:
print("Exception when calling WorkflowRunsApi.get_workflow_run: %s\n" % e)
pprint(e.body)
Expand All @@ -70,7 +63,7 @@ except ApiException as e:
pprint(e.round_trip_time)
```

## Async
## Async<a id="async"></a>

`async` support is available by prepending `a` to any method.

Expand All @@ -90,20 +83,7 @@ async def main():
get_workflow_run_response = await leap.workflow_runs.aget_workflow_run(
workflow_run_id="rnp_x3p27VQk6MyJfLe",
)
pprint(get_workflow_run_response.body)
pprint(get_workflow_run_response.body["id"])
pprint(get_workflow_run_response.body["version_id"])
pprint(get_workflow_run_response.body["status"])
pprint(get_workflow_run_response.body["created_at"])
pprint(get_workflow_run_response.body["started_at"])
pprint(get_workflow_run_response.body["ended_at"])
pprint(get_workflow_run_response.body["workflow_id"])
pprint(get_workflow_run_response.body["error"])
pprint(get_workflow_run_response.body["input"])
pprint(get_workflow_run_response.body["output"])
pprint(get_workflow_run_response.headers)
pprint(get_workflow_run_response.status)
pprint(get_workflow_run_response.round_trip_time)
print(get_workflow_run_response)
except ApiException as e:
print("Exception when calling WorkflowRunsApi.get_workflow_run: %s\n" % e)
pprint(e.body)
Expand All @@ -116,43 +96,83 @@ async def main():
asyncio.run(main())
```

## Raw HTTP Response<a id="raw-http-response"></a>

To access raw HTTP response values, use the `.raw` namespace.

```python
from pprint import pprint
from leap_workflows import Leap, ApiException

leap = Leap(
api_key="YOUR_API_KEY",
)

try:
# Get a workflow run
get_workflow_run_response = leap.workflow_runs.raw.get_workflow_run(
workflow_run_id="rnp_x3p27VQk6MyJfLe",
)
pprint(get_workflow_run_response.body)
pprint(get_workflow_run_response.body["id"])
pprint(get_workflow_run_response.body["version_id"])
pprint(get_workflow_run_response.body["status"])
pprint(get_workflow_run_response.body["created_at"])
pprint(get_workflow_run_response.body["started_at"])
pprint(get_workflow_run_response.body["ended_at"])
pprint(get_workflow_run_response.body["workflow_id"])
pprint(get_workflow_run_response.body["error"])
pprint(get_workflow_run_response.body["input"])
pprint(get_workflow_run_response.body["output"])
pprint(get_workflow_run_response.headers)
pprint(get_workflow_run_response.status)
pprint(get_workflow_run_response.round_trip_time)
except ApiException as e:
print("Exception when calling WorkflowRunsApi.get_workflow_run: %s\n" % e)
pprint(e.body)
pprint(e.headers)
pprint(e.status)
pprint(e.reason)
pprint(e.round_trip_time)
```


## Reference
### `leap.workflow_runs.get_workflow_run`
## Reference<a id="reference"></a>
### `leap.workflow_runs.get_workflow_run`<a id="leapworkflow_runsget_workflow_run"></a>

This endpoint retrieves the details of a specific workflow run using its `workflow_run_id`.

#### 🛠️ Usage
#### 🛠️ Usage<a id="🛠️-usage"></a>

```python
get_workflow_run_response = leap.workflow_runs.get_workflow_run(
workflow_run_id="rnp_x3p27VQk6MyJfLe",
)
```

#### ⚙️ Parameters
#### ⚙️ Parameters<a id="⚙️-parameters"></a>

##### workflow_run_id: `str`
##### workflow_run_id: `str`<a id="workflow_run_id-str"></a>

The ID of the workflow run to retrieve.

#### 🔄 Return
#### 🔄 Return<a id="🔄-return"></a>

[WorkflowRunEntity](./leap_workflows/type/workflow_run_entity.py)
[`WorkflowRunEntity`](./leap_workflows/pydantic/workflow_run_entity.py)

#### 🌐 Endpoint
#### 🌐 Endpoint<a id="🌐-endpoint"></a>

`/v1/runs/{workflow_run_id}` `get`

[🔙 **Back to Table of Contents**](#table-of-contents)

---

### `leap.workflow_runs.workflow`
### `leap.workflow_runs.workflow`<a id="leapworkflow_runsworkflow"></a>

This endpoint lets the user run a specified workflow with the provided workflow definition.

#### 🛠️ Usage
#### 🛠️ Usage<a id="🛠️-usage"></a>

```python
workflow_response = leap.workflow_runs.workflow(
Expand All @@ -165,26 +185,26 @@ workflow_response = leap.workflow_runs.workflow(
)
```

#### ⚙️ Parameters
#### ⚙️ Parameters<a id="⚙️-parameters"></a>

##### workflow_id: `str`
##### workflow_id: `str`<a id="workflow_id-str"></a>

The ID of the workflow to be run.

##### webhook_url: `str`
##### webhook_url: `str`<a id="webhook_url-str"></a>

The URL to which the workflow results should be sent to on completion.

##### input: [`RunWorkflowDtoInput`](./leap_workflows/type/run_workflow_dto_input.py)
##### input: [`RunWorkflowDtoInput`](./leap_workflows/type/run_workflow_dto_input.py)<a id="input-runworkflowdtoinputleap_workflowstyperun_workflow_dto_inputpy"></a>

#### ⚙️ Request Body
#### ⚙️ Request Body<a id="⚙️-request-body"></a>

[`RunWorkflowDto`](./leap_workflows/type/run_workflow_dto.py)
#### 🔄 Return
#### 🔄 Return<a id="🔄-return"></a>

[WorkflowRunEntity](./leap_workflows/type/workflow_run_entity.py)
[`WorkflowRunEntity`](./leap_workflows/pydantic/workflow_run_entity.py)

#### 🌐 Endpoint
#### 🌐 Endpoint<a id="🌐-endpoint"></a>

`/v1/runs` `post`

Expand All @@ -193,5 +213,5 @@ The URL to which the workflow results should be sent to on completion.
---


## Author
## Author<a id="author"></a>
This Python package is automatically generated by [Konfig](https://konfigthis.com)
Binary file added sdks/python/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading