Modified CloudClient (CPP)
[platform/upstream/iotivity.git] / resource / provisioning / examples / cloudAuth.h
1 /* *****************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * *****************************************************************/
20 #ifndef CLOUD_AUTH_H
21 #define CLOUD_AUTH_H
22
23 /**
24  * Sends Sign UP request to cloud
25  *
26  * @param[in] endPoint         peer endpoint
27  * @param[in] authProvider     authentication provider
28  * @param[in] authToken        authentication token
29  * @param[in] response         response callback
30  * @return  OCStackResult application result
31  */
32 OCStackResult CloudSignUp(OCDevAddr  *endPoint, const char *authProvider, const char *authToken,
33                           OCClientResponseHandler response);
34
35 /**
36  * Sends Sign IN request to cloud
37  *
38  * @param[in] endPoint         peer endpoint
39  * @param[in] response         response callback
40  * @return  OCStackResult application result
41  */
42 OCStackResult CloudSignIn(OCDevAddr  *endPoint, OCClientResponseHandler response);
43
44 /**
45  * Sends Sign IN request to cloud
46  *
47  * @param[in] endPoint         peer endpoint
48  * @param[in] response         response callback
49  * @return  OCStackResult application result
50  */
51 OCStackResult CloudSignOut(OCDevAddr  *endPoint, OCClientResponseHandler response);
52
53 /**
54  * Sends Sign Up request to cloud
55  *
56  * @param[in] ctx                    context
57  * @param[in] handle                 handle
58  * @param[in] response               response from peer
59  * @return  OCStackApplicationResult application result
60  */
61 OCStackApplicationResult handleCloudSignUpResponse(void *ctx,
62                                                    OCDoHandle handle,
63                                                    OCClientResponse *response);
64
65 /**
66  * Sends Sign In request to cloud
67  *
68  * @param[in] ctx                    context
69  * @param[in] handle                 handle
70  * @param[in] response               response from peer
71  * @return  OCStackApplicationResult application result
72  */
73 OCStackApplicationResult handleCloudSignInResponse(void *ctx,
74                                                    OCDoHandle handle,
75                                                    OCClientResponse *response);
76
77 /**
78  * Sends Sign Out request to cloud
79  *
80  * @param[in] ctx                    context
81  * @param[in] handle                 handle
82  * @param[in] response               response from peer
83  * @return  OCStackApplicationResult application result
84  */
85 OCStackApplicationResult handleCloudSignOutResponse(void *ctx,
86                                                     OCDoHandle handle,
87                                                     OCClientResponse *response);
88
89
90 #endif // CLOUD_AUTH_H