20
20
* @return {object } The Auth type.
21
21
*/
22
22
function getAuthType ( ) {
23
- return {
24
- type : 'OAUTH2'
25
- } ;
23
+ var cc = DataStudioApp . createCommunityConnector ( ) ;
24
+ return cc . newAuthTypeResponse ( )
25
+ . setAuthType ( cc . AuthType . OAUTH2 )
26
+ . build ( ) ;
26
27
}
27
28
// [END apps_script_data_studio_get_auth_type_oauth2]
28
29
@@ -32,10 +33,11 @@ function getAuthType() {
32
33
* @return {object } The Auth type.
33
34
*/
34
35
function getAuthType ( ) {
35
- return {
36
- type : 'USER_PASS' ,
37
- helpUrl : 'https://www.example.org/connector-auth-help'
38
- } ;
36
+ var cc = DataStudioApp . createCommunityConnector ( ) ;
37
+ return cc . newAuthTypeResponse ( )
38
+ . setAuthType ( cc . AuthType . USER_PASS )
39
+ . setHelpUrl ( 'https://www.example.org/connector-auth-help' )
40
+ . build ( ) ;
39
41
}
40
42
// [END apps_script_data_studio_get_auth_type_user_pass]
41
43
@@ -45,10 +47,11 @@ function getAuthType() {
45
47
* @return {object } The Auth type.
46
48
*/
47
49
function getAuthType ( ) {
48
- return {
49
- type : 'USER_TOKEN' ,
50
- helpUrl : 'https://www.example.org/connector-auth-help'
51
- } ;
50
+ var cc = DataStudioApp . createCommunityConnector ( ) ;
51
+ return cc . newAuthTypeResponse ( )
52
+ . setAuthType ( cc . AuthType . USER_TOKEN )
53
+ . setHelpUrl ( 'https://www.example.org/connector-auth-help' )
54
+ . build ( ) ;
52
55
}
53
56
// [END apps_script_data_studio_get_auth_type_user_token]
54
57
@@ -58,10 +61,11 @@ function getAuthType() {
58
61
* @return {object } The Auth type.
59
62
*/
60
63
function getAuthType ( ) {
61
- return {
62
- type : 'KEY' ,
63
- helpUrl : 'https://www.example.org/connector-auth-help'
64
- } ;
64
+ var cc = DataStudioApp . createCommunityConnector ( ) ;
65
+ return cc . newAuthTypeResponse ( )
66
+ . setAuthType ( cc . AuthType . KEY )
67
+ . setHelpUrl ( 'https://www.example.org/connector-auth-help' )
68
+ . build ( ) ;
65
69
}
66
70
// [END apps_script_data_studio_get_auth_type_key]
67
71
@@ -71,9 +75,10 @@ function getAuthType() {
71
75
* @return {object } The Auth type.
72
76
*/
73
77
function getAuthType ( ) {
74
- return {
75
- type : 'NONE'
76
- } ;
78
+ var cc = DataStudioApp . createCommunityConnector ( ) ;
79
+ return cc . newAuthTypeResponse ( )
80
+ . setAuthType ( cc . AuthType . NONE )
81
+ . build ( ) ;
77
82
}
78
83
// [END apps_script_data_studio_get_auth_type_none]
79
84
0 commit comments