nylas 6.0.0.beta.1 → 6.0.0.beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,99 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "http_client"
4
- require_relative "api_operations"
5
-
6
- module Nylas
7
- # Allows resources to perform CRUD operations on the Grants API endpoints without exposing the
8
- # HTTP client to the end user.
9
- module GrantsApiOperations
10
- # Creates a Nylas object.
11
- module Create
12
- include ApiOperations::Post
13
- # Creates a Nylas object.
14
- #
15
- # @param identifier [String] Grant ID or email account in which to create the object.
16
- # @param query_params [Hash, {}] Query params to pass to the request.
17
- # @param request_body [Hash, nil] Request body to pass to the request.
18
- # @return [Array(Hash, String)] Created Nylas object and API Request ID.
19
- def create(identifier:, query_params: {}, request_body: nil)
20
- post(
21
- path: "#{api_uri}/v3/grants/#{identifier}/#{resource_name}",
22
- query_params: query_params,
23
- request_body: request_body
24
- )
25
- end
26
- end
27
-
28
- # Lists Nylas objects.
29
- module List
30
- include ApiOperations::Get
31
- # Lists Nylas objects.
32
- #
33
- # @param identifier [String] Grant ID or email account to query.
34
- # @param query_params [Hash, {}] Query params to pass to the request.
35
- # @return [Array(Hash, String)] List of Nylas objects and API Request ID.
36
- def list(identifier:, query_params: {})
37
- get(
38
- path: "#{api_uri}/v3/grants/#{identifier}/#{resource_name}",
39
- query_params: query_params
40
- )
41
- end
42
- end
43
-
44
- # Finds a Nylas object.
45
- module Find
46
- include ApiOperations::Get
47
- # Finds a Nylas object.
48
- #
49
- # @param identifier [String] Grant ID or email account to query.
50
- # @param object_id [String] Object ID.
51
- # @param query_params [Hash, {}] Query params to pass to the request.
52
- # @return [Array(Hash, String)] Nylas object and API request ID.
53
- def find(identifier:, object_id:, query_params: {})
54
- get(
55
- path: "#{api_uri}/v3/grants/#{identifier}/#{resource_name}/#{object_id}",
56
- query_params: query_params
57
- )
58
- end
59
- end
60
-
61
- # Updates a Nylas object.
62
- module Update
63
- include ApiOperations::Put
64
- # Updates a Nylas object.
65
- #
66
- # @param identifier [String] Grant ID or email account in which to update an object.
67
- # @param object_id [String] Object ID.
68
- # @param query_params [Hash, {}] Query params to pass to the request.
69
- # @param request_body [Hash, nil] Request body to pass to the request.
70
- # @return [Array(Hash, String)] Updated Nylas object and API Request ID.
71
- def update(identifier:, object_id:, query_params: {}, request_body: nil)
72
- put(
73
- path: "#{api_uri}/v3/grants/#{identifier}/#{resource_name}/#{object_id}",
74
- query_params: query_params,
75
- request_body: request_body
76
- )
77
- end
78
- end
79
-
80
- # Deletes a Nylas object.
81
- module Destroy
82
- include ApiOperations::Delete
83
- # Deletes a Nylas object.
84
- #
85
- # @param identifier [String] Grant ID or email account from which to delete an object.
86
- # @param object_id [String] Object ID.
87
- # @param query_params [Hash, {}] Query params to pass to the request.
88
- # @return [Array(TrueClass, String)] True and the API Request ID for the delete operation.
89
- def destroy(identifier:, object_id:, query_params: {})
90
- _, request_id = delete(
91
- path: "#{api_uri}/v3/grants/#{identifier}/#{resource_name}/#{object_id}",
92
- query_params: query_params
93
- )
94
-
95
- [true, request_id]
96
- end
97
- end
98
- end
99
- end