Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Account.OAuth2 / Interop / Interop.Request.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using System.Runtime.InteropServices;
19
20 /// <summary>
21 /// Contains Interop declarations of OAuth2 classes.
22 /// </summary>
23 internal static partial class Interop
24 {
25     /// <summary>
26     /// Wrapper class for OAuth2 native API.
27     /// </summary>
28     internal static partial class Request
29     {
30         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_create")]
31         internal static extern int Create(out IntPtr /* oauth2_request_h */ handle);
32
33         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_destroy")]
34         internal static extern int Destroy(IntPtr /* oauth2_request_h */ handle);
35
36         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_auth_end_point_url")]
37         internal static extern int SetAuthEndPointUrl(IntPtr /* oauth2_request_h */ handle, string url);
38
39         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_token_end_point_url")]
40         internal static extern int SetTokenEndPointUrl(IntPtr /* oauth2_request_h */ handle, string url);
41
42         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_redirection_url")]
43         internal static extern int SetRedirectionUrl(IntPtr /* oauth2_request_h */ handle, string url);
44
45         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_refresh_token_url")]
46         internal static extern int SetRefreshTokenUrl(IntPtr /* oauth2_request_h */ handle, string url);
47
48         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_refresh_token")]
49         internal static extern int SetRefreshToken(IntPtr /* oauth2_request_h */ handle, string refreshToken);
50
51         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_response_type")]
52         internal static extern int SetResponseType(IntPtr /* oauth2_request_h */ handle, ResponseType /* oauth2_response_type_e */ responseType);
53
54         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_client_id")]
55         internal static extern int SetClientId(IntPtr /* oauth2_request_h */ handle, string clientId);
56
57         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_client_secret")]
58         internal static extern int SetClientSecret(IntPtr /* oauth2_request_h */ handle, string clientSecret);
59
60         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_client_authentication_type")]
61         internal static extern int SetClientAuthenticationType(IntPtr /* oauth2_request_h */ handle, int /* oauth2_client_authentication_type_e */ clientAuthType);
62
63         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_scope")]
64         internal static extern int SetScope(IntPtr /* oauth2_request_h */ handle, string scope);
65
66         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_state")]
67         internal static extern int SetState(IntPtr /* oauth2_request_h */ handle, string state);
68
69         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_grant_type")]
70         internal static extern int SetGrantType(IntPtr /* oauth2_request_h */ handle, GrantType /* oauth2_grant_type_e */ grantType);
71
72         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_authorization_code")]
73         internal static extern int SetAuthorizationCode(IntPtr /* oauth2_request_h */ handle, string code);
74
75         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_user_name")]
76         internal static extern int SetUserName(IntPtr /* oauth2_request_h */ handle, string userName);
77
78         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_password")]
79         internal static extern int SetPassword(IntPtr /* oauth2_request_h */ handle, string password);
80
81         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_add_custom_data")]
82         internal static extern int AddCustomData(IntPtr /* oauth2_request_h */ handle, string key, string value);
83
84         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_auth_end_point_url")]
85         internal static extern int GetAuthEndPointUrl(IntPtr /* oauth2_request_h */ handle, out string url);
86
87         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_token_end_point_url")]
88         internal static extern int GetTokenEndPointUrl(IntPtr /* oauth2_request_h */ handle, out string url);
89
90         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_redirection_url")]
91         internal static extern int GetRedirectionUrl(IntPtr /* oauth2_request_h */ handle, out string url);
92
93         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_refresh_token_url")]
94         internal static extern int GetRefreshTokenUrl(IntPtr /* oauth2_request_h */ handle, out string url);
95
96         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_refresh_token")]
97         internal static extern int GetRefreshToken(IntPtr /* oauth2_request_h */ handle, out string refreshToken);
98
99         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_response_type")]
100         internal static extern int GetResponseType(IntPtr /* oauth2_request_h */ handle, out ResponseType /* oauth2_response_type_e */ responseType);
101
102         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_client_id")]
103         internal static extern int GetClientId(IntPtr /* oauth2_request_h */ handle, out string clientId);
104
105         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_client_secret")]
106         internal static extern int GetClientSecret(IntPtr /* oauth2_request_h */ handle, out string clientSecret);
107
108         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_scope")]
109         internal static extern int GetScope(IntPtr /* oauth2_request_h */ handle, out string scope);
110
111         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_state")]
112         internal static extern int GetState(IntPtr /* oauth2_request_h */ handle, out string state);
113
114         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_grant_type")]
115         internal static extern int GetGrantType(IntPtr /* oauth2_request_h */ handle, out GrantType /* oauth2_grant_type_e */ grantType);
116
117         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_authorization_code")]
118         internal static extern int GetAuthorizationCode(IntPtr /* oauth2_request_h */ handle, out string code);
119
120         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_user_name")]
121         internal static extern int GetUserName(IntPtr /* oauth2_request_h */ handle, out string userName);
122
123         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_password")]
124         internal static extern int GetPassword(IntPtr /* oauth2_request_h */ handle, out string password);
125
126         [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_custom_data")]
127         internal static extern int GetCustomData(IntPtr /* oauth2_request_h */ handle, string customKey, out string customValue);
128     }
129 }