Class: Nylas::RedirectUris

Inherits:
Resource show all
Includes:
ApiOperations::Delete, ApiOperations::Get, ApiOperations::Post, ApiOperations::Put
Defined in:
lib/nylas/resources/redirect_uris.rb

Overview

A collection of redirect URI related API endpoints.

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Nylas::Resource

Instance Method Details

#create(request_body:) ⇒ Array(Hash, String)

Create a redirect uri.

Parameters:

  • request_body (Hash)

    The values to create the redirect uri with.

Returns:

  • (Array(Hash, String))

    The created redirect uri and API Request ID.



37
38
39
40
41
42
# File 'lib/nylas/resources/redirect_uris.rb', line 37

def create(request_body:)
  post(
    path: "#{api_uri}/v3/applications/redirect-uris",
    request_body: request_body
  )
end

#destroy(redirect_uri_id:) ⇒ Array(TrueClass, String)

Delete a redirect uri.

Parameters:

  • redirect_uri_id (String)

    The id of the redirect uri to delete.

Returns:

  • (Array(TrueClass, String))

    True and the API Request ID for the delete operation.



60
61
62
63
64
65
66
# File 'lib/nylas/resources/redirect_uris.rb', line 60

def destroy(redirect_uri_id:)
  _, request_id = delete(
    path: "#{api_uri}/v3/applications/redirect-uris/#{redirect_uri_id}"
  )

  [true, request_id]
end

#find(redirect_uri_id:) ⇒ Array(Hash, String)

Return a redirect uri.

Parameters:

  • redirect_uri_id (String)

    The id of the redirect uri to return.

Returns:

  • (Array(Hash, String))

    The redirect uri and API request ID.



27
28
29
30
31
# File 'lib/nylas/resources/redirect_uris.rb', line 27

def find(redirect_uri_id:)
  get(
    path: "#{api_uri}/v3/applications/redirect-uris/#{redirect_uri_id}"
  )
end

#listArray(Array(Hash), String)

Return all redirect uris.

Returns:

  • (Array(Array(Hash), String))

    The list of redirect uris and API Request ID.



17
18
19
20
21
# File 'lib/nylas/resources/redirect_uris.rb', line 17

def list
  get(
    path: "#{api_uri}/v3/applications/redirect-uris"
  )
end

#update(redirect_uri_id:, request_body:) ⇒ Array(Hash, String)

Update a redirect uri.

Parameters:

  • redirect_uri_id (String)

    The id of the redirect uri to update.

  • request_body (Hash)

    The values to update the redirect uri with

Returns:

  • (Array(Hash, String))

    The updated redirect uri and API Request ID.



49
50
51
52
53
54
# File 'lib/nylas/resources/redirect_uris.rb', line 49

def update(redirect_uri_id:, request_body:)
  put(
    path: "#{api_uri}/v3/applications/redirect-uris/#{redirect_uri_id}",
    request_body: request_body
  )
end