Pre Launch Product

Business Launch Party Ideas

business people word free stock photo public domain pictures free images achievement adult battle black and white businessman business in s f bay area companies sf news sfist best business loans for bad credit u s news business best practices definition tips and notable examples home philtech business group what is a business understanding different types and company sizes businessman png image young business woman free stock photo public domain pictures free images compass destination direction find globe gps hand free images achievement adult agreement american asian blue business networking free stock photo public domain pictures businessman png image free images writing hand finger cash legal document documents business success free stock photo public domain pictures businessman png image business time free stock photo public domain pictures clipart business plan flow chart free image business plan libreshot public domain photos business woman with a headset free stock photo public domain pictures panama business 2 business with a smile visit our site to flickr banner business background webpage free stock photo public domain business meeting two business men shaking hands at interna flickr profits revenue business free image on pixabay 5 pasos imprescindibles para hacer un plan de negocios que funcione business png all business light kuroi san flickr com photos leadsoup 12 flickr business model canvas wikipedia business graphics free stock photo public domain pictures business is business young thug album wikipedia

:
How To Post On Spotify
UAS multi-credential update (Solid State Drive Vs Hard Drive)
1 parent Scientific Method Paper Example commit 2deab36

Business in s f bay area companies sf news sfist 7 files changed How To Add Post To Story On Instagram PC

Lines changed: 100 additions & 0 deletions

Best Credit Card Gas Rewards Business Launch Party Ideas

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
nylas-python Changelog
22
======================
3+
Unreleased
4+
----------
5+
* UAS multi-credential update
36

47
v6.14.2
58
----------

nylas/models/auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class URLForAuthenticationConfig(TypedDict):
4747
include_grant_scopes: NotRequired[bool]
4848
state: NotRequired[str]
4949
login_hint: NotRequired[str]
50+
credential_id: NotRequired[str]
5051

5152

5253
class URLForAdminConsentConfig(URLForAuthenticationConfig):

