Skip to content

Commit 24cc645

Browse files
authored
Create Api.md
1 parent 318a71a commit 24cc645

File tree

1 file changed

+157
-0
lines changed

1 file changed

+157
-0
lines changed

Api.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# API
2+
3+
## Auth Service
4+
5+
### AuthorizeCredential
6+
Get credentials with given authorizationCode. Returns string content.
7+
#### Parameters
8+
AuthorizationCode: The code which you have with `RequestAuthorizationCode` <br/>
9+
10+
<hr/>
11+
12+
### GetAccessTokenDetails
13+
Get information with given accesstoken like scope, expires in etc. Returns a json format.
14+
15+
<hr/>
16+
17+
### GetClientId, GetClientSecret, GetRedirectUrl
18+
Only works when the value stored in appsettings.json.
19+
20+
#### Parameters
21+
RootValue: Allows customization. By default it searches from `GoogleClient` root. <br/>
22+
23+
<hr/>
24+
25+
### GetUserMail
26+
Returns user email with given access token.
27+
28+
<hr/>
29+
30+
### GetValueFromCredential
31+
Brings a value into a given credential string. The credential string can be obtain with result of AuthorizeCredential method.
32+
33+
#### Enum: CredentialValueType -> AccessToken, RefreshToken, Scope, TokenType, ExpiresIn
34+
35+
<hr/>
36+
37+
### IsAccessTokenExpired
38+
Returns a bool value that access token expired.
39+
40+
<hr/>
41+
42+
### RefreshAccessToken
43+
Refresh and create new access token with given refresh token. Returns the new access token as a string.
44+
#### Note
45+
If you placed your clientid, clientsecret and redirecturl in your `appsettings.json`, you can use the method only with refreshtoken. (No need to define them again)
46+
47+
<hr/>
48+
49+
### RequestAuthorizationCode
50+
Opens Google "select account" page in a new tab.
51+
#### Parameters
52+
ClientId: Your project's client id. Can be obtanied on google developer console. <br/>
53+
RedirectUrl: The page which the authorization code will send. The page opens immediately after user selects their google account.
54+
55+
<hr/>
56+
57+
## Calendar Service
58+
59+
### Fields
60+
AccessToken: It must be set before the call of other methods. All methods use this access token value. <br/>
61+
RefreshToken: It is used for automatic renewal of access token. All methods have `forceAccessToken`parameter, and it only works if refresh token is not null or empty.
62+
63+
<hr/>
64+
65+
### EventCallbacks
66+
<b>AccessTokenChanged:</b> Fires when access token changed. <br/>
67+
<b>RefreshTokenChanged:</b> Fires when refresh token changed.
68+
69+
<hr/>
70+
71+
### AddCalendar
72+
Creates a new secondary calendar into user's CalendarList with given `GoogleCalendarListModel`.
73+
74+
<hr/>
75+
76+
### AddEvent
77+
Creates a new event in a specific calendar with given `GoogleCalendarEventModel`.
78+
79+
<hr/>
80+
81+
### ClearCalendar
82+
Deletes all events in a primary calendar. If it's a secondary calendar, it has no effect. Use `DeleteCalendar` method for secondary ones.
83+
84+
<hr/>
85+
86+
### DeleteCalendar
87+
Deletes the specified calendar. Only deletes the secondary calendars. Use `ClearCalendar` method for primary calendar.
88+
89+
<hr/>
90+
91+
### DeleteEvent
92+
Deletes the event in a specific calendar.
93+
94+
<hr/>
95+
96+
### GetCalendarById
97+
Get calendar with given id that authenticated user has. Returns `GoogleCalendarListModel`.
98+
99+
<hr/>
100+
101+
### GetCalendarBySummary
102+
Get calendar with given summary (title) that authenticated user has. Returns `GoogleCalendarListModel`.
103+
104+
<hr/>
105+
106+
### GetCalendars
107+
Get all calendars that authenticated user has. Returns max of 250 calendars (Google limitation). Returns `GoogleCalendarListRoot`.
108+
109+
<hr/>
110+
111+
### GetEventById
112+
Get event in a specific calendar with a given id. Returns `GoogleCalendarEventModel`.
113+
114+
<hr/>
115+
116+
### GetEventByDescription
117+
Get event in a specific calendar with a given description. Returns `GoogleCalendarEventModel`.
118+
119+
<hr/>
120+
121+
### GetEventBySummary
122+
Get event in a specific calendar with a given summary (title). Returns `GoogleCalendarEventModel`.
123+
124+
<hr/>
125+
126+
### GetEvents
127+
Get event list within a specific calendar between the specified dates. Returns a max of 2500 events (Google limitation). Returns `GoogleCalendarEventRoot`.
128+
129+
<hr/>
130+
131+
### GetProperDateTimeFormat
132+
Format datetime (ISO standarts) to make proper Google api calls.
133+
134+
<hr/>
135+
136+
### FindCalendarId
137+
Finds and returns the calendar id which matches with the given value (Summary, description or location). Returns calendar id as string.
138+
139+
<hr/>
140+
141+
### FindEventId
142+
Finds and returns the event id which matches with the given value and type (Summary, description or location). Returns event id as string.
143+
144+
<hr/>
145+
146+
### FindPrimaryCalendar
147+
Get the primary calendar in calendar list. Returns null if not found or `GoogleCalendarListModel` if found.
148+
149+
<hr/>
150+
151+
### UpdateCalendar
152+
Updates the specified calendar with given model. Returns `GoogleCalendarModel`.
153+
154+
<hr/>
155+
156+
### UpdateEvent
157+
Updates the event.

0 commit comments

Comments
 (0)