-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v6.0.0-beta' into fix-free-busy-endpoint
- Loading branch information
Showing
181 changed files
with
2,341 additions
and
5,643 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: sdk-reference | ||
|
||
on: | ||
push: | ||
branches: | ||
- v6.0.0-beta | ||
pull_request: | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: sdk-reference | ||
url: ${{ steps.deploy.outputs.url }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, | ||
# change this to (see https://github.com/ruby/setup-ruby#versioning): | ||
# uses: ruby/setup-ruby@v1 | ||
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e | ||
with: | ||
ruby-version: 3.0 | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
- name: Run rubocop | ||
run: bundle exec yard | ||
- name: Set env BRANCH | ||
run: echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV | ||
- name: Set env CLOUDFLARE_BRANCH | ||
run: | | ||
if [[ $BRANCH == 'v6.0.0-beta' && $GITHUB_EVENT_NAME == 'push' ]]; then | ||
echo "CLOUDFLARE_BRANCH=main" >> "$GITHUB_ENV" | ||
else | ||
echo "CLOUDFLARE_BRANCH=$BRANCH" >> "$GITHUB_ENV" | ||
fi | ||
- name: Publish to Cloudflare Pages | ||
uses: cloudflare/pages-action@v1 | ||
id: deploy | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: nylas-ruby-sdk-reference | ||
directory: doc | ||
wranglerVersion: "3" | ||
branch: ${{ env.CLOUDFLARE_BRANCH }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ TAGS | |
*.swp | ||
vendor/ | ||
out | ||
test.rb |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--no-private | ||
--protected | ||
--exclude lib/nylas/handler/api_operations.rb | ||
--exclude lib/nylas/handler/http_client.rb | ||
--exclude lib/nylas/resources/base_resource.rb | ||
lib/**/*.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,30 +4,29 @@ | |
|
||
# Nylas Ruby SDK | ||
|
||
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nylas/nylas-ruby/CI)](https://github.com/nylas/nylas-ruby/actions/workflows/rspec.yml) | ||
[![Gem (including prereleases)](https://img.shields.io/gem/v/nylas?include_prereleases)](https://rubygems.org/gems/nylas) | ||
[![codecov](https://codecov.io/gh/nylas/nylas-ruby/branch/main/graph/badge.svg?token=IKH0YMH4KA)](https://codecov.io/gh/nylas/nylas-ruby) | ||
|
||
The Nylas Communications Platform allows developers to quickly build features that connect to every inbox, calendar, and contacts book in the world. Nylas makes it easy to build an integration that can be completed in days, and provides pre-built security and compliance features, and a 99.9% guaranteed uptime. Integrations with the Nylas Communications Platform are secure, reliable, and easy to use and maintain. | ||
This is the GitHub repository for the Nylas Ruby SDK. This repo is primarily for anyone who wants to make contributions to the SDK or install it from source. For documentation on how to use this SDK to access the Nylas Email, Calendar, or Contacts APIs, see the official [Ruby SDK Quickstart Guide](https://developer.nylas.com/docs/sdks/ruby/). | ||
|
||
Nylas provides REST APIs for [Email](https://docs.nylas.com/docs/quickstart-email), [Calendar](https://docs.nylas.com/docs/quickstart-calendar), and [Contacts](https://docs.nylas.com/docs/quickstart-contacts), and the Ruby SDK is the quickest way to build your first integration using Ruby. | ||
The Nylas Communications Platform provides REST APIs for [Email](https://developer.nylas.com/docs/email/), [Calendar](https://developer.nylas.com/docs/calendar/), and [Contacts](https://developer.nylas.com/docs/contacts/), and the Nylas SDK is the quickest way to build your integration using Ruby. | ||
|
||
This is the GitHub repository for the Nylas Ruby SDK and is primarily for anyone who wants to make contributions to the SDK or install it from source. If you are looking to use Ruby to access the Nylas Email, Calendar, or Contacts API you should refer to our official [Ruby](https://docs.nylas.com/docs/quickstart-ruby) [SDK Quickstart Guide](https://docs.nylas.com/docs/quickstart-ruby). | ||
Here are some resources to help you get started: | ||
|
||
Here are some additional resources to help you get started: | ||
- [Sign up for the Nylas v3 Beta program to access the v3 Dashboard](https://info.nylas.com/apiv3betasignup.html?utm_source=github&utm_medium=devrel-surfaces&utm_campaign=&utm_content=ruby-sdk-upgrade) | ||
- [Nylas API v3 Quickstart Guide](https://developer.nylas.com/docs/v3-beta/v3-quickstart/) | ||
- [Nylas SDK Reference](https://nylas-ruby-sdk-reference.pages.dev/) | ||
- [Nylas API Reference](https://developer.nylas.com/docs/api/v3-beta/) | ||
- [Nylas Samples repo for code samples and example applications](https://github.com/orgs/nylas-samples/repositories?q=&type=all&language=ruby) | ||
|
||
- [Nylas SDK Tutorials](https://docs.nylas.com/docs/tutorials) | ||
- [Get Started with the Nylas Communications Platform](https://docs.nylas.com/docs/getting-started) | ||
- [Sign up for your Nylas developer account.](https://nylas.com/register) | ||
- [Nylas API Reference](https://docs.nylas.com/reference) | ||
|
||
If you have a question that needs an answer, please reach out to [email protected] to get help. | ||
If you have a question about the Nylas Communications Platform, [contact Nylas Support](https://support.nylas.com/) for help. | ||
|
||
## ⚙️ Install | ||
|
||
### Prerequisites | ||
- Ruby 2.3 or above. | ||
- Ruby Frameworks: `rest-client`, `json`, `yajl-ruby`. | ||
|
||
We support Rails 4.2 and above. A more detailed compatibility list can be found in our [list of Gemfiles](https://github.com/nylas/nylas-ruby/tree/master/gemfiles). | ||
- Ruby 3.0 or above. | ||
- Ruby Frameworks: `rest-client` and `yajl-ruby`. | ||
|
||
### Install | ||
|
||
|
@@ -43,7 +42,7 @@ And then execute: | |
bundle | ||
``` | ||
|
||
To run scripts that use the Nylas Ruby SDK, install the nylas gem. | ||
To run scripts that use the Nylas Ruby SDK, install the `nylas` gem. | ||
|
||
```bash | ||
gem install nylas | ||
|
@@ -56,7 +55,7 @@ git clone https://github.com/nylas/nylas-ruby.git && cd nylas-ruby | |
bundle install | ||
``` | ||
|
||
### Setup Ruby SDK for Development | ||
### Set up Ruby SDK for Development | ||
|
||
Install [RubyGems](https://rubygems.org/pages/download) if you don't already have it: | ||
|
||
|
@@ -76,45 +75,42 @@ You can run tests locally using ```rspec```: | |
```shell | ||
rspec spec | ||
``` | ||
|
||
### MacOS 10.11 (El Capitan) Note | ||
|
||
Apple stopped bundling OpenSSL with MacOS 10.11. However, one of the dependencies of this gem (EventMachine) requires it. If you're on El Capitan and are unable to install the gem, try running the following commands in a terminal: | ||
|
||
```bash | ||
sudo brew install openssl | ||
sudo brew link openssl --force | ||
gem install nylas | ||
``` | ||
|
||
## ⚡️ Usage | ||
|
||
To use this SDK, you first need to [sign up for a free Nylas developer account](https://nylas.com/register). | ||
To use this SDK, you must first [sign up for the v3 Beta and get a free Nylas account](https://info.nylas.com/apiv3betasignup.html?utm_source=github&utm_medium=devrel-surfaces&utm_campaign=&utm_content=ruby-sdk-upgrade). | ||
|
||
Then, follow our guide to [setup your first app and get your API access keys](https://docs.nylas.com/docs/get-your-developer-api-keys). | ||
Then, follow the Quickstart guide to [set up your first app and get your API keys](https://developer.nylas.com/docs/v3-beta/v3-quickstart/). | ||
|
||
All of the functionality of the Nylas Communications Platform is available through the `API` object. To access data for an account that’s connected to Nylas, create a new API client object and pass the variables you gathered when you got your developer API keys. In the following example, replace `CLIENT_ID`, `CLIENT_SECRET`, and `ACCESS_TOKEN` with your values. | ||
For code examples that demonstrate how to use this SDK, take a look at our [Ruby repos in the Nylas Samples collection](https://github.com/orgs/nylas-samples/repositories?q=&type=all&language=ruby). | ||
|
||
### 🚀 Making Your First Request | ||
|
||
All of the functionality of the Nylas Communications Platform is available through the `Client` object. To access data for an account that’s connected to Nylas, create a new API client object and pass in your Nylas API key. In the following example, replace `NYLAS_API_KEY` with your Nylas API Key, and you can provide other additional configurations such as the Nylas API url and the timeout. | ||
|
||
```ruby | ||
require 'nylas' | ||
|
||
nylas = Nylas::API.new( | ||
app_id: CLIENT_ID, | ||
app_secret: CLIENT_SECRET, | ||
access_token: ACCESS_TOKEN | ||
nylas = Nylas::Client.new( | ||
api_key: "NYLAS_API_KEY", | ||
) | ||
``` | ||
|
||
Now, you can use `nylas` to access full email, calendar, and contacts functionality. For example, here is how you would print the subject line for the most recent email message to the console. | ||
|
||
Now, you can use `nylas` to access full email, calendar, and contacts functionality, for example to list all the calendars for a given account: | ||
|
||
```ruby | ||
message = nylas.messages.first | ||
puts(message.subject) | ||
calendars, _request_ids = nylas.calendars.list(identifier: "GRANT_ID") | ||
``` | ||
|
||
To learn more about how to use the Nylas Ruby SDK, please refer to our [Ruby](https://docs.nylas.com/docs/quickstart-ruby) [SDK QuickStart Guide](https://docs.nylas.com/docs/quickstart-ruby). | ||
## 📚 Documentation | ||
|
||
Nylas maintains a [reference guide for the Ruby SDK](https://nylas-ruby-sdk-reference.pages.dev/) to help you get familiar with the available methods and classes. | ||
|
||
## ✨ Upgrading from 5.x | ||
|
||
See [UPGRADE.md](UPGRADE.md) for instructions on upgrading from 5.x to 6.x. | ||
|
||
**Note**: The Ruby SDK v6.x is not compatible with the Nylas API earlier than v3-beta. If you are using Nylas v2.7 or earlier, continue using the v5.x Nylas Ruby SDK. | ||
|
||
## 💙 Contributing | ||
|
||
|
@@ -124,4 +120,4 @@ Taking part in Hacktoberfest 2023 (i.e. issue is tagged with `hacktoberfest`)? R | |
|
||
## 📝 License | ||
|
||
This project is licensed under the terms of the MIT license. Please refer to [LICENSE](LICENSE.txt) for the full terms. | ||
This project is licensed under the terms of the MIT license. Please refer to [LICENSE](LICENSE.txt) for the full terms. |
Oops, something went wrong.