Skip to content

configurations

Configurations

Bases: ListableApiResource, FindableApiResource, CreatableApiResource, UpdatableApiResource, DestroyableApiResource

Nylas Configuration API

The Nylas configuration API allows you to create new configurations or manage existing ones, as well as getting configurations details for a user.

Nylas Scheduler stores Configuration objects in the Scheduler database and loads them as Scheduling Pages in the Scheduler UI.

Source code in nylas/resources/configurations.py
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
class Configurations(
	ListableApiResource,
	FindableApiResource,
	CreatableApiResource,
	UpdatableApiResource,
	DestroyableApiResource,
  ):
	"""
	Nylas Configuration API

	The Nylas configuration API allows you to create new configurations or manage existing ones, as well as getting
	configurations details for a user.

	Nylas Scheduler stores Configuration objects in the Scheduler database and loads them as Scheduling Pages in the Scheduler UI.
	"""

	def list(
		self, 
		identifier: str,
		query_params: ListConfigurationsParams = None,
		overrides: RequestOverrides = None
	) -> ListResponse[Any]:
		"""
		Return all Configurations.

		Args:
			identifier: The identifier of the Grant to act upon.
			overrides: The request overrides to use for the request.

		Returns:
			The list of Configurations.
		"""
		# import pdb; pdb.set_trace();
		res = super().list(
			path=f"/v3/grants/{identifier}/scheduling/configurations",
			overrides=overrides,
			response_type=Configuration,
			query_params=query_params,
		)
		print("What's this", res)
		return res

	def find(
		self,
		identifier: str,
		config_id: str,
		overrides: RequestOverrides = None
	) -> Response[Configuration]:
		"""
		Return a Configuration.

		Args:
			identifier: The identifier of the Grant to act upon.
			config_id: The identifier of the Configuration to get.
			overrides: The request overrides to use for the request.

		Returns:
			The Configuration object.
		"""
		return super().find(
			path=f"/v3/grants/{identifier}/scheduling/configurations/{config_id}",
			overrides=overrides,
			response_type=Configuration,
		)

	def create(
		self,
		identifier: str,
		request_body: CreateConfigurationRequest,
		overrides: RequestOverrides = None
	) -> Response[Configuration]:
		"""
		Create a new Configuration.

		Args:
			identifier: The identifier of the Grant to act upon.
			data: The data to create the Configuration with.
			overrides: The request overrides to use for the request.

		Returns:
			The Configuration object.
		"""
		return super().create(
			path=f"/v3/grants/{identifier}/scheduling/configurations",
			request_body=request_body,
			overrides=overrides,
			response_type=Configuration,
		)

	def update(
		self,
		identifier: str,
		config_id: str,
		request_body: UpdateConfigurationRequest,
		overrides: RequestOverrides = None
	) -> Response[Configuration]:
		"""
		Update a Configuration.

		Args:
			identifier: The identifier of the Grant to act upon.
			config_id: The identifier of the Configuration to update.
			data: The data to update the Configuration with.
			overrides: The request overrides to use for the request.

		Returns:
			The Configuration object.
		"""
		return super().update(
			path=f"/v3/grants/{identifier}/scheduling/configurations/{config_id}",
			request_body=request_body,
			overrides=overrides,
			response_type=Configuration,
		)

	def destroy(
		self,
		identifier: str,
		config_id: str,
		overrides: RequestOverrides = None
	) -> DeleteResponse:
		"""
		Delete a Configuration.

		Args:
			identifier: The identifier of the Grant to act upon.
			config_id: The identifier of the Configuration to delete.
			overrides: The request overrides to use for the request.
		"""
		return super().destroy(
			path=f"/v3/grants/{identifier}/scheduling/configurations/{config_id}",
			overrides=overrides,
		)

create(identifier, request_body, overrides=None)

Create a new Configuration.

Parameters:

Name Type Description Default
identifier str

The identifier of the Grant to act upon.

required
data

The data to create the Configuration with.

required
overrides RequestOverrides

The request overrides to use for the request.

None

Returns:

Type Description
Response[Configuration]

The Configuration object.

Source code in nylas/resources/configurations.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def create(
	self,
	identifier: str,
	request_body: CreateConfigurationRequest,
	overrides: RequestOverrides = None
) -> Response[Configuration]:
	"""
	Create a new Configuration.

	Args:
		identifier: The identifier of the Grant to act upon.
		data: The data to create the Configuration with.
		overrides: The request overrides to use for the request.

	Returns:
		The Configuration object.
	"""
	return super().create(
		path=f"/v3/grants/{identifier}/scheduling/configurations",
		request_body=request_body,
		overrides=overrides,
		response_type=Configuration,
	)

