-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_join_session_token_response.py
More file actions
73 lines (53 loc) · 2.02 KB
/
get_join_session_token_response.py
File metadata and controls
73 lines (53 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
from typing import Any, Dict, Type, TypeVar, Union
from attrs import define as _attrs_define
from ..types import UNSET, Unset
T = TypeVar("T", bound="GetJoinSessionTokenResponse")
@_attrs_define
class GetJoinSessionTokenResponse:
"""
Attributes:
vendor (str): The vendor that the client authorized (sma, enphase, solis, solaredge, enphasevpp, tesla)
access_token (str): The public access token to use when requesting data for clients system
refresh_token (str): The refresh token to use when requesting a new token for clients system
expires_in (str): Amount of time the accessToken is valid (in seconds)
site_id (Union[Unset, str]): Only for enphasevpp, the siteID for the clients system
"""
vendor: str
access_token: str
refresh_token: str
expires_in: str
site_id: Union[Unset, str] = UNSET
def to_dict(self) -> Dict[str, Any]:
vendor = self.vendor
access_token = self.access_token
refresh_token = self.refresh_token
expires_in = self.expires_in
site_id = self.site_id
field_dict: Dict[str, Any] = {}
field_dict.update(
{
"vendor": vendor,
"accessToken": access_token,
"refreshToken": refresh_token,
"expiresIn": expires_in,
}
)
if site_id is not UNSET:
field_dict["siteID"] = site_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
vendor = d.pop("vendor")
access_token = d.pop("accessToken")
refresh_token = d.pop("refreshToken")
expires_in = d.pop("expiresIn")
site_id = d.pop("siteID", UNSET)
get_join_session_token_response = cls(
vendor=vendor,
access_token=access_token,
refresh_token=refresh_token,
expires_in=expires_in,
site_id=site_id,
)
return get_join_session_token_response