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

Improve quickstart examples & documentation overview #281

Merged
merged 1 commit into from
Oct 10, 2023
Merged
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
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,34 @@ nylas = Client(
api_key="API_KEY",
)

calendars = nylas.calendars.list("GRANT_ID")
calendars, request_id, next_cursor = nylas.calendars.list("GRANT_ID")

event, request_id = nylas.events.create(
identifier="GRANT_ID",
request_body={
"title": "test title",
"description": "test description",
"when": {
"start_time": start_unix_timestamp,
"end_time": end_unix_timestamp,
}
},
query_params={"calendar_id": "primary", "notify_participants": True},
)
)
nylas.events.destroy("GRANT_ID", event.id, {"calendar_id": "primary"})

```

## 📚 Documentation

Nylas maintains a [reference guide for the Python SDK](https://nylas-python-sdk-reference.pages.dev/) to help you get familiar with the available functions and classes.
This SDK makes heavy use of [Python 3 dataclasses](https://realpython.com/python-data-classes/) to define the REST resources and request/response schemas of the Nylas APIs. The Client object is a wrapper around all of these resources and is used to interact with the corresponding APIs. Basic CRUD operations are handled by the `create()`, `find()`, `list()`, `update()`, and `destroy()` methods on each resource. Resources may also have other methods which are all detailed in the [reference guide for the Python SDK](https://nylas-python-sdk-reference.pages.dev/). In the code reference, start at `client`, and then `resources` will give more info on available API call methods. `models` is the place to find schemas for requests, responses, and all Nylas object types.

While most resources are accessed via the top-level Client object, note that `auth` contains the sub-resource `grants` as well as a collection of other auth-related API calls.

You'll want to catch `nylas.models.errors.NylasAPIError` to handle errors.

Have fun!!

## ✨ Upgrade from v5.x

Expand Down