destroy(identifier, config_id, overrides=None)

Delete a Configuration.

Parameters:

Name Type Description Default
identifier str

The identifier of the Grant to act upon.

required
config_id str

The identifier of the Configuration to delete.

required
overrides RequestOverrides

The request overrides to use for the request.

None
Source code in nylas/resources/configurations.py
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
def destroy(
	self,
	identifier: str,
	config_id: str,
	overrides: RequestOverrides = None
) -> DeleteResponse:
	"""
	Delete a Configuration.

	Args:
		identifier: The identifier of the Grant to act upon.
		config_id: The identifier of the Configuration to delete.
		overrides: The request overrides to use for the request.
	"""
	return super().destroy(
		path=f"/v3/grants/{identifier}/scheduling/configurations/{config_id}",
		overrides=overrides,
	)

find(identifier, config_id, overrides=None)

Return a Configuration.

Parameters:

Name Type Description Default
identifier str

The identifier of the Grant to act upon.

required
config_id str

The identifier of the Configuration to get.

required
overrides RequestOverrides

The request overrides to use for the request.

None

Returns:

Type Description
Response[Configuration]

The Configuration object.

Source code in nylas/resources/configurations.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
def find(
	self,
	identifier: str,
	config_id: str,
	overrides: RequestOverrides = None
) -> Response[Configuration]:
	"""
	Return a Configuration.

	Args:
		identifier: The identifier of the Grant to act upon.
		config_id: The identifier of the Configuration to get.
		overrides: The request overrides to use for the request.

	Returns:
		The Configuration object.
	"""
	return super().find(
		path=f"/v3/grants/{identifier}/scheduling/configurations/{config_id}",
		overrides=overrides,
		response_type=Configuration,
	)

list(identifier, query_params=None, overrides=None)

Return all Configurations.

Parameters:

Name Type Description Default
identifier str

The identifier of the Grant to act upon.

required
overrides RequestOverrides

The request overrides to use for the request.

None

Returns:

Type Description
ListResponse[Any]

The list of Configurations.

Source code in nylas/resources/configurations.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def list(
	self, 
	identifier: str,
	query_params: ListConfigurationsParams = None,
	overrides: RequestOverrides = None
) -> ListResponse[Any]:
	"""
	Return all Configurations.

	Args:
		identifier: The identifier of the Grant to act upon.
		overrides: The request overrides to use for the request.

	Returns:
		The list of Configurations.
	"""
	# import pdb; pdb.set_trace();
	res = super().list(
		path=f"/v3/grants/{identifier}/scheduling/configurations",
		overrides=overrides,
		response_type=Configuration,
		query_params=query_params,
	)
	print("What's this", res)
	return res

update(identifier, config_id, request_body, overrides=None)

Update a Configuration.

Parameters:

Name Type Description Default
identifier str

The identifier of the Grant to act upon.

required
config_id str

The identifier of the Configuration to update.

required
data

The data to update the Configuration with.

required
overrides RequestOverrides

The request overrides to use for the request.

None

Returns:

Type Description
Response[Configuration]

The Configuration object.

Source code in nylas/resources/configurations.py
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
def update(
	self,
	identifier: str,
	config_id: str,
	request_body: UpdateConfigurationRequest,
	overrides: RequestOverrides = None
) -> Response[Configuration]:
	"""
	Update a Configuration.

	Args:
		identifier: The identifier of the Grant to act upon.
		config_id: The identifier of the Configuration to update.
		data: The data to update the Configuration with.
		overrides: The request overrides to use for the request.

	Returns:
		The Configuration object.
	"""
	return super().update(
		path=f"/v3/grants/{identifier}/scheduling/configurations/{config_id}",
		request_body=request_body,
		overrides=overrides,
		response_type=Configuration,
	)

ListConfigurationsParams

Bases: ListQueryParams

Interface of the query parameters for listing configurations.

Attributes:

Name Type Description
limit

The maximum number of objects to return. This field defaults to 50. The maximum allowed value is 200.

page_token

An identifier that specifies which page of data to return. This value should be taken from a ListResponse object's next_cursor parameter.

identifier

The identifier of the Grant to act upon.

Source code in nylas/resources/configurations.py
15
16
17
18
19
20
21
22
23
24
25
class ListConfigurationsParams(ListQueryParams):
	"""
	Interface of the query parameters for listing configurations.

	Attributes:
		limit: The maximum number of objects to return.
			This field defaults to 50. The maximum allowed value is 200.
		page_token: An identifier that specifies which page of data to return.
			This value should be taken from a ListResponse object's next_cursor parameter.
		identifier: The identifier of the Grant to act upon.
	"""