nylas/models/connectors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class BaseCreateConnectorRequest(TypedDict):
3434
"""
3535

3636
provider: Provider
37+
active_credential_id: NotRequired[str]
3738

3839

3940
class GoogleCreateConnectorSettings(TypedDict):
@@ -141,6 +142,7 @@ class UpdateConnectorRequest(TypedDict):
141142
name: NotRequired[str]
142143
settings: NotRequired[Dict[str, Any]]
143144
scope: NotRequired[List[str]]
145+
active_credential_id: NotRequired[str]
144146

145147

146148
class ListConnectorQueryParams(ListQueryParams):

nylas/models/grants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Grant:
4242
updated_at: Optional[int] = None
4343
provider_user_id: Optional[str] = None
4444
settings: Optional[Dict[str, Any]] = None
45+
credential_id: Optional[str] = None
4546

4647

4748
class CreateGrantRequest(TypedDict):

tests/resources/test_auth.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,25 @@ def test_url_for_oauth2(self, http_client):
137137
== "https://test.nylas.com/v3/connect/auth?client_id=abc-123&redirect_uri=https%3A//example.com/oauth/callback&scope=email.read_only%20calendar%20contacts&login_hint=test%40gmail.com&provider=google&prompt=select_provider%2Cdetect&state=abc-123-state&response_type=code&access_type=online"
138138
)
139139

140+
def test_url_for_oauth2_with_credential_id(self, http_client):
141+
auth = Auth(http_client)
142+
config = {
143+
"client_id": "abc-123",
144+
"redirect_uri": "https://example.com/oauth/callback",
145+
"scope": ["Mail.Read", "User.Read"],
146+
"login_hint": "test@outlook.com",
147+
"provider": "microsoft",
148+
"state": "abc-123-state",
149+
"credential_id": "cred-abc-123",
150+
}
151+
152+
url = auth.url_for_oauth2(config)
153+
154+
assert (
155+
url
156+
== "https://test.nylas.com/v3/connect/auth?client_id=abc-123&redirect_uri=https%3A//example.com/oauth/callback&scope=Mail.Read%20User.Read&login_hint=test%40outlook.com&provider=microsoft&state=abc-123-state&credential_id=cred-abc-123&response_type=code&access_type=online"
157+
)
158+
140159
def test_exchange_code_for_token(self, http_client_token_exchange):
141160
auth = Auth(http_client_token_exchange)
142161
config = {

tests/resources/test_connectors.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ def test_create_connector(self, http_client_response):
6666
"POST", "/v3/connectors", None, None, request_body, overrides=None
6767
)
6868

69+
def test_create_connector_with_active_credential_id(self, http_client_response):
70+
connectors = Connectors(http_client_response)
71+
request_body = {
72+
"provider": "microsoft",
73+
"settings": {
74+
"client_id": "string",
75+
"client_secret": "string",
76+
"tenant": "common",
77+
},
78+
"scope": [
79+
"Mail.Read",
80+
"User.Read",
81+
],
82+
"active_credential_id": "cred-abc-123",
83+
}
84+
85+
connectors.create(request_body=request_body)
86+
87+
http_client_response._execute.assert_called_once_with(
88+
"POST", "/v3/connectors", None, None, request_body, overrides=None
89+
)
90+
6991
def test_update_connector(self, http_client_response):
7092
connectors = Connectors(http_client_response)
7193
request_body = {
@@ -89,6 +111,29 @@ def test_update_connector(self, http_client_response):
89111
"PATCH", "/v3/connectors/google", None, None, request_body, overrides=None
90112
)
91113

114+
def test_update_connector_with_active_credential_id(self, http_client_response):
115+
connectors = Connectors(http_client_response)
116+
request_body = {
117+
"settings": {
118+
"client_id": "string",
119+
"client_secret": "string",
120+
},
121+
"scope": [
122+
"Mail.Read",
123+
"User.Read",
124+
],
125+
"active_credential_id": "cred-xyz-789",
126+
}
127+
128+
connectors.update(
129+
provider="microsoft",
130+
request_body=request_body,
131+
)
132+
133+
http_client_response._execute.assert_called_once_with(
134+
"PATCH", "/v3/connectors/microsoft", None, None, request_body, overrides=None
135+
)
136+
92137
def test_destroy_connector(self, http_client_delete_response):
93138
connectors = Connectors(http_client_delete_response)
94139

tests/resources/test_grants.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,35 @@ def test_grant_deserialization(self, http_client):
3030
assert grant.created_at == 1617817109
3131
assert grant.updated_at == 1617817109
3232

33+
def test_grant_deserialization_with_credential_id(self, http_client):
34+
grant_json = {
35+
"id": "e19f8e1a-eb1c-41c0-b6a6-d2e59daf7f47",
36+
"provider": "microsoft",
37+
"grant_status": "valid",
38+
"email": "email@example.com",
39+
"scope": ["Mail.Read", "User.Read", "offline_access"],
40+
"user_agent": "string",
41+
"ip": "string",
42+
"state": "my-state",
43+
"created_at": 1617817109,
44+
"updated_at": 1617817109,
45+
"credential_id": "cred-abc-123",
46+
}
47+
48+
grant = Grant.from_dict(grant_json)
49+
50+
assert grant.id == "e19f8e1a-eb1c-41c0-b6a6-d2e59daf7f47"
51+
assert grant.provider == "microsoft"
52+
assert grant.grant_status == "valid"
53+
assert grant.email == "email@example.com"
54+
assert grant.scope == ["Mail.Read", "User.Read", "offline_access"]
55+
assert grant.user_agent == "string"
56+
assert grant.ip == "string"
57+
assert grant.state == "my-state"
58+
assert grant.created_at == 1617817109
59+
assert grant.updated_at == 1617817109
60+
assert grant.credential_id == "cred-abc-123"
61+
3362
def test_list_grants(self, http_client_list_response):
3463
grants = Grants(http_client_list_response)
3564

Icon To Indicate Launch Business Party Ideas

Comments
 (0)