From 1539d0c3c7fcd7802d07cab973eb30fe51c31239 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 8 Dec 2022 14:35:17 +0800 Subject: [PATCH 01/19] add dingTalk sdk --- go.mod | 3 + go.sum | 35 +- .../darabonba-openapi/v2/LICENSE | 201 + .../darabonba-openapi/v2/client/client.go | 1834 +++ .../alibabacloud-go/dingtalk/LICENSE | 201 + .../dingtalk/oauth2_1_0/client.go | 1357 ++ .../dingtalk/workflow_1_0/client.go | 10672 ++++++++++++++++ .../alibabacloud-go/tea-utils/v2/LICENSE | 201 + .../tea-utils/v2/service/service.go | 487 + .../tea-utils/v2/service/util.go | 52 + vendor/modules.txt | 12 +- 11 files changed, 15037 insertions(+), 18 deletions(-) create mode 100644 vendor/github.com/alibabacloud-go/darabonba-openapi/v2/LICENSE create mode 100644 vendor/github.com/alibabacloud-go/darabonba-openapi/v2/client/client.go create mode 100644 vendor/github.com/alibabacloud-go/dingtalk/LICENSE create mode 100644 vendor/github.com/alibabacloud-go/dingtalk/oauth2_1_0/client.go create mode 100644 vendor/github.com/alibabacloud-go/dingtalk/workflow_1_0/client.go create mode 100644 vendor/github.com/alibabacloud-go/tea-utils/v2/LICENSE create mode 100644 vendor/github.com/alibabacloud-go/tea-utils/v2/service/service.go create mode 100644 vendor/github.com/alibabacloud-go/tea-utils/v2/service/util.go diff --git a/go.mod b/go.mod index 9101ac0c28..4c7bb8ecd8 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,12 @@ require ( github.com/agiledragon/gomonkey v2.0.2+incompatible github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/alibabacloud-go/darabonba-openapi v0.1.18 + github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2 + github.com/alibabacloud-go/dingtalk v1.4.88 github.com/alibabacloud-go/rds-20140815/v2 v2.1.0 github.com/alibabacloud-go/tea v1.1.19 github.com/alibabacloud-go/tea-utils v1.4.3 + github.com/alibabacloud-go/tea-utils/v2 v2.0.1 github.com/clbanning/mxj/v2 v2.5.6 // indirect github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 github.com/cznic/parser v0.0.0-20181122101858-d773202d5b1f diff --git a/go.sum b/go.sum index 80496c993d..5b8df91e36 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e/go.mod h1:uw9h2sd4WWHOPdJ13MQpwK5qYWKYDumDqxWWIknEQ+k= @@ -118,13 +118,18 @@ github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJ github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= github.com/alibabacloud-go/darabonba-openapi v0.1.18 h1:3eUVmAr7WCJp7fgIvmCd9ZUyuwtJYbtUqJIed5eXCmk= github.com/alibabacloud-go/darabonba-openapi v0.1.18/go.mod h1:PB4HffMhJVmAgNKNq3wYbTUlFvPgxJpTzd1F5pTuUsc= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2 h1:2kR1YkvQloHUstmPcG0Sjk24zTKbza7izzJfJNwBFSs= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= github.com/alibabacloud-go/darabonba-string v1.0.0/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 h1:NqugFkGxx1TXSh/pBcU00Y6bljgDPaFdh5MUSeJ7e50= github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/dingtalk v1.4.88 h1:qFJZFw89cO+Rtzi+l9KjoVsp5JDuNhAxozl6FkJOM8c= +github.com/alibabacloud-go/dingtalk v1.4.88/go.mod h1:D/bjJ/zskKHlTm3H3JgmKWoZOXEM+XOOJzdLltSksxg= github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q= github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= -github.com/alibabacloud-go/openapi-util v0.0.11 h1:iYnqOPR5hyEEnNZmebGyRMkkEJRWUEjDiiaOHZ5aNhA= github.com/alibabacloud-go/openapi-util v0.0.11/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/openapi-util v0.1.0 h1:0z75cIULkDrdEhkLWgi9tnLe+KhAFE/r5Pb3312/eAY= +github.com/alibabacloud-go/openapi-util v0.1.0/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= github.com/alibabacloud-go/rds-20140815/v2 v2.1.0 h1:jw0a3xnMXSxjKaTnlWp82qU6PzSsloha2X7r/2pEZkc= github.com/alibabacloud-go/rds-20140815/v2 v2.1.0/go.mod h1:emxyc338eNNItnkHcNLMWpwiYDM1FJtOJfrWWigOpeY= github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= @@ -137,10 +142,14 @@ github.com/alibabacloud-go/tea v1.1.19/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= github.com/alibabacloud-go/tea-utils v1.4.3 h1:8SzwmmRrOnQ09Hf5a9GyfJc0d7Sjv6fmsZoF4UDbFjo= github.com/alibabacloud-go/tea-utils v1.4.3/go.mod h1:KNcT0oXlZZxOXINnZBs6YvgOd5aYp9U67G+E3R8fcQw= +github.com/alibabacloud-go/tea-utils/v2 v2.0.0/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4= +github.com/alibabacloud-go/tea-utils/v2 v2.0.1 h1:K6kwgo+UiYx+/kr6CO0PN5ACZDzE3nnn9d77215AkTs= +github.com/alibabacloud-go/tea-utils/v2 v2.0.1/go.mod h1:U5MTY10WwlquGPS34DOeomUGBB0gXbLueiq5Trwu0C4= github.com/alibabacloud-go/tea-xml v1.1.2 h1:oLxa7JUXm2EDFzMg+7oRsYc+kutgCVwm+bZlhhmvW5M= github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY= github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= @@ -148,6 +157,7 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/appleboy/gin-jwt/v2 v2.6.3/go.mod h1:MfPYA4ogzvOcVkRwAxT7quHOtQmVKDpTwxyUrC2DNw0= github.com/appleboy/gofight/v2 v2.1.2/go.mod h1:frW+U1QZEdDgixycTj4CygQ48yLTUhplt43+Wczp3rw= github.com/aquarapid/vaultlib v0.5.1/go.mod h1:yT7AlEXtuabkxylOc/+Ulyp18tff1+QjgNLTnFWTlOs= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -221,7 +231,6 @@ github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -260,6 +269,7 @@ github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -537,6 +547,7 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -583,6 +594,7 @@ github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -762,7 +774,6 @@ github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcncea github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -776,7 +787,6 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -812,6 +822,7 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -1011,7 +1022,6 @@ github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OK github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1024,6 +1034,7 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.0.1-0.20180205163309-da645544ed44/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil v2.18.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v2.19.10+incompatible h1:lA4Pi29JEVIQIgATSeftHSY0rMGI9CLrl2ZvDLiahto= @@ -1035,7 +1046,6 @@ github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXY github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20181020040650-a97a25d856ca/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM= @@ -1093,7 +1103,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -1156,7 +1165,6 @@ github.com/unrolled/render v0.0.0-20180914162206-b9786414de4d/go.mod h1:tu82oB5W github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4= github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY= @@ -1268,7 +1276,6 @@ golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1307,7 +1314,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= @@ -1369,7 +1375,6 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210913180222-943fd674d43e h1:+b/22bPvDYt4NPDcy4xAGCmON713ONAWFeY3Z7I3tR8= golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= @@ -1400,8 +1405,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1481,7 +1486,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0 h1:xrCZDmdtoloIiooiA9q0OQb9r8HejIHYoHGhGCe1pGg= golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1586,7 +1590,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= @@ -1699,7 +1702,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= @@ -1754,7 +1756,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/LICENSE b/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/LICENSE new file mode 100644 index 0000000000..0c44dcefe3 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2009-present, Alibaba Cloud All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/client/client.go b/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/client/client.go new file mode 100644 index 0000000000..e4b1a22e4a --- /dev/null +++ b/vendor/github.com/alibabacloud-go/darabonba-openapi/v2/client/client.go @@ -0,0 +1,1834 @@ +// This file is auto-generated, don't edit it. Thanks. +/** + * This is for OpenApi SDK + */ +package client + +import ( + "io" + + spi "github.com/alibabacloud-go/alibabacloud-gateway-spi/client" + openapiutil "github.com/alibabacloud-go/openapi-util/service" + util "github.com/alibabacloud-go/tea-utils/v2/service" + xml "github.com/alibabacloud-go/tea-xml/service" + "github.com/alibabacloud-go/tea/tea" + credential "github.com/aliyun/credentials-go/credentials" +) + +type GlobalParameters struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` + Queries map[string]*string `json:"queries,omitempty" xml:"queries,omitempty"` +} + +func (s GlobalParameters) String() string { + return tea.Prettify(s) +} + +func (s GlobalParameters) GoString() string { + return s.String() +} + +func (s *GlobalParameters) SetHeaders(v map[string]*string) *GlobalParameters { + s.Headers = v + return s +} + +func (s *GlobalParameters) SetQueries(v map[string]*string) *GlobalParameters { + s.Queries = v + return s +} + +/** + * Model for initing client + */ +type Config struct { + // accesskey id + AccessKeyId *string `json:"accessKeyId,omitempty" xml:"accessKeyId,omitempty"` + // accesskey secret + AccessKeySecret *string `json:"accessKeySecret,omitempty" xml:"accessKeySecret,omitempty"` + // security token + SecurityToken *string `json:"securityToken,omitempty" xml:"securityToken,omitempty"` + // http protocol + Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty"` + // http method + Method *string `json:"method,omitempty" xml:"method,omitempty"` + // region id + RegionId *string `json:"regionId,omitempty" xml:"regionId,omitempty"` + // read timeout + ReadTimeout *int `json:"readTimeout,omitempty" xml:"readTimeout,omitempty"` + // connect timeout + ConnectTimeout *int `json:"connectTimeout,omitempty" xml:"connectTimeout,omitempty"` + // http proxy + HttpProxy *string `json:"httpProxy,omitempty" xml:"httpProxy,omitempty"` + // https proxy + HttpsProxy *string `json:"httpsProxy,omitempty" xml:"httpsProxy,omitempty"` + // credential + Credential credential.Credential `json:"credential,omitempty" xml:"credential,omitempty"` + // endpoint + Endpoint *string `json:"endpoint,omitempty" xml:"endpoint,omitempty"` + // proxy white list + NoProxy *string `json:"noProxy,omitempty" xml:"noProxy,omitempty"` + // max idle conns + MaxIdleConns *int `json:"maxIdleConns,omitempty" xml:"maxIdleConns,omitempty"` + // network for endpoint + Network *string `json:"network,omitempty" xml:"network,omitempty"` + // user agent + UserAgent *string `json:"userAgent,omitempty" xml:"userAgent,omitempty"` + // suffix for endpoint + Suffix *string `json:"suffix,omitempty" xml:"suffix,omitempty"` + // socks5 proxy + Socks5Proxy *string `json:"socks5Proxy,omitempty" xml:"socks5Proxy,omitempty"` + // socks5 network + Socks5NetWork *string `json:"socks5NetWork,omitempty" xml:"socks5NetWork,omitempty"` + // endpoint type + EndpointType *string `json:"endpointType,omitempty" xml:"endpointType,omitempty"` + // OpenPlatform endpoint + OpenPlatformEndpoint *string `json:"openPlatformEndpoint,omitempty" xml:"openPlatformEndpoint,omitempty"` + // Deprecated + // credential type + Type *string `json:"type,omitempty" xml:"type,omitempty"` + // Signature Version + SignatureVersion *string `json:"signatureVersion,omitempty" xml:"signatureVersion,omitempty"` + // Signature Algorithm + SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty" xml:"signatureAlgorithm,omitempty"` + // Global Parameters + GlobalParameters *GlobalParameters `json:"globalParameters,omitempty" xml:"globalParameters,omitempty"` +} + +func (s Config) String() string { + return tea.Prettify(s) +} + +func (s Config) GoString() string { + return s.String() +} + +func (s *Config) SetAccessKeyId(v string) *Config { + s.AccessKeyId = &v + return s +} + +func (s *Config) SetAccessKeySecret(v string) *Config { + s.AccessKeySecret = &v + return s +} + +func (s *Config) SetSecurityToken(v string) *Config { + s.SecurityToken = &v + return s +} + +func (s *Config) SetProtocol(v string) *Config { + s.Protocol = &v + return s +} + +func (s *Config) SetMethod(v string) *Config { + s.Method = &v + return s +} + +func (s *Config) SetRegionId(v string) *Config { + s.RegionId = &v + return s +} + +func (s *Config) SetReadTimeout(v int) *Config { + s.ReadTimeout = &v + return s +} + +func (s *Config) SetConnectTimeout(v int) *Config { + s.ConnectTimeout = &v + return s +} + +func (s *Config) SetHttpProxy(v string) *Config { + s.HttpProxy = &v + return s +} + +func (s *Config) SetHttpsProxy(v string) *Config { + s.HttpsProxy = &v + return s +} + +func (s *Config) SetCredential(v credential.Credential) *Config { + s.Credential = v + return s +} + +func (s *Config) SetEndpoint(v string) *Config { + s.Endpoint = &v + return s +} + +func (s *Config) SetNoProxy(v string) *Config { + s.NoProxy = &v + return s +} + +func (s *Config) SetMaxIdleConns(v int) *Config { + s.MaxIdleConns = &v + return s +} + +func (s *Config) SetNetwork(v string) *Config { + s.Network = &v + return s +} + +func (s *Config) SetUserAgent(v string) *Config { + s.UserAgent = &v + return s +} + +func (s *Config) SetSuffix(v string) *Config { + s.Suffix = &v + return s +} + +func (s *Config) SetSocks5Proxy(v string) *Config { + s.Socks5Proxy = &v + return s +} + +func (s *Config) SetSocks5NetWork(v string) *Config { + s.Socks5NetWork = &v + return s +} + +func (s *Config) SetEndpointType(v string) *Config { + s.EndpointType = &v + return s +} + +func (s *Config) SetOpenPlatformEndpoint(v string) *Config { + s.OpenPlatformEndpoint = &v + return s +} + +func (s *Config) SetType(v string) *Config { + s.Type = &v + return s +} + +func (s *Config) SetSignatureVersion(v string) *Config { + s.SignatureVersion = &v + return s +} + +func (s *Config) SetSignatureAlgorithm(v string) *Config { + s.SignatureAlgorithm = &v + return s +} + +func (s *Config) SetGlobalParameters(v *GlobalParameters) *Config { + s.GlobalParameters = v + return s +} + +type OpenApiRequest struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty"` + Query map[string]*string `json:"query,omitempty" xml:"query,omitempty"` + Body interface{} `json:"body,omitempty" xml:"body,omitempty"` + Stream io.Reader `json:"stream,omitempty" xml:"stream,omitempty"` + HostMap map[string]*string `json:"hostMap,omitempty" xml:"hostMap,omitempty"` + EndpointOverride *string `json:"endpointOverride,omitempty" xml:"endpointOverride,omitempty"` +} + +func (s OpenApiRequest) String() string { + return tea.Prettify(s) +} + +func (s OpenApiRequest) GoString() string { + return s.String() +} + +func (s *OpenApiRequest) SetHeaders(v map[string]*string) *OpenApiRequest { + s.Headers = v + return s +} + +func (s *OpenApiRequest) SetQuery(v map[string]*string) *OpenApiRequest { + s.Query = v + return s +} + +func (s *OpenApiRequest) SetBody(v interface{}) *OpenApiRequest { + s.Body = v + return s +} + +func (s *OpenApiRequest) SetStream(v io.Reader) *OpenApiRequest { + s.Stream = v + return s +} + +func (s *OpenApiRequest) SetHostMap(v map[string]*string) *OpenApiRequest { + s.HostMap = v + return s +} + +func (s *OpenApiRequest) SetEndpointOverride(v string) *OpenApiRequest { + s.EndpointOverride = &v + return s +} + +type Params struct { + Action *string `json:"action,omitempty" xml:"action,omitempty" require:"true"` + Version *string `json:"version,omitempty" xml:"version,omitempty" require:"true"` + Protocol *string `json:"protocol,omitempty" xml:"protocol,omitempty" require:"true"` + Pathname *string `json:"pathname,omitempty" xml:"pathname,omitempty" require:"true"` + Method *string `json:"method,omitempty" xml:"method,omitempty" require:"true"` + AuthType *string `json:"authType,omitempty" xml:"authType,omitempty" require:"true"` + BodyType *string `json:"bodyType,omitempty" xml:"bodyType,omitempty" require:"true"` + ReqBodyType *string `json:"reqBodyType,omitempty" xml:"reqBodyType,omitempty" require:"true"` + Style *string `json:"style,omitempty" xml:"style,omitempty"` +} + +func (s Params) String() string { + return tea.Prettify(s) +} + +func (s Params) GoString() string { + return s.String() +} + +func (s *Params) SetAction(v string) *Params { + s.Action = &v + return s +} + +func (s *Params) SetVersion(v string) *Params { + s.Version = &v + return s +} + +func (s *Params) SetProtocol(v string) *Params { + s.Protocol = &v + return s +} + +func (s *Params) SetPathname(v string) *Params { + s.Pathname = &v + return s +} + +func (s *Params) SetMethod(v string) *Params { + s.Method = &v + return s +} + +func (s *Params) SetAuthType(v string) *Params { + s.AuthType = &v + return s +} + +func (s *Params) SetBodyType(v string) *Params { + s.BodyType = &v + return s +} + +func (s *Params) SetReqBodyType(v string) *Params { + s.ReqBodyType = &v + return s +} + +func (s *Params) SetStyle(v string) *Params { + s.Style = &v + return s +} + +type Client struct { + Endpoint *string + RegionId *string + Protocol *string + Method *string + UserAgent *string + EndpointRule *string + EndpointMap map[string]*string + Suffix *string + ReadTimeout *int + ConnectTimeout *int + HttpProxy *string + HttpsProxy *string + Socks5Proxy *string + Socks5NetWork *string + NoProxy *string + Network *string + ProductId *string + MaxIdleConns *int + EndpointType *string + OpenPlatformEndpoint *string + Credential credential.Credential + SignatureVersion *string + SignatureAlgorithm *string + Headers map[string]*string + Spi spi.ClientInterface + GlobalParameters *GlobalParameters +} + +/** + * Init client with Config + * @param config config contains the necessary information to create a client + */ +func NewClient(config *Config) (*Client, error) { + client := new(Client) + err := client.Init(config) + return client, err +} + +func (client *Client) Init(config *Config) (_err error) { + if tea.BoolValue(util.IsUnset(config)) { + _err = tea.NewSDKError(map[string]interface{}{ + "code": "ParameterMissing", + "message": "'config' can not be unset", + }) + return _err + } + + if !tea.BoolValue(util.Empty(config.AccessKeyId)) && !tea.BoolValue(util.Empty(config.AccessKeySecret)) { + if !tea.BoolValue(util.Empty(config.SecurityToken)) { + config.Type = tea.String("sts") + } else { + config.Type = tea.String("access_key") + } + + credentialConfig := &credential.Config{ + AccessKeyId: config.AccessKeyId, + Type: config.Type, + AccessKeySecret: config.AccessKeySecret, + } + credentialConfig.SecurityToken = config.SecurityToken + client.Credential, _err = credential.NewCredential(credentialConfig) + if _err != nil { + return _err + } + + } else if !tea.BoolValue(util.IsUnset(config.Credential)) { + client.Credential = config.Credential + } + + client.Endpoint = config.Endpoint + client.EndpointType = config.EndpointType + client.Network = config.Network + client.Suffix = config.Suffix + client.Protocol = config.Protocol + client.Method = config.Method + client.RegionId = config.RegionId + client.UserAgent = config.UserAgent + client.ReadTimeout = config.ReadTimeout + client.ConnectTimeout = config.ConnectTimeout + client.HttpProxy = config.HttpProxy + client.HttpsProxy = config.HttpsProxy + client.NoProxy = config.NoProxy + client.Socks5Proxy = config.Socks5Proxy + client.Socks5NetWork = config.Socks5NetWork + client.MaxIdleConns = config.MaxIdleConns + client.SignatureVersion = config.SignatureVersion + client.SignatureAlgorithm = config.SignatureAlgorithm + client.GlobalParameters = config.GlobalParameters + return nil +} + +/** + * Encapsulate the request and invoke the network + * @param action api name + * @param version product version + * @param protocol http or https + * @param method e.g. GET + * @param authType authorization type e.g. AK + * @param bodyType response body type e.g. String + * @param request object of OpenApiRequest + * @param runtime which controls some details of call api, such as retry times + * @return the response + */ +func (client *Client) DoRPCRequest(action *string, version *string, protocol *string, method *string, authType *string, bodyType *string, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error) { + _err = tea.Validate(request) + if _err != nil { + return _result, _err + } + _err = tea.Validate(runtime) + if _err != nil { + return _result, _err + } + _runtime := map[string]interface{}{ + "timeouted": "retry", + "readTimeout": tea.IntValue(util.DefaultNumber(runtime.ReadTimeout, client.ReadTimeout)), + "connectTimeout": tea.IntValue(util.DefaultNumber(runtime.ConnectTimeout, client.ConnectTimeout)), + "httpProxy": tea.StringValue(util.DefaultString(runtime.HttpProxy, client.HttpProxy)), + "httpsProxy": tea.StringValue(util.DefaultString(runtime.HttpsProxy, client.HttpsProxy)), + "noProxy": tea.StringValue(util.DefaultString(runtime.NoProxy, client.NoProxy)), + "socks5Proxy": tea.StringValue(util.DefaultString(runtime.Socks5Proxy, client.Socks5Proxy)), + "socks5NetWork": tea.StringValue(util.DefaultString(runtime.Socks5NetWork, client.Socks5NetWork)), + "maxIdleConns": tea.IntValue(util.DefaultNumber(runtime.MaxIdleConns, client.MaxIdleConns)), + "retry": map[string]interface{}{ + "retryable": tea.BoolValue(runtime.Autoretry), + "maxAttempts": tea.IntValue(util.DefaultNumber(runtime.MaxAttempts, tea.Int(3))), + }, + "backoff": map[string]interface{}{ + "policy": tea.StringValue(util.DefaultString(runtime.BackoffPolicy, tea.String("no"))), + "period": tea.IntValue(util.DefaultNumber(runtime.BackoffPeriod, tea.Int(1))), + }, + "ignoreSSL": tea.BoolValue(runtime.IgnoreSSL), + } + + _resp := make(map[string]interface{}) + for _retryTimes := 0; tea.BoolValue(tea.AllowRetry(_runtime["retry"], tea.Int(_retryTimes))); _retryTimes++ { + if _retryTimes > 0 { + _backoffTime := tea.GetBackoffTime(_runtime["backoff"], tea.Int(_retryTimes)) + if tea.IntValue(_backoffTime) > 0 { + tea.Sleep(_backoffTime) + } + } + + _resp, _err = func() (map[string]interface{}, error) { + request_ := tea.NewRequest() + request_.Protocol = util.DefaultString(client.Protocol, protocol) + request_.Method = method + request_.Pathname = tea.String("/") + globalQueries := make(map[string]*string) + globalHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(client.GlobalParameters)) { + globalParams := client.GlobalParameters + if !tea.BoolValue(util.IsUnset(globalParams.Queries)) { + globalQueries = globalParams.Queries + } + + if !tea.BoolValue(util.IsUnset(globalParams.Headers)) { + globalHeaders = globalParams.Headers + } + + } + + request_.Query = tea.Merge(map[string]*string{ + "Action": action, + "Format": tea.String("json"), + "Version": version, + "Timestamp": openapiutil.GetTimestamp(), + "SignatureNonce": util.GetNonce(), + }, globalQueries, + request.Query) + headers, _err := client.GetRpcHeaders() + if _err != nil { + return _result, _err + } + + if tea.BoolValue(util.IsUnset(headers)) { + // endpoint is setted in product client + request_.Headers = tea.Merge(map[string]*string{ + "host": client.Endpoint, + "x-acs-version": version, + "x-acs-action": action, + "user-agent": client.GetUserAgent(), + }, globalHeaders) + } else { + request_.Headers = tea.Merge(map[string]*string{ + "host": client.Endpoint, + "x-acs-version": version, + "x-acs-action": action, + "user-agent": client.GetUserAgent(), + }, globalHeaders, + headers) + } + + if !tea.BoolValue(util.IsUnset(request.Body)) { + m, _err := util.AssertAsMap(request.Body) + if _err != nil { + return _result, _err + } + + tmp := util.AnyifyMapValue(openapiutil.Query(m)) + request_.Body = tea.ToReader(util.ToFormString(tmp)) + request_.Headers["content-type"] = tea.String("application/x-www-form-urlencoded") + } + + if !tea.BoolValue(util.EqualString(authType, tea.String("Anonymous"))) { + accessKeyId, _err := client.GetAccessKeyId() + if _err != nil { + return _result, _err + } + + accessKeySecret, _err := client.GetAccessKeySecret() + if _err != nil { + return _result, _err + } + + securityToken, _err := client.GetSecurityToken() + if _err != nil { + return _result, _err + } + + if !tea.BoolValue(util.Empty(securityToken)) { + request_.Query["SecurityToken"] = securityToken + } + + request_.Query["SignatureMethod"] = tea.String("HMAC-SHA1") + request_.Query["SignatureVersion"] = tea.String("1.0") + request_.Query["AccessKeyId"] = accessKeyId + var t map[string]interface{} + if !tea.BoolValue(util.IsUnset(request.Body)) { + t, _err = util.AssertAsMap(request.Body) + if _err != nil { + return _result, _err + } + + } + + signedParam := tea.Merge(request_.Query, + openapiutil.Query(t)) + request_.Query["Signature"] = openapiutil.GetRPCSignature(signedParam, request_.Method, accessKeySecret) + } + + response_, _err := tea.DoRequest(request_, _runtime) + if _err != nil { + return _result, _err + } + if tea.BoolValue(util.Is4xx(response_.StatusCode)) || tea.BoolValue(util.Is5xx(response_.StatusCode)) { + _res, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + err, _err := util.AssertAsMap(_res) + if _err != nil { + return _result, _err + } + + requestId := DefaultAny(err["RequestId"], err["requestId"]) + err["statusCode"] = response_.StatusCode + _err = tea.NewSDKError(map[string]interface{}{ + "code": tea.ToString(DefaultAny(err["Code"], err["code"])), + "message": "code: " + tea.ToString(tea.IntValue(response_.StatusCode)) + ", " + tea.ToString(DefaultAny(err["Message"], err["message"])) + " request id: " + tea.ToString(requestId), + "data": err, + "description": tea.ToString(DefaultAny(err["Description"], err["description"])), + "accessDeniedDetail": err["AccessDeniedDetail"], + }) + return _result, _err + } + + if tea.BoolValue(util.EqualString(bodyType, tea.String("binary"))) { + resp := map[string]interface{}{ + "body": response_.Body, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + } + _result = resp + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("byte"))) { + byt, _err := util.ReadAsBytes(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": byt, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("string"))) { + str, _err := util.ReadAsString(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": tea.StringValue(str), + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("json"))) { + obj, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + res, _err := util.AssertAsMap(obj) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": res, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("array"))) { + arr, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": arr, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else { + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } + + }() + if !tea.BoolValue(tea.Retryable(_err)) { + break + } + } + + return _resp, _err +} + +/** + * Encapsulate the request and invoke the network + * @param action api name + * @param version product version + * @param protocol http or https + * @param method e.g. GET + * @param authType authorization type e.g. AK + * @param pathname pathname of every api + * @param bodyType response body type e.g. String + * @param request object of OpenApiRequest + * @param runtime which controls some details of call api, such as retry times + * @return the response + */ +func (client *Client) DoROARequest(action *string, version *string, protocol *string, method *string, authType *string, pathname *string, bodyType *string, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error) { + _err = tea.Validate(request) + if _err != nil { + return _result, _err + } + _err = tea.Validate(runtime) + if _err != nil { + return _result, _err + } + _runtime := map[string]interface{}{ + "timeouted": "retry", + "readTimeout": tea.IntValue(util.DefaultNumber(runtime.ReadTimeout, client.ReadTimeout)), + "connectTimeout": tea.IntValue(util.DefaultNumber(runtime.ConnectTimeout, client.ConnectTimeout)), + "httpProxy": tea.StringValue(util.DefaultString(runtime.HttpProxy, client.HttpProxy)), + "httpsProxy": tea.StringValue(util.DefaultString(runtime.HttpsProxy, client.HttpsProxy)), + "noProxy": tea.StringValue(util.DefaultString(runtime.NoProxy, client.NoProxy)), + "socks5Proxy": tea.StringValue(util.DefaultString(runtime.Socks5Proxy, client.Socks5Proxy)), + "socks5NetWork": tea.StringValue(util.DefaultString(runtime.Socks5NetWork, client.Socks5NetWork)), + "maxIdleConns": tea.IntValue(util.DefaultNumber(runtime.MaxIdleConns, client.MaxIdleConns)), + "retry": map[string]interface{}{ + "retryable": tea.BoolValue(runtime.Autoretry), + "maxAttempts": tea.IntValue(util.DefaultNumber(runtime.MaxAttempts, tea.Int(3))), + }, + "backoff": map[string]interface{}{ + "policy": tea.StringValue(util.DefaultString(runtime.BackoffPolicy, tea.String("no"))), + "period": tea.IntValue(util.DefaultNumber(runtime.BackoffPeriod, tea.Int(1))), + }, + "ignoreSSL": tea.BoolValue(runtime.IgnoreSSL), + } + + _resp := make(map[string]interface{}) + for _retryTimes := 0; tea.BoolValue(tea.AllowRetry(_runtime["retry"], tea.Int(_retryTimes))); _retryTimes++ { + if _retryTimes > 0 { + _backoffTime := tea.GetBackoffTime(_runtime["backoff"], tea.Int(_retryTimes)) + if tea.IntValue(_backoffTime) > 0 { + tea.Sleep(_backoffTime) + } + } + + _resp, _err = func() (map[string]interface{}, error) { + request_ := tea.NewRequest() + request_.Protocol = util.DefaultString(client.Protocol, protocol) + request_.Method = method + request_.Pathname = pathname + globalQueries := make(map[string]*string) + globalHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(client.GlobalParameters)) { + globalParams := client.GlobalParameters + if !tea.BoolValue(util.IsUnset(globalParams.Queries)) { + globalQueries = globalParams.Queries + } + + if !tea.BoolValue(util.IsUnset(globalParams.Headers)) { + globalHeaders = globalParams.Headers + } + + } + + request_.Headers = tea.Merge(map[string]*string{ + "date": util.GetDateUTCString(), + "host": client.Endpoint, + "accept": tea.String("application/json"), + "x-acs-signature-nonce": util.GetNonce(), + "x-acs-signature-method": tea.String("HMAC-SHA1"), + "x-acs-signature-version": tea.String("1.0"), + "x-acs-version": version, + "x-acs-action": action, + "user-agent": util.GetUserAgent(client.UserAgent), + }, globalHeaders, + request.Headers) + if !tea.BoolValue(util.IsUnset(request.Body)) { + request_.Body = tea.ToReader(util.ToJSONString(request.Body)) + request_.Headers["content-type"] = tea.String("application/json; charset=utf-8") + } + + request_.Query = globalQueries + if !tea.BoolValue(util.IsUnset(request.Query)) { + request_.Query = tea.Merge(request_.Query, + request.Query) + } + + if !tea.BoolValue(util.EqualString(authType, tea.String("Anonymous"))) { + accessKeyId, _err := client.GetAccessKeyId() + if _err != nil { + return _result, _err + } + + accessKeySecret, _err := client.GetAccessKeySecret() + if _err != nil { + return _result, _err + } + + securityToken, _err := client.GetSecurityToken() + if _err != nil { + return _result, _err + } + + if !tea.BoolValue(util.Empty(securityToken)) { + request_.Headers["x-acs-accesskey-id"] = accessKeyId + request_.Headers["x-acs-security-token"] = securityToken + } + + stringToSign := openapiutil.GetStringToSign(request_) + request_.Headers["authorization"] = tea.String("acs " + tea.StringValue(accessKeyId) + ":" + tea.StringValue(openapiutil.GetROASignature(stringToSign, accessKeySecret))) + } + + response_, _err := tea.DoRequest(request_, _runtime) + if _err != nil { + return _result, _err + } + if tea.BoolValue(util.EqualNumber(response_.StatusCode, tea.Int(204))) { + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]map[string]*string{ + "headers": response_.Headers, + }, &_result) + return _result, _err + } + + if tea.BoolValue(util.Is4xx(response_.StatusCode)) || tea.BoolValue(util.Is5xx(response_.StatusCode)) { + _res, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + err, _err := util.AssertAsMap(_res) + if _err != nil { + return _result, _err + } + + requestId := DefaultAny(err["RequestId"], err["requestId"]) + requestId = DefaultAny(requestId, err["requestid"]) + err["statusCode"] = response_.StatusCode + _err = tea.NewSDKError(map[string]interface{}{ + "code": tea.ToString(DefaultAny(err["Code"], err["code"])), + "message": "code: " + tea.ToString(tea.IntValue(response_.StatusCode)) + ", " + tea.ToString(DefaultAny(err["Message"], err["message"])) + " request id: " + tea.ToString(requestId), + "data": err, + "description": tea.ToString(DefaultAny(err["Description"], err["description"])), + "accessDeniedDetail": err["AccessDeniedDetail"], + }) + return _result, _err + } + + if tea.BoolValue(util.EqualString(bodyType, tea.String("binary"))) { + resp := map[string]interface{}{ + "body": response_.Body, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + } + _result = resp + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("byte"))) { + byt, _err := util.ReadAsBytes(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": byt, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("string"))) { + str, _err := util.ReadAsString(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": tea.StringValue(str), + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("json"))) { + obj, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + res, _err := util.AssertAsMap(obj) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": res, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("array"))) { + arr, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": arr, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else { + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } + + }() + if !tea.BoolValue(tea.Retryable(_err)) { + break + } + } + + return _resp, _err +} + +/** + * Encapsulate the request and invoke the network with form body + * @param action api name + * @param version product version + * @param protocol http or https + * @param method e.g. GET + * @param authType authorization type e.g. AK + * @param pathname pathname of every api + * @param bodyType response body type e.g. String + * @param request object of OpenApiRequest + * @param runtime which controls some details of call api, such as retry times + * @return the response + */ +func (client *Client) DoROARequestWithForm(action *string, version *string, protocol *string, method *string, authType *string, pathname *string, bodyType *string, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error) { + _err = tea.Validate(request) + if _err != nil { + return _result, _err + } + _err = tea.Validate(runtime) + if _err != nil { + return _result, _err + } + _runtime := map[string]interface{}{ + "timeouted": "retry", + "readTimeout": tea.IntValue(util.DefaultNumber(runtime.ReadTimeout, client.ReadTimeout)), + "connectTimeout": tea.IntValue(util.DefaultNumber(runtime.ConnectTimeout, client.ConnectTimeout)), + "httpProxy": tea.StringValue(util.DefaultString(runtime.HttpProxy, client.HttpProxy)), + "httpsProxy": tea.StringValue(util.DefaultString(runtime.HttpsProxy, client.HttpsProxy)), + "noProxy": tea.StringValue(util.DefaultString(runtime.NoProxy, client.NoProxy)), + "socks5Proxy": tea.StringValue(util.DefaultString(runtime.Socks5Proxy, client.Socks5Proxy)), + "socks5NetWork": tea.StringValue(util.DefaultString(runtime.Socks5NetWork, client.Socks5NetWork)), + "maxIdleConns": tea.IntValue(util.DefaultNumber(runtime.MaxIdleConns, client.MaxIdleConns)), + "retry": map[string]interface{}{ + "retryable": tea.BoolValue(runtime.Autoretry), + "maxAttempts": tea.IntValue(util.DefaultNumber(runtime.MaxAttempts, tea.Int(3))), + }, + "backoff": map[string]interface{}{ + "policy": tea.StringValue(util.DefaultString(runtime.BackoffPolicy, tea.String("no"))), + "period": tea.IntValue(util.DefaultNumber(runtime.BackoffPeriod, tea.Int(1))), + }, + "ignoreSSL": tea.BoolValue(runtime.IgnoreSSL), + } + + _resp := make(map[string]interface{}) + for _retryTimes := 0; tea.BoolValue(tea.AllowRetry(_runtime["retry"], tea.Int(_retryTimes))); _retryTimes++ { + if _retryTimes > 0 { + _backoffTime := tea.GetBackoffTime(_runtime["backoff"], tea.Int(_retryTimes)) + if tea.IntValue(_backoffTime) > 0 { + tea.Sleep(_backoffTime) + } + } + + _resp, _err = func() (map[string]interface{}, error) { + request_ := tea.NewRequest() + request_.Protocol = util.DefaultString(client.Protocol, protocol) + request_.Method = method + request_.Pathname = pathname + globalQueries := make(map[string]*string) + globalHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(client.GlobalParameters)) { + globalParams := client.GlobalParameters + if !tea.BoolValue(util.IsUnset(globalParams.Queries)) { + globalQueries = globalParams.Queries + } + + if !tea.BoolValue(util.IsUnset(globalParams.Headers)) { + globalHeaders = globalParams.Headers + } + + } + + request_.Headers = tea.Merge(map[string]*string{ + "date": util.GetDateUTCString(), + "host": client.Endpoint, + "accept": tea.String("application/json"), + "x-acs-signature-nonce": util.GetNonce(), + "x-acs-signature-method": tea.String("HMAC-SHA1"), + "x-acs-signature-version": tea.String("1.0"), + "x-acs-version": version, + "x-acs-action": action, + "user-agent": util.GetUserAgent(client.UserAgent), + }, globalHeaders, + request.Headers) + if !tea.BoolValue(util.IsUnset(request.Body)) { + m, _err := util.AssertAsMap(request.Body) + if _err != nil { + return _result, _err + } + + request_.Body = tea.ToReader(openapiutil.ToForm(m)) + request_.Headers["content-type"] = tea.String("application/x-www-form-urlencoded") + } + + request_.Query = globalQueries + if !tea.BoolValue(util.IsUnset(request.Query)) { + request_.Query = tea.Merge(request_.Query, + request.Query) + } + + if !tea.BoolValue(util.EqualString(authType, tea.String("Anonymous"))) { + accessKeyId, _err := client.GetAccessKeyId() + if _err != nil { + return _result, _err + } + + accessKeySecret, _err := client.GetAccessKeySecret() + if _err != nil { + return _result, _err + } + + securityToken, _err := client.GetSecurityToken() + if _err != nil { + return _result, _err + } + + if !tea.BoolValue(util.Empty(securityToken)) { + request_.Headers["x-acs-accesskey-id"] = accessKeyId + request_.Headers["x-acs-security-token"] = securityToken + } + + stringToSign := openapiutil.GetStringToSign(request_) + request_.Headers["authorization"] = tea.String("acs " + tea.StringValue(accessKeyId) + ":" + tea.StringValue(openapiutil.GetROASignature(stringToSign, accessKeySecret))) + } + + response_, _err := tea.DoRequest(request_, _runtime) + if _err != nil { + return _result, _err + } + if tea.BoolValue(util.EqualNumber(response_.StatusCode, tea.Int(204))) { + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]map[string]*string{ + "headers": response_.Headers, + }, &_result) + return _result, _err + } + + if tea.BoolValue(util.Is4xx(response_.StatusCode)) || tea.BoolValue(util.Is5xx(response_.StatusCode)) { + _res, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + err, _err := util.AssertAsMap(_res) + if _err != nil { + return _result, _err + } + + err["statusCode"] = response_.StatusCode + _err = tea.NewSDKError(map[string]interface{}{ + "code": tea.ToString(DefaultAny(err["Code"], err["code"])), + "message": "code: " + tea.ToString(tea.IntValue(response_.StatusCode)) + ", " + tea.ToString(DefaultAny(err["Message"], err["message"])) + " request id: " + tea.ToString(DefaultAny(err["RequestId"], err["requestId"])), + "data": err, + "description": tea.ToString(DefaultAny(err["Description"], err["description"])), + "accessDeniedDetail": err["AccessDeniedDetail"], + }) + return _result, _err + } + + if tea.BoolValue(util.EqualString(bodyType, tea.String("binary"))) { + resp := map[string]interface{}{ + "body": response_.Body, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + } + _result = resp + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("byte"))) { + byt, _err := util.ReadAsBytes(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": byt, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("string"))) { + str, _err := util.ReadAsString(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": tea.StringValue(str), + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("json"))) { + obj, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + res, _err := util.AssertAsMap(obj) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": res, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(bodyType, tea.String("array"))) { + arr, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": arr, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else { + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } + + }() + if !tea.BoolValue(tea.Retryable(_err)) { + break + } + } + + return _resp, _err +} + +/** + * Encapsulate the request and invoke the network + * @param action api name + * @param version product version + * @param protocol http or https + * @param method e.g. GET + * @param authType authorization type e.g. AK + * @param bodyType response body type e.g. String + * @param request object of OpenApiRequest + * @param runtime which controls some details of call api, such as retry times + * @return the response + */ +func (client *Client) DoRequest(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error) { + _err = tea.Validate(params) + if _err != nil { + return _result, _err + } + _err = tea.Validate(request) + if _err != nil { + return _result, _err + } + _err = tea.Validate(runtime) + if _err != nil { + return _result, _err + } + _runtime := map[string]interface{}{ + "timeouted": "retry", + "readTimeout": tea.IntValue(util.DefaultNumber(runtime.ReadTimeout, client.ReadTimeout)), + "connectTimeout": tea.IntValue(util.DefaultNumber(runtime.ConnectTimeout, client.ConnectTimeout)), + "httpProxy": tea.StringValue(util.DefaultString(runtime.HttpProxy, client.HttpProxy)), + "httpsProxy": tea.StringValue(util.DefaultString(runtime.HttpsProxy, client.HttpsProxy)), + "noProxy": tea.StringValue(util.DefaultString(runtime.NoProxy, client.NoProxy)), + "socks5Proxy": tea.StringValue(util.DefaultString(runtime.Socks5Proxy, client.Socks5Proxy)), + "socks5NetWork": tea.StringValue(util.DefaultString(runtime.Socks5NetWork, client.Socks5NetWork)), + "maxIdleConns": tea.IntValue(util.DefaultNumber(runtime.MaxIdleConns, client.MaxIdleConns)), + "retry": map[string]interface{}{ + "retryable": tea.BoolValue(runtime.Autoretry), + "maxAttempts": tea.IntValue(util.DefaultNumber(runtime.MaxAttempts, tea.Int(3))), + }, + "backoff": map[string]interface{}{ + "policy": tea.StringValue(util.DefaultString(runtime.BackoffPolicy, tea.String("no"))), + "period": tea.IntValue(util.DefaultNumber(runtime.BackoffPeriod, tea.Int(1))), + }, + "ignoreSSL": tea.BoolValue(runtime.IgnoreSSL), + } + + _resp := make(map[string]interface{}) + for _retryTimes := 0; tea.BoolValue(tea.AllowRetry(_runtime["retry"], tea.Int(_retryTimes))); _retryTimes++ { + if _retryTimes > 0 { + _backoffTime := tea.GetBackoffTime(_runtime["backoff"], tea.Int(_retryTimes)) + if tea.IntValue(_backoffTime) > 0 { + tea.Sleep(_backoffTime) + } + } + + _resp, _err = func() (map[string]interface{}, error) { + request_ := tea.NewRequest() + request_.Protocol = util.DefaultString(client.Protocol, params.Protocol) + request_.Method = params.Method + request_.Pathname = params.Pathname + globalQueries := make(map[string]*string) + globalHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(client.GlobalParameters)) { + globalParams := client.GlobalParameters + if !tea.BoolValue(util.IsUnset(globalParams.Queries)) { + globalQueries = globalParams.Queries + } + + if !tea.BoolValue(util.IsUnset(globalParams.Headers)) { + globalHeaders = globalParams.Headers + } + + } + + request_.Query = tea.Merge(globalQueries, + request.Query) + // endpoint is setted in product client + request_.Headers = tea.Merge(map[string]*string{ + "host": client.Endpoint, + "x-acs-version": params.Version, + "x-acs-action": params.Action, + "user-agent": client.GetUserAgent(), + "x-acs-date": openapiutil.GetTimestamp(), + "x-acs-signature-nonce": util.GetNonce(), + "accept": tea.String("application/json"), + }, globalHeaders, + request.Headers) + if tea.BoolValue(util.EqualString(params.Style, tea.String("RPC"))) { + headers, _err := client.GetRpcHeaders() + if _err != nil { + return _result, _err + } + + if !tea.BoolValue(util.IsUnset(headers)) { + request_.Headers = tea.Merge(request_.Headers, + headers) + } + + } + + signatureAlgorithm := util.DefaultString(client.SignatureAlgorithm, tea.String("ACS3-HMAC-SHA256")) + hashedRequestPayload := openapiutil.HexEncode(openapiutil.Hash(util.ToBytes(tea.String("")), signatureAlgorithm)) + if !tea.BoolValue(util.IsUnset(request.Stream)) { + tmp, _err := util.ReadAsBytes(request.Stream) + if _err != nil { + return _result, _err + } + + hashedRequestPayload = openapiutil.HexEncode(openapiutil.Hash(tmp, signatureAlgorithm)) + request_.Body = tea.ToReader(tmp) + request_.Headers["content-type"] = tea.String("application/octet-stream") + } else { + if !tea.BoolValue(util.IsUnset(request.Body)) { + if tea.BoolValue(util.EqualString(params.ReqBodyType, tea.String("json"))) { + jsonObj := util.ToJSONString(request.Body) + hashedRequestPayload = openapiutil.HexEncode(openapiutil.Hash(util.ToBytes(jsonObj), signatureAlgorithm)) + request_.Body = tea.ToReader(jsonObj) + request_.Headers["content-type"] = tea.String("application/json; charset=utf-8") + } else { + m, _err := util.AssertAsMap(request.Body) + if _err != nil { + return _result, _err + } + + formObj := openapiutil.ToForm(m) + hashedRequestPayload = openapiutil.HexEncode(openapiutil.Hash(util.ToBytes(formObj), signatureAlgorithm)) + request_.Body = tea.ToReader(formObj) + request_.Headers["content-type"] = tea.String("application/x-www-form-urlencoded") + } + + } + + } + + request_.Headers["x-acs-content-sha256"] = hashedRequestPayload + if !tea.BoolValue(util.EqualString(params.AuthType, tea.String("Anonymous"))) { + authType, _err := client.GetType() + if _err != nil { + return _result, _err + } + + if tea.BoolValue(util.EqualString(authType, tea.String("bearer"))) { + bearerToken, _err := client.GetBearerToken() + if _err != nil { + return _result, _err + } + + request_.Headers["x-acs-bearer-token"] = bearerToken + } else { + accessKeyId, _err := client.GetAccessKeyId() + if _err != nil { + return _result, _err + } + + accessKeySecret, _err := client.GetAccessKeySecret() + if _err != nil { + return _result, _err + } + + securityToken, _err := client.GetSecurityToken() + if _err != nil { + return _result, _err + } + + if !tea.BoolValue(util.Empty(securityToken)) { + request_.Headers["x-acs-accesskey-id"] = accessKeyId + request_.Headers["x-acs-security-token"] = securityToken + } + + request_.Headers["Authorization"] = openapiutil.GetAuthorization(request_, signatureAlgorithm, hashedRequestPayload, accessKeyId, accessKeySecret) + } + + } + + response_, _err := tea.DoRequest(request_, _runtime) + if _err != nil { + return _result, _err + } + if tea.BoolValue(util.Is4xx(response_.StatusCode)) || tea.BoolValue(util.Is5xx(response_.StatusCode)) { + err := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(response_.Headers["content-type"])) && tea.BoolValue(util.EqualString(response_.Headers["content-type"], tea.String("text/xml;charset=utf-8"))) { + _str, _err := util.ReadAsString(response_.Body) + if _err != nil { + return _result, _err + } + + respMap := xml.ParseXml(_str, nil) + err, _err = util.AssertAsMap(respMap["Error"]) + if _err != nil { + return _result, _err + } + + } else { + _res, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + err, _err = util.AssertAsMap(_res) + if _err != nil { + return _result, _err + } + + } + + err["statusCode"] = response_.StatusCode + _err = tea.NewSDKError(map[string]interface{}{ + "code": tea.ToString(DefaultAny(err["Code"], err["code"])), + "message": "code: " + tea.ToString(tea.IntValue(response_.StatusCode)) + ", " + tea.ToString(DefaultAny(err["Message"], err["message"])) + " request id: " + tea.ToString(DefaultAny(err["RequestId"], err["requestId"])), + "data": err, + "description": tea.ToString(DefaultAny(err["Description"], err["description"])), + "accessDeniedDetail": err["AccessDeniedDetail"], + }) + return _result, _err + } + + if tea.BoolValue(util.EqualString(params.BodyType, tea.String("binary"))) { + resp := map[string]interface{}{ + "body": response_.Body, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + } + _result = resp + return _result, _err + } else if tea.BoolValue(util.EqualString(params.BodyType, tea.String("byte"))) { + byt, _err := util.ReadAsBytes(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": byt, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(params.BodyType, tea.String("string"))) { + str, _err := util.ReadAsString(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": tea.StringValue(str), + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(params.BodyType, tea.String("json"))) { + obj, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + res, _err := util.AssertAsMap(obj) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": res, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else if tea.BoolValue(util.EqualString(params.BodyType, tea.String("array"))) { + arr, _err := util.ReadAsJSON(response_.Body) + if _err != nil { + return _result, _err + } + + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "body": arr, + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } else { + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "headers": response_.Headers, + "statusCode": tea.IntValue(response_.StatusCode), + }, &_result) + return _result, _err + } + + }() + if !tea.BoolValue(tea.Retryable(_err)) { + break + } + } + + return _resp, _err +} + +/** + * Encapsulate the request and invoke the network + * @param action api name + * @param version product version + * @param protocol http or https + * @param method e.g. GET + * @param authType authorization type e.g. AK + * @param bodyType response body type e.g. String + * @param request object of OpenApiRequest + * @param runtime which controls some details of call api, such as retry times + * @return the response + */ +func (client *Client) Execute(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error) { + _err = tea.Validate(params) + if _err != nil { + return _result, _err + } + _err = tea.Validate(request) + if _err != nil { + return _result, _err + } + _err = tea.Validate(runtime) + if _err != nil { + return _result, _err + } + _runtime := map[string]interface{}{ + "timeouted": "retry", + "readTimeout": tea.IntValue(util.DefaultNumber(runtime.ReadTimeout, client.ReadTimeout)), + "connectTimeout": tea.IntValue(util.DefaultNumber(runtime.ConnectTimeout, client.ConnectTimeout)), + "httpProxy": tea.StringValue(util.DefaultString(runtime.HttpProxy, client.HttpProxy)), + "httpsProxy": tea.StringValue(util.DefaultString(runtime.HttpsProxy, client.HttpsProxy)), + "noProxy": tea.StringValue(util.DefaultString(runtime.NoProxy, client.NoProxy)), + "socks5Proxy": tea.StringValue(util.DefaultString(runtime.Socks5Proxy, client.Socks5Proxy)), + "socks5NetWork": tea.StringValue(util.DefaultString(runtime.Socks5NetWork, client.Socks5NetWork)), + "maxIdleConns": tea.IntValue(util.DefaultNumber(runtime.MaxIdleConns, client.MaxIdleConns)), + "retry": map[string]interface{}{ + "retryable": tea.BoolValue(runtime.Autoretry), + "maxAttempts": tea.IntValue(util.DefaultNumber(runtime.MaxAttempts, tea.Int(3))), + }, + "backoff": map[string]interface{}{ + "policy": tea.StringValue(util.DefaultString(runtime.BackoffPolicy, tea.String("no"))), + "period": tea.IntValue(util.DefaultNumber(runtime.BackoffPeriod, tea.Int(1))), + }, + "ignoreSSL": tea.BoolValue(runtime.IgnoreSSL), + } + + _resp := make(map[string]interface{}) + for _retryTimes := 0; tea.BoolValue(tea.AllowRetry(_runtime["retry"], tea.Int(_retryTimes))); _retryTimes++ { + if _retryTimes > 0 { + _backoffTime := tea.GetBackoffTime(_runtime["backoff"], tea.Int(_retryTimes)) + if tea.IntValue(_backoffTime) > 0 { + tea.Sleep(_backoffTime) + } + } + + _resp, _err = func() (map[string]interface{}, error) { + request_ := tea.NewRequest() + // spi = new Gateway();//Gateway implements SPI,这一步在产品 SDK 中实例化 + headers, _err := client.GetRpcHeaders() + if _err != nil { + return _result, _err + } + + globalQueries := make(map[string]*string) + globalHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(client.GlobalParameters)) { + globalParams := client.GlobalParameters + if !tea.BoolValue(util.IsUnset(globalParams.Queries)) { + globalQueries = globalParams.Queries + } + + if !tea.BoolValue(util.IsUnset(globalParams.Headers)) { + globalHeaders = globalParams.Headers + } + + } + + requestContext := &spi.InterceptorContextRequest{ + Headers: tea.Merge(globalHeaders, + request.Headers, + headers), + Query: tea.Merge(globalQueries, + request.Query), + Body: request.Body, + Stream: request.Stream, + HostMap: request.HostMap, + Pathname: params.Pathname, + ProductId: client.ProductId, + Action: params.Action, + Version: params.Version, + Protocol: util.DefaultString(client.Protocol, params.Protocol), + Method: util.DefaultString(client.Method, params.Method), + AuthType: params.AuthType, + BodyType: params.BodyType, + ReqBodyType: params.ReqBodyType, + Style: params.Style, + Credential: client.Credential, + SignatureVersion: client.SignatureVersion, + SignatureAlgorithm: client.SignatureAlgorithm, + UserAgent: client.GetUserAgent(), + } + configurationContext := &spi.InterceptorContextConfiguration{ + RegionId: client.RegionId, + Endpoint: util.DefaultString(request.EndpointOverride, client.Endpoint), + EndpointRule: client.EndpointRule, + EndpointMap: client.EndpointMap, + EndpointType: client.EndpointType, + Network: client.Network, + Suffix: client.Suffix, + } + interceptorContext := &spi.InterceptorContext{ + Request: requestContext, + Configuration: configurationContext, + } + attributeMap := &spi.AttributeMap{} + // 1. spi.modifyConfiguration(context: SPI.InterceptorContext, attributeMap: SPI.AttributeMap); + _err = client.Spi.ModifyConfiguration(interceptorContext, attributeMap) + if _err != nil { + return _result, _err + } + // 2. spi.modifyRequest(context: SPI.InterceptorContext, attributeMap: SPI.AttributeMap); + _err = client.Spi.ModifyRequest(interceptorContext, attributeMap) + if _err != nil { + return _result, _err + } + request_.Protocol = interceptorContext.Request.Protocol + request_.Method = interceptorContext.Request.Method + request_.Pathname = interceptorContext.Request.Pathname + request_.Query = interceptorContext.Request.Query + request_.Body = interceptorContext.Request.Stream + request_.Headers = interceptorContext.Request.Headers + response_, _err := tea.DoRequest(request_, _runtime) + if _err != nil { + return _result, _err + } + responseContext := &spi.InterceptorContextResponse{ + StatusCode: response_.StatusCode, + Headers: response_.Headers, + Body: response_.Body, + } + interceptorContext.Response = responseContext + // 3. spi.modifyResponse(context: SPI.InterceptorContext, attributeMap: SPI.AttributeMap); + _err = client.Spi.ModifyResponse(interceptorContext, attributeMap) + if _err != nil { + return _result, _err + } + _result = make(map[string]interface{}) + _err = tea.Convert(map[string]interface{}{ + "headers": interceptorContext.Response.Headers, + "statusCode": tea.IntValue(interceptorContext.Response.StatusCode), + "body": interceptorContext.Response.DeserializedBody, + }, &_result) + return _result, _err + }() + if !tea.BoolValue(tea.Retryable(_err)) { + break + } + } + + return _resp, _err +} + +func (client *Client) CallApi(params *Params, request *OpenApiRequest, runtime *util.RuntimeOptions) (_result map[string]interface{}, _err error) { + if tea.BoolValue(util.IsUnset(params)) { + _err = tea.NewSDKError(map[string]interface{}{ + "code": "ParameterMissing", + "message": "'params' can not be unset", + }) + return _result, _err + } + + if tea.BoolValue(util.IsUnset(client.SignatureAlgorithm)) || !tea.BoolValue(util.EqualString(client.SignatureAlgorithm, tea.String("v2"))) { + _result = make(map[string]interface{}) + _body, _err := client.DoRequest(params, request, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err + } else if tea.BoolValue(util.EqualString(params.Style, tea.String("ROA"))) && tea.BoolValue(util.EqualString(params.ReqBodyType, tea.String("json"))) { + _result = make(map[string]interface{}) + _body, _err := client.DoROARequest(params.Action, params.Version, params.Protocol, params.Method, params.AuthType, params.Pathname, params.BodyType, request, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err + } else if tea.BoolValue(util.EqualString(params.Style, tea.String("ROA"))) { + _result = make(map[string]interface{}) + _body, _err := client.DoROARequestWithForm(params.Action, params.Version, params.Protocol, params.Method, params.AuthType, params.Pathname, params.BodyType, request, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err + } else { + _result = make(map[string]interface{}) + _body, _err := client.DoRPCRequest(params.Action, params.Version, params.Protocol, params.Method, params.AuthType, params.BodyType, request, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err + } + +} + +/** + * Get user agent + * @return user agent + */ +func (client *Client) GetUserAgent() (_result *string) { + userAgent := util.GetUserAgent(client.UserAgent) + _result = userAgent + return _result +} + +/** + * Get accesskey id by using credential + * @return accesskey id + */ +func (client *Client) GetAccessKeyId() (_result *string, _err error) { + if tea.BoolValue(util.IsUnset(client.Credential)) { + _result = tea.String("") + return _result, _err + } + + accessKeyId, _err := client.Credential.GetAccessKeyId() + if _err != nil { + return _result, _err + } + + _result = accessKeyId + return _result, _err +} + +/** + * Get accesskey secret by using credential + * @return accesskey secret + */ +func (client *Client) GetAccessKeySecret() (_result *string, _err error) { + if tea.BoolValue(util.IsUnset(client.Credential)) { + _result = tea.String("") + return _result, _err + } + + secret, _err := client.Credential.GetAccessKeySecret() + if _err != nil { + return _result, _err + } + + _result = secret + return _result, _err +} + +/** + * Get security token by using credential + * @return security token + */ +func (client *Client) GetSecurityToken() (_result *string, _err error) { + if tea.BoolValue(util.IsUnset(client.Credential)) { + _result = tea.String("") + return _result, _err + } + + token, _err := client.Credential.GetSecurityToken() + if _err != nil { + return _result, _err + } + + _result = token + return _result, _err +} + +/** + * Get bearer token by credential + * @return bearer token + */ +func (client *Client) GetBearerToken() (_result *string, _err error) { + if tea.BoolValue(util.IsUnset(client.Credential)) { + _result = tea.String("") + return _result, _err + } + + token := client.Credential.GetBearerToken() + _result = token + return _result, _err +} + +/** + * Get credential type by credential + * @return credential type e.g. access_key + */ +func (client *Client) GetType() (_result *string, _err error) { + if tea.BoolValue(util.IsUnset(client.Credential)) { + _result = tea.String("") + return _result, _err + } + + authType := client.Credential.GetType() + _result = authType + return _result, _err +} + +/** + * If inputValue is not null, return it or return defaultValue + * @param inputValue users input value + * @param defaultValue default value + * @return the final result + */ +func DefaultAny(inputValue interface{}, defaultValue interface{}) (_result interface{}) { + if tea.BoolValue(util.IsUnset(inputValue)) { + _result = defaultValue + return _result + } + + _result = inputValue + return _result +} + +/** + * If the endpointRule and config.endpoint are empty, throw error + * @param config config contains the necessary information to create a client + */ +func (client *Client) CheckConfig(config *Config) (_err error) { + if tea.BoolValue(util.Empty(client.EndpointRule)) && tea.BoolValue(util.Empty(config.Endpoint)) { + _err = tea.NewSDKError(map[string]interface{}{ + "code": "ParameterMissing", + "message": "'config.endpoint' can not be empty", + }) + return _err + } + + return _err +} + +/** + * set gateway client + * @param spi. + */ +func (client *Client) SetGatewayClient(spi spi.ClientInterface) (_err error) { + client.Spi = spi + return _err +} + +/** + * set RPC header for debug + * @param headers headers for debug, this header can be used only once. + */ +func (client *Client) SetRpcHeaders(headers map[string]*string) (_err error) { + client.Headers = headers + return _err +} + +/** + * get RPC header for debug + */ +func (client *Client) GetRpcHeaders() (_result map[string]*string, _err error) { + headers := client.Headers + client.Headers = nil + _result = headers + return _result, _err +} diff --git a/vendor/github.com/alibabacloud-go/dingtalk/LICENSE b/vendor/github.com/alibabacloud-go/dingtalk/LICENSE new file mode 100644 index 0000000000..0c44dcefe3 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/dingtalk/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2009-present, Alibaba Cloud All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/alibabacloud-go/dingtalk/oauth2_1_0/client.go b/vendor/github.com/alibabacloud-go/dingtalk/oauth2_1_0/client.go new file mode 100644 index 0000000000..371333e7b4 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/dingtalk/oauth2_1_0/client.go @@ -0,0 +1,1357 @@ +// This file is auto-generated, don't edit it. Thanks. +/** + * + */ +package oauth2_1_0 + +import ( + openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" + openapiutil "github.com/alibabacloud-go/openapi-util/service" + util "github.com/alibabacloud-go/tea-utils/v2/service" + "github.com/alibabacloud-go/tea/tea" +) + +type CreateJsapiTicketHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s CreateJsapiTicketHeaders) String() string { + return tea.Prettify(s) +} + +func (s CreateJsapiTicketHeaders) GoString() string { + return s.String() +} + +func (s *CreateJsapiTicketHeaders) SetCommonHeaders(v map[string]*string) *CreateJsapiTicketHeaders { + s.CommonHeaders = v + return s +} + +func (s *CreateJsapiTicketHeaders) SetXAcsDingtalkAccessToken(v string) *CreateJsapiTicketHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type CreateJsapiTicketResponseBody struct { + // 超时时间 + ExpireIn *int64 `json:"expireIn,omitempty" xml:"expireIn,omitempty"` + // jsapi ticket + JsapiTicket *string `json:"jsapiTicket,omitempty" xml:"jsapiTicket,omitempty"` +} + +func (s CreateJsapiTicketResponseBody) String() string { + return tea.Prettify(s) +} + +func (s CreateJsapiTicketResponseBody) GoString() string { + return s.String() +} + +func (s *CreateJsapiTicketResponseBody) SetExpireIn(v int64) *CreateJsapiTicketResponseBody { + s.ExpireIn = &v + return s +} + +func (s *CreateJsapiTicketResponseBody) SetJsapiTicket(v string) *CreateJsapiTicketResponseBody { + s.JsapiTicket = &v + return s +} + +type CreateJsapiTicketResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *CreateJsapiTicketResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s CreateJsapiTicketResponse) String() string { + return tea.Prettify(s) +} + +func (s CreateJsapiTicketResponse) GoString() string { + return s.String() +} + +func (s *CreateJsapiTicketResponse) SetHeaders(v map[string]*string) *CreateJsapiTicketResponse { + s.Headers = v + return s +} + +func (s *CreateJsapiTicketResponse) SetBody(v *CreateJsapiTicketResponseBody) *CreateJsapiTicketResponse { + s.Body = v + return s +} + +type GetAccessTokenRequest struct { + // 应用id + AppKey *string `json:"appKey,omitempty" xml:"appKey,omitempty"` + // 应用密码 + AppSecret *string `json:"appSecret,omitempty" xml:"appSecret,omitempty"` +} + +func (s GetAccessTokenRequest) String() string { + return tea.Prettify(s) +} + +func (s GetAccessTokenRequest) GoString() string { + return s.String() +} + +func (s *GetAccessTokenRequest) SetAppKey(v string) *GetAccessTokenRequest { + s.AppKey = &v + return s +} + +func (s *GetAccessTokenRequest) SetAppSecret(v string) *GetAccessTokenRequest { + s.AppSecret = &v + return s +} + +type GetAccessTokenResponseBody struct { + // accessToken + AccessToken *string `json:"accessToken,omitempty" xml:"accessToken,omitempty"` + // 超时时间 + ExpireIn *int64 `json:"expireIn,omitempty" xml:"expireIn,omitempty"` +} + +func (s GetAccessTokenResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetAccessTokenResponseBody) GoString() string { + return s.String() +} + +func (s *GetAccessTokenResponseBody) SetAccessToken(v string) *GetAccessTokenResponseBody { + s.AccessToken = &v + return s +} + +func (s *GetAccessTokenResponseBody) SetExpireIn(v int64) *GetAccessTokenResponseBody { + s.ExpireIn = &v + return s +} + +type GetAccessTokenResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetAccessTokenResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetAccessTokenResponse) String() string { + return tea.Prettify(s) +} + +func (s GetAccessTokenResponse) GoString() string { + return s.String() +} + +func (s *GetAccessTokenResponse) SetHeaders(v map[string]*string) *GetAccessTokenResponse { + s.Headers = v + return s +} + +func (s *GetAccessTokenResponse) SetBody(v *GetAccessTokenResponseBody) *GetAccessTokenResponse { + s.Body = v + return s +} + +type GetAuthInfoHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetAuthInfoHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoHeaders) GoString() string { + return s.String() +} + +func (s *GetAuthInfoHeaders) SetCommonHeaders(v map[string]*string) *GetAuthInfoHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetAuthInfoHeaders) SetXAcsDingtalkAccessToken(v string) *GetAuthInfoHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetAuthInfoRequest struct { + AuthCorpId *string `json:"authCorpId,omitempty" xml:"authCorpId,omitempty"` +} + +func (s GetAuthInfoRequest) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoRequest) GoString() string { + return s.String() +} + +func (s *GetAuthInfoRequest) SetAuthCorpId(v string) *GetAuthInfoRequest { + s.AuthCorpId = &v + return s +} + +type GetAuthInfoResponseBody struct { + // 授权应用信息 + AuthAppInfo *GetAuthInfoResponseBodyAuthAppInfo `json:"authAppInfo,omitempty" xml:"authAppInfo,omitempty" type:"Struct"` + // 应用企业信息 + AuthCorpInfo *GetAuthInfoResponseBodyAuthCorpInfo `json:"authCorpInfo,omitempty" xml:"authCorpInfo,omitempty" type:"Struct"` + // 授权用户信息 + AuthUserInfo *GetAuthInfoResponseBodyAuthUserInfo `json:"authUserInfo,omitempty" xml:"authUserInfo,omitempty" type:"Struct"` +} + +func (s GetAuthInfoResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoResponseBody) GoString() string { + return s.String() +} + +func (s *GetAuthInfoResponseBody) SetAuthAppInfo(v *GetAuthInfoResponseBodyAuthAppInfo) *GetAuthInfoResponseBody { + s.AuthAppInfo = v + return s +} + +func (s *GetAuthInfoResponseBody) SetAuthCorpInfo(v *GetAuthInfoResponseBodyAuthCorpInfo) *GetAuthInfoResponseBody { + s.AuthCorpInfo = v + return s +} + +func (s *GetAuthInfoResponseBody) SetAuthUserInfo(v *GetAuthInfoResponseBodyAuthUserInfo) *GetAuthInfoResponseBody { + s.AuthUserInfo = v + return s +} + +type GetAuthInfoResponseBodyAuthAppInfo struct { + AgentList []*GetAuthInfoResponseBodyAuthAppInfoAgentList `json:"agentList,omitempty" xml:"agentList,omitempty" type:"Repeated"` +} + +func (s GetAuthInfoResponseBodyAuthAppInfo) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoResponseBodyAuthAppInfo) GoString() string { + return s.String() +} + +func (s *GetAuthInfoResponseBodyAuthAppInfo) SetAgentList(v []*GetAuthInfoResponseBodyAuthAppInfoAgentList) *GetAuthInfoResponseBodyAuthAppInfo { + s.AgentList = v + return s +} + +type GetAuthInfoResponseBodyAuthAppInfoAgentList struct { + // 对此微应用有管理权限的管理员列表 + AdminList []*string `json:"adminList,omitempty" xml:"adminList,omitempty" type:"Repeated"` + // 应用id + AgentId *int64 `json:"agentId,omitempty" xml:"agentId,omitempty"` + // 应用名称 + AgentName *string `json:"agentName,omitempty" xml:"agentName,omitempty"` + // 三方应用id + AppId *int64 `json:"appId,omitempty" xml:"appId,omitempty"` +} + +func (s GetAuthInfoResponseBodyAuthAppInfoAgentList) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoResponseBodyAuthAppInfoAgentList) GoString() string { + return s.String() +} + +func (s *GetAuthInfoResponseBodyAuthAppInfoAgentList) SetAdminList(v []*string) *GetAuthInfoResponseBodyAuthAppInfoAgentList { + s.AdminList = v + return s +} + +func (s *GetAuthInfoResponseBodyAuthAppInfoAgentList) SetAgentId(v int64) *GetAuthInfoResponseBodyAuthAppInfoAgentList { + s.AgentId = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthAppInfoAgentList) SetAgentName(v string) *GetAuthInfoResponseBodyAuthAppInfoAgentList { + s.AgentName = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthAppInfoAgentList) SetAppId(v int64) *GetAuthInfoResponseBodyAuthAppInfoAgentList { + s.AppId = &v + return s +} + +type GetAuthInfoResponseBodyAuthCorpInfo struct { + // 渠道码。 + AuthChannel *string `json:"authChannel,omitempty" xml:"authChannel,omitempty"` + // 渠道类型。 为了避免渠道码重复,可与渠道码共同确认渠道。可能为空,非空时当前只有满天星类型,值为STAR_ACTIVITY。 + AuthChannelType *string `json:"authChannelType,omitempty" xml:"authChannelType,omitempty"` + // 企业认证等级: 0:未认证 1:高级认证 2:中级认证 3:初级认证 + AuthLevel *int64 `json:"authLevel,omitempty" xml:"authLevel,omitempty"` + // 企业logo。 + CorpLogoUrl *string `json:"corpLogoUrl,omitempty" xml:"corpLogoUrl,omitempty"` + // 授权方企业名称。 + CorpName *string `json:"corpName,omitempty" xml:"corpName,omitempty"` + // 企业所属行业。 + Industry *string `json:"industry,omitempty" xml:"industry,omitempty"` + // 邀请码,只有自己邀请的企业才会返回邀请码,可用该邀请码统计不同渠道的拉新,否则值为空字符串。 + InviteCode *string `json:"inviteCode,omitempty" xml:"inviteCode,omitempty"` + // 企业邀请链接。 + InviteUrl *string `json:"inviteUrl,omitempty" xml:"inviteUrl,omitempty"` + // 序列号。 + LicenseCode *string `json:"licenseCode,omitempty" xml:"licenseCode,omitempty"` +} + +func (s GetAuthInfoResponseBodyAuthCorpInfo) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoResponseBodyAuthCorpInfo) GoString() string { + return s.String() +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetAuthChannel(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.AuthChannel = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetAuthChannelType(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.AuthChannelType = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetAuthLevel(v int64) *GetAuthInfoResponseBodyAuthCorpInfo { + s.AuthLevel = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetCorpLogoUrl(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.CorpLogoUrl = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetCorpName(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.CorpName = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetIndustry(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.Industry = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetInviteCode(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.InviteCode = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetInviteUrl(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.InviteUrl = &v + return s +} + +func (s *GetAuthInfoResponseBodyAuthCorpInfo) SetLicenseCode(v string) *GetAuthInfoResponseBodyAuthCorpInfo { + s.LicenseCode = &v + return s +} + +type GetAuthInfoResponseBodyAuthUserInfo struct { + // 授权管理员id + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GetAuthInfoResponseBodyAuthUserInfo) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoResponseBodyAuthUserInfo) GoString() string { + return s.String() +} + +func (s *GetAuthInfoResponseBodyAuthUserInfo) SetUserId(v string) *GetAuthInfoResponseBodyAuthUserInfo { + s.UserId = &v + return s +} + +type GetAuthInfoResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetAuthInfoResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetAuthInfoResponse) String() string { + return tea.Prettify(s) +} + +func (s GetAuthInfoResponse) GoString() string { + return s.String() +} + +func (s *GetAuthInfoResponse) SetHeaders(v map[string]*string) *GetAuthInfoResponse { + s.Headers = v + return s +} + +func (s *GetAuthInfoResponse) SetBody(v *GetAuthInfoResponseBody) *GetAuthInfoResponse { + s.Body = v + return s +} + +type GetCorpAccessTokenRequest struct { + // OAuth 2.0 临时授权码 + AuthCorpId *string `json:"authCorpId,omitempty" xml:"authCorpId,omitempty"` + // 应用id + SuiteKey *string `json:"suiteKey,omitempty" xml:"suiteKey,omitempty"` + // 应用密码 + SuiteSecret *string `json:"suiteSecret,omitempty" xml:"suiteSecret,omitempty"` + // suiteTicket + SuiteTicket *string `json:"suiteTicket,omitempty" xml:"suiteTicket,omitempty"` +} + +func (s GetCorpAccessTokenRequest) String() string { + return tea.Prettify(s) +} + +func (s GetCorpAccessTokenRequest) GoString() string { + return s.String() +} + +func (s *GetCorpAccessTokenRequest) SetAuthCorpId(v string) *GetCorpAccessTokenRequest { + s.AuthCorpId = &v + return s +} + +func (s *GetCorpAccessTokenRequest) SetSuiteKey(v string) *GetCorpAccessTokenRequest { + s.SuiteKey = &v + return s +} + +func (s *GetCorpAccessTokenRequest) SetSuiteSecret(v string) *GetCorpAccessTokenRequest { + s.SuiteSecret = &v + return s +} + +func (s *GetCorpAccessTokenRequest) SetSuiteTicket(v string) *GetCorpAccessTokenRequest { + s.SuiteTicket = &v + return s +} + +type GetCorpAccessTokenResponseBody struct { + // accessToken + AccessToken *string `json:"accessToken,omitempty" xml:"accessToken,omitempty"` + // 超时时间 + ExpireIn *int64 `json:"expireIn,omitempty" xml:"expireIn,omitempty"` +} + +func (s GetCorpAccessTokenResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetCorpAccessTokenResponseBody) GoString() string { + return s.String() +} + +func (s *GetCorpAccessTokenResponseBody) SetAccessToken(v string) *GetCorpAccessTokenResponseBody { + s.AccessToken = &v + return s +} + +func (s *GetCorpAccessTokenResponseBody) SetExpireIn(v int64) *GetCorpAccessTokenResponseBody { + s.ExpireIn = &v + return s +} + +type GetCorpAccessTokenResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetCorpAccessTokenResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetCorpAccessTokenResponse) String() string { + return tea.Prettify(s) +} + +func (s GetCorpAccessTokenResponse) GoString() string { + return s.String() +} + +func (s *GetCorpAccessTokenResponse) SetHeaders(v map[string]*string) *GetCorpAccessTokenResponse { + s.Headers = v + return s +} + +func (s *GetCorpAccessTokenResponse) SetBody(v *GetCorpAccessTokenResponseBody) *GetCorpAccessTokenResponse { + s.Body = v + return s +} + +type GetPersonalAuthRuleHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetPersonalAuthRuleHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetPersonalAuthRuleHeaders) GoString() string { + return s.String() +} + +func (s *GetPersonalAuthRuleHeaders) SetCommonHeaders(v map[string]*string) *GetPersonalAuthRuleHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetPersonalAuthRuleHeaders) SetXAcsDingtalkAccessToken(v string) *GetPersonalAuthRuleHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetPersonalAuthRuleResponseBody struct { + // list + Result []*GetPersonalAuthRuleResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` +} + +func (s GetPersonalAuthRuleResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetPersonalAuthRuleResponseBody) GoString() string { + return s.String() +} + +func (s *GetPersonalAuthRuleResponseBody) SetResult(v []*GetPersonalAuthRuleResponseBodyResult) *GetPersonalAuthRuleResponseBody { + s.Result = v + return s +} + +type GetPersonalAuthRuleResponseBodyResult struct { + // authItems + AuthItems []*string `json:"authItems,omitempty" xml:"authItems,omitempty" type:"Repeated"` + // resource + Resource *string `json:"resource,omitempty" xml:"resource,omitempty"` +} + +func (s GetPersonalAuthRuleResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetPersonalAuthRuleResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetPersonalAuthRuleResponseBodyResult) SetAuthItems(v []*string) *GetPersonalAuthRuleResponseBodyResult { + s.AuthItems = v + return s +} + +func (s *GetPersonalAuthRuleResponseBodyResult) SetResource(v string) *GetPersonalAuthRuleResponseBodyResult { + s.Resource = &v + return s +} + +type GetPersonalAuthRuleResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetPersonalAuthRuleResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetPersonalAuthRuleResponse) String() string { + return tea.Prettify(s) +} + +func (s GetPersonalAuthRuleResponse) GoString() string { + return s.String() +} + +func (s *GetPersonalAuthRuleResponse) SetHeaders(v map[string]*string) *GetPersonalAuthRuleResponse { + s.Headers = v + return s +} + +func (s *GetPersonalAuthRuleResponse) SetBody(v *GetPersonalAuthRuleResponseBody) *GetPersonalAuthRuleResponse { + s.Body = v + return s +} + +type GetSsoAccessTokenRequest struct { + // 企业id + Corpid *string `json:"corpid,omitempty" xml:"corpid,omitempty"` + // sso密码 + SsoSecret *string `json:"ssoSecret,omitempty" xml:"ssoSecret,omitempty"` +} + +func (s GetSsoAccessTokenRequest) String() string { + return tea.Prettify(s) +} + +func (s GetSsoAccessTokenRequest) GoString() string { + return s.String() +} + +func (s *GetSsoAccessTokenRequest) SetCorpid(v string) *GetSsoAccessTokenRequest { + s.Corpid = &v + return s +} + +func (s *GetSsoAccessTokenRequest) SetSsoSecret(v string) *GetSsoAccessTokenRequest { + s.SsoSecret = &v + return s +} + +type GetSsoAccessTokenResponseBody struct { + // accessToken + AccessToken *string `json:"accessToken,omitempty" xml:"accessToken,omitempty"` + // 超时时间 + ExpireIn *int64 `json:"expireIn,omitempty" xml:"expireIn,omitempty"` +} + +func (s GetSsoAccessTokenResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetSsoAccessTokenResponseBody) GoString() string { + return s.String() +} + +func (s *GetSsoAccessTokenResponseBody) SetAccessToken(v string) *GetSsoAccessTokenResponseBody { + s.AccessToken = &v + return s +} + +func (s *GetSsoAccessTokenResponseBody) SetExpireIn(v int64) *GetSsoAccessTokenResponseBody { + s.ExpireIn = &v + return s +} + +type GetSsoAccessTokenResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetSsoAccessTokenResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetSsoAccessTokenResponse) String() string { + return tea.Prettify(s) +} + +func (s GetSsoAccessTokenResponse) GoString() string { + return s.String() +} + +func (s *GetSsoAccessTokenResponse) SetHeaders(v map[string]*string) *GetSsoAccessTokenResponse { + s.Headers = v + return s +} + +func (s *GetSsoAccessTokenResponse) SetBody(v *GetSsoAccessTokenResponseBody) *GetSsoAccessTokenResponse { + s.Body = v + return s +} + +type GetSsoUserInfoHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetSsoUserInfoHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetSsoUserInfoHeaders) GoString() string { + return s.String() +} + +func (s *GetSsoUserInfoHeaders) SetCommonHeaders(v map[string]*string) *GetSsoUserInfoHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetSsoUserInfoHeaders) SetXAcsDingtalkAccessToken(v string) *GetSsoUserInfoHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetSsoUserInfoRequest struct { + Code *string `json:"code,omitempty" xml:"code,omitempty"` +} + +func (s GetSsoUserInfoRequest) String() string { + return tea.Prettify(s) +} + +func (s GetSsoUserInfoRequest) GoString() string { + return s.String() +} + +func (s *GetSsoUserInfoRequest) SetCode(v string) *GetSsoUserInfoRequest { + s.Code = &v + return s +} + +type GetSsoUserInfoResponseBody struct { + // 用户头像链接 + Avatar *string `json:"avatar,omitempty" xml:"avatar,omitempty"` + // 微应用免登用户所在企业id + CorpId *string `json:"corpId,omitempty" xml:"corpId,omitempty"` + // 微应用免登用户所在企业名称 + CorpName *string `json:"corpName,omitempty" xml:"corpName,omitempty"` + // 用户邮箱 + Email *string `json:"email,omitempty" xml:"email,omitempty"` + // 是否为企业管理员 + IsAdmin *bool `json:"isAdmin,omitempty" xml:"isAdmin,omitempty"` + // 用户id + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` + // 用户名称 + UserName *string `json:"userName,omitempty" xml:"userName,omitempty"` +} + +func (s GetSsoUserInfoResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetSsoUserInfoResponseBody) GoString() string { + return s.String() +} + +func (s *GetSsoUserInfoResponseBody) SetAvatar(v string) *GetSsoUserInfoResponseBody { + s.Avatar = &v + return s +} + +func (s *GetSsoUserInfoResponseBody) SetCorpId(v string) *GetSsoUserInfoResponseBody { + s.CorpId = &v + return s +} + +func (s *GetSsoUserInfoResponseBody) SetCorpName(v string) *GetSsoUserInfoResponseBody { + s.CorpName = &v + return s +} + +func (s *GetSsoUserInfoResponseBody) SetEmail(v string) *GetSsoUserInfoResponseBody { + s.Email = &v + return s +} + +func (s *GetSsoUserInfoResponseBody) SetIsAdmin(v bool) *GetSsoUserInfoResponseBody { + s.IsAdmin = &v + return s +} + +func (s *GetSsoUserInfoResponseBody) SetUserId(v string) *GetSsoUserInfoResponseBody { + s.UserId = &v + return s +} + +func (s *GetSsoUserInfoResponseBody) SetUserName(v string) *GetSsoUserInfoResponseBody { + s.UserName = &v + return s +} + +type GetSsoUserInfoResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetSsoUserInfoResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetSsoUserInfoResponse) String() string { + return tea.Prettify(s) +} + +func (s GetSsoUserInfoResponse) GoString() string { + return s.String() +} + +func (s *GetSsoUserInfoResponse) SetHeaders(v map[string]*string) *GetSsoUserInfoResponse { + s.Headers = v + return s +} + +func (s *GetSsoUserInfoResponse) SetBody(v *GetSsoUserInfoResponseBody) *GetSsoUserInfoResponse { + s.Body = v + return s +} + +type GetSuiteAccessTokenRequest struct { + // 应用id + SuiteKey *string `json:"suiteKey,omitempty" xml:"suiteKey,omitempty"` + // 应用密码 + SuiteSecret *string `json:"suiteSecret,omitempty" xml:"suiteSecret,omitempty"` + // suiteTicket + SuiteTicket *string `json:"suiteTicket,omitempty" xml:"suiteTicket,omitempty"` +} + +func (s GetSuiteAccessTokenRequest) String() string { + return tea.Prettify(s) +} + +func (s GetSuiteAccessTokenRequest) GoString() string { + return s.String() +} + +func (s *GetSuiteAccessTokenRequest) SetSuiteKey(v string) *GetSuiteAccessTokenRequest { + s.SuiteKey = &v + return s +} + +func (s *GetSuiteAccessTokenRequest) SetSuiteSecret(v string) *GetSuiteAccessTokenRequest { + s.SuiteSecret = &v + return s +} + +func (s *GetSuiteAccessTokenRequest) SetSuiteTicket(v string) *GetSuiteAccessTokenRequest { + s.SuiteTicket = &v + return s +} + +type GetSuiteAccessTokenResponseBody struct { + // accessToken + AccessToken *string `json:"accessToken,omitempty" xml:"accessToken,omitempty"` + // 超时时间 + ExpireIn *int64 `json:"expireIn,omitempty" xml:"expireIn,omitempty"` +} + +func (s GetSuiteAccessTokenResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetSuiteAccessTokenResponseBody) GoString() string { + return s.String() +} + +func (s *GetSuiteAccessTokenResponseBody) SetAccessToken(v string) *GetSuiteAccessTokenResponseBody { + s.AccessToken = &v + return s +} + +func (s *GetSuiteAccessTokenResponseBody) SetExpireIn(v int64) *GetSuiteAccessTokenResponseBody { + s.ExpireIn = &v + return s +} + +type GetSuiteAccessTokenResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetSuiteAccessTokenResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetSuiteAccessTokenResponse) String() string { + return tea.Prettify(s) +} + +func (s GetSuiteAccessTokenResponse) GoString() string { + return s.String() +} + +func (s *GetSuiteAccessTokenResponse) SetHeaders(v map[string]*string) *GetSuiteAccessTokenResponse { + s.Headers = v + return s +} + +func (s *GetSuiteAccessTokenResponse) SetBody(v *GetSuiteAccessTokenResponseBody) *GetSuiteAccessTokenResponse { + s.Body = v + return s +} + +type GetUserTokenRequest struct { + // 应用id + ClientId *string `json:"clientId,omitempty" xml:"clientId,omitempty"` + // 应用密码 + ClientSecret *string `json:"clientSecret,omitempty" xml:"clientSecret,omitempty"` + // OAuth 2.0 临时授权码 + Code *string `json:"code,omitempty" xml:"code,omitempty"` + // 分为authorization_code和refresh_token。使用授权码换token,传authorization_code;使用刷新token换用户token,传refresh_token + GrantType *string `json:"grantType,omitempty" xml:"grantType,omitempty"` + // OAuth 2.0 刷新令牌 + RefreshToken *string `json:"refreshToken,omitempty" xml:"refreshToken,omitempty"` +} + +func (s GetUserTokenRequest) String() string { + return tea.Prettify(s) +} + +func (s GetUserTokenRequest) GoString() string { + return s.String() +} + +func (s *GetUserTokenRequest) SetClientId(v string) *GetUserTokenRequest { + s.ClientId = &v + return s +} + +func (s *GetUserTokenRequest) SetClientSecret(v string) *GetUserTokenRequest { + s.ClientSecret = &v + return s +} + +func (s *GetUserTokenRequest) SetCode(v string) *GetUserTokenRequest { + s.Code = &v + return s +} + +func (s *GetUserTokenRequest) SetGrantType(v string) *GetUserTokenRequest { + s.GrantType = &v + return s +} + +func (s *GetUserTokenRequest) SetRefreshToken(v string) *GetUserTokenRequest { + s.RefreshToken = &v + return s +} + +type GetUserTokenResponseBody struct { + // accessToken + AccessToken *string `json:"accessToken,omitempty" xml:"accessToken,omitempty"` + // 所选企业corpId + CorpId *string `json:"corpId,omitempty" xml:"corpId,omitempty"` + // 超时时间 + ExpireIn *int64 `json:"expireIn,omitempty" xml:"expireIn,omitempty"` + // refreshToken + RefreshToken *string `json:"refreshToken,omitempty" xml:"refreshToken,omitempty"` +} + +func (s GetUserTokenResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetUserTokenResponseBody) GoString() string { + return s.String() +} + +func (s *GetUserTokenResponseBody) SetAccessToken(v string) *GetUserTokenResponseBody { + s.AccessToken = &v + return s +} + +func (s *GetUserTokenResponseBody) SetCorpId(v string) *GetUserTokenResponseBody { + s.CorpId = &v + return s +} + +func (s *GetUserTokenResponseBody) SetExpireIn(v int64) *GetUserTokenResponseBody { + s.ExpireIn = &v + return s +} + +func (s *GetUserTokenResponseBody) SetRefreshToken(v string) *GetUserTokenResponseBody { + s.RefreshToken = &v + return s +} + +type GetUserTokenResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetUserTokenResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetUserTokenResponse) String() string { + return tea.Prettify(s) +} + +func (s GetUserTokenResponse) GoString() string { + return s.String() +} + +func (s *GetUserTokenResponse) SetHeaders(v map[string]*string) *GetUserTokenResponse { + s.Headers = v + return s +} + +func (s *GetUserTokenResponse) SetBody(v *GetUserTokenResponseBody) *GetUserTokenResponse { + s.Body = v + return s +} + +type Client struct { + openapi.Client +} + +func NewClient(config *openapi.Config) (*Client, error) { + client := new(Client) + err := client.Init(config) + return client, err +} + +func (client *Client) Init(config *openapi.Config) (_err error) { + _err = client.Client.Init(config) + if _err != nil { + return _err + } + client.EndpointRule = tea.String("") + if tea.BoolValue(util.Empty(client.Endpoint)) { + client.Endpoint = tea.String("api.dingtalk.com") + } + + return nil +} + +func (client *Client) CreateJsapiTicket() (_result *CreateJsapiTicketResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &CreateJsapiTicketHeaders{} + _result = &CreateJsapiTicketResponse{} + _body, _err := client.CreateJsapiTicketWithOptions(headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) CreateJsapiTicketWithOptions(headers *CreateJsapiTicketHeaders, runtime *util.RuntimeOptions) (_result *CreateJsapiTicketResponse, _err error) { + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + } + _result = &CreateJsapiTicketResponse{} + _body, _err := client.DoROARequest(tea.String("CreateJsapiTicket"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/oauth2/jsapiTickets"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetAccessToken(request *GetAccessTokenRequest) (_result *GetAccessTokenResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := make(map[string]*string) + _result = &GetAccessTokenResponse{} + _body, _err := client.GetAccessTokenWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetAccessTokenWithOptions(request *GetAccessTokenRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *GetAccessTokenResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AppKey)) { + body["appKey"] = request.AppKey + } + + if !tea.BoolValue(util.IsUnset(request.AppSecret)) { + body["appSecret"] = request.AppSecret + } + + req := &openapi.OpenApiRequest{ + Headers: headers, + Body: openapiutil.ParseToMap(body), + } + _result = &GetAccessTokenResponse{} + _body, _err := client.DoROARequest(tea.String("GetAccessToken"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/oauth2/accessToken"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetAuthInfo(request *GetAuthInfoRequest) (_result *GetAuthInfoResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetAuthInfoHeaders{} + _result = &GetAuthInfoResponse{} + _body, _err := client.GetAuthInfoWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetAuthInfoWithOptions(request *GetAuthInfoRequest, headers *GetAuthInfoHeaders, runtime *util.RuntimeOptions) (_result *GetAuthInfoResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AuthCorpId)) { + query["authCorpId"] = request.AuthCorpId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetAuthInfoResponse{} + _body, _err := client.DoROARequest(tea.String("GetAuthInfo"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/oauth2/apps/authInfo"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetCorpAccessToken(request *GetCorpAccessTokenRequest) (_result *GetCorpAccessTokenResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := make(map[string]*string) + _result = &GetCorpAccessTokenResponse{} + _body, _err := client.GetCorpAccessTokenWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetCorpAccessTokenWithOptions(request *GetCorpAccessTokenRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *GetCorpAccessTokenResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AuthCorpId)) { + body["authCorpId"] = request.AuthCorpId + } + + if !tea.BoolValue(util.IsUnset(request.SuiteKey)) { + body["suiteKey"] = request.SuiteKey + } + + if !tea.BoolValue(util.IsUnset(request.SuiteSecret)) { + body["suiteSecret"] = request.SuiteSecret + } + + if !tea.BoolValue(util.IsUnset(request.SuiteTicket)) { + body["suiteTicket"] = request.SuiteTicket + } + + req := &openapi.OpenApiRequest{ + Headers: headers, + Body: openapiutil.ParseToMap(body), + } + _result = &GetCorpAccessTokenResponse{} + _body, _err := client.DoROARequest(tea.String("GetCorpAccessToken"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/oauth2/corpAccessToken"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetPersonalAuthRule() (_result *GetPersonalAuthRuleResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetPersonalAuthRuleHeaders{} + _result = &GetPersonalAuthRuleResponse{} + _body, _err := client.GetPersonalAuthRuleWithOptions(headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetPersonalAuthRuleWithOptions(headers *GetPersonalAuthRuleHeaders, runtime *util.RuntimeOptions) (_result *GetPersonalAuthRuleResponse, _err error) { + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + } + _result = &GetPersonalAuthRuleResponse{} + _body, _err := client.DoROARequest(tea.String("GetPersonalAuthRule"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/oauth2/authRules/user"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetSsoAccessToken(request *GetSsoAccessTokenRequest) (_result *GetSsoAccessTokenResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := make(map[string]*string) + _result = &GetSsoAccessTokenResponse{} + _body, _err := client.GetSsoAccessTokenWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetSsoAccessTokenWithOptions(request *GetSsoAccessTokenRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *GetSsoAccessTokenResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.Corpid)) { + body["corpid"] = request.Corpid + } + + if !tea.BoolValue(util.IsUnset(request.SsoSecret)) { + body["ssoSecret"] = request.SsoSecret + } + + req := &openapi.OpenApiRequest{ + Headers: headers, + Body: openapiutil.ParseToMap(body), + } + _result = &GetSsoAccessTokenResponse{} + _body, _err := client.DoROARequest(tea.String("GetSsoAccessToken"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/oauth2/ssoAccessToken"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetSsoUserInfo(request *GetSsoUserInfoRequest) (_result *GetSsoUserInfoResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetSsoUserInfoHeaders{} + _result = &GetSsoUserInfoResponse{} + _body, _err := client.GetSsoUserInfoWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetSsoUserInfoWithOptions(request *GetSsoUserInfoRequest, headers *GetSsoUserInfoHeaders, runtime *util.RuntimeOptions) (_result *GetSsoUserInfoResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.Code)) { + query["code"] = request.Code + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetSsoUserInfoResponse{} + _body, _err := client.DoROARequest(tea.String("GetSsoUserInfo"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/oauth2/ssoUserInfo"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetSuiteAccessToken(request *GetSuiteAccessTokenRequest) (_result *GetSuiteAccessTokenResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := make(map[string]*string) + _result = &GetSuiteAccessTokenResponse{} + _body, _err := client.GetSuiteAccessTokenWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetSuiteAccessTokenWithOptions(request *GetSuiteAccessTokenRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *GetSuiteAccessTokenResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.SuiteKey)) { + body["suiteKey"] = request.SuiteKey + } + + if !tea.BoolValue(util.IsUnset(request.SuiteSecret)) { + body["suiteSecret"] = request.SuiteSecret + } + + if !tea.BoolValue(util.IsUnset(request.SuiteTicket)) { + body["suiteTicket"] = request.SuiteTicket + } + + req := &openapi.OpenApiRequest{ + Headers: headers, + Body: openapiutil.ParseToMap(body), + } + _result = &GetSuiteAccessTokenResponse{} + _body, _err := client.DoROARequest(tea.String("GetSuiteAccessToken"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/oauth2/suiteAccessToken"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetUserToken(request *GetUserTokenRequest) (_result *GetUserTokenResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := make(map[string]*string) + _result = &GetUserTokenResponse{} + _body, _err := client.GetUserTokenWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetUserTokenWithOptions(request *GetUserTokenRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *GetUserTokenResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ClientId)) { + body["clientId"] = request.ClientId + } + + if !tea.BoolValue(util.IsUnset(request.ClientSecret)) { + body["clientSecret"] = request.ClientSecret + } + + if !tea.BoolValue(util.IsUnset(request.Code)) { + body["code"] = request.Code + } + + if !tea.BoolValue(util.IsUnset(request.GrantType)) { + body["grantType"] = request.GrantType + } + + if !tea.BoolValue(util.IsUnset(request.RefreshToken)) { + body["refreshToken"] = request.RefreshToken + } + + req := &openapi.OpenApiRequest{ + Headers: headers, + Body: openapiutil.ParseToMap(body), + } + _result = &GetUserTokenResponse{} + _body, _err := client.DoROARequest(tea.String("GetUserToken"), tea.String("oauth2_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/oauth2/userAccessToken"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} diff --git a/vendor/github.com/alibabacloud-go/dingtalk/workflow_1_0/client.go b/vendor/github.com/alibabacloud-go/dingtalk/workflow_1_0/client.go new file mode 100644 index 0000000000..e9a36f61e0 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/dingtalk/workflow_1_0/client.go @@ -0,0 +1,10672 @@ +// This file is auto-generated, don't edit it. Thanks. +/** + * + */ +package workflow_1_0 + +import ( + openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" + openapiutil "github.com/alibabacloud-go/openapi-util/service" + util "github.com/alibabacloud-go/tea-utils/v2/service" + "github.com/alibabacloud-go/tea/tea" +) + +type AvaliableTemplate struct { + // 表单名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 表单模板processCode + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s AvaliableTemplate) String() string { + return tea.Prettify(s) +} + +func (s AvaliableTemplate) GoString() string { + return s.String() +} + +func (s *AvaliableTemplate) SetName(v string) *AvaliableTemplate { + s.Name = &v + return s +} + +func (s *AvaliableTemplate) SetProcessCode(v string) *AvaliableTemplate { + s.ProcessCode = &v + return s +} + +type FormComponent struct { + // 子控件集合 + Children []*FormComponent `json:"children,omitempty" xml:"children,omitempty" type:"Repeated"` + // 控件类型 + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + // 控件属性 + Props *FormComponentProps `json:"props,omitempty" xml:"props,omitempty"` +} + +func (s FormComponent) String() string { + return tea.Prettify(s) +} + +func (s FormComponent) GoString() string { + return s.String() +} + +func (s *FormComponent) SetChildren(v []*FormComponent) *FormComponent { + s.Children = v + return s +} + +func (s *FormComponent) SetComponentType(v string) *FormComponent { + s.ComponentType = &v + return s +} + +func (s *FormComponent) SetProps(v *FormComponentProps) *FormComponent { + s.Props = v + return s +} + +type FormComponentProps struct { + // 明细控件按钮显示文案 + ActionName *string `json:"actionName,omitempty" xml:"actionName,omitempty"` + // 地址控件模式city省市,district省市区,street省市区街道 + AddressModel *string `json:"addressModel,omitempty" xml:"addressModel,omitempty"` + // 文字提示控件显示方式:top|middle|bottom + Align *string `json:"align,omitempty" xml:"align,omitempty"` + // 套件中控件是否可设置为分条件字段 + AsyncCondition *bool `json:"asyncCondition,omitempty" xml:"asyncCondition,omitempty"` + // 关联审批单控件限定模板列表 + AvailableTemplates []*AvaliableTemplate `json:"availableTemplates,omitempty" xml:"availableTemplates,omitempty" type:"Repeated"` + // 业务别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 套件的业务标识 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 联系人控件是否支持多选,1多选,0单选 + Choice *string `json:"choice,omitempty" xml:"choice,omitempty"` + // 自定义控件渲染标识 + CommonBizType *string `json:"commonBizType,omitempty" xml:"commonBizType,omitempty"` + // 控件表单内唯一id + ComponentId *string `json:"componentId,omitempty" xml:"componentId,omitempty"` + // 说明文字控件内容 + Content *string `json:"content,omitempty" xml:"content,omitempty"` + // 关联数据源配置 + DataSource *FormDataSource `json:"dataSource,omitempty" xml:"dataSource,omitempty"` + // 是否不可编辑 + Disabled *bool `json:"disabled,omitempty" xml:"disabled,omitempty"` + // 是否自动计算时长 + Duration *bool `json:"duration,omitempty" xml:"duration,omitempty"` + // 时间格式 + Format *string `json:"format,omitempty" xml:"format,omitempty"` + // 公式 + Formula *string `json:"formula,omitempty" xml:"formula,omitempty"` + // 是否隐藏字段 + Invisible *bool `json:"invisible,omitempty" xml:"invisible,omitempty"` + // 控件标题 + Label *string `json:"label,omitempty" xml:"label,omitempty"` + // 评分控件上限 + Limit *int32 `json:"limit,omitempty" xml:"limit,omitempty"` + // 说明文字控件链接地址 + Link *string `json:"link,omitempty" xml:"link,omitempty"` + // 文本控件支持的最大长度 + MaxLength *int32 `json:"maxLength,omitempty" xml:"maxLength,omitempty"` + // 电话控件支持的类型 + Mode *string `json:"mode,omitempty" xml:"mode,omitempty"` + // 部门控件是否可多选 + Multiple *bool `json:"multiple,omitempty" xml:"multiple,omitempty"` + // 单选多选控件选项列表 + Options []*SelectOption `json:"options,omitempty" xml:"options,omitempty" type:"Repeated"` + // 输入提示 + Placeholder *string `json:"placeholder,omitempty" xml:"placeholder,omitempty"` + // 字段是否可打印,1打印,0不打印,默认打印 + Print *string `json:"print,omitempty" xml:"print,omitempty"` + // 是否必填 + Required *bool `json:"required,omitempty" xml:"required,omitempty"` + // 明细控件数据汇总统计 + StatField []*FormComponentPropsStatField `json:"statField,omitempty" xml:"statField,omitempty" type:"Repeated"` + // 明细填写方式,table(表格)、list(列表) + TableViewMode *string `json:"tableViewMode,omitempty" xml:"tableViewMode,omitempty"` + // 时间单位(天、小时) + Unit *string `json:"unit,omitempty" xml:"unit,omitempty"` + // 金额控件是否需要大写,1不需要大写,其他需要大写 + Upper *string `json:"upper,omitempty" xml:"upper,omitempty"` + // 明细打印方式false横向,true纵向 + VerticalPrint *bool `json:"verticalPrint,omitempty" xml:"verticalPrint,omitempty"` +} + +func (s FormComponentProps) String() string { + return tea.Prettify(s) +} + +func (s FormComponentProps) GoString() string { + return s.String() +} + +func (s *FormComponentProps) SetActionName(v string) *FormComponentProps { + s.ActionName = &v + return s +} + +func (s *FormComponentProps) SetAddressModel(v string) *FormComponentProps { + s.AddressModel = &v + return s +} + +func (s *FormComponentProps) SetAlign(v string) *FormComponentProps { + s.Align = &v + return s +} + +func (s *FormComponentProps) SetAsyncCondition(v bool) *FormComponentProps { + s.AsyncCondition = &v + return s +} + +func (s *FormComponentProps) SetAvailableTemplates(v []*AvaliableTemplate) *FormComponentProps { + s.AvailableTemplates = v + return s +} + +func (s *FormComponentProps) SetBizAlias(v string) *FormComponentProps { + s.BizAlias = &v + return s +} + +func (s *FormComponentProps) SetBizType(v string) *FormComponentProps { + s.BizType = &v + return s +} + +func (s *FormComponentProps) SetChoice(v string) *FormComponentProps { + s.Choice = &v + return s +} + +func (s *FormComponentProps) SetCommonBizType(v string) *FormComponentProps { + s.CommonBizType = &v + return s +} + +func (s *FormComponentProps) SetComponentId(v string) *FormComponentProps { + s.ComponentId = &v + return s +} + +func (s *FormComponentProps) SetContent(v string) *FormComponentProps { + s.Content = &v + return s +} + +func (s *FormComponentProps) SetDataSource(v *FormDataSource) *FormComponentProps { + s.DataSource = v + return s +} + +func (s *FormComponentProps) SetDisabled(v bool) *FormComponentProps { + s.Disabled = &v + return s +} + +func (s *FormComponentProps) SetDuration(v bool) *FormComponentProps { + s.Duration = &v + return s +} + +func (s *FormComponentProps) SetFormat(v string) *FormComponentProps { + s.Format = &v + return s +} + +func (s *FormComponentProps) SetFormula(v string) *FormComponentProps { + s.Formula = &v + return s +} + +func (s *FormComponentProps) SetInvisible(v bool) *FormComponentProps { + s.Invisible = &v + return s +} + +func (s *FormComponentProps) SetLabel(v string) *FormComponentProps { + s.Label = &v + return s +} + +func (s *FormComponentProps) SetLimit(v int32) *FormComponentProps { + s.Limit = &v + return s +} + +func (s *FormComponentProps) SetLink(v string) *FormComponentProps { + s.Link = &v + return s +} + +func (s *FormComponentProps) SetMaxLength(v int32) *FormComponentProps { + s.MaxLength = &v + return s +} + +func (s *FormComponentProps) SetMode(v string) *FormComponentProps { + s.Mode = &v + return s +} + +func (s *FormComponentProps) SetMultiple(v bool) *FormComponentProps { + s.Multiple = &v + return s +} + +func (s *FormComponentProps) SetOptions(v []*SelectOption) *FormComponentProps { + s.Options = v + return s +} + +func (s *FormComponentProps) SetPlaceholder(v string) *FormComponentProps { + s.Placeholder = &v + return s +} + +func (s *FormComponentProps) SetPrint(v string) *FormComponentProps { + s.Print = &v + return s +} + +func (s *FormComponentProps) SetRequired(v bool) *FormComponentProps { + s.Required = &v + return s +} + +func (s *FormComponentProps) SetStatField(v []*FormComponentPropsStatField) *FormComponentProps { + s.StatField = v + return s +} + +func (s *FormComponentProps) SetTableViewMode(v string) *FormComponentProps { + s.TableViewMode = &v + return s +} + +func (s *FormComponentProps) SetUnit(v string) *FormComponentProps { + s.Unit = &v + return s +} + +func (s *FormComponentProps) SetUpper(v string) *FormComponentProps { + s.Upper = &v + return s +} + +func (s *FormComponentProps) SetVerticalPrint(v bool) *FormComponentProps { + s.VerticalPrint = &v + return s +} + +type FormComponentPropsStatField struct { + // 需要统计的明细控件内子控件id + ComponentId *string `json:"componentId,omitempty" xml:"componentId,omitempty"` + // 子控件标题 + Label *string `json:"label,omitempty" xml:"label,omitempty"` + // 金额控件是否需要大写,1不需要大写,其他需要大写 + Upper *string `json:"upper,omitempty" xml:"upper,omitempty"` +} + +func (s FormComponentPropsStatField) String() string { + return tea.Prettify(s) +} + +func (s FormComponentPropsStatField) GoString() string { + return s.String() +} + +func (s *FormComponentPropsStatField) SetComponentId(v string) *FormComponentPropsStatField { + s.ComponentId = &v + return s +} + +func (s *FormComponentPropsStatField) SetLabel(v string) *FormComponentPropsStatField { + s.Label = &v + return s +} + +func (s *FormComponentPropsStatField) SetUpper(v string) *FormComponentPropsStatField { + s.Upper = &v + return s +} + +type FormDataSource struct { + // 关联表单信息 + Target *FormDataSourceTarget `json:"target,omitempty" xml:"target,omitempty" type:"Struct"` + // 关联类型,form关联表单 + Type *string `json:"type,omitempty" xml:"type,omitempty"` +} + +func (s FormDataSource) String() string { + return tea.Prettify(s) +} + +func (s FormDataSource) GoString() string { + return s.String() +} + +func (s *FormDataSource) SetTarget(v *FormDataSourceTarget) *FormDataSource { + s.Target = v + return s +} + +func (s *FormDataSource) SetType(v string) *FormDataSource { + s.Type = &v + return s +} + +type FormDataSourceTarget struct { + // 表单类型,0流程表单 + AppType *int32 `json:"appType,omitempty" xml:"appType,omitempty"` + // 应用appUuid + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 关联表单业务标识 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 关联表单的formCode + FormCode *string `json:"formCode,omitempty" xml:"formCode,omitempty"` +} + +func (s FormDataSourceTarget) String() string { + return tea.Prettify(s) +} + +func (s FormDataSourceTarget) GoString() string { + return s.String() +} + +func (s *FormDataSourceTarget) SetAppType(v int32) *FormDataSourceTarget { + s.AppType = &v + return s +} + +func (s *FormDataSourceTarget) SetAppUuid(v string) *FormDataSourceTarget { + s.AppUuid = &v + return s +} + +func (s *FormDataSourceTarget) SetBizType(v string) *FormDataSourceTarget { + s.BizType = &v + return s +} + +func (s *FormDataSourceTarget) SetFormCode(v string) *FormDataSourceTarget { + s.FormCode = &v + return s +} + +type SelectOption struct { + // 每一个选项的唯一键 + Key *string `json:"key,omitempty" xml:"key,omitempty"` + // 每一个选项的值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s SelectOption) String() string { + return tea.Prettify(s) +} + +func (s SelectOption) GoString() string { + return s.String() +} + +func (s *SelectOption) SetKey(v string) *SelectOption { + s.Key = &v + return s +} + +func (s *SelectOption) SetValue(v string) *SelectOption { + s.Value = &v + return s +} + +type AddApproveDentryAuthHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s AddApproveDentryAuthHeaders) String() string { + return tea.Prettify(s) +} + +func (s AddApproveDentryAuthHeaders) GoString() string { + return s.String() +} + +func (s *AddApproveDentryAuthHeaders) SetCommonHeaders(v map[string]*string) *AddApproveDentryAuthHeaders { + s.CommonHeaders = v + return s +} + +func (s *AddApproveDentryAuthHeaders) SetXAcsDingtalkAccessToken(v string) *AddApproveDentryAuthHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type AddApproveDentryAuthRequest struct { + // 授权的钉盘文件信息列表。支持批量授权,最大列表长度:10。 + FileInfos []*AddApproveDentryAuthRequestFileInfos `json:"fileInfos,omitempty" xml:"fileInfos,omitempty" type:"Repeated"` + // 授权的用户userid。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s AddApproveDentryAuthRequest) String() string { + return tea.Prettify(s) +} + +func (s AddApproveDentryAuthRequest) GoString() string { + return s.String() +} + +func (s *AddApproveDentryAuthRequest) SetFileInfos(v []*AddApproveDentryAuthRequestFileInfos) *AddApproveDentryAuthRequest { + s.FileInfos = v + return s +} + +func (s *AddApproveDentryAuthRequest) SetUserId(v string) *AddApproveDentryAuthRequest { + s.UserId = &v + return s +} + +type AddApproveDentryAuthRequestFileInfos struct { + // 文件ID。 + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 钉盘空间spaceId。 + SpaceId *int64 `json:"spaceId,omitempty" xml:"spaceId,omitempty"` +} + +func (s AddApproveDentryAuthRequestFileInfos) String() string { + return tea.Prettify(s) +} + +func (s AddApproveDentryAuthRequestFileInfos) GoString() string { + return s.String() +} + +func (s *AddApproveDentryAuthRequestFileInfos) SetFileId(v string) *AddApproveDentryAuthRequestFileInfos { + s.FileId = &v + return s +} + +func (s *AddApproveDentryAuthRequestFileInfos) SetSpaceId(v int64) *AddApproveDentryAuthRequestFileInfos { + s.SpaceId = &v + return s +} + +type AddApproveDentryAuthResponseBody struct { + // 返回结果。 + Result *bool `json:"result,omitempty" xml:"result,omitempty"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s AddApproveDentryAuthResponseBody) String() string { + return tea.Prettify(s) +} + +func (s AddApproveDentryAuthResponseBody) GoString() string { + return s.String() +} + +func (s *AddApproveDentryAuthResponseBody) SetResult(v bool) *AddApproveDentryAuthResponseBody { + s.Result = &v + return s +} + +func (s *AddApproveDentryAuthResponseBody) SetSuccess(v bool) *AddApproveDentryAuthResponseBody { + s.Success = &v + return s +} + +type AddApproveDentryAuthResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *AddApproveDentryAuthResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s AddApproveDentryAuthResponse) String() string { + return tea.Prettify(s) +} + +func (s AddApproveDentryAuthResponse) GoString() string { + return s.String() +} + +func (s *AddApproveDentryAuthResponse) SetHeaders(v map[string]*string) *AddApproveDentryAuthResponse { + s.Headers = v + return s +} + +func (s *AddApproveDentryAuthResponse) SetBody(v *AddApproveDentryAuthResponseBody) *AddApproveDentryAuthResponse { + s.Body = v + return s +} + +type AddProcessInstanceCommentHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s AddProcessInstanceCommentHeaders) String() string { + return tea.Prettify(s) +} + +func (s AddProcessInstanceCommentHeaders) GoString() string { + return s.String() +} + +func (s *AddProcessInstanceCommentHeaders) SetCommonHeaders(v map[string]*string) *AddProcessInstanceCommentHeaders { + s.CommonHeaders = v + return s +} + +func (s *AddProcessInstanceCommentHeaders) SetXAcsDingtalkAccessToken(v string) *AddProcessInstanceCommentHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type AddProcessInstanceCommentRequest struct { + // 评论人的userid。 + CommentUserId *string `json:"commentUserId,omitempty" xml:"commentUserId,omitempty"` + // 文件。 + File *AddProcessInstanceCommentRequestFile `json:"file,omitempty" xml:"file,omitempty" type:"Struct"` + // 审批实例ID,可通过调用获取审批实例ID列表接口获取。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 评论的内容。 + Text *string `json:"text,omitempty" xml:"text,omitempty"` +} + +func (s AddProcessInstanceCommentRequest) String() string { + return tea.Prettify(s) +} + +func (s AddProcessInstanceCommentRequest) GoString() string { + return s.String() +} + +func (s *AddProcessInstanceCommentRequest) SetCommentUserId(v string) *AddProcessInstanceCommentRequest { + s.CommentUserId = &v + return s +} + +func (s *AddProcessInstanceCommentRequest) SetFile(v *AddProcessInstanceCommentRequestFile) *AddProcessInstanceCommentRequest { + s.File = v + return s +} + +func (s *AddProcessInstanceCommentRequest) SetProcessInstanceId(v string) *AddProcessInstanceCommentRequest { + s.ProcessInstanceId = &v + return s +} + +func (s *AddProcessInstanceCommentRequest) SetText(v string) *AddProcessInstanceCommentRequest { + s.Text = &v + return s +} + +type AddProcessInstanceCommentRequestFile struct { + // 附件列表。 + Attachments []*AddProcessInstanceCommentRequestFileAttachments `json:"attachments,omitempty" xml:"attachments,omitempty" type:"Repeated"` + // 图片URL地址。 + Photos []*string `json:"photos,omitempty" xml:"photos,omitempty" type:"Repeated"` +} + +func (s AddProcessInstanceCommentRequestFile) String() string { + return tea.Prettify(s) +} + +func (s AddProcessInstanceCommentRequestFile) GoString() string { + return s.String() +} + +func (s *AddProcessInstanceCommentRequestFile) SetAttachments(v []*AddProcessInstanceCommentRequestFileAttachments) *AddProcessInstanceCommentRequestFile { + s.Attachments = v + return s +} + +func (s *AddProcessInstanceCommentRequestFile) SetPhotos(v []*string) *AddProcessInstanceCommentRequestFile { + s.Photos = v + return s +} + +type AddProcessInstanceCommentRequestFileAttachments struct { + // 文件ID。 + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 文件名称。 + FileName *string `json:"fileName,omitempty" xml:"fileName,omitempty"` + // 文件大小。 + FileSize *string `json:"fileSize,omitempty" xml:"fileSize,omitempty"` + // 文件类型。 + FileType *string `json:"fileType,omitempty" xml:"fileType,omitempty"` + // 钉盘空间ID。 + SpaceId *string `json:"spaceId,omitempty" xml:"spaceId,omitempty"` +} + +func (s AddProcessInstanceCommentRequestFileAttachments) String() string { + return tea.Prettify(s) +} + +func (s AddProcessInstanceCommentRequestFileAttachments) GoString() string { + return s.String() +} + +func (s *AddProcessInstanceCommentRequestFileAttachments) SetFileId(v string) *AddProcessInstanceCommentRequestFileAttachments { + s.FileId = &v + return s +} + +func (s *AddProcessInstanceCommentRequestFileAttachments) SetFileName(v string) *AddProcessInstanceCommentRequestFileAttachments { + s.FileName = &v + return s +} + +func (s *AddProcessInstanceCommentRequestFileAttachments) SetFileSize(v string) *AddProcessInstanceCommentRequestFileAttachments { + s.FileSize = &v + return s +} + +func (s *AddProcessInstanceCommentRequestFileAttachments) SetFileType(v string) *AddProcessInstanceCommentRequestFileAttachments { + s.FileType = &v + return s +} + +func (s *AddProcessInstanceCommentRequestFileAttachments) SetSpaceId(v string) *AddProcessInstanceCommentRequestFileAttachments { + s.SpaceId = &v + return s +} + +type AddProcessInstanceCommentResponseBody struct { + // 评论是否成功。 + Result *bool `json:"result,omitempty" xml:"result,omitempty"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s AddProcessInstanceCommentResponseBody) String() string { + return tea.Prettify(s) +} + +func (s AddProcessInstanceCommentResponseBody) GoString() string { + return s.String() +} + +func (s *AddProcessInstanceCommentResponseBody) SetResult(v bool) *AddProcessInstanceCommentResponseBody { + s.Result = &v + return s +} + +func (s *AddProcessInstanceCommentResponseBody) SetSuccess(v bool) *AddProcessInstanceCommentResponseBody { + s.Success = &v + return s +} + +type AddProcessInstanceCommentResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *AddProcessInstanceCommentResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s AddProcessInstanceCommentResponse) String() string { + return tea.Prettify(s) +} + +func (s AddProcessInstanceCommentResponse) GoString() string { + return s.String() +} + +func (s *AddProcessInstanceCommentResponse) SetHeaders(v map[string]*string) *AddProcessInstanceCommentResponse { + s.Headers = v + return s +} + +func (s *AddProcessInstanceCommentResponse) SetBody(v *AddProcessInstanceCommentResponseBody) *AddProcessInstanceCommentResponse { + s.Body = v + return s +} + +type BatchUpdateProcessInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s BatchUpdateProcessInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s BatchUpdateProcessInstanceHeaders) GoString() string { + return s.String() +} + +func (s *BatchUpdateProcessInstanceHeaders) SetCommonHeaders(v map[string]*string) *BatchUpdateProcessInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *BatchUpdateProcessInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *BatchUpdateProcessInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type BatchUpdateProcessInstanceRequest struct { + // 实列列表。 + UpdateProcessInstanceRequests []*BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests `json:"updateProcessInstanceRequests,omitempty" xml:"updateProcessInstanceRequests,omitempty" type:"Repeated"` +} + +func (s BatchUpdateProcessInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s BatchUpdateProcessInstanceRequest) GoString() string { + return s.String() +} + +func (s *BatchUpdateProcessInstanceRequest) SetUpdateProcessInstanceRequests(v []*BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests) *BatchUpdateProcessInstanceRequest { + s.UpdateProcessInstanceRequests = v + return s +} + +type BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests struct { + // 抄送列表,注意最大抄送人数量不能超过30。 + Notifiers []*BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequestsNotifiers `json:"notifiers,omitempty" xml:"notifiers,omitempty" type:"Repeated"` + // 实例id + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 实例结果: + // 实例状态是COMPLETED,必须设置代表以下含义。 + // agree:同意 + // refuse:拒绝 + // 实例状态为TERMINATED,必须设置代表含义,result取值agree和refuse均代表撤销审批流。 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 实例状态: + // COMPLETED:结束审批流 + // TERMINATED:终止审批流 + Status *string `json:"status,omitempty" xml:"status,omitempty"` +} + +func (s BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests) String() string { + return tea.Prettify(s) +} + +func (s BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests) GoString() string { + return s.String() +} + +func (s *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests) SetNotifiers(v []*BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequestsNotifiers) *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests { + s.Notifiers = v + return s +} + +func (s *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests) SetProcessInstanceId(v string) *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests { + s.ProcessInstanceId = &v + return s +} + +func (s *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests) SetResult(v string) *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests { + s.Result = &v + return s +} + +func (s *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests) SetStatus(v string) *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequests { + s.Status = &v + return s +} + +type BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequestsNotifiers struct { + // 抄送接收人用户userId。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequestsNotifiers) String() string { + return tea.Prettify(s) +} + +func (s BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequestsNotifiers) GoString() string { + return s.String() +} + +func (s *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequestsNotifiers) SetUserId(v string) *BatchUpdateProcessInstanceRequestUpdateProcessInstanceRequestsNotifiers { + s.UserId = &v + return s +} + +type BatchUpdateProcessInstanceResponseBody struct { + // 成功标识 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s BatchUpdateProcessInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s BatchUpdateProcessInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *BatchUpdateProcessInstanceResponseBody) SetSuccess(v bool) *BatchUpdateProcessInstanceResponseBody { + s.Success = &v + return s +} + +type BatchUpdateProcessInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *BatchUpdateProcessInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s BatchUpdateProcessInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s BatchUpdateProcessInstanceResponse) GoString() string { + return s.String() +} + +func (s *BatchUpdateProcessInstanceResponse) SetHeaders(v map[string]*string) *BatchUpdateProcessInstanceResponse { + s.Headers = v + return s +} + +func (s *BatchUpdateProcessInstanceResponse) SetBody(v *BatchUpdateProcessInstanceResponseBody) *BatchUpdateProcessInstanceResponse { + s.Body = v + return s +} + +type CancelIntegratedTaskHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s CancelIntegratedTaskHeaders) String() string { + return tea.Prettify(s) +} + +func (s CancelIntegratedTaskHeaders) GoString() string { + return s.String() +} + +func (s *CancelIntegratedTaskHeaders) SetCommonHeaders(v map[string]*string) *CancelIntegratedTaskHeaders { + s.CommonHeaders = v + return s +} + +func (s *CancelIntegratedTaskHeaders) SetXAcsDingtalkAccessToken(v string) *CancelIntegratedTaskHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type CancelIntegratedTaskRequest struct { + // 待办组ID,需要在调用创建待办接口时,主动设置该值。 + ActivityId *string `json:"activityId,omitempty" xml:"activityId,omitempty"` + // 待办组ID列表,用于批量取消。 + ActivityIds []*string `json:"activityIds,omitempty" xml:"activityIds,omitempty" type:"Repeated"` + // OA审批流程实例ID + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` +} + +func (s CancelIntegratedTaskRequest) String() string { + return tea.Prettify(s) +} + +func (s CancelIntegratedTaskRequest) GoString() string { + return s.String() +} + +func (s *CancelIntegratedTaskRequest) SetActivityId(v string) *CancelIntegratedTaskRequest { + s.ActivityId = &v + return s +} + +func (s *CancelIntegratedTaskRequest) SetActivityIds(v []*string) *CancelIntegratedTaskRequest { + s.ActivityIds = v + return s +} + +func (s *CancelIntegratedTaskRequest) SetProcessInstanceId(v string) *CancelIntegratedTaskRequest { + s.ProcessInstanceId = &v + return s +} + +type CancelIntegratedTaskResponseBody struct { + // 是否更新成功 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s CancelIntegratedTaskResponseBody) String() string { + return tea.Prettify(s) +} + +func (s CancelIntegratedTaskResponseBody) GoString() string { + return s.String() +} + +func (s *CancelIntegratedTaskResponseBody) SetSuccess(v bool) *CancelIntegratedTaskResponseBody { + s.Success = &v + return s +} + +type CancelIntegratedTaskResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *CancelIntegratedTaskResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s CancelIntegratedTaskResponse) String() string { + return tea.Prettify(s) +} + +func (s CancelIntegratedTaskResponse) GoString() string { + return s.String() +} + +func (s *CancelIntegratedTaskResponse) SetHeaders(v map[string]*string) *CancelIntegratedTaskResponse { + s.Headers = v + return s +} + +func (s *CancelIntegratedTaskResponse) SetBody(v *CancelIntegratedTaskResponseBody) *CancelIntegratedTaskResponse { + s.Body = v + return s +} + +type CleanProcessDataHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s CleanProcessDataHeaders) String() string { + return tea.Prettify(s) +} + +func (s CleanProcessDataHeaders) GoString() string { + return s.String() +} + +func (s *CleanProcessDataHeaders) SetCommonHeaders(v map[string]*string) *CleanProcessDataHeaders { + s.CommonHeaders = v + return s +} + +func (s *CleanProcessDataHeaders) SetXAcsDingtalkAccessToken(v string) *CleanProcessDataHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type CleanProcessDataRequest struct { + // 企业的corpId。 + CorpId *string `json:"corpId,omitempty" xml:"corpId,omitempty"` + // 模板唯一码。 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s CleanProcessDataRequest) String() string { + return tea.Prettify(s) +} + +func (s CleanProcessDataRequest) GoString() string { + return s.String() +} + +func (s *CleanProcessDataRequest) SetCorpId(v string) *CleanProcessDataRequest { + s.CorpId = &v + return s +} + +func (s *CleanProcessDataRequest) SetProcessCode(v string) *CleanProcessDataRequest { + s.ProcessCode = &v + return s +} + +type CleanProcessDataResponseBody struct { + // 是否调用成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s CleanProcessDataResponseBody) String() string { + return tea.Prettify(s) +} + +func (s CleanProcessDataResponseBody) GoString() string { + return s.String() +} + +func (s *CleanProcessDataResponseBody) SetSuccess(v bool) *CleanProcessDataResponseBody { + s.Success = &v + return s +} + +type CleanProcessDataResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *CleanProcessDataResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s CleanProcessDataResponse) String() string { + return tea.Prettify(s) +} + +func (s CleanProcessDataResponse) GoString() string { + return s.String() +} + +func (s *CleanProcessDataResponse) SetHeaders(v map[string]*string) *CleanProcessDataResponse { + s.Headers = v + return s +} + +func (s *CleanProcessDataResponse) SetBody(v *CleanProcessDataResponseBody) *CleanProcessDataResponse { + s.Body = v + return s +} + +type CopyProcessHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s CopyProcessHeaders) String() string { + return tea.Prettify(s) +} + +func (s CopyProcessHeaders) GoString() string { + return s.String() +} + +func (s *CopyProcessHeaders) SetCommonHeaders(v map[string]*string) *CopyProcessHeaders { + s.CommonHeaders = v + return s +} + +func (s *CopyProcessHeaders) SetXAcsDingtalkAccessToken(v string) *CopyProcessHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type CopyProcessRequest struct { + // 复制选项 + CopyOptions *CopyProcessRequestCopyOptions `json:"copyOptions,omitempty" xml:"copyOptions,omitempty" type:"Struct"` + SourceCorpId *string `json:"sourceCorpId,omitempty" xml:"sourceCorpId,omitempty"` + // 源模版列表 + SourceProcessVOList []*CopyProcessRequestSourceProcessVOList `json:"sourceProcessVOList,omitempty" xml:"sourceProcessVOList,omitempty" type:"Repeated"` +} + +func (s CopyProcessRequest) String() string { + return tea.Prettify(s) +} + +func (s CopyProcessRequest) GoString() string { + return s.String() +} + +func (s *CopyProcessRequest) SetCopyOptions(v *CopyProcessRequestCopyOptions) *CopyProcessRequest { + s.CopyOptions = v + return s +} + +func (s *CopyProcessRequest) SetSourceCorpId(v string) *CopyProcessRequest { + s.SourceCorpId = &v + return s +} + +func (s *CopyProcessRequest) SetSourceProcessVOList(v []*CopyProcessRequestSourceProcessVOList) *CopyProcessRequest { + s.SourceProcessVOList = v + return s +} + +type CopyProcessRequestCopyOptions struct { + // 默认为1 + // COPE_TYPE_DEFAULT = 1 默认会使用groupId进行隔离分组,审批首页不可见 + // COPE_TYPE_INCLUDE_FLOW = 2 使用dingtalk 2作为隔离分组,审批首页可见 + CopyType *int32 `json:"copyType,omitempty" xml:"copyType,omitempty"` +} + +func (s CopyProcessRequestCopyOptions) String() string { + return tea.Prettify(s) +} + +func (s CopyProcessRequestCopyOptions) GoString() string { + return s.String() +} + +func (s *CopyProcessRequestCopyOptions) SetCopyType(v int32) *CopyProcessRequestCopyOptions { + s.CopyType = &v + return s +} + +type CopyProcessRequestSourceProcessVOList struct { + // 套件业务标识 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 模板名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 模板code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s CopyProcessRequestSourceProcessVOList) String() string { + return tea.Prettify(s) +} + +func (s CopyProcessRequestSourceProcessVOList) GoString() string { + return s.String() +} + +func (s *CopyProcessRequestSourceProcessVOList) SetBizType(v string) *CopyProcessRequestSourceProcessVOList { + s.BizType = &v + return s +} + +func (s *CopyProcessRequestSourceProcessVOList) SetName(v string) *CopyProcessRequestSourceProcessVOList { + s.Name = &v + return s +} + +func (s *CopyProcessRequestSourceProcessVOList) SetProcessCode(v string) *CopyProcessRequestSourceProcessVOList { + s.ProcessCode = &v + return s +} + +type CopyProcessResponseBody struct { + Result []*CopyProcessResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` +} + +func (s CopyProcessResponseBody) String() string { + return tea.Prettify(s) +} + +func (s CopyProcessResponseBody) GoString() string { + return s.String() +} + +func (s *CopyProcessResponseBody) SetResult(v []*CopyProcessResponseBodyResult) *CopyProcessResponseBody { + s.Result = v + return s +} + +type CopyProcessResponseBodyResult struct { + // 业务标识 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 模板名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 模板code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s CopyProcessResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s CopyProcessResponseBodyResult) GoString() string { + return s.String() +} + +func (s *CopyProcessResponseBodyResult) SetBizType(v string) *CopyProcessResponseBodyResult { + s.BizType = &v + return s +} + +func (s *CopyProcessResponseBodyResult) SetName(v string) *CopyProcessResponseBodyResult { + s.Name = &v + return s +} + +func (s *CopyProcessResponseBodyResult) SetProcessCode(v string) *CopyProcessResponseBodyResult { + s.ProcessCode = &v + return s +} + +type CopyProcessResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *CopyProcessResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s CopyProcessResponse) String() string { + return tea.Prettify(s) +} + +func (s CopyProcessResponse) GoString() string { + return s.String() +} + +func (s *CopyProcessResponse) SetHeaders(v map[string]*string) *CopyProcessResponse { + s.Headers = v + return s +} + +func (s *CopyProcessResponse) SetBody(v *CopyProcessResponseBody) *CopyProcessResponse { + s.Body = v + return s +} + +type CreateIntegratedTaskHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s CreateIntegratedTaskHeaders) String() string { + return tea.Prettify(s) +} + +func (s CreateIntegratedTaskHeaders) GoString() string { + return s.String() +} + +func (s *CreateIntegratedTaskHeaders) SetCommonHeaders(v map[string]*string) *CreateIntegratedTaskHeaders { + s.CommonHeaders = v + return s +} + +func (s *CreateIntegratedTaskHeaders) SetXAcsDingtalkAccessToken(v string) *CreateIntegratedTaskHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type CreateIntegratedTaskRequest struct { + // 待办组ID,调用方提供自定义唯一分组标识 + ActivityId *string `json:"activityId,omitempty" xml:"activityId,omitempty"` + // OA审批实例ID,通过创建实例接口获取。 + // + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 任务列表 + Tasks []*CreateIntegratedTaskRequestTasks `json:"tasks,omitempty" xml:"tasks,omitempty" type:"Repeated"` +} + +func (s CreateIntegratedTaskRequest) String() string { + return tea.Prettify(s) +} + +func (s CreateIntegratedTaskRequest) GoString() string { + return s.String() +} + +func (s *CreateIntegratedTaskRequest) SetActivityId(v string) *CreateIntegratedTaskRequest { + s.ActivityId = &v + return s +} + +func (s *CreateIntegratedTaskRequest) SetProcessInstanceId(v string) *CreateIntegratedTaskRequest { + s.ProcessInstanceId = &v + return s +} + +func (s *CreateIntegratedTaskRequest) SetTasks(v []*CreateIntegratedTaskRequestTasks) *CreateIntegratedTaskRequest { + s.Tasks = v + return s +} + +type CreateIntegratedTaskRequestTasks struct { + // 待办事项跳转URL。 + // 创建审批实例接口里的url,实现的是钉钉审批应用里的审批单跳转。这个接口里的url,实现的是钉钉待办页面,对应的待办卡片的跳转。两种跳转场景不同。需要注意的是,钉钉的待办页面,也同时支持移动端和PC端,所以这个接口里传的url参数,它所对应的页面也要适配好移动端和PC端。 + // + Url *string `json:"url,omitempty" xml:"url,omitempty"` + // OA审批任务执行人的用户ID + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s CreateIntegratedTaskRequestTasks) String() string { + return tea.Prettify(s) +} + +func (s CreateIntegratedTaskRequestTasks) GoString() string { + return s.String() +} + +func (s *CreateIntegratedTaskRequestTasks) SetUrl(v string) *CreateIntegratedTaskRequestTasks { + s.Url = &v + return s +} + +func (s *CreateIntegratedTaskRequestTasks) SetUserId(v string) *CreateIntegratedTaskRequestTasks { + s.UserId = &v + return s +} + +type CreateIntegratedTaskResponseBody struct { + Result []*CreateIntegratedTaskResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` + // 是否创建成功 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s CreateIntegratedTaskResponseBody) String() string { + return tea.Prettify(s) +} + +func (s CreateIntegratedTaskResponseBody) GoString() string { + return s.String() +} + +func (s *CreateIntegratedTaskResponseBody) SetResult(v []*CreateIntegratedTaskResponseBodyResult) *CreateIntegratedTaskResponseBody { + s.Result = v + return s +} + +func (s *CreateIntegratedTaskResponseBody) SetSuccess(v bool) *CreateIntegratedTaskResponseBody { + s.Success = &v + return s +} + +type CreateIntegratedTaskResponseBodyResult struct { + // OA审批任务ID + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` + // OA审批任务执行人用户ID + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s CreateIntegratedTaskResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s CreateIntegratedTaskResponseBodyResult) GoString() string { + return s.String() +} + +func (s *CreateIntegratedTaskResponseBodyResult) SetTaskId(v int64) *CreateIntegratedTaskResponseBodyResult { + s.TaskId = &v + return s +} + +func (s *CreateIntegratedTaskResponseBodyResult) SetUserId(v string) *CreateIntegratedTaskResponseBodyResult { + s.UserId = &v + return s +} + +type CreateIntegratedTaskResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *CreateIntegratedTaskResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s CreateIntegratedTaskResponse) String() string { + return tea.Prettify(s) +} + +func (s CreateIntegratedTaskResponse) GoString() string { + return s.String() +} + +func (s *CreateIntegratedTaskResponse) SetHeaders(v map[string]*string) *CreateIntegratedTaskResponse { + s.Headers = v + return s +} + +func (s *CreateIntegratedTaskResponse) SetBody(v *CreateIntegratedTaskResponseBody) *CreateIntegratedTaskResponse { + s.Body = v + return s +} + +type DeleteProcessHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s DeleteProcessHeaders) String() string { + return tea.Prettify(s) +} + +func (s DeleteProcessHeaders) GoString() string { + return s.String() +} + +func (s *DeleteProcessHeaders) SetCommonHeaders(v map[string]*string) *DeleteProcessHeaders { + s.CommonHeaders = v + return s +} + +func (s *DeleteProcessHeaders) SetXAcsDingtalkAccessToken(v string) *DeleteProcessHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type DeleteProcessRequest struct { + // 是否清理正在运行的任务 + CleanRunningTask *bool `json:"cleanRunningTask,omitempty" xml:"cleanRunningTask,omitempty"` + // 模板code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s DeleteProcessRequest) String() string { + return tea.Prettify(s) +} + +func (s DeleteProcessRequest) GoString() string { + return s.String() +} + +func (s *DeleteProcessRequest) SetCleanRunningTask(v bool) *DeleteProcessRequest { + s.CleanRunningTask = &v + return s +} + +func (s *DeleteProcessRequest) SetProcessCode(v string) *DeleteProcessRequest { + s.ProcessCode = &v + return s +} + +type DeleteProcessResponseBody struct { + Result *DeleteProcessResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s DeleteProcessResponseBody) String() string { + return tea.Prettify(s) +} + +func (s DeleteProcessResponseBody) GoString() string { + return s.String() +} + +func (s *DeleteProcessResponseBody) SetResult(v *DeleteProcessResponseBodyResult) *DeleteProcessResponseBody { + s.Result = v + return s +} + +type DeleteProcessResponseBodyResult struct { + // 模板code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s DeleteProcessResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s DeleteProcessResponseBodyResult) GoString() string { + return s.String() +} + +func (s *DeleteProcessResponseBodyResult) SetProcessCode(v string) *DeleteProcessResponseBodyResult { + s.ProcessCode = &v + return s +} + +type DeleteProcessResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *DeleteProcessResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s DeleteProcessResponse) String() string { + return tea.Prettify(s) +} + +func (s DeleteProcessResponse) GoString() string { + return s.String() +} + +func (s *DeleteProcessResponse) SetHeaders(v map[string]*string) *DeleteProcessResponse { + s.Headers = v + return s +} + +func (s *DeleteProcessResponse) SetBody(v *DeleteProcessResponseBody) *DeleteProcessResponse { + s.Body = v + return s +} + +type ExecuteProcessInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s ExecuteProcessInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s ExecuteProcessInstanceHeaders) GoString() string { + return s.String() +} + +func (s *ExecuteProcessInstanceHeaders) SetCommonHeaders(v map[string]*string) *ExecuteProcessInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *ExecuteProcessInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *ExecuteProcessInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type ExecuteProcessInstanceRequest struct { + // 操作人userid,可通过调用获取审批实例详情接口获取。 + ActionerUserId *string `json:"actionerUserId,omitempty" xml:"actionerUserId,omitempty"` + // 文件。 + File *ExecuteProcessInstanceRequestFile `json:"file,omitempty" xml:"file,omitempty" type:"Struct"` + // 审批实例ID,可通过调用获取审批实例ID列表接口获取。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 审批意见,可为空。 + Remark *string `json:"remark,omitempty" xml:"remark,omitempty"` + // 审批操作,取值。 + // + // agree:同意 + // + // refuse:拒绝 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 任务节点id,可通过调用获取审批实例详情接口获取。 + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` +} + +func (s ExecuteProcessInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s ExecuteProcessInstanceRequest) GoString() string { + return s.String() +} + +func (s *ExecuteProcessInstanceRequest) SetActionerUserId(v string) *ExecuteProcessInstanceRequest { + s.ActionerUserId = &v + return s +} + +func (s *ExecuteProcessInstanceRequest) SetFile(v *ExecuteProcessInstanceRequestFile) *ExecuteProcessInstanceRequest { + s.File = v + return s +} + +func (s *ExecuteProcessInstanceRequest) SetProcessInstanceId(v string) *ExecuteProcessInstanceRequest { + s.ProcessInstanceId = &v + return s +} + +func (s *ExecuteProcessInstanceRequest) SetRemark(v string) *ExecuteProcessInstanceRequest { + s.Remark = &v + return s +} + +func (s *ExecuteProcessInstanceRequest) SetResult(v string) *ExecuteProcessInstanceRequest { + s.Result = &v + return s +} + +func (s *ExecuteProcessInstanceRequest) SetTaskId(v int64) *ExecuteProcessInstanceRequest { + s.TaskId = &v + return s +} + +type ExecuteProcessInstanceRequestFile struct { + // 附件列表。 + Attachments []*ExecuteProcessInstanceRequestFileAttachments `json:"attachments,omitempty" xml:"attachments,omitempty" type:"Repeated"` + // 图片URL地址。 + Photos []*string `json:"photos,omitempty" xml:"photos,omitempty" type:"Repeated"` +} + +func (s ExecuteProcessInstanceRequestFile) String() string { + return tea.Prettify(s) +} + +func (s ExecuteProcessInstanceRequestFile) GoString() string { + return s.String() +} + +func (s *ExecuteProcessInstanceRequestFile) SetAttachments(v []*ExecuteProcessInstanceRequestFileAttachments) *ExecuteProcessInstanceRequestFile { + s.Attachments = v + return s +} + +func (s *ExecuteProcessInstanceRequestFile) SetPhotos(v []*string) *ExecuteProcessInstanceRequestFile { + s.Photos = v + return s +} + +type ExecuteProcessInstanceRequestFileAttachments struct { + // 文件ID。 + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 文件名称。 + FileName *string `json:"fileName,omitempty" xml:"fileName,omitempty"` + // 文件大小。 + FileSize *string `json:"fileSize,omitempty" xml:"fileSize,omitempty"` + // 文件类型。 + FileType *string `json:"fileType,omitempty" xml:"fileType,omitempty"` + // 钉盘空间ID。 + SpaceId *string `json:"spaceId,omitempty" xml:"spaceId,omitempty"` +} + +func (s ExecuteProcessInstanceRequestFileAttachments) String() string { + return tea.Prettify(s) +} + +func (s ExecuteProcessInstanceRequestFileAttachments) GoString() string { + return s.String() +} + +func (s *ExecuteProcessInstanceRequestFileAttachments) SetFileId(v string) *ExecuteProcessInstanceRequestFileAttachments { + s.FileId = &v + return s +} + +func (s *ExecuteProcessInstanceRequestFileAttachments) SetFileName(v string) *ExecuteProcessInstanceRequestFileAttachments { + s.FileName = &v + return s +} + +func (s *ExecuteProcessInstanceRequestFileAttachments) SetFileSize(v string) *ExecuteProcessInstanceRequestFileAttachments { + s.FileSize = &v + return s +} + +func (s *ExecuteProcessInstanceRequestFileAttachments) SetFileType(v string) *ExecuteProcessInstanceRequestFileAttachments { + s.FileType = &v + return s +} + +func (s *ExecuteProcessInstanceRequestFileAttachments) SetSpaceId(v string) *ExecuteProcessInstanceRequestFileAttachments { + s.SpaceId = &v + return s +} + +type ExecuteProcessInstanceResponseBody struct { + // 同意或拒绝结果。 + Result *bool `json:"result,omitempty" xml:"result,omitempty"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s ExecuteProcessInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s ExecuteProcessInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *ExecuteProcessInstanceResponseBody) SetResult(v bool) *ExecuteProcessInstanceResponseBody { + s.Result = &v + return s +} + +func (s *ExecuteProcessInstanceResponseBody) SetSuccess(v bool) *ExecuteProcessInstanceResponseBody { + s.Success = &v + return s +} + +type ExecuteProcessInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *ExecuteProcessInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s ExecuteProcessInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s ExecuteProcessInstanceResponse) GoString() string { + return s.String() +} + +func (s *ExecuteProcessInstanceResponse) SetHeaders(v map[string]*string) *ExecuteProcessInstanceResponse { + s.Headers = v + return s +} + +func (s *ExecuteProcessInstanceResponse) SetBody(v *ExecuteProcessInstanceResponseBody) *ExecuteProcessInstanceResponse { + s.Body = v + return s +} + +type FormCreateHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s FormCreateHeaders) String() string { + return tea.Prettify(s) +} + +func (s FormCreateHeaders) GoString() string { + return s.String() +} + +func (s *FormCreateHeaders) SetCommonHeaders(v map[string]*string) *FormCreateHeaders { + s.CommonHeaders = v + return s +} + +func (s *FormCreateHeaders) SetXAcsDingtalkAccessToken(v string) *FormCreateHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type FormCreateRequest struct { + // 表单模板描述 + Description *string `json:"description,omitempty" xml:"description,omitempty"` + // 表单控件列表 + FormComponents []*FormComponent `json:"formComponents,omitempty" xml:"formComponents,omitempty" type:"Repeated"` + // 表单模板名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 模板配置信息 + TemplateConfig *FormCreateRequestTemplateConfig `json:"templateConfig,omitempty" xml:"templateConfig,omitempty" type:"Struct"` +} + +func (s FormCreateRequest) String() string { + return tea.Prettify(s) +} + +func (s FormCreateRequest) GoString() string { + return s.String() +} + +func (s *FormCreateRequest) SetDescription(v string) *FormCreateRequest { + s.Description = &v + return s +} + +func (s *FormCreateRequest) SetFormComponents(v []*FormComponent) *FormCreateRequest { + s.FormComponents = v + return s +} + +func (s *FormCreateRequest) SetName(v string) *FormCreateRequest { + s.Name = &v + return s +} + +func (s *FormCreateRequest) SetProcessCode(v string) *FormCreateRequest { + s.ProcessCode = &v + return s +} + +func (s *FormCreateRequest) SetTemplateConfig(v *FormCreateRequestTemplateConfig) *FormCreateRequest { + s.TemplateConfig = v + return s +} + +type FormCreateRequestTemplateConfig struct { + // 更新后模板目录id + DirId *string `json:"dirId,omitempty" xml:"dirId,omitempty"` + // 禁用模板删除按钮 + DisableDeleteProcess *bool `json:"disableDeleteProcess,omitempty" xml:"disableDeleteProcess,omitempty"` + // 禁用表单编辑 + DisableFormEdit *bool `json:"disableFormEdit,omitempty" xml:"disableFormEdit,omitempty"` + // 首页工作台是否可见 + DisableHomepage *bool `json:"disableHomepage,omitempty" xml:"disableHomepage,omitempty"` + // 禁用再次提交 + DisableResubmit *bool `json:"disableResubmit,omitempty" xml:"disableResubmit,omitempty"` + // 禁用停止按钮 + DisableStopProcessButton *bool `json:"disableStopProcessButton,omitempty" xml:"disableStopProcessButton,omitempty"` + // 审批场景内隐藏模板 + Hidden *bool `json:"hidden,omitempty" xml:"hidden,omitempty"` + // 源模板目录id + OriginDirId *string `json:"originDirId,omitempty" xml:"originDirId,omitempty"` +} + +func (s FormCreateRequestTemplateConfig) String() string { + return tea.Prettify(s) +} + +func (s FormCreateRequestTemplateConfig) GoString() string { + return s.String() +} + +func (s *FormCreateRequestTemplateConfig) SetDirId(v string) *FormCreateRequestTemplateConfig { + s.DirId = &v + return s +} + +func (s *FormCreateRequestTemplateConfig) SetDisableDeleteProcess(v bool) *FormCreateRequestTemplateConfig { + s.DisableDeleteProcess = &v + return s +} + +func (s *FormCreateRequestTemplateConfig) SetDisableFormEdit(v bool) *FormCreateRequestTemplateConfig { + s.DisableFormEdit = &v + return s +} + +func (s *FormCreateRequestTemplateConfig) SetDisableHomepage(v bool) *FormCreateRequestTemplateConfig { + s.DisableHomepage = &v + return s +} + +func (s *FormCreateRequestTemplateConfig) SetDisableResubmit(v bool) *FormCreateRequestTemplateConfig { + s.DisableResubmit = &v + return s +} + +func (s *FormCreateRequestTemplateConfig) SetDisableStopProcessButton(v bool) *FormCreateRequestTemplateConfig { + s.DisableStopProcessButton = &v + return s +} + +func (s *FormCreateRequestTemplateConfig) SetHidden(v bool) *FormCreateRequestTemplateConfig { + s.Hidden = &v + return s +} + +func (s *FormCreateRequestTemplateConfig) SetOriginDirId(v string) *FormCreateRequestTemplateConfig { + s.OriginDirId = &v + return s +} + +type FormCreateResponseBody struct { + // 表单模板信息 + Result *FormCreateResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s FormCreateResponseBody) String() string { + return tea.Prettify(s) +} + +func (s FormCreateResponseBody) GoString() string { + return s.String() +} + +func (s *FormCreateResponseBody) SetResult(v *FormCreateResponseBodyResult) *FormCreateResponseBody { + s.Result = v + return s +} + +type FormCreateResponseBodyResult struct { + // 保存或更新的表单code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s FormCreateResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s FormCreateResponseBodyResult) GoString() string { + return s.String() +} + +func (s *FormCreateResponseBodyResult) SetProcessCode(v string) *FormCreateResponseBodyResult { + s.ProcessCode = &v + return s +} + +type FormCreateResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *FormCreateResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s FormCreateResponse) String() string { + return tea.Prettify(s) +} + +func (s FormCreateResponse) GoString() string { + return s.String() +} + +func (s *FormCreateResponse) SetHeaders(v map[string]*string) *FormCreateResponse { + s.Headers = v + return s +} + +func (s *FormCreateResponse) SetBody(v *FormCreateResponseBody) *FormCreateResponse { + s.Body = v + return s +} + +type GetAttachmentSpaceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetAttachmentSpaceHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetAttachmentSpaceHeaders) GoString() string { + return s.String() +} + +func (s *GetAttachmentSpaceHeaders) SetCommonHeaders(v map[string]*string) *GetAttachmentSpaceHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetAttachmentSpaceHeaders) SetXAcsDingtalkAccessToken(v string) *GetAttachmentSpaceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetAttachmentSpaceRequest struct { + // 应用的agentid。 + AgentId *int64 `json:"agentId,omitempty" xml:"agentId,omitempty"` + // 用户的userid + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GetAttachmentSpaceRequest) String() string { + return tea.Prettify(s) +} + +func (s GetAttachmentSpaceRequest) GoString() string { + return s.String() +} + +func (s *GetAttachmentSpaceRequest) SetAgentId(v int64) *GetAttachmentSpaceRequest { + s.AgentId = &v + return s +} + +func (s *GetAttachmentSpaceRequest) SetUserId(v string) *GetAttachmentSpaceRequest { + s.UserId = &v + return s +} + +type GetAttachmentSpaceResponseBody struct { + // 返回结果。 + Result *GetAttachmentSpaceResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s GetAttachmentSpaceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetAttachmentSpaceResponseBody) GoString() string { + return s.String() +} + +func (s *GetAttachmentSpaceResponseBody) SetResult(v *GetAttachmentSpaceResponseBodyResult) *GetAttachmentSpaceResponseBody { + s.Result = v + return s +} + +func (s *GetAttachmentSpaceResponseBody) SetSuccess(v bool) *GetAttachmentSpaceResponseBody { + s.Success = &v + return s +} + +type GetAttachmentSpaceResponseBodyResult struct { + // 钉盘空间ID。 + SpaceId *int64 `json:"spaceId,omitempty" xml:"spaceId,omitempty"` +} + +func (s GetAttachmentSpaceResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetAttachmentSpaceResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetAttachmentSpaceResponseBodyResult) SetSpaceId(v int64) *GetAttachmentSpaceResponseBodyResult { + s.SpaceId = &v + return s +} + +type GetAttachmentSpaceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetAttachmentSpaceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetAttachmentSpaceResponse) String() string { + return tea.Prettify(s) +} + +func (s GetAttachmentSpaceResponse) GoString() string { + return s.String() +} + +func (s *GetAttachmentSpaceResponse) SetHeaders(v map[string]*string) *GetAttachmentSpaceResponse { + s.Headers = v + return s +} + +func (s *GetAttachmentSpaceResponse) SetBody(v *GetAttachmentSpaceResponseBody) *GetAttachmentSpaceResponse { + s.Body = v + return s +} + +type GetConditionFormComponentHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetConditionFormComponentHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetConditionFormComponentHeaders) GoString() string { + return s.String() +} + +func (s *GetConditionFormComponentHeaders) SetCommonHeaders(v map[string]*string) *GetConditionFormComponentHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetConditionFormComponentHeaders) SetXAcsDingtalkAccessToken(v string) *GetConditionFormComponentHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetConditionFormComponentRequest struct { + // 应用ID (三方应用为AppID),可在开发者管理后台后台的应用详情页面获取。 + AgentId *int64 `json:"agentId,omitempty" xml:"agentId,omitempty"` + // 审批模板ID。 + // + // processCode需要OA管理后台,在编辑审批表单的URL中获取。 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s GetConditionFormComponentRequest) String() string { + return tea.Prettify(s) +} + +func (s GetConditionFormComponentRequest) GoString() string { + return s.String() +} + +func (s *GetConditionFormComponentRequest) SetAgentId(v int64) *GetConditionFormComponentRequest { + s.AgentId = &v + return s +} + +func (s *GetConditionFormComponentRequest) SetProcessCode(v string) *GetConditionFormComponentRequest { + s.ProcessCode = &v + return s +} + +type GetConditionFormComponentResponseBody struct { + // 返回结果。 + Result []*GetConditionFormComponentResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` +} + +func (s GetConditionFormComponentResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetConditionFormComponentResponseBody) GoString() string { + return s.String() +} + +func (s *GetConditionFormComponentResponseBody) SetResult(v []*GetConditionFormComponentResponseBodyResult) *GetConditionFormComponentResponseBody { + s.Result = v + return s +} + +type GetConditionFormComponentResponseBodyResult struct { + // 表单ID。 + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 表单名称。 + Label *string `json:"label,omitempty" xml:"label,omitempty"` +} + +func (s GetConditionFormComponentResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetConditionFormComponentResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetConditionFormComponentResponseBodyResult) SetId(v string) *GetConditionFormComponentResponseBodyResult { + s.Id = &v + return s +} + +func (s *GetConditionFormComponentResponseBodyResult) SetLabel(v string) *GetConditionFormComponentResponseBodyResult { + s.Label = &v + return s +} + +type GetConditionFormComponentResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetConditionFormComponentResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetConditionFormComponentResponse) String() string { + return tea.Prettify(s) +} + +func (s GetConditionFormComponentResponse) GoString() string { + return s.String() +} + +func (s *GetConditionFormComponentResponse) SetHeaders(v map[string]*string) *GetConditionFormComponentResponse { + s.Headers = v + return s +} + +func (s *GetConditionFormComponentResponse) SetBody(v *GetConditionFormComponentResponseBody) *GetConditionFormComponentResponse { + s.Body = v + return s +} + +type GetCrmProcCodesHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetCrmProcCodesHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetCrmProcCodesHeaders) GoString() string { + return s.String() +} + +func (s *GetCrmProcCodesHeaders) SetCommonHeaders(v map[string]*string) *GetCrmProcCodesHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetCrmProcCodesHeaders) SetXAcsDingtalkAccessToken(v string) *GetCrmProcCodesHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetCrmProcCodesResponseBody struct { + // 模板code列表。 + Result []*string `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` +} + +func (s GetCrmProcCodesResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetCrmProcCodesResponseBody) GoString() string { + return s.String() +} + +func (s *GetCrmProcCodesResponseBody) SetResult(v []*string) *GetCrmProcCodesResponseBody { + s.Result = v + return s +} + +type GetCrmProcCodesResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetCrmProcCodesResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetCrmProcCodesResponse) String() string { + return tea.Prettify(s) +} + +func (s GetCrmProcCodesResponse) GoString() string { + return s.String() +} + +func (s *GetCrmProcCodesResponse) SetHeaders(v map[string]*string) *GetCrmProcCodesResponse { + s.Headers = v + return s +} + +func (s *GetCrmProcCodesResponse) SetBody(v *GetCrmProcCodesResponseBody) *GetCrmProcCodesResponse { + s.Body = v + return s +} + +type GetManageProcessByStaffIdHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetManageProcessByStaffIdHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetManageProcessByStaffIdHeaders) GoString() string { + return s.String() +} + +func (s *GetManageProcessByStaffIdHeaders) SetCommonHeaders(v map[string]*string) *GetManageProcessByStaffIdHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetManageProcessByStaffIdHeaders) SetXAcsDingtalkAccessToken(v string) *GetManageProcessByStaffIdHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetManageProcessByStaffIdRequest struct { + // 用户的userid。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GetManageProcessByStaffIdRequest) String() string { + return tea.Prettify(s) +} + +func (s GetManageProcessByStaffIdRequest) GoString() string { + return s.String() +} + +func (s *GetManageProcessByStaffIdRequest) SetUserId(v string) *GetManageProcessByStaffIdRequest { + s.UserId = &v + return s +} + +type GetManageProcessByStaffIdResponseBody struct { + // 返回结果列表。 + Result []*GetManageProcessByStaffIdResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s GetManageProcessByStaffIdResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetManageProcessByStaffIdResponseBody) GoString() string { + return s.String() +} + +func (s *GetManageProcessByStaffIdResponseBody) SetResult(v []*GetManageProcessByStaffIdResponseBodyResult) *GetManageProcessByStaffIdResponseBody { + s.Result = v + return s +} + +func (s *GetManageProcessByStaffIdResponseBody) SetSuccess(v bool) *GetManageProcessByStaffIdResponseBody { + s.Success = &v + return s +} + +type GetManageProcessByStaffIdResponseBodyResult struct { + // 关联考勤类型,取值。 + // + // 0:无 + // 1:补卡申请 + // 2:请假 + AttendanceType *int32 `json:"attendanceType,omitempty" xml:"attendanceType,omitempty"` + // 模版名称。 + FlowTitle *string `json:"flowTitle,omitempty" xml:"flowTitle,omitempty"` + // 修改时间。 + GmtModified *string `json:"gmtModified,omitempty" xml:"gmtModified,omitempty"` + // 模板图标名。 + IconName *string `json:"iconName,omitempty" xml:"iconName,omitempty"` + // 图标URL地址。 + IconUrl *string `json:"iconUrl,omitempty" xml:"iconUrl,omitempty"` + // 是否新模版。 + NewProcess *bool `json:"newProcess,omitempty" xml:"newProcess,omitempty"` + // 模版code。 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s GetManageProcessByStaffIdResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetManageProcessByStaffIdResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetManageProcessByStaffIdResponseBodyResult) SetAttendanceType(v int32) *GetManageProcessByStaffIdResponseBodyResult { + s.AttendanceType = &v + return s +} + +func (s *GetManageProcessByStaffIdResponseBodyResult) SetFlowTitle(v string) *GetManageProcessByStaffIdResponseBodyResult { + s.FlowTitle = &v + return s +} + +func (s *GetManageProcessByStaffIdResponseBodyResult) SetGmtModified(v string) *GetManageProcessByStaffIdResponseBodyResult { + s.GmtModified = &v + return s +} + +func (s *GetManageProcessByStaffIdResponseBodyResult) SetIconName(v string) *GetManageProcessByStaffIdResponseBodyResult { + s.IconName = &v + return s +} + +func (s *GetManageProcessByStaffIdResponseBodyResult) SetIconUrl(v string) *GetManageProcessByStaffIdResponseBodyResult { + s.IconUrl = &v + return s +} + +func (s *GetManageProcessByStaffIdResponseBodyResult) SetNewProcess(v bool) *GetManageProcessByStaffIdResponseBodyResult { + s.NewProcess = &v + return s +} + +func (s *GetManageProcessByStaffIdResponseBodyResult) SetProcessCode(v string) *GetManageProcessByStaffIdResponseBodyResult { + s.ProcessCode = &v + return s +} + +type GetManageProcessByStaffIdResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetManageProcessByStaffIdResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetManageProcessByStaffIdResponse) String() string { + return tea.Prettify(s) +} + +func (s GetManageProcessByStaffIdResponse) GoString() string { + return s.String() +} + +func (s *GetManageProcessByStaffIdResponse) SetHeaders(v map[string]*string) *GetManageProcessByStaffIdResponse { + s.Headers = v + return s +} + +func (s *GetManageProcessByStaffIdResponse) SetBody(v *GetManageProcessByStaffIdResponseBody) *GetManageProcessByStaffIdResponse { + s.Body = v + return s +} + +type GetProcessCodeByNameHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetProcessCodeByNameHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetProcessCodeByNameHeaders) GoString() string { + return s.String() +} + +func (s *GetProcessCodeByNameHeaders) SetCommonHeaders(v map[string]*string) *GetProcessCodeByNameHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetProcessCodeByNameHeaders) SetXAcsDingtalkAccessToken(v string) *GetProcessCodeByNameHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetProcessCodeByNameRequest struct { + // 模板名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` +} + +func (s GetProcessCodeByNameRequest) String() string { + return tea.Prettify(s) +} + +func (s GetProcessCodeByNameRequest) GoString() string { + return s.String() +} + +func (s *GetProcessCodeByNameRequest) SetName(v string) *GetProcessCodeByNameRequest { + s.Name = &v + return s +} + +type GetProcessCodeByNameResponseBody struct { + // 表单模板信息 + Result *GetProcessCodeByNameResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s GetProcessCodeByNameResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetProcessCodeByNameResponseBody) GoString() string { + return s.String() +} + +func (s *GetProcessCodeByNameResponseBody) SetResult(v *GetProcessCodeByNameResponseBodyResult) *GetProcessCodeByNameResponseBody { + s.Result = v + return s +} + +type GetProcessCodeByNameResponseBodyResult struct { + // 保存或更新的表单code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s GetProcessCodeByNameResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetProcessCodeByNameResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetProcessCodeByNameResponseBodyResult) SetProcessCode(v string) *GetProcessCodeByNameResponseBodyResult { + s.ProcessCode = &v + return s +} + +type GetProcessCodeByNameResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetProcessCodeByNameResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetProcessCodeByNameResponse) String() string { + return tea.Prettify(s) +} + +func (s GetProcessCodeByNameResponse) GoString() string { + return s.String() +} + +func (s *GetProcessCodeByNameResponse) SetHeaders(v map[string]*string) *GetProcessCodeByNameResponse { + s.Headers = v + return s +} + +func (s *GetProcessCodeByNameResponse) SetBody(v *GetProcessCodeByNameResponseBody) *GetProcessCodeByNameResponse { + s.Body = v + return s +} + +type GetProcessConfigHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetProcessConfigHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigHeaders) GoString() string { + return s.String() +} + +func (s *GetProcessConfigHeaders) SetCommonHeaders(v map[string]*string) *GetProcessConfigHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetProcessConfigHeaders) SetXAcsDingtalkAccessToken(v string) *GetProcessConfigHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetProcessConfigRequest struct { + // 模板code + ProcCode *string `json:"procCode,omitempty" xml:"procCode,omitempty"` +} + +func (s GetProcessConfigRequest) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigRequest) GoString() string { + return s.String() +} + +func (s *GetProcessConfigRequest) SetProcCode(v string) *GetProcessConfigRequest { + s.ProcCode = &v + return s +} + +type GetProcessConfigResponseBody struct { + Result *GetProcessConfigResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s GetProcessConfigResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBody) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBody) SetResult(v *GetProcessConfigResponseBodyResult) *GetProcessConfigResponseBody { + s.Result = v + return s +} + +type GetProcessConfigResponseBodyResult struct { + // 自定义摘要信息 + AbstractGenRule []*string `json:"abstractGenRule,omitempty" xml:"abstractGenRule,omitempty" type:"Repeated"` + // 表单节点权限 + ActivityAuth *string `json:"activityAuth,omitempty" xml:"activityAuth,omitempty"` + // 是否允许撤销 + AllowRevoke *bool `json:"allowRevoke,omitempty" xml:"allowRevoke,omitempty"` + // 是否允许加签 + AppendEnable *bool `json:"appendEnable,omitempty" xml:"appendEnable,omitempty"` + // 如果审批人和发起人是同一个人,则去重 + AutoExecuteOriginatorTasks *bool `json:"autoExecuteOriginatorTasks,omitempty" xml:"autoExecuteOriginatorTasks,omitempty"` + // 流程表单业务标识 + BizCategoryId *string `json:"bizCategoryId,omitempty" xml:"bizCategoryId,omitempty"` + // 纯表单业务标识 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 评论配置 + CommentConf *GetProcessConfigResponseBodyResultCommentConf `json:"commentConf,omitempty" xml:"commentConf,omitempty" type:"Struct"` + // 审批人自动去重 + DuplicateRemoval *string `json:"duplicateRemoval,omitempty" xml:"duplicateRemoval,omitempty"` + // 表单配置 + FormSchema *string `json:"formSchema,omitempty" xml:"formSchema,omitempty"` + // 手写签名配置 + HandSignConf *GetProcessConfigResponseBodyResultHandSignConf `json:"handSignConf,omitempty" xml:"handSignConf,omitempty" type:"Struct"` + // 表单管理员 + Managers []*string `json:"managers,omitempty" xml:"managers,omitempty" type:"Repeated"` + // 表单名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 是否流程表单 + ProcessAppType *bool `json:"processAppType,omitempty" xml:"processAppType,omitempty"` + // 流程配置 + ProcessConfig *string `json:"processConfig,omitempty" xml:"processConfig,omitempty"` + // 是否静态流程 + StaticProc *bool `json:"staticProc,omitempty" xml:"staticProc,omitempty"` + // 代提交配置 + SubstituteSubmitConf *GetProcessConfigResponseBodyResultSubstituteSubmitConf `json:"substituteSubmitConf,omitempty" xml:"substituteSubmitConf,omitempty" type:"Struct"` + // 自定义标题规则 + TitleGenRule *GetProcessConfigResponseBodyResultTitleGenRule `json:"titleGenRule,omitempty" xml:"titleGenRule,omitempty" type:"Struct"` + // 模板可见性 + Visibility []*GetProcessConfigResponseBodyResultVisibility `json:"visibility,omitempty" xml:"visibility,omitempty" type:"Repeated"` +} + +func (s GetProcessConfigResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBodyResult) SetAbstractGenRule(v []*string) *GetProcessConfigResponseBodyResult { + s.AbstractGenRule = v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetActivityAuth(v string) *GetProcessConfigResponseBodyResult { + s.ActivityAuth = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetAllowRevoke(v bool) *GetProcessConfigResponseBodyResult { + s.AllowRevoke = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetAppendEnable(v bool) *GetProcessConfigResponseBodyResult { + s.AppendEnable = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetAutoExecuteOriginatorTasks(v bool) *GetProcessConfigResponseBodyResult { + s.AutoExecuteOriginatorTasks = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetBizCategoryId(v string) *GetProcessConfigResponseBodyResult { + s.BizCategoryId = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetBizType(v string) *GetProcessConfigResponseBodyResult { + s.BizType = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetCommentConf(v *GetProcessConfigResponseBodyResultCommentConf) *GetProcessConfigResponseBodyResult { + s.CommentConf = v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetDuplicateRemoval(v string) *GetProcessConfigResponseBodyResult { + s.DuplicateRemoval = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetFormSchema(v string) *GetProcessConfigResponseBodyResult { + s.FormSchema = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetHandSignConf(v *GetProcessConfigResponseBodyResultHandSignConf) *GetProcessConfigResponseBodyResult { + s.HandSignConf = v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetManagers(v []*string) *GetProcessConfigResponseBodyResult { + s.Managers = v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetName(v string) *GetProcessConfigResponseBodyResult { + s.Name = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetProcessAppType(v bool) *GetProcessConfigResponseBodyResult { + s.ProcessAppType = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetProcessConfig(v string) *GetProcessConfigResponseBodyResult { + s.ProcessConfig = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetStaticProc(v bool) *GetProcessConfigResponseBodyResult { + s.StaticProc = &v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetSubstituteSubmitConf(v *GetProcessConfigResponseBodyResultSubstituteSubmitConf) *GetProcessConfigResponseBodyResult { + s.SubstituteSubmitConf = v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetTitleGenRule(v *GetProcessConfigResponseBodyResultTitleGenRule) *GetProcessConfigResponseBodyResult { + s.TitleGenRule = v + return s +} + +func (s *GetProcessConfigResponseBodyResult) SetVisibility(v []*GetProcessConfigResponseBodyResultVisibility) *GetProcessConfigResponseBodyResult { + s.Visibility = v + return s +} + +type GetProcessConfigResponseBodyResultCommentConf struct { + // 提示内容 + CommentDescription *string `json:"commentDescription,omitempty" xml:"commentDescription,omitempty"` + // 评论对发起人不可见 + CommentHiddenForProposer *bool `json:"commentHiddenForProposer,omitempty" xml:"commentHiddenForProposer,omitempty"` + // 评论必填 + CommentRequired *bool `json:"commentRequired,omitempty" xml:"commentRequired,omitempty"` +} + +func (s GetProcessConfigResponseBodyResultCommentConf) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBodyResultCommentConf) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBodyResultCommentConf) SetCommentDescription(v string) *GetProcessConfigResponseBodyResultCommentConf { + s.CommentDescription = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultCommentConf) SetCommentHiddenForProposer(v bool) *GetProcessConfigResponseBodyResultCommentConf { + s.CommentHiddenForProposer = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultCommentConf) SetCommentRequired(v bool) *GetProcessConfigResponseBodyResultCommentConf { + s.CommentRequired = &v + return s +} + +type GetProcessConfigResponseBodyResultHandSignConf struct { + // 开启手写签名 + HandSignEnable *bool `json:"handSignEnable,omitempty" xml:"handSignEnable,omitempty"` + // 是否使用上次签名 + ResignEnable *bool `json:"resignEnable,omitempty" xml:"resignEnable,omitempty"` +} + +func (s GetProcessConfigResponseBodyResultHandSignConf) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBodyResultHandSignConf) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBodyResultHandSignConf) SetHandSignEnable(v bool) *GetProcessConfigResponseBodyResultHandSignConf { + s.HandSignEnable = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultHandSignConf) SetResignEnable(v bool) *GetProcessConfigResponseBodyResultHandSignConf { + s.ResignEnable = &v + return s +} + +type GetProcessConfigResponseBodyResultSubstituteSubmitConf struct { + // 是否允许代提交 + Enable *bool `json:"enable,omitempty" xml:"enable,omitempty"` + // 代提交人 + SubmitterList []*GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList `json:"submitterList,omitempty" xml:"submitterList,omitempty" type:"Repeated"` +} + +func (s GetProcessConfigResponseBodyResultSubstituteSubmitConf) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBodyResultSubstituteSubmitConf) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBodyResultSubstituteSubmitConf) SetEnable(v bool) *GetProcessConfigResponseBodyResultSubstituteSubmitConf { + s.Enable = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultSubstituteSubmitConf) SetSubmitterList(v []*GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList) *GetProcessConfigResponseBodyResultSubstituteSubmitConf { + s.SubmitterList = v + return s +} + +type GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList struct { + // 名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 类型 + Type *string `json:"type,omitempty" xml:"type,omitempty"` + // 员工staffId/部门id + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList) SetName(v string) *GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList { + s.Name = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList) SetType(v string) *GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList { + s.Type = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList) SetValue(v string) *GetProcessConfigResponseBodyResultSubstituteSubmitConfSubmitterList { + s.Value = &v + return s +} + +type GetProcessConfigResponseBodyResultTitleGenRule struct { + // 规则表达式 + Express *string `json:"express,omitempty" xml:"express,omitempty"` + // 规则类型 + Type *int32 `json:"type,omitempty" xml:"type,omitempty"` +} + +func (s GetProcessConfigResponseBodyResultTitleGenRule) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBodyResultTitleGenRule) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBodyResultTitleGenRule) SetExpress(v string) *GetProcessConfigResponseBodyResultTitleGenRule { + s.Express = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultTitleGenRule) SetType(v int32) *GetProcessConfigResponseBodyResultTitleGenRule { + s.Type = &v + return s +} + +type GetProcessConfigResponseBodyResultVisibility struct { + // 类型 + Type *int32 `json:"type,omitempty" xml:"type,omitempty"` + // 员工staffId/部门id + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s GetProcessConfigResponseBodyResultVisibility) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponseBodyResultVisibility) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponseBodyResultVisibility) SetType(v int32) *GetProcessConfigResponseBodyResultVisibility { + s.Type = &v + return s +} + +func (s *GetProcessConfigResponseBodyResultVisibility) SetValue(v string) *GetProcessConfigResponseBodyResultVisibility { + s.Value = &v + return s +} + +type GetProcessConfigResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetProcessConfigResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetProcessConfigResponse) String() string { + return tea.Prettify(s) +} + +func (s GetProcessConfigResponse) GoString() string { + return s.String() +} + +func (s *GetProcessConfigResponse) SetHeaders(v map[string]*string) *GetProcessConfigResponse { + s.Headers = v + return s +} + +func (s *GetProcessConfigResponse) SetBody(v *GetProcessConfigResponseBody) *GetProcessConfigResponse { + s.Body = v + return s +} + +type GetProcessInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetProcessInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceHeaders) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceHeaders) SetCommonHeaders(v map[string]*string) *GetProcessInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetProcessInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *GetProcessInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetProcessInstanceRequest struct { + // 审批实例ID企业内部应用可通过获取审批实例ID列表接口获取。钉钉三方企业应用可以通过推送的审批事件中获取,参考biz_type=22。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` +} + +func (s GetProcessInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceRequest) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceRequest) SetProcessInstanceId(v string) *GetProcessInstanceRequest { + s.ProcessInstanceId = &v + return s +} + +type GetProcessInstanceResponseBody struct { + // 返回结果。 + Result *GetProcessInstanceResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` + // 调用是否成功。 + Success *string `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s GetProcessInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceResponseBody) SetResult(v *GetProcessInstanceResponseBodyResult) *GetProcessInstanceResponseBody { + s.Result = v + return s +} + +func (s *GetProcessInstanceResponseBody) SetSuccess(v string) *GetProcessInstanceResponseBody { + s.Success = &v + return s +} + +type GetProcessInstanceResponseBodyResult struct { + // 审批人userid列表。 + ApproverUserIds []*string `json:"approverUserIds,omitempty" xml:"approverUserIds,omitempty" type:"Repeated"` + // 审批附属实例列表,当已经通过的审批实例被修改或撤销,会生成一个新的实例,作为原有审批实例的附属。 如果想知道当前已经通过的审批实例的状态,可以依次遍历它的附属列表,查询里面每个实例的biz_action。 + AttachedProcessInstanceIds []*string `json:"attachedProcessInstanceIds,omitempty" xml:"attachedProcessInstanceIds,omitempty" type:"Repeated"` + // 审批实例业务动作: MODIFY:表示该审批实例是基于原来的实例修改而来 REVOKE:表示该审批实例是由原来的实例撤销后重新发起的 NONE表示正常发起 + BizAction *string `json:"bizAction,omitempty" xml:"bizAction,omitempty"` + // 审批实例业务编号。 + BusinessId *string `json:"businessId,omitempty" xml:"businessId,omitempty"` + // 抄送人userid列表。 + CcUserIds []*string `json:"ccUserIds,omitempty" xml:"ccUserIds,omitempty" type:"Repeated"` + // 创建时间。 + CreateTime *string `json:"createTime,omitempty" xml:"createTime,omitempty"` + // 结束时间。 + FinishTime *string `json:"finishTime,omitempty" xml:"finishTime,omitempty"` + // 表单详情列表。 + FormComponentValues []*GetProcessInstanceResponseBodyResultFormComponentValues `json:"formComponentValues,omitempty" xml:"formComponentValues,omitempty" type:"Repeated"` + // 主流程实例标识。 + MainProcessInstanceId *string `json:"mainProcessInstanceId,omitempty" xml:"mainProcessInstanceId,omitempty"` + // 操作记录列表。 + OperationRecords []*GetProcessInstanceResponseBodyResultOperationRecords `json:"operationRecords,omitempty" xml:"operationRecords,omitempty" type:"Repeated"` + // 发起人的部门。-1表示根部门。 + OriginatorDeptId *string `json:"originatorDeptId,omitempty" xml:"originatorDeptId,omitempty"` + // 发起人的部门名。 + OriginatorDeptName *string `json:"originatorDeptName,omitempty" xml:"originatorDeptName,omitempty"` + // 发起人的userid。 + OriginatorUserId *string `json:"originatorUserId,omitempty" xml:"originatorUserId,omitempty"` + // 审批结果: agree:同意 refuse:拒绝。 说明 status为COMPLETED且result为同意时,表示审批单完结并审批通过。 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 审批状态: NEW:新创建 RUNNING:审批中 TERMINATED:被终止 COMPLETED:完成 CANCELED:取消 + Status *string `json:"status,omitempty" xml:"status,omitempty"` + // 任务列表。 + Tasks []*GetProcessInstanceResponseBodyResultTasks `json:"tasks,omitempty" xml:"tasks,omitempty" type:"Repeated"` + // 审批实例标题。 + Title *string `json:"title,omitempty" xml:"title,omitempty"` +} + +func (s GetProcessInstanceResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceResponseBodyResult) SetApproverUserIds(v []*string) *GetProcessInstanceResponseBodyResult { + s.ApproverUserIds = v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetAttachedProcessInstanceIds(v []*string) *GetProcessInstanceResponseBodyResult { + s.AttachedProcessInstanceIds = v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetBizAction(v string) *GetProcessInstanceResponseBodyResult { + s.BizAction = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetBusinessId(v string) *GetProcessInstanceResponseBodyResult { + s.BusinessId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetCcUserIds(v []*string) *GetProcessInstanceResponseBodyResult { + s.CcUserIds = v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetCreateTime(v string) *GetProcessInstanceResponseBodyResult { + s.CreateTime = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetFinishTime(v string) *GetProcessInstanceResponseBodyResult { + s.FinishTime = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetFormComponentValues(v []*GetProcessInstanceResponseBodyResultFormComponentValues) *GetProcessInstanceResponseBodyResult { + s.FormComponentValues = v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetMainProcessInstanceId(v string) *GetProcessInstanceResponseBodyResult { + s.MainProcessInstanceId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetOperationRecords(v []*GetProcessInstanceResponseBodyResultOperationRecords) *GetProcessInstanceResponseBodyResult { + s.OperationRecords = v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetOriginatorDeptId(v string) *GetProcessInstanceResponseBodyResult { + s.OriginatorDeptId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetOriginatorDeptName(v string) *GetProcessInstanceResponseBodyResult { + s.OriginatorDeptName = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetOriginatorUserId(v string) *GetProcessInstanceResponseBodyResult { + s.OriginatorUserId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetResult(v string) *GetProcessInstanceResponseBodyResult { + s.Result = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetStatus(v string) *GetProcessInstanceResponseBodyResult { + s.Status = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetTasks(v []*GetProcessInstanceResponseBodyResultTasks) *GetProcessInstanceResponseBodyResult { + s.Tasks = v + return s +} + +func (s *GetProcessInstanceResponseBodyResult) SetTitle(v string) *GetProcessInstanceResponseBodyResult { + s.Title = &v + return s +} + +type GetProcessInstanceResponseBodyResultFormComponentValues struct { + // 组件别名。 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 组件类型。 + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + // 标签扩展值。 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 组件ID。 + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 组件名称。 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 标签值。 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s GetProcessInstanceResponseBodyResultFormComponentValues) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceResponseBodyResultFormComponentValues) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceResponseBodyResultFormComponentValues) SetBizAlias(v string) *GetProcessInstanceResponseBodyResultFormComponentValues { + s.BizAlias = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultFormComponentValues) SetComponentType(v string) *GetProcessInstanceResponseBodyResultFormComponentValues { + s.ComponentType = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultFormComponentValues) SetExtValue(v string) *GetProcessInstanceResponseBodyResultFormComponentValues { + s.ExtValue = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultFormComponentValues) SetId(v string) *GetProcessInstanceResponseBodyResultFormComponentValues { + s.Id = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultFormComponentValues) SetName(v string) *GetProcessInstanceResponseBodyResultFormComponentValues { + s.Name = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultFormComponentValues) SetValue(v string) *GetProcessInstanceResponseBodyResultFormComponentValues { + s.Value = &v + return s +} + +type GetProcessInstanceResponseBodyResultOperationRecords struct { + // 评论附件列表。 + Attachments []*GetProcessInstanceResponseBodyResultOperationRecordsAttachments `json:"attachments,omitempty" xml:"attachments,omitempty" type:"Repeated"` + // 抄送人userIds列表 + CcUserIds []*string `json:"ccUserIds,omitempty" xml:"ccUserIds,omitempty" type:"Repeated"` + // 操作时间。 + Date *string `json:"date,omitempty" xml:"date,omitempty"` + // 评论内容。 审批操作附带评论时才返回该字段。 + Remark *string `json:"remark,omitempty" xml:"remark,omitempty"` + // 操作结果: AGREE:同意 REFUSE:拒绝 NONE + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 操作类型: EXECUTE_TASK_NORMAL:正常执行任务 EXECUTE_TASK_AGENT:代理人执行任务 APPEND_TASK_BEFORE:前加签任务 APPEND_TASK_AFTER:后加签任务 REDIRECT_TASK:转交任务 START_PROCESS_INSTANCE:发起流程实例 TERMINATE_PROCESS_INSTANCE:终止(撤销)流程实例 FINISH_PROCESS_INSTANCE:结束流程实例 ADD_REMARK:添加评论 REDIRECT_PROCESS:审批退回 PROCESS_CC:抄送 + Type *string `json:"type,omitempty" xml:"type,omitempty"` + // 操作人userid。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GetProcessInstanceResponseBodyResultOperationRecords) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceResponseBodyResultOperationRecords) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecords) SetAttachments(v []*GetProcessInstanceResponseBodyResultOperationRecordsAttachments) *GetProcessInstanceResponseBodyResultOperationRecords { + s.Attachments = v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecords) SetCcUserIds(v []*string) *GetProcessInstanceResponseBodyResultOperationRecords { + s.CcUserIds = v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecords) SetDate(v string) *GetProcessInstanceResponseBodyResultOperationRecords { + s.Date = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecords) SetRemark(v string) *GetProcessInstanceResponseBodyResultOperationRecords { + s.Remark = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecords) SetResult(v string) *GetProcessInstanceResponseBodyResultOperationRecords { + s.Result = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecords) SetType(v string) *GetProcessInstanceResponseBodyResultOperationRecords { + s.Type = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecords) SetUserId(v string) *GetProcessInstanceResponseBodyResultOperationRecords { + s.UserId = &v + return s +} + +type GetProcessInstanceResponseBodyResultOperationRecordsAttachments struct { + // 附件ID。 + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 附件名称。 + FileName *string `json:"fileName,omitempty" xml:"fileName,omitempty"` + // 附件大小。 + FileSize *string `json:"fileSize,omitempty" xml:"fileSize,omitempty"` + // 附件类型。 + FileType *string `json:"fileType,omitempty" xml:"fileType,omitempty"` +} + +func (s GetProcessInstanceResponseBodyResultOperationRecordsAttachments) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceResponseBodyResultOperationRecordsAttachments) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecordsAttachments) SetFileId(v string) *GetProcessInstanceResponseBodyResultOperationRecordsAttachments { + s.FileId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecordsAttachments) SetFileName(v string) *GetProcessInstanceResponseBodyResultOperationRecordsAttachments { + s.FileName = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecordsAttachments) SetFileSize(v string) *GetProcessInstanceResponseBodyResultOperationRecordsAttachments { + s.FileSize = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultOperationRecordsAttachments) SetFileType(v string) *GetProcessInstanceResponseBodyResultOperationRecordsAttachments { + s.FileType = &v + return s +} + +type GetProcessInstanceResponseBodyResultTasks struct { + // 任务节点ID。 + ActivityId *string `json:"activityId,omitempty" xml:"activityId,omitempty"` + // 开始时间。 + CreateTime *string `json:"createTime,omitempty" xml:"createTime,omitempty"` + // 结束时间。 + FinishTime *string `json:"finishTime,omitempty" xml:"finishTime,omitempty"` + // 移动端任务URL。 + MobileUrl *string `json:"mobileUrl,omitempty" xml:"mobileUrl,omitempty"` + // PC端任务URL。 + PcUrl *string `json:"pcUrl,omitempty" xml:"pcUrl,omitempty"` + // 实例ID。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 结果: AGREE:同意 REFUSE:拒绝 REDIRECTED:转交 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 任务状态: NEW:未启动 RUNNING:处理中 PAUSED:暂停 CANCELED:取消 COMPLETED:完成 TERMINATED:终止 + Status *string `json:"status,omitempty" xml:"status,omitempty"` + // 任务ID。 + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` + // 任务处理人。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GetProcessInstanceResponseBodyResultTasks) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceResponseBodyResultTasks) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetActivityId(v string) *GetProcessInstanceResponseBodyResultTasks { + s.ActivityId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetCreateTime(v string) *GetProcessInstanceResponseBodyResultTasks { + s.CreateTime = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetFinishTime(v string) *GetProcessInstanceResponseBodyResultTasks { + s.FinishTime = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetMobileUrl(v string) *GetProcessInstanceResponseBodyResultTasks { + s.MobileUrl = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetPcUrl(v string) *GetProcessInstanceResponseBodyResultTasks { + s.PcUrl = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetProcessInstanceId(v string) *GetProcessInstanceResponseBodyResultTasks { + s.ProcessInstanceId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetResult(v string) *GetProcessInstanceResponseBodyResultTasks { + s.Result = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetStatus(v string) *GetProcessInstanceResponseBodyResultTasks { + s.Status = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetTaskId(v int64) *GetProcessInstanceResponseBodyResultTasks { + s.TaskId = &v + return s +} + +func (s *GetProcessInstanceResponseBodyResultTasks) SetUserId(v string) *GetProcessInstanceResponseBodyResultTasks { + s.UserId = &v + return s +} + +type GetProcessInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetProcessInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetProcessInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s GetProcessInstanceResponse) GoString() string { + return s.String() +} + +func (s *GetProcessInstanceResponse) SetHeaders(v map[string]*string) *GetProcessInstanceResponse { + s.Headers = v + return s +} + +func (s *GetProcessInstanceResponse) SetBody(v *GetProcessInstanceResponseBody) *GetProcessInstanceResponse { + s.Body = v + return s +} + +type GetSpaceWithDownloadAuthHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetSpaceWithDownloadAuthHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetSpaceWithDownloadAuthHeaders) GoString() string { + return s.String() +} + +func (s *GetSpaceWithDownloadAuthHeaders) SetCommonHeaders(v map[string]*string) *GetSpaceWithDownloadAuthHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetSpaceWithDownloadAuthHeaders) SetXAcsDingtalkAccessToken(v string) *GetSpaceWithDownloadAuthHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetSpaceWithDownloadAuthRequest struct { + // 应用的agentid。 + AgentId *int64 `json:"agentId,omitempty" xml:"agentId,omitempty"` + // 审批附件ID。 + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 附件ID列表,支持批量授权,最大列表长度:20。 + FileIdList []*string `json:"fileIdList,omitempty" xml:"fileIdList,omitempty" type:"Repeated"` + // 实例ID。 + // + // 企业内部应用 + // + // 可通过获取审批实例ID列表接口获取。 + // + // 第三方企业应用 + // + // 可以通过推送的审批事件中获取,参考biz_type=22。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 授权允许预览附件的用户userid。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GetSpaceWithDownloadAuthRequest) String() string { + return tea.Prettify(s) +} + +func (s GetSpaceWithDownloadAuthRequest) GoString() string { + return s.String() +} + +func (s *GetSpaceWithDownloadAuthRequest) SetAgentId(v int64) *GetSpaceWithDownloadAuthRequest { + s.AgentId = &v + return s +} + +func (s *GetSpaceWithDownloadAuthRequest) SetFileId(v string) *GetSpaceWithDownloadAuthRequest { + s.FileId = &v + return s +} + +func (s *GetSpaceWithDownloadAuthRequest) SetFileIdList(v []*string) *GetSpaceWithDownloadAuthRequest { + s.FileIdList = v + return s +} + +func (s *GetSpaceWithDownloadAuthRequest) SetProcessInstanceId(v string) *GetSpaceWithDownloadAuthRequest { + s.ProcessInstanceId = &v + return s +} + +func (s *GetSpaceWithDownloadAuthRequest) SetUserId(v string) *GetSpaceWithDownloadAuthRequest { + s.UserId = &v + return s +} + +type GetSpaceWithDownloadAuthResponseBody struct { + // 返回结果。 + Result *GetSpaceWithDownloadAuthResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s GetSpaceWithDownloadAuthResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetSpaceWithDownloadAuthResponseBody) GoString() string { + return s.String() +} + +func (s *GetSpaceWithDownloadAuthResponseBody) SetResult(v *GetSpaceWithDownloadAuthResponseBodyResult) *GetSpaceWithDownloadAuthResponseBody { + s.Result = v + return s +} + +func (s *GetSpaceWithDownloadAuthResponseBody) SetSuccess(v bool) *GetSpaceWithDownloadAuthResponseBody { + s.Success = &v + return s +} + +type GetSpaceWithDownloadAuthResponseBodyResult struct { + // 钉盘空间ID。 + SpaceId *int64 `json:"spaceId,omitempty" xml:"spaceId,omitempty"` +} + +func (s GetSpaceWithDownloadAuthResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GetSpaceWithDownloadAuthResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GetSpaceWithDownloadAuthResponseBodyResult) SetSpaceId(v int64) *GetSpaceWithDownloadAuthResponseBodyResult { + s.SpaceId = &v + return s +} + +type GetSpaceWithDownloadAuthResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetSpaceWithDownloadAuthResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetSpaceWithDownloadAuthResponse) String() string { + return tea.Prettify(s) +} + +func (s GetSpaceWithDownloadAuthResponse) GoString() string { + return s.String() +} + +func (s *GetSpaceWithDownloadAuthResponse) SetHeaders(v map[string]*string) *GetSpaceWithDownloadAuthResponse { + s.Headers = v + return s +} + +func (s *GetSpaceWithDownloadAuthResponse) SetBody(v *GetSpaceWithDownloadAuthResponseBody) *GetSpaceWithDownloadAuthResponse { + s.Body = v + return s +} + +type GetUserTodoTaskSumHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GetUserTodoTaskSumHeaders) String() string { + return tea.Prettify(s) +} + +func (s GetUserTodoTaskSumHeaders) GoString() string { + return s.String() +} + +func (s *GetUserTodoTaskSumHeaders) SetCommonHeaders(v map[string]*string) *GetUserTodoTaskSumHeaders { + s.CommonHeaders = v + return s +} + +func (s *GetUserTodoTaskSumHeaders) SetXAcsDingtalkAccessToken(v string) *GetUserTodoTaskSumHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GetUserTodoTaskSumRequest struct { + // 要查询的用户userid。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GetUserTodoTaskSumRequest) String() string { + return tea.Prettify(s) +} + +func (s GetUserTodoTaskSumRequest) GoString() string { + return s.String() +} + +func (s *GetUserTodoTaskSumRequest) SetUserId(v string) *GetUserTodoTaskSumRequest { + s.UserId = &v + return s +} + +type GetUserTodoTaskSumResponseBody struct { + // 待处理的审批数量。 + Result *int32 `json:"result,omitempty" xml:"result,omitempty"` +} + +func (s GetUserTodoTaskSumResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GetUserTodoTaskSumResponseBody) GoString() string { + return s.String() +} + +func (s *GetUserTodoTaskSumResponseBody) SetResult(v int32) *GetUserTodoTaskSumResponseBody { + s.Result = &v + return s +} + +type GetUserTodoTaskSumResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GetUserTodoTaskSumResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GetUserTodoTaskSumResponse) String() string { + return tea.Prettify(s) +} + +func (s GetUserTodoTaskSumResponse) GoString() string { + return s.String() +} + +func (s *GetUserTodoTaskSumResponse) SetHeaders(v map[string]*string) *GetUserTodoTaskSumResponse { + s.Headers = v + return s +} + +func (s *GetUserTodoTaskSumResponse) SetBody(v *GetUserTodoTaskSumResponseBody) *GetUserTodoTaskSumResponse { + s.Body = v + return s +} + +type GrantCspaceAuthorizationHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GrantCspaceAuthorizationHeaders) String() string { + return tea.Prettify(s) +} + +func (s GrantCspaceAuthorizationHeaders) GoString() string { + return s.String() +} + +func (s *GrantCspaceAuthorizationHeaders) SetCommonHeaders(v map[string]*string) *GrantCspaceAuthorizationHeaders { + s.CommonHeaders = v + return s +} + +func (s *GrantCspaceAuthorizationHeaders) SetXAcsDingtalkAccessToken(v string) *GrantCspaceAuthorizationHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GrantCspaceAuthorizationRequest struct { + // 权限有效时间,单位为秒。 + DurationSeconds *int64 `json:"durationSeconds,omitempty" xml:"durationSeconds,omitempty"` + // 审批控件 id。 + SpaceId *string `json:"spaceId,omitempty" xml:"spaceId,omitempty"` + // 权限类型。 + Type *string `json:"type,omitempty" xml:"type,omitempty"` + // 用户 id。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s GrantCspaceAuthorizationRequest) String() string { + return tea.Prettify(s) +} + +func (s GrantCspaceAuthorizationRequest) GoString() string { + return s.String() +} + +func (s *GrantCspaceAuthorizationRequest) SetDurationSeconds(v int64) *GrantCspaceAuthorizationRequest { + s.DurationSeconds = &v + return s +} + +func (s *GrantCspaceAuthorizationRequest) SetSpaceId(v string) *GrantCspaceAuthorizationRequest { + s.SpaceId = &v + return s +} + +func (s *GrantCspaceAuthorizationRequest) SetType(v string) *GrantCspaceAuthorizationRequest { + s.Type = &v + return s +} + +func (s *GrantCspaceAuthorizationRequest) SetUserId(v string) *GrantCspaceAuthorizationRequest { + s.UserId = &v + return s +} + +type GrantCspaceAuthorizationResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` +} + +func (s GrantCspaceAuthorizationResponse) String() string { + return tea.Prettify(s) +} + +func (s GrantCspaceAuthorizationResponse) GoString() string { + return s.String() +} + +func (s *GrantCspaceAuthorizationResponse) SetHeaders(v map[string]*string) *GrantCspaceAuthorizationResponse { + s.Headers = v + return s +} + +type GrantProcessInstanceForDownloadFileHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s GrantProcessInstanceForDownloadFileHeaders) String() string { + return tea.Prettify(s) +} + +func (s GrantProcessInstanceForDownloadFileHeaders) GoString() string { + return s.String() +} + +func (s *GrantProcessInstanceForDownloadFileHeaders) SetCommonHeaders(v map[string]*string) *GrantProcessInstanceForDownloadFileHeaders { + s.CommonHeaders = v + return s +} + +func (s *GrantProcessInstanceForDownloadFileHeaders) SetXAcsDingtalkAccessToken(v string) *GrantProcessInstanceForDownloadFileHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type GrantProcessInstanceForDownloadFileRequest struct { + // 文件id,调用获取审批实例详情接口获取。 + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 实例ID。 + // + // 调用获取审批实例详情接口获取。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` +} + +func (s GrantProcessInstanceForDownloadFileRequest) String() string { + return tea.Prettify(s) +} + +func (s GrantProcessInstanceForDownloadFileRequest) GoString() string { + return s.String() +} + +func (s *GrantProcessInstanceForDownloadFileRequest) SetFileId(v string) *GrantProcessInstanceForDownloadFileRequest { + s.FileId = &v + return s +} + +func (s *GrantProcessInstanceForDownloadFileRequest) SetProcessInstanceId(v string) *GrantProcessInstanceForDownloadFileRequest { + s.ProcessInstanceId = &v + return s +} + +type GrantProcessInstanceForDownloadFileResponseBody struct { + // 返回结果。 + Result *GrantProcessInstanceForDownloadFileResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s GrantProcessInstanceForDownloadFileResponseBody) String() string { + return tea.Prettify(s) +} + +func (s GrantProcessInstanceForDownloadFileResponseBody) GoString() string { + return s.String() +} + +func (s *GrantProcessInstanceForDownloadFileResponseBody) SetResult(v *GrantProcessInstanceForDownloadFileResponseBodyResult) *GrantProcessInstanceForDownloadFileResponseBody { + s.Result = v + return s +} + +func (s *GrantProcessInstanceForDownloadFileResponseBody) SetSuccess(v bool) *GrantProcessInstanceForDownloadFileResponseBody { + s.Success = &v + return s +} + +type GrantProcessInstanceForDownloadFileResponseBodyResult struct { + // 文件下载地址。 + DownloadUri *string `json:"downloadUri,omitempty" xml:"downloadUri,omitempty"` + // 文件ID。 + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 钉盘空间ID。 + SpaceId *int64 `json:"spaceId,omitempty" xml:"spaceId,omitempty"` +} + +func (s GrantProcessInstanceForDownloadFileResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s GrantProcessInstanceForDownloadFileResponseBodyResult) GoString() string { + return s.String() +} + +func (s *GrantProcessInstanceForDownloadFileResponseBodyResult) SetDownloadUri(v string) *GrantProcessInstanceForDownloadFileResponseBodyResult { + s.DownloadUri = &v + return s +} + +func (s *GrantProcessInstanceForDownloadFileResponseBodyResult) SetFileId(v string) *GrantProcessInstanceForDownloadFileResponseBodyResult { + s.FileId = &v + return s +} + +func (s *GrantProcessInstanceForDownloadFileResponseBodyResult) SetSpaceId(v int64) *GrantProcessInstanceForDownloadFileResponseBodyResult { + s.SpaceId = &v + return s +} + +type GrantProcessInstanceForDownloadFileResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *GrantProcessInstanceForDownloadFileResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s GrantProcessInstanceForDownloadFileResponse) String() string { + return tea.Prettify(s) +} + +func (s GrantProcessInstanceForDownloadFileResponse) GoString() string { + return s.String() +} + +func (s *GrantProcessInstanceForDownloadFileResponse) SetHeaders(v map[string]*string) *GrantProcessInstanceForDownloadFileResponse { + s.Headers = v + return s +} + +func (s *GrantProcessInstanceForDownloadFileResponse) SetBody(v *GrantProcessInstanceForDownloadFileResponseBody) *GrantProcessInstanceForDownloadFileResponse { + s.Body = v + return s +} + +type InstallAppHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s InstallAppHeaders) String() string { + return tea.Prettify(s) +} + +func (s InstallAppHeaders) GoString() string { + return s.String() +} + +func (s *InstallAppHeaders) SetCommonHeaders(v map[string]*string) *InstallAppHeaders { + s.CommonHeaders = v + return s +} + +func (s *InstallAppHeaders) SetXAcsDingtalkAccessToken(v string) *InstallAppHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type InstallAppRequest struct { + // 业务分组 + BizGroup *string `json:"bizGroup,omitempty" xml:"bizGroup,omitempty"` + // 安装选项 + // + InstallOption *InstallAppRequestInstallOption `json:"installOption,omitempty" xml:"installOption,omitempty" type:"Struct"` + // 安装的目录名称 + SourceDirName *string `json:"sourceDirName,omitempty" xml:"sourceDirName,omitempty"` +} + +func (s InstallAppRequest) String() string { + return tea.Prettify(s) +} + +func (s InstallAppRequest) GoString() string { + return s.String() +} + +func (s *InstallAppRequest) SetBizGroup(v string) *InstallAppRequest { + s.BizGroup = &v + return s +} + +func (s *InstallAppRequest) SetInstallOption(v *InstallAppRequestInstallOption) *InstallAppRequest { + s.InstallOption = v + return s +} + +func (s *InstallAppRequest) SetSourceDirName(v string) *InstallAppRequest { + s.SourceDirName = &v + return s +} + +type InstallAppRequestInstallOption struct { + // 是否同步,目前只有同步 + IsSync *bool `json:"isSync,omitempty" xml:"isSync,omitempty"` +} + +func (s InstallAppRequestInstallOption) String() string { + return tea.Prettify(s) +} + +func (s InstallAppRequestInstallOption) GoString() string { + return s.String() +} + +func (s *InstallAppRequestInstallOption) SetIsSync(v bool) *InstallAppRequestInstallOption { + s.IsSync = &v + return s +} + +type InstallAppResponseBody struct { + // 返回对象列表 + Result []*InstallAppResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` +} + +func (s InstallAppResponseBody) String() string { + return tea.Prettify(s) +} + +func (s InstallAppResponseBody) GoString() string { + return s.String() +} + +func (s *InstallAppResponseBody) SetResult(v []*InstallAppResponseBodyResult) *InstallAppResponseBody { + s.Result = v + return s +} + +type InstallAppResponseBodyResult struct { + // 套件业务类型 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 模版名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 模版processcode + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s InstallAppResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s InstallAppResponseBodyResult) GoString() string { + return s.String() +} + +func (s *InstallAppResponseBodyResult) SetBizType(v string) *InstallAppResponseBodyResult { + s.BizType = &v + return s +} + +func (s *InstallAppResponseBodyResult) SetName(v string) *InstallAppResponseBodyResult { + s.Name = &v + return s +} + +func (s *InstallAppResponseBodyResult) SetProcessCode(v string) *InstallAppResponseBodyResult { + s.ProcessCode = &v + return s +} + +type InstallAppResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *InstallAppResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s InstallAppResponse) String() string { + return tea.Prettify(s) +} + +func (s InstallAppResponse) GoString() string { + return s.String() +} + +func (s *InstallAppResponse) SetHeaders(v map[string]*string) *InstallAppResponse { + s.Headers = v + return s +} + +func (s *InstallAppResponse) SetBody(v *InstallAppResponseBody) *InstallAppResponse { + s.Body = v + return s +} + +type ListProcessInstanceIdsHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s ListProcessInstanceIdsHeaders) String() string { + return tea.Prettify(s) +} + +func (s ListProcessInstanceIdsHeaders) GoString() string { + return s.String() +} + +func (s *ListProcessInstanceIdsHeaders) SetCommonHeaders(v map[string]*string) *ListProcessInstanceIdsHeaders { + s.CommonHeaders = v + return s +} + +func (s *ListProcessInstanceIdsHeaders) SetXAcsDingtalkAccessToken(v string) *ListProcessInstanceIdsHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type ListProcessInstanceIdsRequest struct { + // 审批实例结束时间,Unix时间戳,单位毫秒。 例如:获取审批单发起时间在2020.4.10-2020.4.14之间审批单,该值传2020.4.14 23:59:59对应的时间戳1586879999000。 + EndTime *int64 `json:"endTime,omitempty" xml:"endTime,omitempty"` + // 分页参数,每页大小,最多传20。 + MaxResults *int64 `json:"maxResults,omitempty" xml:"maxResults,omitempty"` + // 分页查询的游标,最开始传0,后续传返回参数中的nextToken值。 + NextToken *int64 `json:"nextToken,omitempty" xml:"nextToken,omitempty"` + // 审批流的唯一码。 + // + // processCode在审批模板编辑页面的URL中获取。 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 审批实例开始时间。Unix时间戳,单位毫秒。 + // + // 例如:获取审批单发起时间在2020.4.10-2020.4.14之间审批单,该值传2020.4.10 00:00:00对应的时间戳1586448000000。 + StartTime *int64 `json:"startTime,omitempty" xml:"startTime,omitempty"` + // 发起userid列表,最大列表长度为10。 + UserIds []*string `json:"userIds,omitempty" xml:"userIds,omitempty" type:"Repeated"` +} + +func (s ListProcessInstanceIdsRequest) String() string { + return tea.Prettify(s) +} + +func (s ListProcessInstanceIdsRequest) GoString() string { + return s.String() +} + +func (s *ListProcessInstanceIdsRequest) SetEndTime(v int64) *ListProcessInstanceIdsRequest { + s.EndTime = &v + return s +} + +func (s *ListProcessInstanceIdsRequest) SetMaxResults(v int64) *ListProcessInstanceIdsRequest { + s.MaxResults = &v + return s +} + +func (s *ListProcessInstanceIdsRequest) SetNextToken(v int64) *ListProcessInstanceIdsRequest { + s.NextToken = &v + return s +} + +func (s *ListProcessInstanceIdsRequest) SetProcessCode(v string) *ListProcessInstanceIdsRequest { + s.ProcessCode = &v + return s +} + +func (s *ListProcessInstanceIdsRequest) SetStartTime(v int64) *ListProcessInstanceIdsRequest { + s.StartTime = &v + return s +} + +func (s *ListProcessInstanceIdsRequest) SetUserIds(v []*string) *ListProcessInstanceIdsRequest { + s.UserIds = v + return s +} + +type ListProcessInstanceIdsResponseBody struct { + // 返回结果。 + Result *ListProcessInstanceIdsResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` + // 接口请求是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s ListProcessInstanceIdsResponseBody) String() string { + return tea.Prettify(s) +} + +func (s ListProcessInstanceIdsResponseBody) GoString() string { + return s.String() +} + +func (s *ListProcessInstanceIdsResponseBody) SetResult(v *ListProcessInstanceIdsResponseBodyResult) *ListProcessInstanceIdsResponseBody { + s.Result = v + return s +} + +func (s *ListProcessInstanceIdsResponseBody) SetSuccess(v bool) *ListProcessInstanceIdsResponseBody { + s.Success = &v + return s +} + +type ListProcessInstanceIdsResponseBodyResult struct { + // 审批实例ID列表。 + List []*string `json:"list,omitempty" xml:"list,omitempty" type:"Repeated"` + // 表示下次查询的游标,当返回结果没有该字段时表示没有更多数据了。 + NextToken *string `json:"nextToken,omitempty" xml:"nextToken,omitempty"` +} + +func (s ListProcessInstanceIdsResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s ListProcessInstanceIdsResponseBodyResult) GoString() string { + return s.String() +} + +func (s *ListProcessInstanceIdsResponseBodyResult) SetList(v []*string) *ListProcessInstanceIdsResponseBodyResult { + s.List = v + return s +} + +func (s *ListProcessInstanceIdsResponseBodyResult) SetNextToken(v string) *ListProcessInstanceIdsResponseBodyResult { + s.NextToken = &v + return s +} + +type ListProcessInstanceIdsResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *ListProcessInstanceIdsResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s ListProcessInstanceIdsResponse) String() string { + return tea.Prettify(s) +} + +func (s ListProcessInstanceIdsResponse) GoString() string { + return s.String() +} + +func (s *ListProcessInstanceIdsResponse) SetHeaders(v map[string]*string) *ListProcessInstanceIdsResponse { + s.Headers = v + return s +} + +func (s *ListProcessInstanceIdsResponse) SetBody(v *ListProcessInstanceIdsResponseBody) *ListProcessInstanceIdsResponse { + s.Body = v + return s +} + +type ListTodoWorkRecordsHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s ListTodoWorkRecordsHeaders) String() string { + return tea.Prettify(s) +} + +func (s ListTodoWorkRecordsHeaders) GoString() string { + return s.String() +} + +func (s *ListTodoWorkRecordsHeaders) SetCommonHeaders(v map[string]*string) *ListTodoWorkRecordsHeaders { + s.CommonHeaders = v + return s +} + +func (s *ListTodoWorkRecordsHeaders) SetXAcsDingtalkAccessToken(v string) *ListTodoWorkRecordsHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type ListTodoWorkRecordsRequest struct { + // 分页大小,最大值50。 + MaxResults *int32 `json:"maxResults,omitempty" xml:"maxResults,omitempty"` + // 分页游标。 + // + // 如果是首次调用,该参数传0。 + // 如果是非首次调用,该参数传上次调用时返回的nextToken。 + // + NextToken *int32 `json:"nextToken,omitempty" xml:"nextToken,omitempty"` + // 待办事项的状态: + // + // 0:待处理 + // + // -1:已经移除 + // + Status *int32 `json:"status,omitempty" xml:"status,omitempty"` + // 要查询的执行人userid。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s ListTodoWorkRecordsRequest) String() string { + return tea.Prettify(s) +} + +func (s ListTodoWorkRecordsRequest) GoString() string { + return s.String() +} + +func (s *ListTodoWorkRecordsRequest) SetMaxResults(v int32) *ListTodoWorkRecordsRequest { + s.MaxResults = &v + return s +} + +func (s *ListTodoWorkRecordsRequest) SetNextToken(v int32) *ListTodoWorkRecordsRequest { + s.NextToken = &v + return s +} + +func (s *ListTodoWorkRecordsRequest) SetStatus(v int32) *ListTodoWorkRecordsRequest { + s.Status = &v + return s +} + +func (s *ListTodoWorkRecordsRequest) SetUserId(v string) *ListTodoWorkRecordsRequest { + s.UserId = &v + return s +} + +type ListTodoWorkRecordsResponseBody struct { + // 查询结果。 + Result *ListTodoWorkRecordsResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s ListTodoWorkRecordsResponseBody) String() string { + return tea.Prettify(s) +} + +func (s ListTodoWorkRecordsResponseBody) GoString() string { + return s.String() +} + +func (s *ListTodoWorkRecordsResponseBody) SetResult(v *ListTodoWorkRecordsResponseBodyResult) *ListTodoWorkRecordsResponseBody { + s.Result = v + return s +} + +type ListTodoWorkRecordsResponseBodyResult struct { + // 待办事项列表。 + List []*ListTodoWorkRecordsResponseBodyResultList `json:"list,omitempty" xml:"list,omitempty" type:"Repeated"` + // 分页游标。不为空表示有数据。 + NextToken *int64 `json:"nextToken,omitempty" xml:"nextToken,omitempty"` +} + +func (s ListTodoWorkRecordsResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s ListTodoWorkRecordsResponseBodyResult) GoString() string { + return s.String() +} + +func (s *ListTodoWorkRecordsResponseBodyResult) SetList(v []*ListTodoWorkRecordsResponseBodyResultList) *ListTodoWorkRecordsResponseBodyResult { + s.List = v + return s +} + +func (s *ListTodoWorkRecordsResponseBodyResult) SetNextToken(v int64) *ListTodoWorkRecordsResponseBodyResult { + s.NextToken = &v + return s +} + +type ListTodoWorkRecordsResponseBodyResultList struct { + // 表单列表。 + Forms []*ListTodoWorkRecordsResponseBodyResultListForms `json:"forms,omitempty" xml:"forms,omitempty" type:"Repeated"` + // 实例ID。 + InstanceId *string `json:"instanceId,omitempty" xml:"instanceId,omitempty"` + // 待办任务ID。 + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` + // 待办标题。 + Title *string `json:"title,omitempty" xml:"title,omitempty"` + // 待办跳转链接。 + Url *string `json:"url,omitempty" xml:"url,omitempty"` +} + +func (s ListTodoWorkRecordsResponseBodyResultList) String() string { + return tea.Prettify(s) +} + +func (s ListTodoWorkRecordsResponseBodyResultList) GoString() string { + return s.String() +} + +func (s *ListTodoWorkRecordsResponseBodyResultList) SetForms(v []*ListTodoWorkRecordsResponseBodyResultListForms) *ListTodoWorkRecordsResponseBodyResultList { + s.Forms = v + return s +} + +func (s *ListTodoWorkRecordsResponseBodyResultList) SetInstanceId(v string) *ListTodoWorkRecordsResponseBodyResultList { + s.InstanceId = &v + return s +} + +func (s *ListTodoWorkRecordsResponseBodyResultList) SetTaskId(v int64) *ListTodoWorkRecordsResponseBodyResultList { + s.TaskId = &v + return s +} + +func (s *ListTodoWorkRecordsResponseBodyResultList) SetTitle(v string) *ListTodoWorkRecordsResponseBodyResultList { + s.Title = &v + return s +} + +func (s *ListTodoWorkRecordsResponseBodyResultList) SetUrl(v string) *ListTodoWorkRecordsResponseBodyResultList { + s.Url = &v + return s +} + +type ListTodoWorkRecordsResponseBodyResultListForms struct { + // 表单内容。 + Content *string `json:"content,omitempty" xml:"content,omitempty"` + // 表单标题。 + Title *string `json:"title,omitempty" xml:"title,omitempty"` +} + +func (s ListTodoWorkRecordsResponseBodyResultListForms) String() string { + return tea.Prettify(s) +} + +func (s ListTodoWorkRecordsResponseBodyResultListForms) GoString() string { + return s.String() +} + +func (s *ListTodoWorkRecordsResponseBodyResultListForms) SetContent(v string) *ListTodoWorkRecordsResponseBodyResultListForms { + s.Content = &v + return s +} + +func (s *ListTodoWorkRecordsResponseBodyResultListForms) SetTitle(v string) *ListTodoWorkRecordsResponseBodyResultListForms { + s.Title = &v + return s +} + +type ListTodoWorkRecordsResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *ListTodoWorkRecordsResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s ListTodoWorkRecordsResponse) String() string { + return tea.Prettify(s) +} + +func (s ListTodoWorkRecordsResponse) GoString() string { + return s.String() +} + +func (s *ListTodoWorkRecordsResponse) SetHeaders(v map[string]*string) *ListTodoWorkRecordsResponse { + s.Headers = v + return s +} + +func (s *ListTodoWorkRecordsResponse) SetBody(v *ListTodoWorkRecordsResponseBody) *ListTodoWorkRecordsResponse { + s.Body = v + return s +} + +type ListUserVisibleBpmsProcessesHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s ListUserVisibleBpmsProcessesHeaders) String() string { + return tea.Prettify(s) +} + +func (s ListUserVisibleBpmsProcessesHeaders) GoString() string { + return s.String() +} + +func (s *ListUserVisibleBpmsProcessesHeaders) SetCommonHeaders(v map[string]*string) *ListUserVisibleBpmsProcessesHeaders { + s.CommonHeaders = v + return s +} + +func (s *ListUserVisibleBpmsProcessesHeaders) SetXAcsDingtalkAccessToken(v string) *ListUserVisibleBpmsProcessesHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type ListUserVisibleBpmsProcessesRequest struct { + // 分页大小,最大可设置成100。 + MaxResults *int64 `json:"maxResults,omitempty" xml:"maxResults,omitempty"` + // 分页游标,从0开始。根据返回结果里的nextToken是否为空来判断是否还有下一页,且再次调用时设置成nextToken的最新值。 + NextToken *int64 `json:"nextToken,omitempty" xml:"nextToken,omitempty"` + // 要查询的员工的userid。不传表示查询企业下所有审批表单。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s ListUserVisibleBpmsProcessesRequest) String() string { + return tea.Prettify(s) +} + +func (s ListUserVisibleBpmsProcessesRequest) GoString() string { + return s.String() +} + +func (s *ListUserVisibleBpmsProcessesRequest) SetMaxResults(v int64) *ListUserVisibleBpmsProcessesRequest { + s.MaxResults = &v + return s +} + +func (s *ListUserVisibleBpmsProcessesRequest) SetNextToken(v int64) *ListUserVisibleBpmsProcessesRequest { + s.NextToken = &v + return s +} + +func (s *ListUserVisibleBpmsProcessesRequest) SetUserId(v string) *ListUserVisibleBpmsProcessesRequest { + s.UserId = &v + return s +} + +type ListUserVisibleBpmsProcessesResponseBody struct { + // 返回结果。 + Result *ListUserVisibleBpmsProcessesResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s ListUserVisibleBpmsProcessesResponseBody) String() string { + return tea.Prettify(s) +} + +func (s ListUserVisibleBpmsProcessesResponseBody) GoString() string { + return s.String() +} + +func (s *ListUserVisibleBpmsProcessesResponseBody) SetResult(v *ListUserVisibleBpmsProcessesResponseBodyResult) *ListUserVisibleBpmsProcessesResponseBody { + s.Result = v + return s +} + +type ListUserVisibleBpmsProcessesResponseBodyResult struct { + // 下一次分页调用的值,当返回结果里没有nextToken时,表示分页结束。 + NextToken *int64 `json:"nextToken,omitempty" xml:"nextToken,omitempty"` + // 可见表单列表。 + ProcessList []*ListUserVisibleBpmsProcessesResponseBodyResultProcessList `json:"processList,omitempty" xml:"processList,omitempty" type:"Repeated"` +} + +func (s ListUserVisibleBpmsProcessesResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s ListUserVisibleBpmsProcessesResponseBodyResult) GoString() string { + return s.String() +} + +func (s *ListUserVisibleBpmsProcessesResponseBodyResult) SetNextToken(v int64) *ListUserVisibleBpmsProcessesResponseBodyResult { + s.NextToken = &v + return s +} + +func (s *ListUserVisibleBpmsProcessesResponseBodyResult) SetProcessList(v []*ListUserVisibleBpmsProcessesResponseBodyResultProcessList) *ListUserVisibleBpmsProcessesResponseBodyResult { + s.ProcessList = v + return s +} + +type ListUserVisibleBpmsProcessesResponseBodyResultProcessList struct { + // 图标URL。 + IconUrl *string `json:"iconUrl,omitempty" xml:"iconUrl,omitempty"` + // 表单名称。 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 表单唯一标识。 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 表单URL。 + Url *string `json:"url,omitempty" xml:"url,omitempty"` +} + +func (s ListUserVisibleBpmsProcessesResponseBodyResultProcessList) String() string { + return tea.Prettify(s) +} + +func (s ListUserVisibleBpmsProcessesResponseBodyResultProcessList) GoString() string { + return s.String() +} + +func (s *ListUserVisibleBpmsProcessesResponseBodyResultProcessList) SetIconUrl(v string) *ListUserVisibleBpmsProcessesResponseBodyResultProcessList { + s.IconUrl = &v + return s +} + +func (s *ListUserVisibleBpmsProcessesResponseBodyResultProcessList) SetName(v string) *ListUserVisibleBpmsProcessesResponseBodyResultProcessList { + s.Name = &v + return s +} + +func (s *ListUserVisibleBpmsProcessesResponseBodyResultProcessList) SetProcessCode(v string) *ListUserVisibleBpmsProcessesResponseBodyResultProcessList { + s.ProcessCode = &v + return s +} + +func (s *ListUserVisibleBpmsProcessesResponseBodyResultProcessList) SetUrl(v string) *ListUserVisibleBpmsProcessesResponseBodyResultProcessList { + s.Url = &v + return s +} + +type ListUserVisibleBpmsProcessesResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *ListUserVisibleBpmsProcessesResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s ListUserVisibleBpmsProcessesResponse) String() string { + return tea.Prettify(s) +} + +func (s ListUserVisibleBpmsProcessesResponse) GoString() string { + return s.String() +} + +func (s *ListUserVisibleBpmsProcessesResponse) SetHeaders(v map[string]*string) *ListUserVisibleBpmsProcessesResponse { + s.Headers = v + return s +} + +func (s *ListUserVisibleBpmsProcessesResponse) SetBody(v *ListUserVisibleBpmsProcessesResponseBody) *ListUserVisibleBpmsProcessesResponse { + s.Body = v + return s +} + +type ProcessForecastHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s ProcessForecastHeaders) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastHeaders) GoString() string { + return s.String() +} + +func (s *ProcessForecastHeaders) SetCommonHeaders(v map[string]*string) *ProcessForecastHeaders { + s.CommonHeaders = v + return s +} + +func (s *ProcessForecastHeaders) SetXAcsDingtalkAccessToken(v string) *ProcessForecastHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type ProcessForecastRequest struct { + // 部门ID + DeptId *int32 `json:"deptId,omitempty" xml:"deptId,omitempty"` + // 表单数据内容,控件列表 + FormComponentValues []*ProcessForecastRequestFormComponentValues `json:"formComponentValues,omitempty" xml:"formComponentValues,omitempty" type:"Repeated"` + // 审批流的唯一码 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 审批发起人的userId + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s ProcessForecastRequest) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastRequest) GoString() string { + return s.String() +} + +func (s *ProcessForecastRequest) SetDeptId(v int32) *ProcessForecastRequest { + s.DeptId = &v + return s +} + +func (s *ProcessForecastRequest) SetFormComponentValues(v []*ProcessForecastRequestFormComponentValues) *ProcessForecastRequest { + s.FormComponentValues = v + return s +} + +func (s *ProcessForecastRequest) SetProcessCode(v string) *ProcessForecastRequest { + s.ProcessCode = &v + return s +} + +func (s *ProcessForecastRequest) SetUserId(v string) *ProcessForecastRequest { + s.UserId = &v + return s +} + +type ProcessForecastRequestFormComponentValues struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 控件类型 + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + Details []*ProcessForecastRequestFormComponentValuesDetails `json:"details,omitempty" xml:"details,omitempty" type:"Repeated"` + // 控件扩展值 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 控件值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s ProcessForecastRequestFormComponentValues) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastRequestFormComponentValues) GoString() string { + return s.String() +} + +func (s *ProcessForecastRequestFormComponentValues) SetBizAlias(v string) *ProcessForecastRequestFormComponentValues { + s.BizAlias = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValues) SetComponentType(v string) *ProcessForecastRequestFormComponentValues { + s.ComponentType = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValues) SetDetails(v []*ProcessForecastRequestFormComponentValuesDetails) *ProcessForecastRequestFormComponentValues { + s.Details = v + return s +} + +func (s *ProcessForecastRequestFormComponentValues) SetExtValue(v string) *ProcessForecastRequestFormComponentValues { + s.ExtValue = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValues) SetId(v string) *ProcessForecastRequestFormComponentValues { + s.Id = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValues) SetName(v string) *ProcessForecastRequestFormComponentValues { + s.Name = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValues) SetValue(v string) *ProcessForecastRequestFormComponentValues { + s.Value = &v + return s +} + +type ProcessForecastRequestFormComponentValuesDetails struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + Details []*ProcessForecastRequestFormComponentValuesDetailsDetails `json:"details,omitempty" xml:"details,omitempty" type:"Repeated"` + // 控件扩展值 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 控件值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s ProcessForecastRequestFormComponentValuesDetails) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastRequestFormComponentValuesDetails) GoString() string { + return s.String() +} + +func (s *ProcessForecastRequestFormComponentValuesDetails) SetBizAlias(v string) *ProcessForecastRequestFormComponentValuesDetails { + s.BizAlias = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetails) SetDetails(v []*ProcessForecastRequestFormComponentValuesDetailsDetails) *ProcessForecastRequestFormComponentValuesDetails { + s.Details = v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetails) SetExtValue(v string) *ProcessForecastRequestFormComponentValuesDetails { + s.ExtValue = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetails) SetId(v string) *ProcessForecastRequestFormComponentValuesDetails { + s.Id = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetails) SetName(v string) *ProcessForecastRequestFormComponentValuesDetails { + s.Name = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetails) SetValue(v string) *ProcessForecastRequestFormComponentValuesDetails { + s.Value = &v + return s +} + +type ProcessForecastRequestFormComponentValuesDetailsDetails struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + // 控件扩展值 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 控件值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s ProcessForecastRequestFormComponentValuesDetailsDetails) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastRequestFormComponentValuesDetailsDetails) GoString() string { + return s.String() +} + +func (s *ProcessForecastRequestFormComponentValuesDetailsDetails) SetBizAlias(v string) *ProcessForecastRequestFormComponentValuesDetailsDetails { + s.BizAlias = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetailsDetails) SetComponentType(v string) *ProcessForecastRequestFormComponentValuesDetailsDetails { + s.ComponentType = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetailsDetails) SetExtValue(v string) *ProcessForecastRequestFormComponentValuesDetailsDetails { + s.ExtValue = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetailsDetails) SetId(v string) *ProcessForecastRequestFormComponentValuesDetailsDetails { + s.Id = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetailsDetails) SetName(v string) *ProcessForecastRequestFormComponentValuesDetailsDetails { + s.Name = &v + return s +} + +func (s *ProcessForecastRequestFormComponentValuesDetailsDetails) SetValue(v string) *ProcessForecastRequestFormComponentValuesDetailsDetails { + s.Value = &v + return s +} + +type ProcessForecastResponseBody struct { + // 返回结果 + Result *ProcessForecastResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s ProcessForecastResponseBody) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBody) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBody) SetResult(v *ProcessForecastResponseBodyResult) *ProcessForecastResponseBody { + s.Result = v + return s +} + +type ProcessForecastResponseBodyResult struct { + // 是否预测成功 + IsForecastSuccess *bool `json:"isForecastSuccess,omitempty" xml:"isForecastSuccess,omitempty"` + // 是否静态流程 + IsStaticWorkflow *bool `json:"isStaticWorkflow,omitempty" xml:"isStaticWorkflow,omitempty"` + // 流程 code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 流程 id + ProcessId *int64 `json:"processId,omitempty" xml:"processId,omitempty"` + // 用户 id + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` + WorkflowActivityRules []*ProcessForecastResponseBodyResultWorkflowActivityRules `json:"workflowActivityRules,omitempty" xml:"workflowActivityRules,omitempty" type:"Repeated"` + WorkflowForecastNodes []*ProcessForecastResponseBodyResultWorkflowForecastNodes `json:"workflowForecastNodes,omitempty" xml:"workflowForecastNodes,omitempty" type:"Repeated"` +} + +func (s ProcessForecastResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBodyResult) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBodyResult) SetIsForecastSuccess(v bool) *ProcessForecastResponseBodyResult { + s.IsForecastSuccess = &v + return s +} + +func (s *ProcessForecastResponseBodyResult) SetIsStaticWorkflow(v bool) *ProcessForecastResponseBodyResult { + s.IsStaticWorkflow = &v + return s +} + +func (s *ProcessForecastResponseBodyResult) SetProcessCode(v string) *ProcessForecastResponseBodyResult { + s.ProcessCode = &v + return s +} + +func (s *ProcessForecastResponseBodyResult) SetProcessId(v int64) *ProcessForecastResponseBodyResult { + s.ProcessId = &v + return s +} + +func (s *ProcessForecastResponseBodyResult) SetUserId(v string) *ProcessForecastResponseBodyResult { + s.UserId = &v + return s +} + +func (s *ProcessForecastResponseBodyResult) SetWorkflowActivityRules(v []*ProcessForecastResponseBodyResultWorkflowActivityRules) *ProcessForecastResponseBodyResult { + s.WorkflowActivityRules = v + return s +} + +func (s *ProcessForecastResponseBodyResult) SetWorkflowForecastNodes(v []*ProcessForecastResponseBodyResultWorkflowForecastNodes) *ProcessForecastResponseBodyResult { + s.WorkflowForecastNodes = v + return s +} + +type ProcessForecastResponseBodyResultWorkflowActivityRules struct { + // 节点 id + ActivityId *string `json:"activityId,omitempty" xml:"activityId,omitempty"` + // 节点名称 + ActivityName *string `json:"activityName,omitempty" xml:"activityName,omitempty"` + // 规则类型 + ActivityType *string `json:"activityType,omitempty" xml:"activityType,omitempty"` + // 是否自选审批节点 + IsTargetSelect *bool `json:"isTargetSelect,omitempty" xml:"isTargetSelect,omitempty"` + // 流程中前一个节点的 id + PrevActivityId *string `json:"prevActivityId,omitempty" xml:"prevActivityId,omitempty"` + // 节点操作人信息 + WorkflowActor *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor `json:"workflowActor,omitempty" xml:"workflowActor,omitempty" type:"Struct"` +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRules) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRules) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRules) SetActivityId(v string) *ProcessForecastResponseBodyResultWorkflowActivityRules { + s.ActivityId = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRules) SetActivityName(v string) *ProcessForecastResponseBodyResultWorkflowActivityRules { + s.ActivityName = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRules) SetActivityType(v string) *ProcessForecastResponseBodyResultWorkflowActivityRules { + s.ActivityType = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRules) SetIsTargetSelect(v bool) *ProcessForecastResponseBodyResultWorkflowActivityRules { + s.IsTargetSelect = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRules) SetPrevActivityId(v string) *ProcessForecastResponseBodyResultWorkflowActivityRules { + s.PrevActivityId = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRules) SetWorkflowActor(v *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) *ProcessForecastResponseBodyResultWorkflowActivityRules { + s.WorkflowActor = v + return s +} + +type ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor struct { + // 节点激活类型 + ActorActivateType *string `json:"actorActivateType,omitempty" xml:"actorActivateType,omitempty"` + // 节点操作人 key + ActorKey *string `json:"actorKey,omitempty" xml:"actorKey,omitempty"` + // 节点操作人选择范围 + ActorSelectionRange *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange `json:"actorSelectionRange,omitempty" xml:"actorSelectionRange,omitempty" type:"Struct"` + // 节点操作人选择范围类型 + ActorSelectionType *string `json:"actorSelectionType,omitempty" xml:"actorSelectionType,omitempty"` + // 节点操作人类型 + ActorType *string `json:"actorType,omitempty" xml:"actorType,omitempty"` + // 是否允许多选,还是仅允许选一人 + AllowedMulti *bool `json:"allowedMulti,omitempty" xml:"allowedMulti,omitempty"` + // 节点审批方式 + ApprovalMethod *string `json:"approvalMethod,omitempty" xml:"approvalMethod,omitempty"` + // 节点审批类型 + ApprovalType *string `json:"approvalType,omitempty" xml:"approvalType,omitempty"` + // 该审批人节点在发起审批时是否必填 + Required *bool `json:"required,omitempty" xml:"required,omitempty"` +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetActorActivateType(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.ActorActivateType = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetActorKey(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.ActorKey = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetActorSelectionRange(v *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.ActorSelectionRange = v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetActorSelectionType(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.ActorSelectionType = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetActorType(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.ActorType = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetAllowedMulti(v bool) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.AllowedMulti = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetApprovalMethod(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.ApprovalMethod = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetApprovalType(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.ApprovalType = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor) SetRequired(v bool) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActor { + s.Required = &v + return s +} + +type ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange struct { + // 审批指定成员 + Approvals []*ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals `json:"approvals,omitempty" xml:"approvals,omitempty" type:"Repeated"` + // 审批指定角色 + Labels []*ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels `json:"labels,omitempty" xml:"labels,omitempty" type:"Repeated"` +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange) SetApprovals(v []*ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange { + s.Approvals = v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange) SetLabels(v []*ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRange { + s.Labels = v + return s +} + +type ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals struct { + // 员工姓名 + UserName *string `json:"userName,omitempty" xml:"userName,omitempty"` + // 员工 userId + WorkNo *string `json:"workNo,omitempty" xml:"workNo,omitempty"` +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals) SetUserName(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals { + s.UserName = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals) SetWorkNo(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeApprovals { + s.WorkNo = &v + return s +} + +type ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels struct { + // 角色名字 + LabelNames *string `json:"labelNames,omitempty" xml:"labelNames,omitempty"` + // 角色 id + Labels *string `json:"labels,omitempty" xml:"labels,omitempty"` +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels) SetLabelNames(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels { + s.LabelNames = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels) SetLabels(v string) *ProcessForecastResponseBodyResultWorkflowActivityRulesWorkflowActorActorSelectionRangeLabels { + s.Labels = &v + return s +} + +type ProcessForecastResponseBodyResultWorkflowForecastNodes struct { + // 节点 id + ActivityId *string `json:"activityId,omitempty" xml:"activityId,omitempty"` + // 节点出线 id + OutId *string `json:"outId,omitempty" xml:"outId,omitempty"` +} + +func (s ProcessForecastResponseBodyResultWorkflowForecastNodes) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponseBodyResultWorkflowForecastNodes) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponseBodyResultWorkflowForecastNodes) SetActivityId(v string) *ProcessForecastResponseBodyResultWorkflowForecastNodes { + s.ActivityId = &v + return s +} + +func (s *ProcessForecastResponseBodyResultWorkflowForecastNodes) SetOutId(v string) *ProcessForecastResponseBodyResultWorkflowForecastNodes { + s.OutId = &v + return s +} + +type ProcessForecastResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *ProcessForecastResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s ProcessForecastResponse) String() string { + return tea.Prettify(s) +} + +func (s ProcessForecastResponse) GoString() string { + return s.String() +} + +func (s *ProcessForecastResponse) SetHeaders(v map[string]*string) *ProcessForecastResponse { + s.Headers = v + return s +} + +func (s *ProcessForecastResponse) SetBody(v *ProcessForecastResponseBody) *ProcessForecastResponse { + s.Body = v + return s +} + +type QueryAllFormInstancesHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s QueryAllFormInstancesHeaders) String() string { + return tea.Prettify(s) +} + +func (s QueryAllFormInstancesHeaders) GoString() string { + return s.String() +} + +func (s *QueryAllFormInstancesHeaders) SetCommonHeaders(v map[string]*string) *QueryAllFormInstancesHeaders { + s.CommonHeaders = v + return s +} + +func (s *QueryAllFormInstancesHeaders) SetXAcsDingtalkAccessToken(v string) *QueryAllFormInstancesHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type QueryAllFormInstancesRequest struct { + // 应用搭建id + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 表单模板id + FormCode *string `json:"formCode,omitempty" xml:"formCode,omitempty"` + // 翻页size + MaxResults *int32 `json:"maxResults,omitempty" xml:"maxResults,omitempty"` + // 分页游标,第一次调用传空或者null + NextToken *string `json:"nextToken,omitempty" xml:"nextToken,omitempty"` +} + +func (s QueryAllFormInstancesRequest) String() string { + return tea.Prettify(s) +} + +func (s QueryAllFormInstancesRequest) GoString() string { + return s.String() +} + +func (s *QueryAllFormInstancesRequest) SetAppUuid(v string) *QueryAllFormInstancesRequest { + s.AppUuid = &v + return s +} + +func (s *QueryAllFormInstancesRequest) SetFormCode(v string) *QueryAllFormInstancesRequest { + s.FormCode = &v + return s +} + +func (s *QueryAllFormInstancesRequest) SetMaxResults(v int32) *QueryAllFormInstancesRequest { + s.MaxResults = &v + return s +} + +func (s *QueryAllFormInstancesRequest) SetNextToken(v string) *QueryAllFormInstancesRequest { + s.NextToken = &v + return s +} + +type QueryAllFormInstancesResponseBody struct { + // 分页结果 + Result *QueryAllFormInstancesResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s QueryAllFormInstancesResponseBody) String() string { + return tea.Prettify(s) +} + +func (s QueryAllFormInstancesResponseBody) GoString() string { + return s.String() +} + +func (s *QueryAllFormInstancesResponseBody) SetResult(v *QueryAllFormInstancesResponseBodyResult) *QueryAllFormInstancesResponseBody { + s.Result = v + return s +} + +type QueryAllFormInstancesResponseBodyResult struct { + // 是否有更多数据 + HasMore *bool `json:"hasMore,omitempty" xml:"hasMore,omitempty"` + // 分页大小 + MaxResults *int64 `json:"maxResults,omitempty" xml:"maxResults,omitempty"` + // 下一页的游标 + NextToken *string `json:"nextToken,omitempty" xml:"nextToken,omitempty"` + // 表单列表 + Values []*QueryAllFormInstancesResponseBodyResultValues `json:"values,omitempty" xml:"values,omitempty" type:"Repeated"` +} + +func (s QueryAllFormInstancesResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s QueryAllFormInstancesResponseBodyResult) GoString() string { + return s.String() +} + +func (s *QueryAllFormInstancesResponseBodyResult) SetHasMore(v bool) *QueryAllFormInstancesResponseBodyResult { + s.HasMore = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResult) SetMaxResults(v int64) *QueryAllFormInstancesResponseBodyResult { + s.MaxResults = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResult) SetNextToken(v string) *QueryAllFormInstancesResponseBodyResult { + s.NextToken = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResult) SetValues(v []*QueryAllFormInstancesResponseBodyResultValues) *QueryAllFormInstancesResponseBodyResult { + s.Values = v + return s +} + +type QueryAllFormInstancesResponseBodyResultValues struct { + // 应用搭建id + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 扩展信息 + Attributes map[string]interface{} `json:"attributes,omitempty" xml:"attributes,omitempty"` + // 创建时间 + CreateTimestamp *int64 `json:"createTimestamp,omitempty" xml:"createTimestamp,omitempty"` + // 创建人 + Creator *string `json:"creator,omitempty" xml:"creator,omitempty"` + // 表单模板code + FormCode *string `json:"formCode,omitempty" xml:"formCode,omitempty"` + // 表单实例数据 + FormInstDataList []*QueryAllFormInstancesResponseBodyResultValuesFormInstDataList `json:"formInstDataList,omitempty" xml:"formInstDataList,omitempty" type:"Repeated"` + // 表单实例id + FormInstanceId *string `json:"formInstanceId,omitempty" xml:"formInstanceId,omitempty"` + // 修改人 + Modifier *string `json:"modifier,omitempty" xml:"modifier,omitempty"` + // 修改时间 + ModifyTimestamp *int64 `json:"modifyTimestamp,omitempty" xml:"modifyTimestamp,omitempty"` + // 外部业务编码 + OutBizCode *string `json:"outBizCode,omitempty" xml:"outBizCode,omitempty"` + // 外部实例编码 + OutInstanceId *string `json:"outInstanceId,omitempty" xml:"outInstanceId,omitempty"` + // 标题 + Title *string `json:"title,omitempty" xml:"title,omitempty"` +} + +func (s QueryAllFormInstancesResponseBodyResultValues) String() string { + return tea.Prettify(s) +} + +func (s QueryAllFormInstancesResponseBodyResultValues) GoString() string { + return s.String() +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetAppUuid(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.AppUuid = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetAttributes(v map[string]interface{}) *QueryAllFormInstancesResponseBodyResultValues { + s.Attributes = v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetCreateTimestamp(v int64) *QueryAllFormInstancesResponseBodyResultValues { + s.CreateTimestamp = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetCreator(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.Creator = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetFormCode(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.FormCode = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetFormInstDataList(v []*QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) *QueryAllFormInstancesResponseBodyResultValues { + s.FormInstDataList = v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetFormInstanceId(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.FormInstanceId = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetModifier(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.Modifier = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetModifyTimestamp(v int64) *QueryAllFormInstancesResponseBodyResultValues { + s.ModifyTimestamp = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetOutBizCode(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.OutBizCode = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetOutInstanceId(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.OutInstanceId = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValues) SetTitle(v string) *QueryAllFormInstancesResponseBodyResultValues { + s.Title = &v + return s +} + +type QueryAllFormInstancesResponseBodyResultValuesFormInstDataList struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 控件类型 + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + // 表单控件扩展数据 + ExtendValue *string `json:"extendValue,omitempty" xml:"extendValue,omitempty"` + // 控件唯一id + Key *string `json:"key,omitempty" xml:"key,omitempty"` + // 控件名称 + Label *string `json:"label,omitempty" xml:"label,omitempty"` + // 控件填写的数据 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) String() string { + return tea.Prettify(s) +} + +func (s QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) GoString() string { + return s.String() +} + +func (s *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) SetBizAlias(v string) *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList { + s.BizAlias = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) SetComponentType(v string) *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList { + s.ComponentType = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) SetExtendValue(v string) *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList { + s.ExtendValue = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) SetKey(v string) *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList { + s.Key = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) SetLabel(v string) *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList { + s.Label = &v + return s +} + +func (s *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList) SetValue(v string) *QueryAllFormInstancesResponseBodyResultValuesFormInstDataList { + s.Value = &v + return s +} + +type QueryAllFormInstancesResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *QueryAllFormInstancesResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s QueryAllFormInstancesResponse) String() string { + return tea.Prettify(s) +} + +func (s QueryAllFormInstancesResponse) GoString() string { + return s.String() +} + +func (s *QueryAllFormInstancesResponse) SetHeaders(v map[string]*string) *QueryAllFormInstancesResponse { + s.Headers = v + return s +} + +func (s *QueryAllFormInstancesResponse) SetBody(v *QueryAllFormInstancesResponseBody) *QueryAllFormInstancesResponse { + s.Body = v + return s +} + +type QueryAllProcessInstancesHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s QueryAllProcessInstancesHeaders) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesHeaders) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesHeaders) SetCommonHeaders(v map[string]*string) *QueryAllProcessInstancesHeaders { + s.CommonHeaders = v + return s +} + +func (s *QueryAllProcessInstancesHeaders) SetXAcsDingtalkAccessToken(v string) *QueryAllProcessInstancesHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type QueryAllProcessInstancesRequest struct { + // 应用编码 + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 结束时间 + EndTimeInMills *int64 `json:"endTimeInMills,omitempty" xml:"endTimeInMills,omitempty"` + // 分页大小 + MaxResults *int64 `json:"maxResults,omitempty" xml:"maxResults,omitempty"` + // 分页起始值 + NextToken *string `json:"nextToken,omitempty" xml:"nextToken,omitempty"` + // 模板编码 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 开始时间 + StartTimeInMills *int64 `json:"startTimeInMills,omitempty" xml:"startTimeInMills,omitempty"` +} + +func (s QueryAllProcessInstancesRequest) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesRequest) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesRequest) SetAppUuid(v string) *QueryAllProcessInstancesRequest { + s.AppUuid = &v + return s +} + +func (s *QueryAllProcessInstancesRequest) SetEndTimeInMills(v int64) *QueryAllProcessInstancesRequest { + s.EndTimeInMills = &v + return s +} + +func (s *QueryAllProcessInstancesRequest) SetMaxResults(v int64) *QueryAllProcessInstancesRequest { + s.MaxResults = &v + return s +} + +func (s *QueryAllProcessInstancesRequest) SetNextToken(v string) *QueryAllProcessInstancesRequest { + s.NextToken = &v + return s +} + +func (s *QueryAllProcessInstancesRequest) SetProcessCode(v string) *QueryAllProcessInstancesRequest { + s.ProcessCode = &v + return s +} + +func (s *QueryAllProcessInstancesRequest) SetStartTimeInMills(v int64) *QueryAllProcessInstancesRequest { + s.StartTimeInMills = &v + return s +} + +type QueryAllProcessInstancesResponseBody struct { + // result + Result *QueryAllProcessInstancesResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s QueryAllProcessInstancesResponseBody) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponseBody) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponseBody) SetResult(v *QueryAllProcessInstancesResponseBodyResult) *QueryAllProcessInstancesResponseBody { + s.Result = v + return s +} + +type QueryAllProcessInstancesResponseBodyResult struct { + // 是否有更多数据 + HasMore *bool `json:"hasMore,omitempty" xml:"hasMore,omitempty"` + List []*QueryAllProcessInstancesResponseBodyResultList `json:"list,omitempty" xml:"list,omitempty" type:"Repeated"` + // 总数 + MaxResults *int64 `json:"maxResults,omitempty" xml:"maxResults,omitempty"` + // 下次获取数据的游标 + NextToken *string `json:"nextToken,omitempty" xml:"nextToken,omitempty"` +} + +func (s QueryAllProcessInstancesResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponseBodyResult) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponseBodyResult) SetHasMore(v bool) *QueryAllProcessInstancesResponseBodyResult { + s.HasMore = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResult) SetList(v []*QueryAllProcessInstancesResponseBodyResultList) *QueryAllProcessInstancesResponseBodyResult { + s.List = v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResult) SetMaxResults(v int64) *QueryAllProcessInstancesResponseBodyResult { + s.MaxResults = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResult) SetNextToken(v string) *QueryAllProcessInstancesResponseBodyResult { + s.NextToken = &v + return s +} + +type QueryAllProcessInstancesResponseBodyResultList struct { + // 附属单信息 + AttachedProcessInstanceIds *string `json:"attachedProcessInstanceIds,omitempty" xml:"attachedProcessInstanceIds,omitempty"` + // 审批单编号 + BusinessId *string `json:"businessId,omitempty" xml:"businessId,omitempty"` + // 审批单创建时间 + CreateTime *int64 `json:"createTime,omitempty" xml:"createTime,omitempty"` + // 审批结束时间 + FinishTime *int64 `json:"finishTime,omitempty" xml:"finishTime,omitempty"` + FormComponentValues []*QueryAllProcessInstancesResponseBodyResultListFormComponentValues `json:"formComponentValues,omitempty" xml:"formComponentValues,omitempty" type:"Repeated"` + // 主单实例Id + MainProcessInstanceId *string `json:"mainProcessInstanceId,omitempty" xml:"mainProcessInstanceId,omitempty"` + // 审批单操作记录 + OperationRecords []*QueryAllProcessInstancesResponseBodyResultListOperationRecords `json:"operationRecords,omitempty" xml:"operationRecords,omitempty" type:"Repeated"` + // 发起人部门id + OriginatorDeptId *string `json:"originatorDeptId,omitempty" xml:"originatorDeptId,omitempty"` + // 发起者userId + OriginatorUserid *string `json:"originatorUserid,omitempty" xml:"originatorUserid,omitempty"` + // 流程实例ID + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 审批结果 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 审批单状态 + Status *string `json:"status,omitempty" xml:"status,omitempty"` + // 任务列表 + Tasks []*QueryAllProcessInstancesResponseBodyResultListTasks `json:"tasks,omitempty" xml:"tasks,omitempty" type:"Repeated"` + // 审批单标题 + Title *string `json:"title,omitempty" xml:"title,omitempty"` +} + +func (s QueryAllProcessInstancesResponseBodyResultList) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponseBodyResultList) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetAttachedProcessInstanceIds(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.AttachedProcessInstanceIds = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetBusinessId(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.BusinessId = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetCreateTime(v int64) *QueryAllProcessInstancesResponseBodyResultList { + s.CreateTime = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetFinishTime(v int64) *QueryAllProcessInstancesResponseBodyResultList { + s.FinishTime = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetFormComponentValues(v []*QueryAllProcessInstancesResponseBodyResultListFormComponentValues) *QueryAllProcessInstancesResponseBodyResultList { + s.FormComponentValues = v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetMainProcessInstanceId(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.MainProcessInstanceId = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetOperationRecords(v []*QueryAllProcessInstancesResponseBodyResultListOperationRecords) *QueryAllProcessInstancesResponseBodyResultList { + s.OperationRecords = v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetOriginatorDeptId(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.OriginatorDeptId = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetOriginatorUserid(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.OriginatorUserid = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetProcessInstanceId(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.ProcessInstanceId = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetResult(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.Result = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetStatus(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.Status = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetTasks(v []*QueryAllProcessInstancesResponseBodyResultListTasks) *QueryAllProcessInstancesResponseBodyResultList { + s.Tasks = v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultList) SetTitle(v string) *QueryAllProcessInstancesResponseBodyResultList { + s.Title = &v + return s +} + +type QueryAllProcessInstancesResponseBodyResultListFormComponentValues struct { + // 控件扩展数据 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 控件数据 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s QueryAllProcessInstancesResponseBodyResultListFormComponentValues) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponseBodyResultListFormComponentValues) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponseBodyResultListFormComponentValues) SetExtValue(v string) *QueryAllProcessInstancesResponseBodyResultListFormComponentValues { + s.ExtValue = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListFormComponentValues) SetId(v string) *QueryAllProcessInstancesResponseBodyResultListFormComponentValues { + s.Id = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListFormComponentValues) SetName(v string) *QueryAllProcessInstancesResponseBodyResultListFormComponentValues { + s.Name = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListFormComponentValues) SetValue(v string) *QueryAllProcessInstancesResponseBodyResultListFormComponentValues { + s.Value = &v + return s +} + +type QueryAllProcessInstancesResponseBodyResultListOperationRecords struct { + // 评论附件 + Attachments []*QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments `json:"attachments,omitempty" xml:"attachments,omitempty" type:"Repeated"` + // 操作类型 + OperationType *string `json:"operationType,omitempty" xml:"operationType,omitempty"` + // 评论 + Remark *string `json:"remark,omitempty" xml:"remark,omitempty"` + // 操作结果 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 操作时间戳 + Timestamp *int64 `json:"timestamp,omitempty" xml:"timestamp,omitempty"` + // 操作人staffId + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s QueryAllProcessInstancesResponseBodyResultListOperationRecords) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponseBodyResultListOperationRecords) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecords) SetAttachments(v []*QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments) *QueryAllProcessInstancesResponseBodyResultListOperationRecords { + s.Attachments = v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecords) SetOperationType(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecords { + s.OperationType = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecords) SetRemark(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecords { + s.Remark = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecords) SetResult(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecords { + s.Result = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecords) SetTimestamp(v int64) *QueryAllProcessInstancesResponseBodyResultListOperationRecords { + s.Timestamp = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecords) SetUserId(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecords { + s.UserId = &v + return s +} + +type QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments struct { + // 附件钉盘id + FileId *string `json:"fileId,omitempty" xml:"fileId,omitempty"` + // 附件名称 + FileName *string `json:"fileName,omitempty" xml:"fileName,omitempty"` + // 文件大小 + FileSize *string `json:"fileSize,omitempty" xml:"fileSize,omitempty"` + // 文件类型 + FileType *string `json:"fileType,omitempty" xml:"fileType,omitempty"` +} + +func (s QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments) SetFileId(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments { + s.FileId = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments) SetFileName(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments { + s.FileName = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments) SetFileSize(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments { + s.FileSize = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments) SetFileType(v string) *QueryAllProcessInstancesResponseBodyResultListOperationRecordsAttachments { + s.FileType = &v + return s +} + +type QueryAllProcessInstancesResponseBodyResultListTasks struct { + // 节点id + ActivityId *string `json:"activityId,omitempty" xml:"activityId,omitempty"` + // 任务创建时间戳 + CreateTimestamp *int64 `json:"createTimestamp,omitempty" xml:"createTimestamp,omitempty"` + // 任务结束时间戳 + FinishTimestamp *int64 `json:"finishTimestamp,omitempty" xml:"finishTimestamp,omitempty"` + // 任务结果 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 任务状态 + Status *string `json:"status,omitempty" xml:"status,omitempty"` + // 任务Id + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` + // 任务处理人 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s QueryAllProcessInstancesResponseBodyResultListTasks) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponseBodyResultListTasks) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponseBodyResultListTasks) SetActivityId(v string) *QueryAllProcessInstancesResponseBodyResultListTasks { + s.ActivityId = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListTasks) SetCreateTimestamp(v int64) *QueryAllProcessInstancesResponseBodyResultListTasks { + s.CreateTimestamp = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListTasks) SetFinishTimestamp(v int64) *QueryAllProcessInstancesResponseBodyResultListTasks { + s.FinishTimestamp = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListTasks) SetResult(v string) *QueryAllProcessInstancesResponseBodyResultListTasks { + s.Result = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListTasks) SetStatus(v string) *QueryAllProcessInstancesResponseBodyResultListTasks { + s.Status = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListTasks) SetTaskId(v int64) *QueryAllProcessInstancesResponseBodyResultListTasks { + s.TaskId = &v + return s +} + +func (s *QueryAllProcessInstancesResponseBodyResultListTasks) SetUserId(v string) *QueryAllProcessInstancesResponseBodyResultListTasks { + s.UserId = &v + return s +} + +type QueryAllProcessInstancesResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *QueryAllProcessInstancesResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s QueryAllProcessInstancesResponse) String() string { + return tea.Prettify(s) +} + +func (s QueryAllProcessInstancesResponse) GoString() string { + return s.String() +} + +func (s *QueryAllProcessInstancesResponse) SetHeaders(v map[string]*string) *QueryAllProcessInstancesResponse { + s.Headers = v + return s +} + +func (s *QueryAllProcessInstancesResponse) SetBody(v *QueryAllProcessInstancesResponseBody) *QueryAllProcessInstancesResponse { + s.Body = v + return s +} + +type QueryFormByBizTypeHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s QueryFormByBizTypeHeaders) String() string { + return tea.Prettify(s) +} + +func (s QueryFormByBizTypeHeaders) GoString() string { + return s.String() +} + +func (s *QueryFormByBizTypeHeaders) SetCommonHeaders(v map[string]*string) *QueryFormByBizTypeHeaders { + s.CommonHeaders = v + return s +} + +func (s *QueryFormByBizTypeHeaders) SetXAcsDingtalkAccessToken(v string) *QueryFormByBizTypeHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type QueryFormByBizTypeRequest struct { + // 应用搭建id + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 表单业务标识 + BizTypes []*string `json:"bizTypes,omitempty" xml:"bizTypes,omitempty" type:"Repeated"` +} + +func (s QueryFormByBizTypeRequest) String() string { + return tea.Prettify(s) +} + +func (s QueryFormByBizTypeRequest) GoString() string { + return s.String() +} + +func (s *QueryFormByBizTypeRequest) SetAppUuid(v string) *QueryFormByBizTypeRequest { + s.AppUuid = &v + return s +} + +func (s *QueryFormByBizTypeRequest) SetBizTypes(v []*string) *QueryFormByBizTypeRequest { + s.BizTypes = v + return s +} + +type QueryFormByBizTypeResponseBody struct { + // 模板列表 + Result []*QueryFormByBizTypeResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` +} + +func (s QueryFormByBizTypeResponseBody) String() string { + return tea.Prettify(s) +} + +func (s QueryFormByBizTypeResponseBody) GoString() string { + return s.String() +} + +func (s *QueryFormByBizTypeResponseBody) SetResult(v []*QueryFormByBizTypeResponseBodyResult) *QueryFormByBizTypeResponseBody { + s.Result = v + return s +} + +type QueryFormByBizTypeResponseBodyResult struct { + // 表单类型,0为流程表单,1为数据表单 + AppType *int32 `json:"appType,omitempty" xml:"appType,omitempty"` + // 应用搭建id + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 业务标识 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 表单控件描述 + Content *string `json:"content,omitempty" xml:"content,omitempty"` + // 创建时间 + CreateTime *int64 `json:"createTime,omitempty" xml:"createTime,omitempty"` + // 创建人 + Creator *string `json:"creator,omitempty" xml:"creator,omitempty"` + // 模板code + FormCode *string `json:"formCode,omitempty" xml:"formCode,omitempty"` + // 表单uuid + FormUuid *string `json:"formUuid,omitempty" xml:"formUuid,omitempty"` + // 模板描述 + Memo *string `json:"memo,omitempty" xml:"memo,omitempty"` + // 修改时间 + ModifedTime *int64 `json:"modifedTime,omitempty" xml:"modifedTime,omitempty"` + // 模板名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 数据归属id + OwnerId *string `json:"ownerId,omitempty" xml:"ownerId,omitempty"` + // 模板状态 + Status *string `json:"status,omitempty" xml:"status,omitempty"` +} + +func (s QueryFormByBizTypeResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s QueryFormByBizTypeResponseBodyResult) GoString() string { + return s.String() +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetAppType(v int32) *QueryFormByBizTypeResponseBodyResult { + s.AppType = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetAppUuid(v string) *QueryFormByBizTypeResponseBodyResult { + s.AppUuid = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetBizType(v string) *QueryFormByBizTypeResponseBodyResult { + s.BizType = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetContent(v string) *QueryFormByBizTypeResponseBodyResult { + s.Content = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetCreateTime(v int64) *QueryFormByBizTypeResponseBodyResult { + s.CreateTime = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetCreator(v string) *QueryFormByBizTypeResponseBodyResult { + s.Creator = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetFormCode(v string) *QueryFormByBizTypeResponseBodyResult { + s.FormCode = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetFormUuid(v string) *QueryFormByBizTypeResponseBodyResult { + s.FormUuid = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetMemo(v string) *QueryFormByBizTypeResponseBodyResult { + s.Memo = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetModifedTime(v int64) *QueryFormByBizTypeResponseBodyResult { + s.ModifedTime = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetName(v string) *QueryFormByBizTypeResponseBodyResult { + s.Name = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetOwnerId(v string) *QueryFormByBizTypeResponseBodyResult { + s.OwnerId = &v + return s +} + +func (s *QueryFormByBizTypeResponseBodyResult) SetStatus(v string) *QueryFormByBizTypeResponseBodyResult { + s.Status = &v + return s +} + +type QueryFormByBizTypeResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *QueryFormByBizTypeResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s QueryFormByBizTypeResponse) String() string { + return tea.Prettify(s) +} + +func (s QueryFormByBizTypeResponse) GoString() string { + return s.String() +} + +func (s *QueryFormByBizTypeResponse) SetHeaders(v map[string]*string) *QueryFormByBizTypeResponse { + s.Headers = v + return s +} + +func (s *QueryFormByBizTypeResponse) SetBody(v *QueryFormByBizTypeResponseBody) *QueryFormByBizTypeResponse { + s.Body = v + return s +} + +type QueryFormInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s QueryFormInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s QueryFormInstanceHeaders) GoString() string { + return s.String() +} + +func (s *QueryFormInstanceHeaders) SetCommonHeaders(v map[string]*string) *QueryFormInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *QueryFormInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *QueryFormInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type QueryFormInstanceRequest struct { + // 应用搭建id + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 表单模板Code + FormCode *string `json:"formCode,omitempty" xml:"formCode,omitempty"` + // 表单实例id + FormInstanceId *string `json:"formInstanceId,omitempty" xml:"formInstanceId,omitempty"` +} + +func (s QueryFormInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s QueryFormInstanceRequest) GoString() string { + return s.String() +} + +func (s *QueryFormInstanceRequest) SetAppUuid(v string) *QueryFormInstanceRequest { + s.AppUuid = &v + return s +} + +func (s *QueryFormInstanceRequest) SetFormCode(v string) *QueryFormInstanceRequest { + s.FormCode = &v + return s +} + +func (s *QueryFormInstanceRequest) SetFormInstanceId(v string) *QueryFormInstanceRequest { + s.FormInstanceId = &v + return s +} + +type QueryFormInstanceResponseBody struct { + // 应用搭建id + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 扩展信息 + Attributes map[string]interface{} `json:"attributes,omitempty" xml:"attributes,omitempty"` + // 实例创建时间戳 + CreateTimestamp *int64 `json:"createTimestamp,omitempty" xml:"createTimestamp,omitempty"` + // 创建人 + Creator *string `json:"creator,omitempty" xml:"creator,omitempty"` + // 表单模板id + FormCode *string `json:"formCode,omitempty" xml:"formCode,omitempty"` + // 表单数据 + FormInstDataList []*QueryFormInstanceResponseBodyFormInstDataList `json:"formInstDataList,omitempty" xml:"formInstDataList,omitempty" type:"Repeated"` + // 实例id + FormInstanceId *string `json:"formInstanceId,omitempty" xml:"formInstanceId,omitempty"` + // 修改人 + Modifier *string `json:"modifier,omitempty" xml:"modifier,omitempty"` + // 实例最近修改时间戳 + ModifyTimestamp *int64 `json:"modifyTimestamp,omitempty" xml:"modifyTimestamp,omitempty"` + // 外联业务code + OutBizCode *string `json:"outBizCode,omitempty" xml:"outBizCode,omitempty"` + // 外联业务实例id + OutInstanceId *string `json:"outInstanceId,omitempty" xml:"outInstanceId,omitempty"` + // 表单标题 + Title *string `json:"title,omitempty" xml:"title,omitempty"` +} + +func (s QueryFormInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s QueryFormInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *QueryFormInstanceResponseBody) SetAppUuid(v string) *QueryFormInstanceResponseBody { + s.AppUuid = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetAttributes(v map[string]interface{}) *QueryFormInstanceResponseBody { + s.Attributes = v + return s +} + +func (s *QueryFormInstanceResponseBody) SetCreateTimestamp(v int64) *QueryFormInstanceResponseBody { + s.CreateTimestamp = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetCreator(v string) *QueryFormInstanceResponseBody { + s.Creator = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetFormCode(v string) *QueryFormInstanceResponseBody { + s.FormCode = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetFormInstDataList(v []*QueryFormInstanceResponseBodyFormInstDataList) *QueryFormInstanceResponseBody { + s.FormInstDataList = v + return s +} + +func (s *QueryFormInstanceResponseBody) SetFormInstanceId(v string) *QueryFormInstanceResponseBody { + s.FormInstanceId = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetModifier(v string) *QueryFormInstanceResponseBody { + s.Modifier = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetModifyTimestamp(v int64) *QueryFormInstanceResponseBody { + s.ModifyTimestamp = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetOutBizCode(v string) *QueryFormInstanceResponseBody { + s.OutBizCode = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetOutInstanceId(v string) *QueryFormInstanceResponseBody { + s.OutInstanceId = &v + return s +} + +func (s *QueryFormInstanceResponseBody) SetTitle(v string) *QueryFormInstanceResponseBody { + s.Title = &v + return s +} + +type QueryFormInstanceResponseBodyFormInstDataList struct { + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + ExtendValue *string `json:"extendValue,omitempty" xml:"extendValue,omitempty"` + Key *string `json:"key,omitempty" xml:"key,omitempty"` + Label *string `json:"label,omitempty" xml:"label,omitempty"` + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s QueryFormInstanceResponseBodyFormInstDataList) String() string { + return tea.Prettify(s) +} + +func (s QueryFormInstanceResponseBodyFormInstDataList) GoString() string { + return s.String() +} + +func (s *QueryFormInstanceResponseBodyFormInstDataList) SetBizAlias(v string) *QueryFormInstanceResponseBodyFormInstDataList { + s.BizAlias = &v + return s +} + +func (s *QueryFormInstanceResponseBodyFormInstDataList) SetComponentType(v string) *QueryFormInstanceResponseBodyFormInstDataList { + s.ComponentType = &v + return s +} + +func (s *QueryFormInstanceResponseBodyFormInstDataList) SetExtendValue(v string) *QueryFormInstanceResponseBodyFormInstDataList { + s.ExtendValue = &v + return s +} + +func (s *QueryFormInstanceResponseBodyFormInstDataList) SetKey(v string) *QueryFormInstanceResponseBodyFormInstDataList { + s.Key = &v + return s +} + +func (s *QueryFormInstanceResponseBodyFormInstDataList) SetLabel(v string) *QueryFormInstanceResponseBodyFormInstDataList { + s.Label = &v + return s +} + +func (s *QueryFormInstanceResponseBodyFormInstDataList) SetValue(v string) *QueryFormInstanceResponseBodyFormInstDataList { + s.Value = &v + return s +} + +type QueryFormInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *QueryFormInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s QueryFormInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s QueryFormInstanceResponse) GoString() string { + return s.String() +} + +func (s *QueryFormInstanceResponse) SetHeaders(v map[string]*string) *QueryFormInstanceResponse { + s.Headers = v + return s +} + +func (s *QueryFormInstanceResponse) SetBody(v *QueryFormInstanceResponseBody) *QueryFormInstanceResponse { + s.Body = v + return s +} + +type QueryIntegratedTodoTaskHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s QueryIntegratedTodoTaskHeaders) String() string { + return tea.Prettify(s) +} + +func (s QueryIntegratedTodoTaskHeaders) GoString() string { + return s.String() +} + +func (s *QueryIntegratedTodoTaskHeaders) SetCommonHeaders(v map[string]*string) *QueryIntegratedTodoTaskHeaders { + s.CommonHeaders = v + return s +} + +func (s *QueryIntegratedTodoTaskHeaders) SetXAcsDingtalkAccessToken(v string) *QueryIntegratedTodoTaskHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type QueryIntegratedTodoTaskRequest struct { + // 在此时间戳之前创建的 + CreateBefore *int64 `json:"createBefore,omitempty" xml:"createBefore,omitempty"` + // 第几页,取值范围为 1 ≤ page ≤ 1000 + PageNumber *int32 `json:"pageNumber,omitempty" xml:"pageNumber,omitempty"` + // 分页大小,取值范围为 1 ≤ pageSize ≤ 40 + PageSize *int32 `json:"pageSize,omitempty" xml:"pageSize,omitempty"` + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s QueryIntegratedTodoTaskRequest) String() string { + return tea.Prettify(s) +} + +func (s QueryIntegratedTodoTaskRequest) GoString() string { + return s.String() +} + +func (s *QueryIntegratedTodoTaskRequest) SetCreateBefore(v int64) *QueryIntegratedTodoTaskRequest { + s.CreateBefore = &v + return s +} + +func (s *QueryIntegratedTodoTaskRequest) SetPageNumber(v int32) *QueryIntegratedTodoTaskRequest { + s.PageNumber = &v + return s +} + +func (s *QueryIntegratedTodoTaskRequest) SetPageSize(v int32) *QueryIntegratedTodoTaskRequest { + s.PageSize = &v + return s +} + +func (s *QueryIntegratedTodoTaskRequest) SetUserId(v string) *QueryIntegratedTodoTaskRequest { + s.UserId = &v + return s +} + +type QueryIntegratedTodoTaskResponseBody struct { + Result *QueryIntegratedTodoTaskResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s QueryIntegratedTodoTaskResponseBody) String() string { + return tea.Prettify(s) +} + +func (s QueryIntegratedTodoTaskResponseBody) GoString() string { + return s.String() +} + +func (s *QueryIntegratedTodoTaskResponseBody) SetResult(v *QueryIntegratedTodoTaskResponseBodyResult) *QueryIntegratedTodoTaskResponseBody { + s.Result = v + return s +} + +type QueryIntegratedTodoTaskResponseBodyResult struct { + // 是否还有下一页 + HasMore *bool `json:"hasMore,omitempty" xml:"hasMore,omitempty"` + List []*QueryIntegratedTodoTaskResponseBodyResultList `json:"list,omitempty" xml:"list,omitempty" type:"Repeated"` +} + +func (s QueryIntegratedTodoTaskResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s QueryIntegratedTodoTaskResponseBodyResult) GoString() string { + return s.String() +} + +func (s *QueryIntegratedTodoTaskResponseBodyResult) SetHasMore(v bool) *QueryIntegratedTodoTaskResponseBodyResult { + s.HasMore = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResult) SetList(v []*QueryIntegratedTodoTaskResponseBodyResultList) *QueryIntegratedTodoTaskResponseBodyResult { + s.List = v + return s +} + +type QueryIntegratedTodoTaskResponseBodyResultList struct { + // 待办组ID,需要在调用创建流程中心集成任务接口时,主动设置该值。 + ActivityId *string `json:"activityId,omitempty" xml:"activityId,omitempty"` + // OA审批任务创建时间 + CreateTime *int64 `json:"createTime,omitempty" xml:"createTime,omitempty"` + // OA审批任务完成时间 + FinishTime *string `json:"finishTime,omitempty" xml:"finishTime,omitempty"` + // 流程实例ID + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 任务处理结果:agree 或 refuse + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 任务状态 + Status *string `json:"status,omitempty" xml:"status,omitempty"` + // OA审批任务ID + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` + // OA审批任务执行人的用户ID + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s QueryIntegratedTodoTaskResponseBodyResultList) String() string { + return tea.Prettify(s) +} + +func (s QueryIntegratedTodoTaskResponseBodyResultList) GoString() string { + return s.String() +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetActivityId(v string) *QueryIntegratedTodoTaskResponseBodyResultList { + s.ActivityId = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetCreateTime(v int64) *QueryIntegratedTodoTaskResponseBodyResultList { + s.CreateTime = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetFinishTime(v string) *QueryIntegratedTodoTaskResponseBodyResultList { + s.FinishTime = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetProcessInstanceId(v string) *QueryIntegratedTodoTaskResponseBodyResultList { + s.ProcessInstanceId = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetResult(v string) *QueryIntegratedTodoTaskResponseBodyResultList { + s.Result = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetStatus(v string) *QueryIntegratedTodoTaskResponseBodyResultList { + s.Status = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetTaskId(v int64) *QueryIntegratedTodoTaskResponseBodyResultList { + s.TaskId = &v + return s +} + +func (s *QueryIntegratedTodoTaskResponseBodyResultList) SetUserId(v string) *QueryIntegratedTodoTaskResponseBodyResultList { + s.UserId = &v + return s +} + +type QueryIntegratedTodoTaskResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *QueryIntegratedTodoTaskResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s QueryIntegratedTodoTaskResponse) String() string { + return tea.Prettify(s) +} + +func (s QueryIntegratedTodoTaskResponse) GoString() string { + return s.String() +} + +func (s *QueryIntegratedTodoTaskResponse) SetHeaders(v map[string]*string) *QueryIntegratedTodoTaskResponse { + s.Headers = v + return s +} + +func (s *QueryIntegratedTodoTaskResponse) SetBody(v *QueryIntegratedTodoTaskResponseBody) *QueryIntegratedTodoTaskResponse { + s.Body = v + return s +} + +type QueryProcessByBizCategoryIdHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s QueryProcessByBizCategoryIdHeaders) String() string { + return tea.Prettify(s) +} + +func (s QueryProcessByBizCategoryIdHeaders) GoString() string { + return s.String() +} + +func (s *QueryProcessByBizCategoryIdHeaders) SetCommonHeaders(v map[string]*string) *QueryProcessByBizCategoryIdHeaders { + s.CommonHeaders = v + return s +} + +func (s *QueryProcessByBizCategoryIdHeaders) SetXAcsDingtalkAccessToken(v string) *QueryProcessByBizCategoryIdHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type QueryProcessByBizCategoryIdRequest struct { + // 业务标识 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 用户id + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s QueryProcessByBizCategoryIdRequest) String() string { + return tea.Prettify(s) +} + +func (s QueryProcessByBizCategoryIdRequest) GoString() string { + return s.String() +} + +func (s *QueryProcessByBizCategoryIdRequest) SetBizType(v string) *QueryProcessByBizCategoryIdRequest { + s.BizType = &v + return s +} + +func (s *QueryProcessByBizCategoryIdRequest) SetUserId(v string) *QueryProcessByBizCategoryIdRequest { + s.UserId = &v + return s +} + +type QueryProcessByBizCategoryIdResponseBody struct { + Result []*QueryProcessByBizCategoryIdResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Repeated"` +} + +func (s QueryProcessByBizCategoryIdResponseBody) String() string { + return tea.Prettify(s) +} + +func (s QueryProcessByBizCategoryIdResponseBody) GoString() string { + return s.String() +} + +func (s *QueryProcessByBizCategoryIdResponseBody) SetResult(v []*QueryProcessByBizCategoryIdResponseBodyResult) *QueryProcessByBizCategoryIdResponseBody { + s.Result = v + return s +} + +type QueryProcessByBizCategoryIdResponseBodyResult struct { + // 模板描述 + Description *string `json:"description,omitempty" xml:"description,omitempty"` + // 模板名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 模板code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 模版发布状态。 + // + // - PUBLISHED:已启用 + // + // - INVALID:停用 + // + // - SAVED:已保存 + Status *string `json:"status,omitempty" xml:"status,omitempty"` +} + +func (s QueryProcessByBizCategoryIdResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s QueryProcessByBizCategoryIdResponseBodyResult) GoString() string { + return s.String() +} + +func (s *QueryProcessByBizCategoryIdResponseBodyResult) SetDescription(v string) *QueryProcessByBizCategoryIdResponseBodyResult { + s.Description = &v + return s +} + +func (s *QueryProcessByBizCategoryIdResponseBodyResult) SetName(v string) *QueryProcessByBizCategoryIdResponseBodyResult { + s.Name = &v + return s +} + +func (s *QueryProcessByBizCategoryIdResponseBodyResult) SetProcessCode(v string) *QueryProcessByBizCategoryIdResponseBodyResult { + s.ProcessCode = &v + return s +} + +func (s *QueryProcessByBizCategoryIdResponseBodyResult) SetStatus(v string) *QueryProcessByBizCategoryIdResponseBodyResult { + s.Status = &v + return s +} + +type QueryProcessByBizCategoryIdResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *QueryProcessByBizCategoryIdResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s QueryProcessByBizCategoryIdResponse) String() string { + return tea.Prettify(s) +} + +func (s QueryProcessByBizCategoryIdResponse) GoString() string { + return s.String() +} + +func (s *QueryProcessByBizCategoryIdResponse) SetHeaders(v map[string]*string) *QueryProcessByBizCategoryIdResponse { + s.Headers = v + return s +} + +func (s *QueryProcessByBizCategoryIdResponse) SetBody(v *QueryProcessByBizCategoryIdResponseBody) *QueryProcessByBizCategoryIdResponse { + s.Body = v + return s +} + +type QuerySchemaByProcessCodeHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s QuerySchemaByProcessCodeHeaders) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeHeaders) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeHeaders) SetCommonHeaders(v map[string]*string) *QuerySchemaByProcessCodeHeaders { + s.CommonHeaders = v + return s +} + +func (s *QuerySchemaByProcessCodeHeaders) SetXAcsDingtalkAccessToken(v string) *QuerySchemaByProcessCodeHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type QuerySchemaByProcessCodeRequest struct { + // 应用搭建隔离信息 + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 表单的唯一码 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s QuerySchemaByProcessCodeRequest) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeRequest) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeRequest) SetAppUuid(v string) *QuerySchemaByProcessCodeRequest { + s.AppUuid = &v + return s +} + +func (s *QuerySchemaByProcessCodeRequest) SetProcessCode(v string) *QuerySchemaByProcessCodeRequest { + s.ProcessCode = &v + return s +} + +type QuerySchemaByProcessCodeResponseBody struct { + // 返回结果详情。 + Result *QuerySchemaByProcessCodeResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s QuerySchemaByProcessCodeResponseBody) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBody) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBody) SetResult(v *QuerySchemaByProcessCodeResponseBodyResult) *QuerySchemaByProcessCodeResponseBody { + s.Result = v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResult struct { + // 表单类型。 + AppType *int32 `json:"appType,omitempty" xml:"appType,omitempty"` + // 表单应用 uuid 或者 corpId。 + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 代表表单业务含义的类型。 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 创建人 userId。 + CreatorUserId *string `json:"creatorUserId,omitempty" xml:"creatorUserId,omitempty"` + // 业务自定义设置数据。 + CustomSetting *string `json:"customSetting,omitempty" xml:"customSetting,omitempty"` + // 引擎类型,表单:0,页面:1 + EngineType *int32 `json:"engineType,omitempty" xml:"engineType,omitempty"` + // 表单的唯一码。 + FormCode *string `json:"formCode,omitempty" xml:"formCode,omitempty"` + // 表单 uuid。 + FormUuid *string `json:"formUuid,omitempty" xml:"formUuid,omitempty"` + // 创建时间的时间戳。 + GmtCreate *string `json:"gmtCreate,omitempty" xml:"gmtCreate,omitempty"` + // 修改时间的时间戳。 + GmtModified *string `json:"gmtModified,omitempty" xml:"gmtModified,omitempty"` + // 图标。 + Icon *string `json:"icon,omitempty" xml:"icon,omitempty"` + // 排序 id。 + ListOrder *int32 `json:"listOrder,omitempty" xml:"listOrder,omitempty"` + // 说明文案。 + Memo *string `json:"memo,omitempty" xml:"memo,omitempty"` + // 表单名称。 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 数据归属者的 id 类型。企业(orgId), 群(cid), 人(uid)。 + OwnerIdType *string `json:"ownerIdType,omitempty" xml:"ownerIdType,omitempty"` + // 目标类型: inner, outer, customer。 + ProcType *string `json:"procType,omitempty" xml:"procType,omitempty"` + // 表单 schema 详情。 + SchemaContent *QuerySchemaByProcessCodeResponseBodyResultSchemaContent `json:"schemaContent,omitempty" xml:"schemaContent,omitempty" type:"Struct"` + // 状态, PUBLISHED(启用), INVALID(停用), SAVED(草稿) + Status *string `json:"status,omitempty" xml:"status,omitempty"` + // 可见范围类型。 + VisibleRange *string `json:"visibleRange,omitempty" xml:"visibleRange,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResult) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetAppType(v int32) *QuerySchemaByProcessCodeResponseBodyResult { + s.AppType = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetAppUuid(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.AppUuid = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetBizType(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.BizType = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetCreatorUserId(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.CreatorUserId = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetCustomSetting(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.CustomSetting = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetEngineType(v int32) *QuerySchemaByProcessCodeResponseBodyResult { + s.EngineType = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetFormCode(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.FormCode = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetFormUuid(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.FormUuid = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetGmtCreate(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.GmtCreate = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetGmtModified(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.GmtModified = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetIcon(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.Icon = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetListOrder(v int32) *QuerySchemaByProcessCodeResponseBodyResult { + s.ListOrder = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetMemo(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.Memo = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetName(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.Name = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetOwnerIdType(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.OwnerIdType = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetProcType(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.ProcType = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetSchemaContent(v *QuerySchemaByProcessCodeResponseBodyResultSchemaContent) *QuerySchemaByProcessCodeResponseBodyResult { + s.SchemaContent = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetStatus(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.Status = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResult) SetVisibleRange(v string) *QuerySchemaByProcessCodeResponseBodyResult { + s.VisibleRange = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContent struct { + // 图标 + Icon *string `json:"icon,omitempty" xml:"icon,omitempty"` + // 控件列表 + Items []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems `json:"items,omitempty" xml:"items,omitempty" type:"Repeated"` + // 表单名称。 + Title *string `json:"title,omitempty" xml:"title,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContent) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContent) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContent) SetIcon(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContent { + s.Icon = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContent) SetItems(v []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems) *QuerySchemaByProcessCodeResponseBodyResultSchemaContent { + s.Items = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContent) SetTitle(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContent { + s.Title = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems struct { + // 子控件列表 + Children []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren `json:"children,omitempty" xml:"children,omitempty" type:"Repeated"` + // 控件类型,取值: + ComponentName *string `json:"componentName,omitempty" xml:"componentName,omitempty"` + // 控件属性。 + Props *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps `json:"props,omitempty" xml:"props,omitempty" type:"Struct"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems) SetChildren(v []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems { + s.Children = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems) SetComponentName(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems { + s.ComponentName = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems) SetProps(v *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItems { + s.Props = v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren struct { + // 控件类型 + ComponentName *string `json:"componentName,omitempty" xml:"componentName,omitempty"` + // 子控件属性 + Props *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps `json:"props,omitempty" xml:"props,omitempty" type:"Struct"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren) SetComponentName(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren { + s.ComponentName = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren) SetProps(v *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildren { + s.Props = v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps struct { + // 控件业务别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Label *string `json:"label,omitempty" xml:"label,omitempty"` + // 是否必填 + Required *bool `json:"required,omitempty" xml:"required,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps) SetBizAlias(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps { + s.BizAlias = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps) SetId(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps { + s.Id = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps) SetLabel(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps { + s.Label = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps) SetRequired(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsChildrenProps { + s.Required = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps struct { + // 加班套件4.0新增 加班明细名称。 + ActionName *string `json:"actionName,omitempty" xml:"actionName,omitempty"` + // textnote的样式,top|middle|bottom。 + Align *string `json:"align,omitempty" xml:"align,omitempty"` + // ISV 微应用 appId,用于ISV身份权限识别,ISV可获得相应数据。 + AppId *int64 `json:"appId,omitempty" xml:"appId,omitempty"` + // 套件是否开启异步获取分条件规则,true:开启;false:不开启。 + AsyncCondition *bool `json:"asyncCondition,omitempty" xml:"asyncCondition,omitempty"` + // 请假、出差、外出、加班类型标签。 + AttendTypeLabel *string `json:"attendTypeLabel,omitempty" xml:"attendTypeLabel,omitempty"` + // 表单关联控件列表。 + BehaviorLinkage []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage `json:"behaviorLinkage,omitempty" xml:"behaviorLinkage,omitempty" type:"Repeated"` + // 控件业务自定义别名。 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 业务套件类型。 + BizType *string `json:"bizType,omitempty" xml:"bizType,omitempty"` + // 套件内子组件可见性 + ChildFieldVisible map[string]*bool `json:"childFieldVisible,omitempty" xml:"childFieldVisible,omitempty"` + // 内部联系人choice,1表示多选,0表示单选。 + Choice *int32 `json:"choice,omitempty" xml:"choice,omitempty"` + // common field的commonBizType。 + CommonBizType *string `json:"commonBizType,omitempty" xml:"commonBizType,omitempty"` + // 是否可编辑。 + Disabled *bool `json:"disabled,omitempty" xml:"disabled,omitempty"` + // 是否自动计算时长。 + Duration *bool `json:"duration,omitempty" xml:"duration,omitempty"` + // 兼容字段。 + DurationLabel *string `json:"durationLabel,omitempty" xml:"durationLabel,omitempty"` + // e签宝专用标识。 + ESign *bool `json:"eSign,omitempty" xml:"eSign,omitempty"` + // 套件值是否打平 + Extract *bool `json:"extract,omitempty" xml:"extract,omitempty"` + // 关联表单中的fields存储 + FieldsInfo *string `json:"fieldsInfo,omitempty" xml:"fieldsInfo,omitempty"` + // 时间格式(DDDateField和DDDateRangeField)。 + Format *string `json:"format,omitempty" xml:"format,omitempty"` + // 公式。 + Formula *string `json:"formula,omitempty" xml:"formula,omitempty"` + // 加班套件4.0新增 加班明细是否隐藏。 + Hidden *bool `json:"hidden,omitempty" xml:"hidden,omitempty"` + // textnote在详情页是否隐藏,true隐藏, false不隐藏 + HiddenInApprovalDetail *bool `json:"hiddenInApprovalDetail,omitempty" xml:"hiddenInApprovalDetail,omitempty"` + // 加班套件4.0新增 加班明细是否隐藏标签。 + HideLabel *bool `json:"hideLabel,omitempty" xml:"hideLabel,omitempty"` + // 兼容出勤套件类型。 + HolidayOptions []map[string]*string `json:"holidayOptions,omitempty" xml:"holidayOptions,omitempty" type:"Repeated"` + // 控件 id。 + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称。 + Label *string `json:"label,omitempty" xml:"label,omitempty"` + // label是否可修改 true:不可修改。 + LabelEditableFreeze *bool `json:"labelEditableFreeze,omitempty" xml:"labelEditableFreeze,omitempty"` + // 说明文案的链接地址。 + Link *string `json:"link,omitempty" xml:"link,omitempty"` + // 加班套件4.0新增 加班明细描述。 + MainTitle *string `json:"mainTitle,omitempty" xml:"mainTitle,omitempty"` + // 是否参与打印(1表示不打印, 0表示打印)。 + NotPrint *string `json:"notPrint,omitempty" xml:"notPrint,omitempty"` + // 是否需要大写 默认是需要; 1:不需要大写, 空或者0:需要大写。 + NotUpper *string `json:"notUpper,omitempty" xml:"notUpper,omitempty"` + // 选项内容列表,提供给业务方更多的选择器操作。 + ObjOptions []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsObjOptions `json:"objOptions,omitempty" xml:"objOptions,omitempty" type:"Repeated"` + // 单选框选项列表。 + Options []*string `json:"options,omitempty" xml:"options,omitempty" type:"Repeated"` + // 是否有支付属性。 + PayEnable *bool `json:"payEnable,omitempty" xml:"payEnable,omitempty"` + // 占位符。 + Placeholder *string `json:"placeholder,omitempty" xml:"placeholder,omitempty"` + // 同步到考勤, 表示是否设置为员工状态。 + Push *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush `json:"push,omitempty" xml:"push,omitempty" type:"Struct"` + // 推送到考勤, 子类型(DDSelectField)。 + PushToAttendance *bool `json:"pushToAttendance,omitempty" xml:"pushToAttendance,omitempty"` + // 是否推送管理日历(DDDateRangeField, 1表示推送, 0表示不推送, 该属性为兼容保留)。 + PushToCalendar *int32 `json:"pushToCalendar,omitempty" xml:"pushToCalendar,omitempty"` + // 是否必填。 + Required *bool `json:"required,omitempty" xml:"required,omitempty"` + // 必填是否可修改 true:不可修改。 + RequiredEditableFreeze *bool `json:"requiredEditableFreeze,omitempty" xml:"requiredEditableFreeze,omitempty"` + // 兼容出勤套件类型。 + ShowAttendOptions *bool `json:"showAttendOptions,omitempty" xml:"showAttendOptions,omitempty"` + // 是否开启员工状态。 + StaffStatusEnabled *bool `json:"staffStatusEnabled,omitempty" xml:"staffStatusEnabled,omitempty"` + // 需要计算总和的明细组件 + StatField []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField `json:"statField,omitempty" xml:"statField,omitempty" type:"Repeated"` + // 数字组件/日期区间组件单位属性。 + Unit *string `json:"unit,omitempty" xml:"unit,omitempty"` + // 是否使用考勤日历。 + UseCalendar *bool `json:"useCalendar,omitempty" xml:"useCalendar,omitempty"` + // 明细打印排版方式 false:横向 true:纵向。 + VerticalPrint *bool `json:"verticalPrint,omitempty" xml:"verticalPrint,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetActionName(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.ActionName = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetAlign(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Align = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetAppId(v int64) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.AppId = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetAsyncCondition(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.AsyncCondition = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetAttendTypeLabel(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.AttendTypeLabel = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetBehaviorLinkage(v []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.BehaviorLinkage = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetBizAlias(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.BizAlias = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetBizType(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.BizType = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetChildFieldVisible(v map[string]*bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.ChildFieldVisible = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetChoice(v int32) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Choice = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetCommonBizType(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.CommonBizType = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetDisabled(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Disabled = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetDuration(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Duration = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetDurationLabel(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.DurationLabel = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetESign(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.ESign = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetExtract(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Extract = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetFieldsInfo(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.FieldsInfo = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetFormat(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Format = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetFormula(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Formula = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetHidden(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Hidden = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetHiddenInApprovalDetail(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.HiddenInApprovalDetail = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetHideLabel(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.HideLabel = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetHolidayOptions(v []map[string]*string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.HolidayOptions = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetId(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Id = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetLabel(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Label = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetLabelEditableFreeze(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.LabelEditableFreeze = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetLink(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Link = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetMainTitle(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.MainTitle = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetNotPrint(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.NotPrint = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetNotUpper(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.NotUpper = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetObjOptions(v []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsObjOptions) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.ObjOptions = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetOptions(v []*string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Options = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetPayEnable(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.PayEnable = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetPlaceholder(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Placeholder = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetPush(v *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Push = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetPushToAttendance(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.PushToAttendance = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetPushToCalendar(v int32) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.PushToCalendar = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetRequired(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Required = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetRequiredEditableFreeze(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.RequiredEditableFreeze = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetShowAttendOptions(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.ShowAttendOptions = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetStaffStatusEnabled(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.StaffStatusEnabled = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetStatField(v []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.StatField = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetUnit(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.Unit = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetUseCalendar(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.UseCalendar = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps) SetVerticalPrint(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsProps { + s.VerticalPrint = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage struct { + // 关联控件列表。 + Targets []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets `json:"targets,omitempty" xml:"targets,omitempty" type:"Repeated"` + // 控件值。 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage) SetTargets(v []*QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage { + s.Targets = v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage) SetValue(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkage { + s.Value = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets struct { + // 行为。 + Behavior *string `json:"behavior,omitempty" xml:"behavior,omitempty"` + // 字段 id。 + FieldId *string `json:"fieldId,omitempty" xml:"fieldId,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets) SetBehavior(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets { + s.Behavior = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets) SetFieldId(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsBehaviorLinkageTargets { + s.FieldId = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsObjOptions struct { + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsObjOptions) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsObjOptions) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsObjOptions) SetValue(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsObjOptions { + s.Value = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush struct { + // 考勤类型(1表示请假, 2表示出差, 3表示加班, 4表示外出) + AttendanceRule *int32 `json:"attendanceRule,omitempty" xml:"attendanceRule,omitempty"` + // 开启状态(1表示开启, 0表示关闭) + PushSwitch *int32 `json:"pushSwitch,omitempty" xml:"pushSwitch,omitempty"` + // 状态显示名称 + PushTag *string `json:"pushTag,omitempty" xml:"pushTag,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush) SetAttendanceRule(v int32) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush { + s.AttendanceRule = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush) SetPushSwitch(v int32) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush { + s.PushSwitch = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush) SetPushTag(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsPush { + s.PushTag = &v + return s +} + +type QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField struct { + // id 值。 + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 名称。 + Label *string `json:"label,omitempty" xml:"label,omitempty"` + // 单位。 + Unit *string `json:"unit,omitempty" xml:"unit,omitempty"` + // 大写。 + Upper *bool `json:"upper,omitempty" xml:"upper,omitempty"` +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField) SetId(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField { + s.Id = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField) SetLabel(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField { + s.Label = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField) SetUnit(v string) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField { + s.Unit = &v + return s +} + +func (s *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField) SetUpper(v bool) *QuerySchemaByProcessCodeResponseBodyResultSchemaContentItemsPropsStatField { + s.Upper = &v + return s +} + +type QuerySchemaByProcessCodeResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *QuerySchemaByProcessCodeResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s QuerySchemaByProcessCodeResponse) String() string { + return tea.Prettify(s) +} + +func (s QuerySchemaByProcessCodeResponse) GoString() string { + return s.String() +} + +func (s *QuerySchemaByProcessCodeResponse) SetHeaders(v map[string]*string) *QuerySchemaByProcessCodeResponse { + s.Headers = v + return s +} + +func (s *QuerySchemaByProcessCodeResponse) SetBody(v *QuerySchemaByProcessCodeResponseBody) *QuerySchemaByProcessCodeResponse { + s.Body = v + return s +} + +type RedirectWorkflowTaskHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s RedirectWorkflowTaskHeaders) String() string { + return tea.Prettify(s) +} + +func (s RedirectWorkflowTaskHeaders) GoString() string { + return s.String() +} + +func (s *RedirectWorkflowTaskHeaders) SetCommonHeaders(v map[string]*string) *RedirectWorkflowTaskHeaders { + s.CommonHeaders = v + return s +} + +func (s *RedirectWorkflowTaskHeaders) SetXAcsDingtalkAccessToken(v string) *RedirectWorkflowTaskHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type RedirectWorkflowTaskRequest struct { + // 操作节点名 + ActionName *string `json:"actionName,omitempty" xml:"actionName,omitempty"` + // 操作人的用户ID,需要跟任务的当前执行人保持一致,否则无法通过校验 + OperateUserId *string `json:"operateUserId,omitempty" xml:"operateUserId,omitempty"` + // 转交备注信息 + Remark *string `json:"remark,omitempty" xml:"remark,omitempty"` + // OA审批任务ID + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` + // OA审批任务被转交对象的用户ID + ToUserId *string `json:"toUserId,omitempty" xml:"toUserId,omitempty"` +} + +func (s RedirectWorkflowTaskRequest) String() string { + return tea.Prettify(s) +} + +func (s RedirectWorkflowTaskRequest) GoString() string { + return s.String() +} + +func (s *RedirectWorkflowTaskRequest) SetActionName(v string) *RedirectWorkflowTaskRequest { + s.ActionName = &v + return s +} + +func (s *RedirectWorkflowTaskRequest) SetOperateUserId(v string) *RedirectWorkflowTaskRequest { + s.OperateUserId = &v + return s +} + +func (s *RedirectWorkflowTaskRequest) SetRemark(v string) *RedirectWorkflowTaskRequest { + s.Remark = &v + return s +} + +func (s *RedirectWorkflowTaskRequest) SetTaskId(v int64) *RedirectWorkflowTaskRequest { + s.TaskId = &v + return s +} + +func (s *RedirectWorkflowTaskRequest) SetToUserId(v string) *RedirectWorkflowTaskRequest { + s.ToUserId = &v + return s +} + +type RedirectWorkflowTaskResponseBody struct { + // 是否转交成功 + Result *bool `json:"result,omitempty" xml:"result,omitempty"` +} + +func (s RedirectWorkflowTaskResponseBody) String() string { + return tea.Prettify(s) +} + +func (s RedirectWorkflowTaskResponseBody) GoString() string { + return s.String() +} + +func (s *RedirectWorkflowTaskResponseBody) SetResult(v bool) *RedirectWorkflowTaskResponseBody { + s.Result = &v + return s +} + +type RedirectWorkflowTaskResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *RedirectWorkflowTaskResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s RedirectWorkflowTaskResponse) String() string { + return tea.Prettify(s) +} + +func (s RedirectWorkflowTaskResponse) GoString() string { + return s.String() +} + +func (s *RedirectWorkflowTaskResponse) SetHeaders(v map[string]*string) *RedirectWorkflowTaskResponse { + s.Headers = v + return s +} + +func (s *RedirectWorkflowTaskResponse) SetBody(v *RedirectWorkflowTaskResponseBody) *RedirectWorkflowTaskResponse { + s.Body = v + return s +} + +type SaveIntegratedInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s SaveIntegratedInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s SaveIntegratedInstanceHeaders) GoString() string { + return s.String() +} + +func (s *SaveIntegratedInstanceHeaders) SetCommonHeaders(v map[string]*string) *SaveIntegratedInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *SaveIntegratedInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *SaveIntegratedInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type SaveIntegratedInstanceRequest struct { + FormComponentValueList []*SaveIntegratedInstanceRequestFormComponentValueList `json:"formComponentValueList,omitempty" xml:"formComponentValueList,omitempty" type:"Repeated"` + Notifiers []*SaveIntegratedInstanceRequestNotifiers `json:"notifiers,omitempty" xml:"notifiers,omitempty" type:"Repeated"` + // 审批实例接收人的userId。 + OriginatorUserId *string `json:"originatorUserId,omitempty" xml:"originatorUserId,omitempty"` + // 审批模板唯一码 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 实例标题 + Title *string `json:"title,omitempty" xml:"title,omitempty"` + // 三方审批系统中审批单的详情页地址 + Url *string `json:"url,omitempty" xml:"url,omitempty"` +} + +func (s SaveIntegratedInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s SaveIntegratedInstanceRequest) GoString() string { + return s.String() +} + +func (s *SaveIntegratedInstanceRequest) SetFormComponentValueList(v []*SaveIntegratedInstanceRequestFormComponentValueList) *SaveIntegratedInstanceRequest { + s.FormComponentValueList = v + return s +} + +func (s *SaveIntegratedInstanceRequest) SetNotifiers(v []*SaveIntegratedInstanceRequestNotifiers) *SaveIntegratedInstanceRequest { + s.Notifiers = v + return s +} + +func (s *SaveIntegratedInstanceRequest) SetOriginatorUserId(v string) *SaveIntegratedInstanceRequest { + s.OriginatorUserId = &v + return s +} + +func (s *SaveIntegratedInstanceRequest) SetProcessCode(v string) *SaveIntegratedInstanceRequest { + s.ProcessCode = &v + return s +} + +func (s *SaveIntegratedInstanceRequest) SetTitle(v string) *SaveIntegratedInstanceRequest { + s.Title = &v + return s +} + +func (s *SaveIntegratedInstanceRequest) SetUrl(v string) *SaveIntegratedInstanceRequest { + s.Url = &v + return s +} + +type SaveIntegratedInstanceRequestFormComponentValueList struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 控件类型,取值: + // + // TextField:单行输入框 + // + // TextareaField:多行输入框 + // + // NumberField:数字输入框 + // + // DDSelectField:单选框 + // + // DDMultiSelectField:多选框 + // + // DDDateField:日期控件 + // + // DDDateRangeField:时间区间控件 + // + // TextNote:文字说明控件 + // + // PhoneField:电话控件 + // + // DDPhotoField:图片控件 + // + // MoneyField:金额控件 + // + // TableField:明细控件 + // + // DDAttachment:附件 + // + // InnerContactField:联系人控件 + // + // RelateField:关联审批单 + // + // FormRelateField:关联控件 + // + // AddressField:省市区控件 + // + // StarRatingField:评分控件 + // + // DepartmentField:部门控件 + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + // 表单扩展值 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 表单名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 表单值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s SaveIntegratedInstanceRequestFormComponentValueList) String() string { + return tea.Prettify(s) +} + +func (s SaveIntegratedInstanceRequestFormComponentValueList) GoString() string { + return s.String() +} + +func (s *SaveIntegratedInstanceRequestFormComponentValueList) SetBizAlias(v string) *SaveIntegratedInstanceRequestFormComponentValueList { + s.BizAlias = &v + return s +} + +func (s *SaveIntegratedInstanceRequestFormComponentValueList) SetComponentType(v string) *SaveIntegratedInstanceRequestFormComponentValueList { + s.ComponentType = &v + return s +} + +func (s *SaveIntegratedInstanceRequestFormComponentValueList) SetExtValue(v string) *SaveIntegratedInstanceRequestFormComponentValueList { + s.ExtValue = &v + return s +} + +func (s *SaveIntegratedInstanceRequestFormComponentValueList) SetId(v string) *SaveIntegratedInstanceRequestFormComponentValueList { + s.Id = &v + return s +} + +func (s *SaveIntegratedInstanceRequestFormComponentValueList) SetName(v string) *SaveIntegratedInstanceRequestFormComponentValueList { + s.Name = &v + return s +} + +func (s *SaveIntegratedInstanceRequestFormComponentValueList) SetValue(v string) *SaveIntegratedInstanceRequestFormComponentValueList { + s.Value = &v + return s +} + +type SaveIntegratedInstanceRequestNotifiers struct { + // 抄送位置,可以值有: + // start - 审批发起时,通知抄送人 + // finish - 审批通过后,通知抄送人 + // start_finish - 审批发起时和审批通过后,都通知抄送人 + Position *string `json:"position,omitempty" xml:"position,omitempty"` + // 抄送接收人用户ID + Userid *string `json:"userid,omitempty" xml:"userid,omitempty"` +} + +func (s SaveIntegratedInstanceRequestNotifiers) String() string { + return tea.Prettify(s) +} + +func (s SaveIntegratedInstanceRequestNotifiers) GoString() string { + return s.String() +} + +func (s *SaveIntegratedInstanceRequestNotifiers) SetPosition(v string) *SaveIntegratedInstanceRequestNotifiers { + s.Position = &v + return s +} + +func (s *SaveIntegratedInstanceRequestNotifiers) SetUserid(v string) *SaveIntegratedInstanceRequestNotifiers { + s.Userid = &v + return s +} + +type SaveIntegratedInstanceResponseBody struct { + Result *SaveIntegratedInstanceResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s SaveIntegratedInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s SaveIntegratedInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *SaveIntegratedInstanceResponseBody) SetResult(v *SaveIntegratedInstanceResponseBodyResult) *SaveIntegratedInstanceResponseBody { + s.Result = v + return s +} + +type SaveIntegratedInstanceResponseBodyResult struct { + // 实例id + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` +} + +func (s SaveIntegratedInstanceResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s SaveIntegratedInstanceResponseBodyResult) GoString() string { + return s.String() +} + +func (s *SaveIntegratedInstanceResponseBodyResult) SetProcessInstanceId(v string) *SaveIntegratedInstanceResponseBodyResult { + s.ProcessInstanceId = &v + return s +} + +type SaveIntegratedInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *SaveIntegratedInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s SaveIntegratedInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s SaveIntegratedInstanceResponse) GoString() string { + return s.String() +} + +func (s *SaveIntegratedInstanceResponse) SetHeaders(v map[string]*string) *SaveIntegratedInstanceResponse { + s.Headers = v + return s +} + +func (s *SaveIntegratedInstanceResponse) SetBody(v *SaveIntegratedInstanceResponseBody) *SaveIntegratedInstanceResponse { + s.Body = v + return s +} + +type SaveProcessHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s SaveProcessHeaders) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessHeaders) GoString() string { + return s.String() +} + +func (s *SaveProcessHeaders) SetCommonHeaders(v map[string]*string) *SaveProcessHeaders { + s.CommonHeaders = v + return s +} + +func (s *SaveProcessHeaders) SetXAcsDingtalkAccessToken(v string) *SaveProcessHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type SaveProcessRequest struct { + // 表单模板描述 + Description *string `json:"description,omitempty" xml:"description,omitempty"` + // 表单控件列表 + FormComponents []*FormComponent `json:"formComponents,omitempty" xml:"formComponents,omitempty" type:"Repeated"` + // 表单模板名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 模板code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 流程中心集成配置 + ProcessFeatureConfig *SaveProcessRequestProcessFeatureConfig `json:"processFeatureConfig,omitempty" xml:"processFeatureConfig,omitempty" type:"Struct"` +} + +func (s SaveProcessRequest) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessRequest) GoString() string { + return s.String() +} + +func (s *SaveProcessRequest) SetDescription(v string) *SaveProcessRequest { + s.Description = &v + return s +} + +func (s *SaveProcessRequest) SetFormComponents(v []*FormComponent) *SaveProcessRequest { + s.FormComponents = v + return s +} + +func (s *SaveProcessRequest) SetName(v string) *SaveProcessRequest { + s.Name = &v + return s +} + +func (s *SaveProcessRequest) SetProcessCode(v string) *SaveProcessRequest { + s.ProcessCode = &v + return s +} + +func (s *SaveProcessRequest) SetProcessFeatureConfig(v *SaveProcessRequestProcessFeatureConfig) *SaveProcessRequest { + s.ProcessFeatureConfig = v + return s +} + +type SaveProcessRequestProcessFeatureConfig struct { + // 配置列表 + Features []*SaveProcessRequestProcessFeatureConfigFeatures `json:"features,omitempty" xml:"features,omitempty" type:"Repeated"` +} + +func (s SaveProcessRequestProcessFeatureConfig) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessRequestProcessFeatureConfig) GoString() string { + return s.String() +} + +func (s *SaveProcessRequestProcessFeatureConfig) SetFeatures(v []*SaveProcessRequestProcessFeatureConfigFeatures) *SaveProcessRequestProcessFeatureConfig { + s.Features = v + return s +} + +type SaveProcessRequestProcessFeatureConfigFeatures struct { + Callback *SaveProcessRequestProcessFeatureConfigFeaturesCallback `json:"callback,omitempty" xml:"callback,omitempty" type:"Struct"` + // 手机端链接 + MobileUrl *string `json:"mobileUrl,omitempty" xml:"mobileUrl,omitempty"` + // 名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // pc端链接 + PcUrl *string `json:"pcUrl,omitempty" xml:"pcUrl,omitempty"` + // 运行方式: + // ORIGIN:原生运行,即在官方审批内运行对应功能; + // REDIRECT:外部跳转运行,需要跳转到三方地址运行对应功能 + RunType *string `json:"runType,omitempty" xml:"runType,omitempty"` +} + +func (s SaveProcessRequestProcessFeatureConfigFeatures) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessRequestProcessFeatureConfigFeatures) GoString() string { + return s.String() +} + +func (s *SaveProcessRequestProcessFeatureConfigFeatures) SetCallback(v *SaveProcessRequestProcessFeatureConfigFeaturesCallback) *SaveProcessRequestProcessFeatureConfigFeatures { + s.Callback = v + return s +} + +func (s *SaveProcessRequestProcessFeatureConfigFeatures) SetMobileUrl(v string) *SaveProcessRequestProcessFeatureConfigFeatures { + s.MobileUrl = &v + return s +} + +func (s *SaveProcessRequestProcessFeatureConfigFeatures) SetName(v string) *SaveProcessRequestProcessFeatureConfigFeatures { + s.Name = &v + return s +} + +func (s *SaveProcessRequestProcessFeatureConfigFeatures) SetPcUrl(v string) *SaveProcessRequestProcessFeatureConfigFeatures { + s.PcUrl = &v + return s +} + +func (s *SaveProcessRequestProcessFeatureConfigFeatures) SetRunType(v string) *SaveProcessRequestProcessFeatureConfigFeatures { + s.RunType = &v + return s +} + +type SaveProcessRequestProcessFeatureConfigFeaturesCallback struct { + // 网关接口标识 + ApiKey *string `json:"apiKey,omitempty" xml:"apiKey,omitempty"` + // 网关接口对应应用的uuid + AppUuid *string `json:"appUuid,omitempty" xml:"appUuid,omitempty"` + // 网关接口版本 + Version *string `json:"version,omitempty" xml:"version,omitempty"` +} + +func (s SaveProcessRequestProcessFeatureConfigFeaturesCallback) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessRequestProcessFeatureConfigFeaturesCallback) GoString() string { + return s.String() +} + +func (s *SaveProcessRequestProcessFeatureConfigFeaturesCallback) SetApiKey(v string) *SaveProcessRequestProcessFeatureConfigFeaturesCallback { + s.ApiKey = &v + return s +} + +func (s *SaveProcessRequestProcessFeatureConfigFeaturesCallback) SetAppUuid(v string) *SaveProcessRequestProcessFeatureConfigFeaturesCallback { + s.AppUuid = &v + return s +} + +func (s *SaveProcessRequestProcessFeatureConfigFeaturesCallback) SetVersion(v string) *SaveProcessRequestProcessFeatureConfigFeaturesCallback { + s.Version = &v + return s +} + +type SaveProcessResponseBody struct { + // 表单模板信息 + Result *SaveProcessResponseBodyResult `json:"result,omitempty" xml:"result,omitempty" type:"Struct"` +} + +func (s SaveProcessResponseBody) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessResponseBody) GoString() string { + return s.String() +} + +func (s *SaveProcessResponseBody) SetResult(v *SaveProcessResponseBodyResult) *SaveProcessResponseBody { + s.Result = v + return s +} + +type SaveProcessResponseBodyResult struct { + // 保存或更新的表单code + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` +} + +func (s SaveProcessResponseBodyResult) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessResponseBodyResult) GoString() string { + return s.String() +} + +func (s *SaveProcessResponseBodyResult) SetProcessCode(v string) *SaveProcessResponseBodyResult { + s.ProcessCode = &v + return s +} + +type SaveProcessResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *SaveProcessResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s SaveProcessResponse) String() string { + return tea.Prettify(s) +} + +func (s SaveProcessResponse) GoString() string { + return s.String() +} + +func (s *SaveProcessResponse) SetHeaders(v map[string]*string) *SaveProcessResponse { + s.Headers = v + return s +} + +func (s *SaveProcessResponse) SetBody(v *SaveProcessResponseBody) *SaveProcessResponse { + s.Body = v + return s +} + +type StartProcessInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s StartProcessInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceHeaders) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceHeaders) SetCommonHeaders(v map[string]*string) *StartProcessInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *StartProcessInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *StartProcessInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type StartProcessInstanceRequest struct { + // 不使用审批流模板时,直接指定审批人列表 + Approvers []*StartProcessInstanceRequestApprovers `json:"approvers,omitempty" xml:"approvers,omitempty" type:"Repeated"` + // 抄送人userId列表 + CcList []*string `json:"ccList,omitempty" xml:"ccList,omitempty" type:"Repeated"` + // 抄送时间 + CcPosition *string `json:"ccPosition,omitempty" xml:"ccPosition,omitempty"` + // 部门ID + DeptId *int64 `json:"deptId,omitempty" xml:"deptId,omitempty"` + // 表单数据内容,控件列表 + FormComponentValues []*StartProcessInstanceRequestFormComponentValues `json:"formComponentValues,omitempty" xml:"formComponentValues,omitempty" type:"Repeated"` + // 企业微应用标识 + MicroappAgentId *int64 `json:"microappAgentId,omitempty" xml:"microappAgentId,omitempty"` + // 审批发起人的userId + OriginatorUserId *string `json:"originatorUserId,omitempty" xml:"originatorUserId,omitempty"` + // 审批流的唯一码 + ProcessCode *string `json:"processCode,omitempty" xml:"processCode,omitempty"` + // 使用审批流模板时,模板上的自选操作人列表 + TargetSelectActioners []*StartProcessInstanceRequestTargetSelectActioners `json:"targetSelectActioners,omitempty" xml:"targetSelectActioners,omitempty" type:"Repeated"` +} + +func (s StartProcessInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceRequest) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceRequest) SetApprovers(v []*StartProcessInstanceRequestApprovers) *StartProcessInstanceRequest { + s.Approvers = v + return s +} + +func (s *StartProcessInstanceRequest) SetCcList(v []*string) *StartProcessInstanceRequest { + s.CcList = v + return s +} + +func (s *StartProcessInstanceRequest) SetCcPosition(v string) *StartProcessInstanceRequest { + s.CcPosition = &v + return s +} + +func (s *StartProcessInstanceRequest) SetDeptId(v int64) *StartProcessInstanceRequest { + s.DeptId = &v + return s +} + +func (s *StartProcessInstanceRequest) SetFormComponentValues(v []*StartProcessInstanceRequestFormComponentValues) *StartProcessInstanceRequest { + s.FormComponentValues = v + return s +} + +func (s *StartProcessInstanceRequest) SetMicroappAgentId(v int64) *StartProcessInstanceRequest { + s.MicroappAgentId = &v + return s +} + +func (s *StartProcessInstanceRequest) SetOriginatorUserId(v string) *StartProcessInstanceRequest { + s.OriginatorUserId = &v + return s +} + +func (s *StartProcessInstanceRequest) SetProcessCode(v string) *StartProcessInstanceRequest { + s.ProcessCode = &v + return s +} + +func (s *StartProcessInstanceRequest) SetTargetSelectActioners(v []*StartProcessInstanceRequestTargetSelectActioners) *StartProcessInstanceRequest { + s.TargetSelectActioners = v + return s +} + +type StartProcessInstanceRequestApprovers struct { + // 审批类型 + ActionType *string `json:"actionType,omitempty" xml:"actionType,omitempty"` + // 审批人列表 + UserIds []*string `json:"userIds,omitempty" xml:"userIds,omitempty" type:"Repeated"` +} + +func (s StartProcessInstanceRequestApprovers) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceRequestApprovers) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceRequestApprovers) SetActionType(v string) *StartProcessInstanceRequestApprovers { + s.ActionType = &v + return s +} + +func (s *StartProcessInstanceRequestApprovers) SetUserIds(v []*string) *StartProcessInstanceRequestApprovers { + s.UserIds = v + return s +} + +type StartProcessInstanceRequestFormComponentValues struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 控件类型 + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + Details []*StartProcessInstanceRequestFormComponentValuesDetails `json:"details,omitempty" xml:"details,omitempty" type:"Repeated"` + // 控件扩展值 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 控件值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s StartProcessInstanceRequestFormComponentValues) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceRequestFormComponentValues) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceRequestFormComponentValues) SetBizAlias(v string) *StartProcessInstanceRequestFormComponentValues { + s.BizAlias = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValues) SetComponentType(v string) *StartProcessInstanceRequestFormComponentValues { + s.ComponentType = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValues) SetDetails(v []*StartProcessInstanceRequestFormComponentValuesDetails) *StartProcessInstanceRequestFormComponentValues { + s.Details = v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValues) SetExtValue(v string) *StartProcessInstanceRequestFormComponentValues { + s.ExtValue = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValues) SetId(v string) *StartProcessInstanceRequestFormComponentValues { + s.Id = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValues) SetName(v string) *StartProcessInstanceRequestFormComponentValues { + s.Name = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValues) SetValue(v string) *StartProcessInstanceRequestFormComponentValues { + s.Value = &v + return s +} + +type StartProcessInstanceRequestFormComponentValuesDetails struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + Details []*StartProcessInstanceRequestFormComponentValuesDetailsDetails `json:"details,omitempty" xml:"details,omitempty" type:"Repeated"` + // 控件扩展值 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 控件值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s StartProcessInstanceRequestFormComponentValuesDetails) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceRequestFormComponentValuesDetails) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetails) SetBizAlias(v string) *StartProcessInstanceRequestFormComponentValuesDetails { + s.BizAlias = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetails) SetDetails(v []*StartProcessInstanceRequestFormComponentValuesDetailsDetails) *StartProcessInstanceRequestFormComponentValuesDetails { + s.Details = v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetails) SetExtValue(v string) *StartProcessInstanceRequestFormComponentValuesDetails { + s.ExtValue = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetails) SetId(v string) *StartProcessInstanceRequestFormComponentValuesDetails { + s.Id = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetails) SetName(v string) *StartProcessInstanceRequestFormComponentValuesDetails { + s.Name = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetails) SetValue(v string) *StartProcessInstanceRequestFormComponentValuesDetails { + s.Value = &v + return s +} + +type StartProcessInstanceRequestFormComponentValuesDetailsDetails struct { + // 控件别名 + BizAlias *string `json:"bizAlias,omitempty" xml:"bizAlias,omitempty"` + // 控件类型 + ComponentType *string `json:"componentType,omitempty" xml:"componentType,omitempty"` + // 控件扩展值 + ExtValue *string `json:"extValue,omitempty" xml:"extValue,omitempty"` + // 控件id + Id *string `json:"id,omitempty" xml:"id,omitempty"` + // 控件名称 + Name *string `json:"name,omitempty" xml:"name,omitempty"` + // 控件值 + Value *string `json:"value,omitempty" xml:"value,omitempty"` +} + +func (s StartProcessInstanceRequestFormComponentValuesDetailsDetails) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceRequestFormComponentValuesDetailsDetails) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetailsDetails) SetBizAlias(v string) *StartProcessInstanceRequestFormComponentValuesDetailsDetails { + s.BizAlias = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetailsDetails) SetComponentType(v string) *StartProcessInstanceRequestFormComponentValuesDetailsDetails { + s.ComponentType = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetailsDetails) SetExtValue(v string) *StartProcessInstanceRequestFormComponentValuesDetailsDetails { + s.ExtValue = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetailsDetails) SetId(v string) *StartProcessInstanceRequestFormComponentValuesDetailsDetails { + s.Id = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetailsDetails) SetName(v string) *StartProcessInstanceRequestFormComponentValuesDetailsDetails { + s.Name = &v + return s +} + +func (s *StartProcessInstanceRequestFormComponentValuesDetailsDetails) SetValue(v string) *StartProcessInstanceRequestFormComponentValuesDetailsDetails { + s.Value = &v + return s +} + +type StartProcessInstanceRequestTargetSelectActioners struct { + // 自选节点的规则key + ActionerKey *string `json:"actionerKey,omitempty" xml:"actionerKey,omitempty"` + // 操作人userId列表 + ActionerUserIds []*string `json:"actionerUserIds,omitempty" xml:"actionerUserIds,omitempty" type:"Repeated"` +} + +func (s StartProcessInstanceRequestTargetSelectActioners) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceRequestTargetSelectActioners) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceRequestTargetSelectActioners) SetActionerKey(v string) *StartProcessInstanceRequestTargetSelectActioners { + s.ActionerKey = &v + return s +} + +func (s *StartProcessInstanceRequestTargetSelectActioners) SetActionerUserIds(v []*string) *StartProcessInstanceRequestTargetSelectActioners { + s.ActionerUserIds = v + return s +} + +type StartProcessInstanceResponseBody struct { + // 审批实例id + InstanceId *string `json:"instanceId,omitempty" xml:"instanceId,omitempty"` +} + +func (s StartProcessInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceResponseBody) SetInstanceId(v string) *StartProcessInstanceResponseBody { + s.InstanceId = &v + return s +} + +type StartProcessInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *StartProcessInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s StartProcessInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s StartProcessInstanceResponse) GoString() string { + return s.String() +} + +func (s *StartProcessInstanceResponse) SetHeaders(v map[string]*string) *StartProcessInstanceResponse { + s.Headers = v + return s +} + +func (s *StartProcessInstanceResponse) SetBody(v *StartProcessInstanceResponseBody) *StartProcessInstanceResponse { + s.Body = v + return s +} + +type TerminateProcessInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s TerminateProcessInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s TerminateProcessInstanceHeaders) GoString() string { + return s.String() +} + +func (s *TerminateProcessInstanceHeaders) SetCommonHeaders(v map[string]*string) *TerminateProcessInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *TerminateProcessInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *TerminateProcessInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type TerminateProcessInstanceRequest struct { + // 是否通过系统操作: + // + // true:由系统直接终止 + // + // false:由指定的操作者终止 + IsSystem *bool `json:"isSystem,omitempty" xml:"isSystem,omitempty"` + // 操作人的userid。 + // + // 当is_system为false时,该参数必传。 + OperatingUserId *string `json:"operatingUserId,omitempty" xml:"operatingUserId,omitempty"` + // 审批实例ID,可通过调用获取审批实例ID列表接口获取。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 终止说明。 + Remark *string `json:"remark,omitempty" xml:"remark,omitempty"` +} + +func (s TerminateProcessInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s TerminateProcessInstanceRequest) GoString() string { + return s.String() +} + +func (s *TerminateProcessInstanceRequest) SetIsSystem(v bool) *TerminateProcessInstanceRequest { + s.IsSystem = &v + return s +} + +func (s *TerminateProcessInstanceRequest) SetOperatingUserId(v string) *TerminateProcessInstanceRequest { + s.OperatingUserId = &v + return s +} + +func (s *TerminateProcessInstanceRequest) SetProcessInstanceId(v string) *TerminateProcessInstanceRequest { + s.ProcessInstanceId = &v + return s +} + +func (s *TerminateProcessInstanceRequest) SetRemark(v string) *TerminateProcessInstanceRequest { + s.Remark = &v + return s +} + +type TerminateProcessInstanceResponseBody struct { + // 撤销结果。 + Result *bool `json:"result,omitempty" xml:"result,omitempty"` + // 接口调用是否成功。 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s TerminateProcessInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s TerminateProcessInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *TerminateProcessInstanceResponseBody) SetResult(v bool) *TerminateProcessInstanceResponseBody { + s.Result = &v + return s +} + +func (s *TerminateProcessInstanceResponseBody) SetSuccess(v bool) *TerminateProcessInstanceResponseBody { + s.Success = &v + return s +} + +type TerminateProcessInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *TerminateProcessInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s TerminateProcessInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s TerminateProcessInstanceResponse) GoString() string { + return s.String() +} + +func (s *TerminateProcessInstanceResponse) SetHeaders(v map[string]*string) *TerminateProcessInstanceResponse { + s.Headers = v + return s +} + +func (s *TerminateProcessInstanceResponse) SetBody(v *TerminateProcessInstanceResponseBody) *TerminateProcessInstanceResponse { + s.Body = v + return s +} + +type UpdateIntegratedTaskHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s UpdateIntegratedTaskHeaders) String() string { + return tea.Prettify(s) +} + +func (s UpdateIntegratedTaskHeaders) GoString() string { + return s.String() +} + +func (s *UpdateIntegratedTaskHeaders) SetCommonHeaders(v map[string]*string) *UpdateIntegratedTaskHeaders { + s.CommonHeaders = v + return s +} + +func (s *UpdateIntegratedTaskHeaders) SetXAcsDingtalkAccessToken(v string) *UpdateIntegratedTaskHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type UpdateIntegratedTaskRequest struct { + // OA审批流程实例ID,过创建实例接口获取 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + Tasks []*UpdateIntegratedTaskRequestTasks `json:"tasks,omitempty" xml:"tasks,omitempty" type:"Repeated"` +} + +func (s UpdateIntegratedTaskRequest) String() string { + return tea.Prettify(s) +} + +func (s UpdateIntegratedTaskRequest) GoString() string { + return s.String() +} + +func (s *UpdateIntegratedTaskRequest) SetProcessInstanceId(v string) *UpdateIntegratedTaskRequest { + s.ProcessInstanceId = &v + return s +} + +func (s *UpdateIntegratedTaskRequest) SetTasks(v []*UpdateIntegratedTaskRequestTasks) *UpdateIntegratedTaskRequest { + s.Tasks = v + return s +} + +type UpdateIntegratedTaskRequestTasks struct { + // 当status为COMPLETED时,必须指定任务结果: + // AGREE:同意 + // REFUSE:拒绝 + // + // 说明 当status为CANCELED时,不需要传result。 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 更新为目标任务状态,可选值 CANCELED、COMPLETED + Status *string `json:"status,omitempty" xml:"status,omitempty"` + // OA审批任务ID + TaskId *int64 `json:"taskId,omitempty" xml:"taskId,omitempty"` +} + +func (s UpdateIntegratedTaskRequestTasks) String() string { + return tea.Prettify(s) +} + +func (s UpdateIntegratedTaskRequestTasks) GoString() string { + return s.String() +} + +func (s *UpdateIntegratedTaskRequestTasks) SetResult(v string) *UpdateIntegratedTaskRequestTasks { + s.Result = &v + return s +} + +func (s *UpdateIntegratedTaskRequestTasks) SetStatus(v string) *UpdateIntegratedTaskRequestTasks { + s.Status = &v + return s +} + +func (s *UpdateIntegratedTaskRequestTasks) SetTaskId(v int64) *UpdateIntegratedTaskRequestTasks { + s.TaskId = &v + return s +} + +type UpdateIntegratedTaskResponseBody struct { + // 是否更新成功 + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s UpdateIntegratedTaskResponseBody) String() string { + return tea.Prettify(s) +} + +func (s UpdateIntegratedTaskResponseBody) GoString() string { + return s.String() +} + +func (s *UpdateIntegratedTaskResponseBody) SetSuccess(v bool) *UpdateIntegratedTaskResponseBody { + s.Success = &v + return s +} + +type UpdateIntegratedTaskResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *UpdateIntegratedTaskResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s UpdateIntegratedTaskResponse) String() string { + return tea.Prettify(s) +} + +func (s UpdateIntegratedTaskResponse) GoString() string { + return s.String() +} + +func (s *UpdateIntegratedTaskResponse) SetHeaders(v map[string]*string) *UpdateIntegratedTaskResponse { + s.Headers = v + return s +} + +func (s *UpdateIntegratedTaskResponse) SetBody(v *UpdateIntegratedTaskResponseBody) *UpdateIntegratedTaskResponse { + s.Body = v + return s +} + +type UpdateProcessInstanceHeaders struct { + CommonHeaders map[string]*string `json:"commonHeaders,omitempty" xml:"commonHeaders,omitempty"` + XAcsDingtalkAccessToken *string `json:"x-acs-dingtalk-access-token,omitempty" xml:"x-acs-dingtalk-access-token,omitempty"` +} + +func (s UpdateProcessInstanceHeaders) String() string { + return tea.Prettify(s) +} + +func (s UpdateProcessInstanceHeaders) GoString() string { + return s.String() +} + +func (s *UpdateProcessInstanceHeaders) SetCommonHeaders(v map[string]*string) *UpdateProcessInstanceHeaders { + s.CommonHeaders = v + return s +} + +func (s *UpdateProcessInstanceHeaders) SetXAcsDingtalkAccessToken(v string) *UpdateProcessInstanceHeaders { + s.XAcsDingtalkAccessToken = &v + return s +} + +type UpdateProcessInstanceRequest struct { + // 抄送列表,注意最大抄送人数量不能超过30。 + Notifiers []*UpdateProcessInstanceRequestNotifiers `json:"notifiers,omitempty" xml:"notifiers,omitempty" type:"Repeated"` + // 审批实例ID。 + ProcessInstanceId *string `json:"processInstanceId,omitempty" xml:"processInstanceId,omitempty"` + // 实例结果: + // 实例状态是COMPLETED,必须设置代表以下含义。 + // agree:同意 + // refuse:拒绝 + // 实例状态为TERMINATED,必须设置代表含义,result取值agree和refuse均代表撤销审批流。 + Result *string `json:"result,omitempty" xml:"result,omitempty"` + // 实例状态: + // COMPLETED:结束审批流 + // TERMINATED:终止审批流 + Status *string `json:"status,omitempty" xml:"status,omitempty"` +} + +func (s UpdateProcessInstanceRequest) String() string { + return tea.Prettify(s) +} + +func (s UpdateProcessInstanceRequest) GoString() string { + return s.String() +} + +func (s *UpdateProcessInstanceRequest) SetNotifiers(v []*UpdateProcessInstanceRequestNotifiers) *UpdateProcessInstanceRequest { + s.Notifiers = v + return s +} + +func (s *UpdateProcessInstanceRequest) SetProcessInstanceId(v string) *UpdateProcessInstanceRequest { + s.ProcessInstanceId = &v + return s +} + +func (s *UpdateProcessInstanceRequest) SetResult(v string) *UpdateProcessInstanceRequest { + s.Result = &v + return s +} + +func (s *UpdateProcessInstanceRequest) SetStatus(v string) *UpdateProcessInstanceRequest { + s.Status = &v + return s +} + +type UpdateProcessInstanceRequestNotifiers struct { + // 抄送接收人用户userId。 + UserId *string `json:"userId,omitempty" xml:"userId,omitempty"` +} + +func (s UpdateProcessInstanceRequestNotifiers) String() string { + return tea.Prettify(s) +} + +func (s UpdateProcessInstanceRequestNotifiers) GoString() string { + return s.String() +} + +func (s *UpdateProcessInstanceRequestNotifiers) SetUserId(v string) *UpdateProcessInstanceRequestNotifiers { + s.UserId = &v + return s +} + +type UpdateProcessInstanceResponseBody struct { + Success *bool `json:"success,omitempty" xml:"success,omitempty"` +} + +func (s UpdateProcessInstanceResponseBody) String() string { + return tea.Prettify(s) +} + +func (s UpdateProcessInstanceResponseBody) GoString() string { + return s.String() +} + +func (s *UpdateProcessInstanceResponseBody) SetSuccess(v bool) *UpdateProcessInstanceResponseBody { + s.Success = &v + return s +} + +type UpdateProcessInstanceResponse struct { + Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"` + Body *UpdateProcessInstanceResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"` +} + +func (s UpdateProcessInstanceResponse) String() string { + return tea.Prettify(s) +} + +func (s UpdateProcessInstanceResponse) GoString() string { + return s.String() +} + +func (s *UpdateProcessInstanceResponse) SetHeaders(v map[string]*string) *UpdateProcessInstanceResponse { + s.Headers = v + return s +} + +func (s *UpdateProcessInstanceResponse) SetBody(v *UpdateProcessInstanceResponseBody) *UpdateProcessInstanceResponse { + s.Body = v + return s +} + +type Client struct { + openapi.Client +} + +func NewClient(config *openapi.Config) (*Client, error) { + client := new(Client) + err := client.Init(config) + return client, err +} + +func (client *Client) Init(config *openapi.Config) (_err error) { + _err = client.Client.Init(config) + if _err != nil { + return _err + } + client.EndpointRule = tea.String("") + if tea.BoolValue(util.Empty(client.Endpoint)) { + client.Endpoint = tea.String("api.dingtalk.com") + } + + return nil +} + +func (client *Client) AddApproveDentryAuth(request *AddApproveDentryAuthRequest) (_result *AddApproveDentryAuthResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &AddApproveDentryAuthHeaders{} + _result = &AddApproveDentryAuthResponse{} + _body, _err := client.AddApproveDentryAuthWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) AddApproveDentryAuthWithOptions(request *AddApproveDentryAuthRequest, headers *AddApproveDentryAuthHeaders, runtime *util.RuntimeOptions) (_result *AddApproveDentryAuthResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.FileInfos)) { + body["fileInfos"] = request.FileInfos + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + body["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &AddApproveDentryAuthResponse{} + _body, _err := client.DoROARequest(tea.String("AddApproveDentryAuth"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances/spaces/files/authDownload"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) AddProcessInstanceComment(request *AddProcessInstanceCommentRequest) (_result *AddProcessInstanceCommentResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &AddProcessInstanceCommentHeaders{} + _result = &AddProcessInstanceCommentResponse{} + _body, _err := client.AddProcessInstanceCommentWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) AddProcessInstanceCommentWithOptions(request *AddProcessInstanceCommentRequest, headers *AddProcessInstanceCommentHeaders, runtime *util.RuntimeOptions) (_result *AddProcessInstanceCommentResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.CommentUserId)) { + body["commentUserId"] = request.CommentUserId + } + + if !tea.BoolValue(util.IsUnset(request.File)) { + body["file"] = request.File + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + if !tea.BoolValue(util.IsUnset(request.Text)) { + body["text"] = request.Text + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &AddProcessInstanceCommentResponse{} + _body, _err := client.DoROARequest(tea.String("AddProcessInstanceComment"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances/comments"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) BatchUpdateProcessInstance(request *BatchUpdateProcessInstanceRequest) (_result *BatchUpdateProcessInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &BatchUpdateProcessInstanceHeaders{} + _result = &BatchUpdateProcessInstanceResponse{} + _body, _err := client.BatchUpdateProcessInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) BatchUpdateProcessInstanceWithOptions(request *BatchUpdateProcessInstanceRequest, headers *BatchUpdateProcessInstanceHeaders, runtime *util.RuntimeOptions) (_result *BatchUpdateProcessInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.UpdateProcessInstanceRequests)) { + body["updateProcessInstanceRequests"] = request.UpdateProcessInstanceRequests + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &BatchUpdateProcessInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("BatchUpdateProcessInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("PUT"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/instances/batch"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) CancelIntegratedTask(request *CancelIntegratedTaskRequest) (_result *CancelIntegratedTaskResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &CancelIntegratedTaskHeaders{} + _result = &CancelIntegratedTaskResponse{} + _body, _err := client.CancelIntegratedTaskWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) CancelIntegratedTaskWithOptions(request *CancelIntegratedTaskRequest, headers *CancelIntegratedTaskHeaders, runtime *util.RuntimeOptions) (_result *CancelIntegratedTaskResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ActivityId)) { + body["activityId"] = request.ActivityId + } + + if !tea.BoolValue(util.IsUnset(request.ActivityIds)) { + body["activityIds"] = request.ActivityIds + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &CancelIntegratedTaskResponse{} + _body, _err := client.DoROARequest(tea.String("CancelIntegratedTask"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/tasks/cancel"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) CleanProcessData(request *CleanProcessDataRequest) (_result *CleanProcessDataResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &CleanProcessDataHeaders{} + _result = &CleanProcessDataResponse{} + _body, _err := client.CleanProcessDataWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) CleanProcessDataWithOptions(request *CleanProcessDataRequest, headers *CleanProcessDataHeaders, runtime *util.RuntimeOptions) (_result *CleanProcessDataResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.CorpId)) { + body["corpId"] = request.CorpId + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + body["processCode"] = request.ProcessCode + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &CleanProcessDataResponse{} + _body, _err := client.DoROARequest(tea.String("CleanProcessData"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processes/clean"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) CopyProcess(request *CopyProcessRequest) (_result *CopyProcessResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &CopyProcessHeaders{} + _result = &CopyProcessResponse{} + _body, _err := client.CopyProcessWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) CopyProcessWithOptions(request *CopyProcessRequest, headers *CopyProcessHeaders, runtime *util.RuntimeOptions) (_result *CopyProcessResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.CopyOptions)) { + body["copyOptions"] = request.CopyOptions + } + + if !tea.BoolValue(util.IsUnset(request.SourceCorpId)) { + body["sourceCorpId"] = request.SourceCorpId + } + + if !tea.BoolValue(util.IsUnset(request.SourceProcessVOList)) { + body["sourceProcessVOList"] = request.SourceProcessVOList + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &CopyProcessResponse{} + _body, _err := client.DoROARequest(tea.String("CopyProcess"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processes/copy"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) CreateIntegratedTask(request *CreateIntegratedTaskRequest) (_result *CreateIntegratedTaskResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &CreateIntegratedTaskHeaders{} + _result = &CreateIntegratedTaskResponse{} + _body, _err := client.CreateIntegratedTaskWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) CreateIntegratedTaskWithOptions(request *CreateIntegratedTaskRequest, headers *CreateIntegratedTaskHeaders, runtime *util.RuntimeOptions) (_result *CreateIntegratedTaskResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ActivityId)) { + body["activityId"] = request.ActivityId + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + if !tea.BoolValue(util.IsUnset(request.Tasks)) { + body["tasks"] = request.Tasks + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &CreateIntegratedTaskResponse{} + _body, _err := client.DoROARequest(tea.String("CreateIntegratedTask"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/tasks"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) DeleteProcess(request *DeleteProcessRequest) (_result *DeleteProcessResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &DeleteProcessHeaders{} + _result = &DeleteProcessResponse{} + _body, _err := client.DeleteProcessWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) DeleteProcessWithOptions(request *DeleteProcessRequest, headers *DeleteProcessHeaders, runtime *util.RuntimeOptions) (_result *DeleteProcessResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.CleanRunningTask)) { + query["cleanRunningTask"] = request.CleanRunningTask + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + query["processCode"] = request.ProcessCode + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &DeleteProcessResponse{} + _body, _err := client.DoROARequest(tea.String("DeleteProcess"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("DELETE"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/schemas"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) ExecuteProcessInstance(request *ExecuteProcessInstanceRequest) (_result *ExecuteProcessInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &ExecuteProcessInstanceHeaders{} + _result = &ExecuteProcessInstanceResponse{} + _body, _err := client.ExecuteProcessInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) ExecuteProcessInstanceWithOptions(request *ExecuteProcessInstanceRequest, headers *ExecuteProcessInstanceHeaders, runtime *util.RuntimeOptions) (_result *ExecuteProcessInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ActionerUserId)) { + body["actionerUserId"] = request.ActionerUserId + } + + if !tea.BoolValue(util.IsUnset(request.File)) { + body["file"] = request.File + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + if !tea.BoolValue(util.IsUnset(request.Remark)) { + body["remark"] = request.Remark + } + + if !tea.BoolValue(util.IsUnset(request.Result)) { + body["result"] = request.Result + } + + if !tea.BoolValue(util.IsUnset(request.TaskId)) { + body["taskId"] = request.TaskId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &ExecuteProcessInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("ExecuteProcessInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances/execute"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) FormCreate(request *FormCreateRequest) (_result *FormCreateResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &FormCreateHeaders{} + _result = &FormCreateResponse{} + _body, _err := client.FormCreateWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) FormCreateWithOptions(request *FormCreateRequest, headers *FormCreateHeaders, runtime *util.RuntimeOptions) (_result *FormCreateResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.Description)) { + body["description"] = request.Description + } + + if !tea.BoolValue(util.IsUnset(request.FormComponents)) { + body["formComponents"] = request.FormComponents + } + + if !tea.BoolValue(util.IsUnset(request.Name)) { + body["name"] = request.Name + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + body["processCode"] = request.ProcessCode + } + + if !tea.BoolValue(util.IsUnset(request.TemplateConfig)) { + body["templateConfig"] = request.TemplateConfig + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &FormCreateResponse{} + _body, _err := client.DoROARequest(tea.String("FormCreate"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/forms"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetAttachmentSpace(request *GetAttachmentSpaceRequest) (_result *GetAttachmentSpaceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetAttachmentSpaceHeaders{} + _result = &GetAttachmentSpaceResponse{} + _body, _err := client.GetAttachmentSpaceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetAttachmentSpaceWithOptions(request *GetAttachmentSpaceRequest, headers *GetAttachmentSpaceHeaders, runtime *util.RuntimeOptions) (_result *GetAttachmentSpaceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AgentId)) { + body["agentId"] = request.AgentId + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + body["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &GetAttachmentSpaceResponse{} + _body, _err := client.DoROARequest(tea.String("GetAttachmentSpace"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances/spaces/infos/query"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetConditionFormComponent(request *GetConditionFormComponentRequest) (_result *GetConditionFormComponentResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetConditionFormComponentHeaders{} + _result = &GetConditionFormComponentResponse{} + _body, _err := client.GetConditionFormComponentWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetConditionFormComponentWithOptions(request *GetConditionFormComponentRequest, headers *GetConditionFormComponentHeaders, runtime *util.RuntimeOptions) (_result *GetConditionFormComponentResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AgentId)) { + query["agentId"] = request.AgentId + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + query["processCode"] = request.ProcessCode + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetConditionFormComponentResponse{} + _body, _err := client.DoROARequest(tea.String("GetConditionFormComponent"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processes/conditions/components"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetCrmProcCodes() (_result *GetCrmProcCodesResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetCrmProcCodesHeaders{} + _result = &GetCrmProcCodesResponse{} + _body, _err := client.GetCrmProcCodesWithOptions(headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetCrmProcCodesWithOptions(headers *GetCrmProcCodesHeaders, runtime *util.RuntimeOptions) (_result *GetCrmProcCodesResponse, _err error) { + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + } + _result = &GetCrmProcCodesResponse{} + _body, _err := client.DoROARequest(tea.String("GetCrmProcCodes"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/crm/processes"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetManageProcessByStaffId(request *GetManageProcessByStaffIdRequest) (_result *GetManageProcessByStaffIdResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetManageProcessByStaffIdHeaders{} + _result = &GetManageProcessByStaffIdResponse{} + _body, _err := client.GetManageProcessByStaffIdWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetManageProcessByStaffIdWithOptions(request *GetManageProcessByStaffIdRequest, headers *GetManageProcessByStaffIdHeaders, runtime *util.RuntimeOptions) (_result *GetManageProcessByStaffIdResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.UserId)) { + query["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetManageProcessByStaffIdResponse{} + _body, _err := client.DoROARequest(tea.String("GetManageProcessByStaffId"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processes/managements/templates"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetProcessCodeByName(request *GetProcessCodeByNameRequest) (_result *GetProcessCodeByNameResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetProcessCodeByNameHeaders{} + _result = &GetProcessCodeByNameResponse{} + _body, _err := client.GetProcessCodeByNameWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetProcessCodeByNameWithOptions(request *GetProcessCodeByNameRequest, headers *GetProcessCodeByNameHeaders, runtime *util.RuntimeOptions) (_result *GetProcessCodeByNameResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.Name)) { + query["name"] = request.Name + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetProcessCodeByNameResponse{} + _body, _err := client.DoROARequest(tea.String("GetProcessCodeByName"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/schemaNames/processCodes"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetProcessConfig(request *GetProcessConfigRequest) (_result *GetProcessConfigResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetProcessConfigHeaders{} + _result = &GetProcessConfigResponse{} + _body, _err := client.GetProcessConfigWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetProcessConfigWithOptions(request *GetProcessConfigRequest, headers *GetProcessConfigHeaders, runtime *util.RuntimeOptions) (_result *GetProcessConfigResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ProcCode)) { + query["procCode"] = request.ProcCode + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetProcessConfigResponse{} + _body, _err := client.DoROARequest(tea.String("GetProcessConfig"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/crm/processes/configurations"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetProcessInstance(request *GetProcessInstanceRequest) (_result *GetProcessInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetProcessInstanceHeaders{} + _result = &GetProcessInstanceResponse{} + _body, _err := client.GetProcessInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetProcessInstanceWithOptions(request *GetProcessInstanceRequest, headers *GetProcessInstanceHeaders, runtime *util.RuntimeOptions) (_result *GetProcessInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + query["processInstanceId"] = request.ProcessInstanceId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetProcessInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("GetProcessInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetSpaceWithDownloadAuth(request *GetSpaceWithDownloadAuthRequest) (_result *GetSpaceWithDownloadAuthResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetSpaceWithDownloadAuthHeaders{} + _result = &GetSpaceWithDownloadAuthResponse{} + _body, _err := client.GetSpaceWithDownloadAuthWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetSpaceWithDownloadAuthWithOptions(request *GetSpaceWithDownloadAuthRequest, headers *GetSpaceWithDownloadAuthHeaders, runtime *util.RuntimeOptions) (_result *GetSpaceWithDownloadAuthResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AgentId)) { + body["agentId"] = request.AgentId + } + + if !tea.BoolValue(util.IsUnset(request.FileId)) { + body["fileId"] = request.FileId + } + + if !tea.BoolValue(util.IsUnset(request.FileIdList)) { + body["fileIdList"] = request.FileIdList + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + body["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &GetSpaceWithDownloadAuthResponse{} + _body, _err := client.DoROARequest(tea.String("GetSpaceWithDownloadAuth"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances/spaces/authPreview"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GetUserTodoTaskSum(request *GetUserTodoTaskSumRequest) (_result *GetUserTodoTaskSumResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GetUserTodoTaskSumHeaders{} + _result = &GetUserTodoTaskSumResponse{} + _body, _err := client.GetUserTodoTaskSumWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GetUserTodoTaskSumWithOptions(request *GetUserTodoTaskSumRequest, headers *GetUserTodoTaskSumHeaders, runtime *util.RuntimeOptions) (_result *GetUserTodoTaskSumResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.UserId)) { + query["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &GetUserTodoTaskSumResponse{} + _body, _err := client.DoROARequest(tea.String("GetUserTodoTaskSum"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processes/todoTasks/numbers"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GrantCspaceAuthorization(request *GrantCspaceAuthorizationRequest) (_result *GrantCspaceAuthorizationResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GrantCspaceAuthorizationHeaders{} + _result = &GrantCspaceAuthorizationResponse{} + _body, _err := client.GrantCspaceAuthorizationWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GrantCspaceAuthorizationWithOptions(request *GrantCspaceAuthorizationRequest, headers *GrantCspaceAuthorizationHeaders, runtime *util.RuntimeOptions) (_result *GrantCspaceAuthorizationResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.DurationSeconds)) { + body["durationSeconds"] = request.DurationSeconds + } + + if !tea.BoolValue(util.IsUnset(request.SpaceId)) { + body["spaceId"] = request.SpaceId + } + + if !tea.BoolValue(util.IsUnset(request.Type)) { + body["type"] = request.Type + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + body["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &GrantCspaceAuthorizationResponse{} + _body, _err := client.DoROARequest(tea.String("GrantCspaceAuthorization"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/spaces/authorize"), tea.String("none"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) GrantProcessInstanceForDownloadFile(request *GrantProcessInstanceForDownloadFileRequest) (_result *GrantProcessInstanceForDownloadFileResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &GrantProcessInstanceForDownloadFileHeaders{} + _result = &GrantProcessInstanceForDownloadFileResponse{} + _body, _err := client.GrantProcessInstanceForDownloadFileWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) GrantProcessInstanceForDownloadFileWithOptions(request *GrantProcessInstanceForDownloadFileRequest, headers *GrantProcessInstanceForDownloadFileHeaders, runtime *util.RuntimeOptions) (_result *GrantProcessInstanceForDownloadFileResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.FileId)) { + body["fileId"] = request.FileId + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &GrantProcessInstanceForDownloadFileResponse{} + _body, _err := client.DoROARequest(tea.String("GrantProcessInstanceForDownloadFile"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances/spaces/files/urls/download"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) InstallApp(request *InstallAppRequest) (_result *InstallAppResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &InstallAppHeaders{} + _result = &InstallAppResponse{} + _body, _err := client.InstallAppWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) InstallAppWithOptions(request *InstallAppRequest, headers *InstallAppHeaders, runtime *util.RuntimeOptions) (_result *InstallAppResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.BizGroup)) { + body["bizGroup"] = request.BizGroup + } + + if !tea.BoolValue(util.IsUnset(request.InstallOption)) { + body["installOption"] = request.InstallOption + } + + if !tea.BoolValue(util.IsUnset(request.SourceDirName)) { + body["sourceDirName"] = request.SourceDirName + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &InstallAppResponse{} + _body, _err := client.DoROARequest(tea.String("InstallApp"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processes/apps/install"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) ListProcessInstanceIds(request *ListProcessInstanceIdsRequest) (_result *ListProcessInstanceIdsResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &ListProcessInstanceIdsHeaders{} + _result = &ListProcessInstanceIdsResponse{} + _body, _err := client.ListProcessInstanceIdsWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) ListProcessInstanceIdsWithOptions(request *ListProcessInstanceIdsRequest, headers *ListProcessInstanceIdsHeaders, runtime *util.RuntimeOptions) (_result *ListProcessInstanceIdsResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.EndTime)) { + body["endTime"] = request.EndTime + } + + if !tea.BoolValue(util.IsUnset(request.MaxResults)) { + body["maxResults"] = request.MaxResults + } + + if !tea.BoolValue(util.IsUnset(request.NextToken)) { + body["nextToken"] = request.NextToken + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + body["processCode"] = request.ProcessCode + } + + if !tea.BoolValue(util.IsUnset(request.StartTime)) { + body["startTime"] = request.StartTime + } + + if !tea.BoolValue(util.IsUnset(request.UserIds)) { + body["userIds"] = request.UserIds + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &ListProcessInstanceIdsResponse{} + _body, _err := client.DoROARequest(tea.String("ListProcessInstanceIds"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processes/instanceIds/query"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) ListTodoWorkRecords(request *ListTodoWorkRecordsRequest) (_result *ListTodoWorkRecordsResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &ListTodoWorkRecordsHeaders{} + _result = &ListTodoWorkRecordsResponse{} + _body, _err := client.ListTodoWorkRecordsWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) ListTodoWorkRecordsWithOptions(request *ListTodoWorkRecordsRequest, headers *ListTodoWorkRecordsHeaders, runtime *util.RuntimeOptions) (_result *ListTodoWorkRecordsResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.MaxResults)) { + query["maxResults"] = request.MaxResults + } + + if !tea.BoolValue(util.IsUnset(request.NextToken)) { + query["nextToken"] = request.NextToken + } + + if !tea.BoolValue(util.IsUnset(request.Status)) { + query["status"] = request.Status + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + query["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &ListTodoWorkRecordsResponse{} + _body, _err := client.DoROARequest(tea.String("ListTodoWorkRecords"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/workRecords/todoTasks"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) ListUserVisibleBpmsProcesses(request *ListUserVisibleBpmsProcessesRequest) (_result *ListUserVisibleBpmsProcessesResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &ListUserVisibleBpmsProcessesHeaders{} + _result = &ListUserVisibleBpmsProcessesResponse{} + _body, _err := client.ListUserVisibleBpmsProcessesWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) ListUserVisibleBpmsProcessesWithOptions(request *ListUserVisibleBpmsProcessesRequest, headers *ListUserVisibleBpmsProcessesHeaders, runtime *util.RuntimeOptions) (_result *ListUserVisibleBpmsProcessesResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.MaxResults)) { + query["maxResults"] = request.MaxResults + } + + if !tea.BoolValue(util.IsUnset(request.NextToken)) { + query["nextToken"] = request.NextToken + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + query["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &ListUserVisibleBpmsProcessesResponse{} + _body, _err := client.DoROARequest(tea.String("ListUserVisibleBpmsProcesses"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processes/userVisibilities/templates"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) ProcessForecast(request *ProcessForecastRequest) (_result *ProcessForecastResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &ProcessForecastHeaders{} + _result = &ProcessForecastResponse{} + _body, _err := client.ProcessForecastWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) ProcessForecastWithOptions(request *ProcessForecastRequest, headers *ProcessForecastHeaders, runtime *util.RuntimeOptions) (_result *ProcessForecastResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.DeptId)) { + body["deptId"] = request.DeptId + } + + if !tea.BoolValue(util.IsUnset(request.FormComponentValues)) { + body["formComponentValues"] = request.FormComponentValues + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + body["processCode"] = request.ProcessCode + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + body["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &ProcessForecastResponse{} + _body, _err := client.DoROARequest(tea.String("ProcessForecast"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processes/forecast"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) QueryAllFormInstances(request *QueryAllFormInstancesRequest) (_result *QueryAllFormInstancesResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &QueryAllFormInstancesHeaders{} + _result = &QueryAllFormInstancesResponse{} + _body, _err := client.QueryAllFormInstancesWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) QueryAllFormInstancesWithOptions(request *QueryAllFormInstancesRequest, headers *QueryAllFormInstancesHeaders, runtime *util.RuntimeOptions) (_result *QueryAllFormInstancesResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AppUuid)) { + query["appUuid"] = request.AppUuid + } + + if !tea.BoolValue(util.IsUnset(request.FormCode)) { + query["formCode"] = request.FormCode + } + + if !tea.BoolValue(util.IsUnset(request.MaxResults)) { + query["maxResults"] = request.MaxResults + } + + if !tea.BoolValue(util.IsUnset(request.NextToken)) { + query["nextToken"] = request.NextToken + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &QueryAllFormInstancesResponse{} + _body, _err := client.DoROARequest(tea.String("QueryAllFormInstances"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/forms/pages/instances"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) QueryAllProcessInstances(request *QueryAllProcessInstancesRequest) (_result *QueryAllProcessInstancesResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &QueryAllProcessInstancesHeaders{} + _result = &QueryAllProcessInstancesResponse{} + _body, _err := client.QueryAllProcessInstancesWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) QueryAllProcessInstancesWithOptions(request *QueryAllProcessInstancesRequest, headers *QueryAllProcessInstancesHeaders, runtime *util.RuntimeOptions) (_result *QueryAllProcessInstancesResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AppUuid)) { + query["appUuid"] = request.AppUuid + } + + if !tea.BoolValue(util.IsUnset(request.EndTimeInMills)) { + query["endTimeInMills"] = request.EndTimeInMills + } + + if !tea.BoolValue(util.IsUnset(request.MaxResults)) { + query["maxResults"] = request.MaxResults + } + + if !tea.BoolValue(util.IsUnset(request.NextToken)) { + query["nextToken"] = request.NextToken + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + query["processCode"] = request.ProcessCode + } + + if !tea.BoolValue(util.IsUnset(request.StartTimeInMills)) { + query["startTimeInMills"] = request.StartTimeInMills + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &QueryAllProcessInstancesResponse{} + _body, _err := client.DoROARequest(tea.String("QueryAllProcessInstances"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processes/pages/instances"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) QueryFormByBizType(request *QueryFormByBizTypeRequest) (_result *QueryFormByBizTypeResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &QueryFormByBizTypeHeaders{} + _result = &QueryFormByBizTypeResponse{} + _body, _err := client.QueryFormByBizTypeWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) QueryFormByBizTypeWithOptions(request *QueryFormByBizTypeRequest, headers *QueryFormByBizTypeHeaders, runtime *util.RuntimeOptions) (_result *QueryFormByBizTypeResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AppUuid)) { + body["appUuid"] = request.AppUuid + } + + if !tea.BoolValue(util.IsUnset(request.BizTypes)) { + body["bizTypes"] = request.BizTypes + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &QueryFormByBizTypeResponse{} + _body, _err := client.DoROARequest(tea.String("QueryFormByBizType"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/forms/forminfos/query"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) QueryFormInstance(request *QueryFormInstanceRequest) (_result *QueryFormInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &QueryFormInstanceHeaders{} + _result = &QueryFormInstanceResponse{} + _body, _err := client.QueryFormInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) QueryFormInstanceWithOptions(request *QueryFormInstanceRequest, headers *QueryFormInstanceHeaders, runtime *util.RuntimeOptions) (_result *QueryFormInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AppUuid)) { + query["appUuid"] = request.AppUuid + } + + if !tea.BoolValue(util.IsUnset(request.FormCode)) { + query["formCode"] = request.FormCode + } + + if !tea.BoolValue(util.IsUnset(request.FormInstanceId)) { + query["formInstanceId"] = request.FormInstanceId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &QueryFormInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("QueryFormInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/forms/instances"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) QueryIntegratedTodoTask(request *QueryIntegratedTodoTaskRequest) (_result *QueryIntegratedTodoTaskResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &QueryIntegratedTodoTaskHeaders{} + _result = &QueryIntegratedTodoTaskResponse{} + _body, _err := client.QueryIntegratedTodoTaskWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) QueryIntegratedTodoTaskWithOptions(request *QueryIntegratedTodoTaskRequest, headers *QueryIntegratedTodoTaskHeaders, runtime *util.RuntimeOptions) (_result *QueryIntegratedTodoTaskResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.CreateBefore)) { + query["createBefore"] = request.CreateBefore + } + + if !tea.BoolValue(util.IsUnset(request.PageNumber)) { + query["pageNumber"] = request.PageNumber + } + + if !tea.BoolValue(util.IsUnset(request.PageSize)) { + query["pageSize"] = request.PageSize + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + query["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &QueryIntegratedTodoTaskResponse{} + _body, _err := client.DoROARequest(tea.String("QueryIntegratedTodoTask"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/todoTasks"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) QueryProcessByBizCategoryId(request *QueryProcessByBizCategoryIdRequest) (_result *QueryProcessByBizCategoryIdResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &QueryProcessByBizCategoryIdHeaders{} + _result = &QueryProcessByBizCategoryIdResponse{} + _body, _err := client.QueryProcessByBizCategoryIdWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) QueryProcessByBizCategoryIdWithOptions(request *QueryProcessByBizCategoryIdRequest, headers *QueryProcessByBizCategoryIdHeaders, runtime *util.RuntimeOptions) (_result *QueryProcessByBizCategoryIdResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.BizType)) { + query["bizType"] = request.BizType + } + + if !tea.BoolValue(util.IsUnset(request.UserId)) { + query["userId"] = request.UserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &QueryProcessByBizCategoryIdResponse{} + _body, _err := client.DoROARequest(tea.String("QueryProcessByBizCategoryId"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/processes/categories/templates"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) QuerySchemaByProcessCode(request *QuerySchemaByProcessCodeRequest) (_result *QuerySchemaByProcessCodeResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &QuerySchemaByProcessCodeHeaders{} + _result = &QuerySchemaByProcessCodeResponse{} + _body, _err := client.QuerySchemaByProcessCodeWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) QuerySchemaByProcessCodeWithOptions(request *QuerySchemaByProcessCodeRequest, headers *QuerySchemaByProcessCodeHeaders, runtime *util.RuntimeOptions) (_result *QuerySchemaByProcessCodeResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + query := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.AppUuid)) { + query["appUuid"] = request.AppUuid + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + query["processCode"] = request.ProcessCode + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Query: openapiutil.Query(query), + } + _result = &QuerySchemaByProcessCodeResponse{} + _body, _err := client.DoROARequest(tea.String("QuerySchemaByProcessCode"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("GET"), tea.String("AK"), tea.String("/v1.0/workflow/forms/schemas/processCodes"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) RedirectWorkflowTask(request *RedirectWorkflowTaskRequest) (_result *RedirectWorkflowTaskResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &RedirectWorkflowTaskHeaders{} + _result = &RedirectWorkflowTaskResponse{} + _body, _err := client.RedirectWorkflowTaskWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) RedirectWorkflowTaskWithOptions(request *RedirectWorkflowTaskRequest, headers *RedirectWorkflowTaskHeaders, runtime *util.RuntimeOptions) (_result *RedirectWorkflowTaskResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ActionName)) { + body["actionName"] = request.ActionName + } + + if !tea.BoolValue(util.IsUnset(request.OperateUserId)) { + body["operateUserId"] = request.OperateUserId + } + + if !tea.BoolValue(util.IsUnset(request.Remark)) { + body["remark"] = request.Remark + } + + if !tea.BoolValue(util.IsUnset(request.TaskId)) { + body["taskId"] = request.TaskId + } + + if !tea.BoolValue(util.IsUnset(request.ToUserId)) { + body["toUserId"] = request.ToUserId + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &RedirectWorkflowTaskResponse{} + _body, _err := client.DoROARequest(tea.String("RedirectWorkflowTask"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/tasks/redirect"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) SaveIntegratedInstance(request *SaveIntegratedInstanceRequest) (_result *SaveIntegratedInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &SaveIntegratedInstanceHeaders{} + _result = &SaveIntegratedInstanceResponse{} + _body, _err := client.SaveIntegratedInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) SaveIntegratedInstanceWithOptions(request *SaveIntegratedInstanceRequest, headers *SaveIntegratedInstanceHeaders, runtime *util.RuntimeOptions) (_result *SaveIntegratedInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.FormComponentValueList)) { + body["formComponentValueList"] = request.FormComponentValueList + } + + if !tea.BoolValue(util.IsUnset(request.Notifiers)) { + body["notifiers"] = request.Notifiers + } + + if !tea.BoolValue(util.IsUnset(request.OriginatorUserId)) { + body["originatorUserId"] = request.OriginatorUserId + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + body["processCode"] = request.ProcessCode + } + + if !tea.BoolValue(util.IsUnset(request.Title)) { + body["title"] = request.Title + } + + if !tea.BoolValue(util.IsUnset(request.Url)) { + body["url"] = request.Url + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &SaveIntegratedInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("SaveIntegratedInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/instances"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) SaveProcess(request *SaveProcessRequest) (_result *SaveProcessResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &SaveProcessHeaders{} + _result = &SaveProcessResponse{} + _body, _err := client.SaveProcessWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) SaveProcessWithOptions(request *SaveProcessRequest, headers *SaveProcessHeaders, runtime *util.RuntimeOptions) (_result *SaveProcessResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.Description)) { + body["description"] = request.Description + } + + if !tea.BoolValue(util.IsUnset(request.FormComponents)) { + body["formComponents"] = request.FormComponents + } + + if !tea.BoolValue(util.IsUnset(request.Name)) { + body["name"] = request.Name + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + body["processCode"] = request.ProcessCode + } + + if !tea.BoolValue(util.IsUnset(request.ProcessFeatureConfig)) { + body["processFeatureConfig"] = request.ProcessFeatureConfig + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &SaveProcessResponse{} + _body, _err := client.DoROARequest(tea.String("SaveProcess"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/schemas"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) StartProcessInstance(request *StartProcessInstanceRequest) (_result *StartProcessInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &StartProcessInstanceHeaders{} + _result = &StartProcessInstanceResponse{} + _body, _err := client.StartProcessInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) StartProcessInstanceWithOptions(request *StartProcessInstanceRequest, headers *StartProcessInstanceHeaders, runtime *util.RuntimeOptions) (_result *StartProcessInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.Approvers)) { + body["approvers"] = request.Approvers + } + + if !tea.BoolValue(util.IsUnset(request.CcList)) { + body["ccList"] = request.CcList + } + + if !tea.BoolValue(util.IsUnset(request.CcPosition)) { + body["ccPosition"] = request.CcPosition + } + + if !tea.BoolValue(util.IsUnset(request.DeptId)) { + body["deptId"] = request.DeptId + } + + if !tea.BoolValue(util.IsUnset(request.FormComponentValues)) { + body["formComponentValues"] = request.FormComponentValues + } + + if !tea.BoolValue(util.IsUnset(request.MicroappAgentId)) { + body["microappAgentId"] = request.MicroappAgentId + } + + if !tea.BoolValue(util.IsUnset(request.OriginatorUserId)) { + body["originatorUserId"] = request.OriginatorUserId + } + + if !tea.BoolValue(util.IsUnset(request.ProcessCode)) { + body["processCode"] = request.ProcessCode + } + + if !tea.BoolValue(util.IsUnset(request.TargetSelectActioners)) { + body["targetSelectActioners"] = request.TargetSelectActioners + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &StartProcessInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("StartProcessInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) TerminateProcessInstance(request *TerminateProcessInstanceRequest) (_result *TerminateProcessInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &TerminateProcessInstanceHeaders{} + _result = &TerminateProcessInstanceResponse{} + _body, _err := client.TerminateProcessInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) TerminateProcessInstanceWithOptions(request *TerminateProcessInstanceRequest, headers *TerminateProcessInstanceHeaders, runtime *util.RuntimeOptions) (_result *TerminateProcessInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.IsSystem)) { + body["isSystem"] = request.IsSystem + } + + if !tea.BoolValue(util.IsUnset(request.OperatingUserId)) { + body["operatingUserId"] = request.OperatingUserId + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + if !tea.BoolValue(util.IsUnset(request.Remark)) { + body["remark"] = request.Remark + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &TerminateProcessInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("TerminateProcessInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("POST"), tea.String("AK"), tea.String("/v1.0/workflow/processInstances/terminate"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) UpdateIntegratedTask(request *UpdateIntegratedTaskRequest) (_result *UpdateIntegratedTaskResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &UpdateIntegratedTaskHeaders{} + _result = &UpdateIntegratedTaskResponse{} + _body, _err := client.UpdateIntegratedTaskWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) UpdateIntegratedTaskWithOptions(request *UpdateIntegratedTaskRequest, headers *UpdateIntegratedTaskHeaders, runtime *util.RuntimeOptions) (_result *UpdateIntegratedTaskResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + if !tea.BoolValue(util.IsUnset(request.Tasks)) { + body["tasks"] = request.Tasks + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &UpdateIntegratedTaskResponse{} + _body, _err := client.DoROARequest(tea.String("UpdateIntegratedTask"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("PUT"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/tasks"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} + +func (client *Client) UpdateProcessInstance(request *UpdateProcessInstanceRequest) (_result *UpdateProcessInstanceResponse, _err error) { + runtime := &util.RuntimeOptions{} + headers := &UpdateProcessInstanceHeaders{} + _result = &UpdateProcessInstanceResponse{} + _body, _err := client.UpdateProcessInstanceWithOptions(request, headers, runtime) + if _err != nil { + return _result, _err + } + _result = _body + return _result, _err +} + +func (client *Client) UpdateProcessInstanceWithOptions(request *UpdateProcessInstanceRequest, headers *UpdateProcessInstanceHeaders, runtime *util.RuntimeOptions) (_result *UpdateProcessInstanceResponse, _err error) { + _err = util.ValidateModel(request) + if _err != nil { + return _result, _err + } + body := map[string]interface{}{} + if !tea.BoolValue(util.IsUnset(request.Notifiers)) { + body["notifiers"] = request.Notifiers + } + + if !tea.BoolValue(util.IsUnset(request.ProcessInstanceId)) { + body["processInstanceId"] = request.ProcessInstanceId + } + + if !tea.BoolValue(util.IsUnset(request.Result)) { + body["result"] = request.Result + } + + if !tea.BoolValue(util.IsUnset(request.Status)) { + body["status"] = request.Status + } + + realHeaders := make(map[string]*string) + if !tea.BoolValue(util.IsUnset(headers.CommonHeaders)) { + realHeaders = headers.CommonHeaders + } + + if !tea.BoolValue(util.IsUnset(headers.XAcsDingtalkAccessToken)) { + realHeaders["x-acs-dingtalk-access-token"] = util.ToJSONString(headers.XAcsDingtalkAccessToken) + } + + req := &openapi.OpenApiRequest{ + Headers: realHeaders, + Body: openapiutil.ParseToMap(body), + } + _result = &UpdateProcessInstanceResponse{} + _body, _err := client.DoROARequest(tea.String("UpdateProcessInstance"), tea.String("workflow_1.0"), tea.String("HTTP"), tea.String("PUT"), tea.String("AK"), tea.String("/v1.0/workflow/processCentres/instances"), tea.String("json"), req, runtime) + if _err != nil { + return _result, _err + } + _err = tea.Convert(_body, &_result) + return _result, _err +} diff --git a/vendor/github.com/alibabacloud-go/tea-utils/v2/LICENSE b/vendor/github.com/alibabacloud-go/tea-utils/v2/LICENSE new file mode 100644 index 0000000000..0c44dcefe3 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/tea-utils/v2/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2009-present, Alibaba Cloud All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/alibabacloud-go/tea-utils/v2/service/service.go b/vendor/github.com/alibabacloud-go/tea-utils/v2/service/service.go new file mode 100644 index 0000000000..1362cbd2e6 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/tea-utils/v2/service/service.go @@ -0,0 +1,487 @@ +package service + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "reflect" + "runtime" + "strconv" + "strings" + "time" + + "github.com/alibabacloud-go/tea/tea" +) + +var defaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s TeaDSL/1", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), "0.01") + +type RuntimeOptions struct { + Autoretry *bool `json:"autoretry" xml:"autoretry"` + IgnoreSSL *bool `json:"ignoreSSL" xml:"ignoreSSL"` + Key *string `json:"key,omitempty" xml:"key,omitempty"` + Cert *string `json:"cert,omitempty" xml:"cert,omitempty"` + Ca *string `json:"ca,omitempty" xml:"ca,omitempty"` + MaxAttempts *int `json:"maxAttempts" xml:"maxAttempts"` + BackoffPolicy *string `json:"backoffPolicy" xml:"backoffPolicy"` + BackoffPeriod *int `json:"backoffPeriod" xml:"backoffPeriod"` + ReadTimeout *int `json:"readTimeout" xml:"readTimeout"` + ConnectTimeout *int `json:"connectTimeout" xml:"connectTimeout"` + LocalAddr *string `json:"localAddr" xml:"localAddr"` + HttpProxy *string `json:"httpProxy" xml:"httpProxy"` + HttpsProxy *string `json:"httpsProxy" xml:"httpsProxy"` + NoProxy *string `json:"noProxy" xml:"noProxy"` + MaxIdleConns *int `json:"maxIdleConns" xml:"maxIdleConns"` + Socks5Proxy *string `json:"socks5Proxy" xml:"socks5Proxy"` + Socks5NetWork *string `json:"socks5NetWork" xml:"socks5NetWork"` + KeepAlive *bool `json:"keepAlive" xml:"keepAlive"` +} + +func (s RuntimeOptions) String() string { + return tea.Prettify(s) +} + +func (s RuntimeOptions) GoString() string { + return s.String() +} + +func (s *RuntimeOptions) SetAutoretry(v bool) *RuntimeOptions { + s.Autoretry = &v + return s +} + +func (s *RuntimeOptions) SetIgnoreSSL(v bool) *RuntimeOptions { + s.IgnoreSSL = &v + return s +} + +func (s *RuntimeOptions) SetKey(v string) *RuntimeOptions { + s.Key = &v + return s +} + +func (s *RuntimeOptions) SetCert(v string) *RuntimeOptions { + s.Cert = &v + return s +} + +func (s *RuntimeOptions) SetCa(v string) *RuntimeOptions { + s.Ca = &v + return s +} + +func (s *RuntimeOptions) SetMaxAttempts(v int) *RuntimeOptions { + s.MaxAttempts = &v + return s +} + +func (s *RuntimeOptions) SetBackoffPolicy(v string) *RuntimeOptions { + s.BackoffPolicy = &v + return s +} + +func (s *RuntimeOptions) SetBackoffPeriod(v int) *RuntimeOptions { + s.BackoffPeriod = &v + return s +} + +func (s *RuntimeOptions) SetReadTimeout(v int) *RuntimeOptions { + s.ReadTimeout = &v + return s +} + +func (s *RuntimeOptions) SetConnectTimeout(v int) *RuntimeOptions { + s.ConnectTimeout = &v + return s +} + +func (s *RuntimeOptions) SetHttpProxy(v string) *RuntimeOptions { + s.HttpProxy = &v + return s +} + +func (s *RuntimeOptions) SetHttpsProxy(v string) *RuntimeOptions { + s.HttpsProxy = &v + return s +} + +func (s *RuntimeOptions) SetNoProxy(v string) *RuntimeOptions { + s.NoProxy = &v + return s +} + +func (s *RuntimeOptions) SetMaxIdleConns(v int) *RuntimeOptions { + s.MaxIdleConns = &v + return s +} + +func (s *RuntimeOptions) SetLocalAddr(v string) *RuntimeOptions { + s.LocalAddr = &v + return s +} + +func (s *RuntimeOptions) SetSocks5Proxy(v string) *RuntimeOptions { + s.Socks5Proxy = &v + return s +} + +func (s *RuntimeOptions) SetSocks5NetWork(v string) *RuntimeOptions { + s.Socks5NetWork = &v + return s +} + +func (s *RuntimeOptions) SetKeepAlive(v bool) *RuntimeOptions { + s.KeepAlive = &v + return s +} + +func ReadAsString(body io.Reader) (*string, error) { + byt, err := ioutil.ReadAll(body) + if err != nil { + return tea.String(""), err + } + r, ok := body.(io.ReadCloser) + if ok { + r.Close() + } + return tea.String(string(byt)), nil +} + +func StringifyMapValue(a map[string]interface{}) map[string]*string { + res := make(map[string]*string) + for key, value := range a { + if value != nil { + switch value.(type) { + case string: + res[key] = tea.String(value.(string)) + default: + byt, _ := json.Marshal(value) + res[key] = tea.String(string(byt)) + } + } + } + return res +} + +func AnyifyMapValue(a map[string]*string) map[string]interface{} { + res := make(map[string]interface{}) + for key, value := range a { + res[key] = tea.StringValue(value) + } + return res +} + +func ReadAsBytes(body io.Reader) ([]byte, error) { + byt, err := ioutil.ReadAll(body) + if err != nil { + return nil, err + } + r, ok := body.(io.ReadCloser) + if ok { + r.Close() + } + return byt, nil +} + +func DefaultString(reaStr, defaultStr *string) *string { + if reaStr == nil { + return defaultStr + } + return reaStr +} + +func ToJSONString(a interface{}) *string { + switch v := a.(type) { + case *string: + return v + case string: + return tea.String(v) + case []byte: + return tea.String(string(v)) + case io.Reader: + byt, err := ioutil.ReadAll(v) + if err != nil { + return nil + } + return tea.String(string(byt)) + } + byt, err := json.Marshal(a) + if err != nil { + return nil + } + return tea.String(string(byt)) +} + +func DefaultNumber(reaNum, defaultNum *int) *int { + if reaNum == nil { + return defaultNum + } + return reaNum +} + +func ReadAsJSON(body io.Reader) (result interface{}, err error) { + byt, err := ioutil.ReadAll(body) + if err != nil { + return + } + if string(byt) == "" { + return + } + r, ok := body.(io.ReadCloser) + if ok { + r.Close() + } + d := json.NewDecoder(bytes.NewReader(byt)) + d.UseNumber() + err = d.Decode(&result) + return +} + +func GetNonce() *string { + return tea.String(getUUID()) +} + +func Empty(val *string) *bool { + return tea.Bool(val == nil || tea.StringValue(val) == "") +} + +func ValidateModel(a interface{}) error { + if a == nil { + return nil + } + err := tea.Validate(a) + return err +} + +func EqualString(val1, val2 *string) *bool { + return tea.Bool(tea.StringValue(val1) == tea.StringValue(val2)) +} + +func EqualNumber(val1, val2 *int) *bool { + return tea.Bool(tea.IntValue(val1) == tea.IntValue(val2)) +} + +func IsUnset(val interface{}) *bool { + if val == nil { + return tea.Bool(true) + } + + v := reflect.ValueOf(val) + if v.Kind() == reflect.Ptr || v.Kind() == reflect.Slice || v.Kind() == reflect.Map { + return tea.Bool(v.IsNil()) + } + + valType := reflect.TypeOf(val) + valZero := reflect.Zero(valType) + return tea.Bool(valZero == v) +} + +func ToBytes(a *string) []byte { + return []byte(tea.StringValue(a)) +} + +func AssertAsMap(a interface{}) (_result map[string]interface{}, _err error) { + r := reflect.ValueOf(a) + if r.Kind().String() != "map" { + return nil, errors.New(fmt.Sprintf("%v is not a map[string]interface{}", a)) + } + + res := make(map[string]interface{}) + tmp := r.MapKeys() + for _, key := range tmp { + res[key.String()] = r.MapIndex(key).Interface() + } + + return res, nil +} + +func AssertAsNumber(a interface{}) (_result *int, _err error) { + res := 0 + switch a.(type) { + case int: + tmp := a.(int) + res = tmp + case *int: + tmp := a.(*int) + res = tea.IntValue(tmp) + default: + return nil, errors.New(fmt.Sprintf("%v is not a int", a)) + } + + return tea.Int(res), nil +} + +func AssertAsBoolean(a interface{}) (_result *bool, _err error) { + res := false + switch a.(type) { + case bool: + tmp := a.(bool) + res = tmp + case *bool: + tmp := a.(*bool) + res = tea.BoolValue(tmp) + default: + return nil, errors.New(fmt.Sprintf("%v is not a bool", a)) + } + + return tea.Bool(res), nil +} + +func AssertAsString(a interface{}) (_result *string, _err error) { + res := "" + switch a.(type) { + case string: + tmp := a.(string) + res = tmp + case *string: + tmp := a.(*string) + res = tea.StringValue(tmp) + default: + return nil, errors.New(fmt.Sprintf("%v is not a string", a)) + } + + return tea.String(res), nil +} + +func AssertAsBytes(a interface{}) (_result []byte, _err error) { + res, ok := a.([]byte) + if !ok { + return nil, errors.New(fmt.Sprintf("%v is not a []byte", a)) + } + return res, nil +} + +func AssertAsReadable(a interface{}) (_result io.Reader, _err error) { + res, ok := a.(io.Reader) + if !ok { + return nil, errors.New(fmt.Sprintf("%v is not a reader", a)) + } + return res, nil +} + +func AssertAsArray(a interface{}) (_result []interface{}, _err error) { + r := reflect.ValueOf(a) + if r.Kind().String() != "array" && r.Kind().String() != "slice" { + return nil, errors.New(fmt.Sprintf("%v is not a []interface{}", a)) + } + aLen := r.Len() + res := make([]interface{}, 0) + for i := 0; i < aLen; i++ { + res = append(res, r.Index(i).Interface()) + } + return res, nil +} + +func ParseJSON(a *string) interface{} { + mapTmp := make(map[string]interface{}) + d := json.NewDecoder(bytes.NewReader([]byte(tea.StringValue(a)))) + d.UseNumber() + err := d.Decode(&mapTmp) + if err == nil { + return mapTmp + } + + sliceTmp := make([]interface{}, 0) + d = json.NewDecoder(bytes.NewReader([]byte(tea.StringValue(a)))) + d.UseNumber() + err = d.Decode(&sliceTmp) + if err == nil { + return sliceTmp + } + + if num, err := strconv.Atoi(tea.StringValue(a)); err == nil { + return num + } + + if ok, err := strconv.ParseBool(tea.StringValue(a)); err == nil { + return ok + } + + if floa64tVal, err := strconv.ParseFloat(tea.StringValue(a), 64); err == nil { + return floa64tVal + } + return nil +} + +func ToString(a []byte) *string { + return tea.String(string(a)) +} + +func ToMap(in interface{}) map[string]interface{} { + if in == nil { + return nil + } + res := tea.ToMap(in) + return res +} + +func ToFormString(a map[string]interface{}) *string { + if a == nil { + return tea.String("") + } + res := "" + urlEncoder := url.Values{} + for key, value := range a { + v := fmt.Sprintf("%v", value) + urlEncoder.Add(key, v) + } + res = urlEncoder.Encode() + return tea.String(res) +} + +func GetDateUTCString() *string { + return tea.String(time.Now().UTC().Format(http.TimeFormat)) +} + +func GetUserAgent(userAgent *string) *string { + if userAgent != nil && tea.StringValue(userAgent) != "" { + return tea.String(defaultUserAgent + " " + tea.StringValue(userAgent)) + } + return tea.String(defaultUserAgent) +} + +func Is2xx(code *int) *bool { + tmp := tea.IntValue(code) + return tea.Bool(tmp >= 200 && tmp < 300) +} + +func Is3xx(code *int) *bool { + tmp := tea.IntValue(code) + return tea.Bool(tmp >= 300 && tmp < 400) +} + +func Is4xx(code *int) *bool { + tmp := tea.IntValue(code) + return tea.Bool(tmp >= 400 && tmp < 500) +} + +func Is5xx(code *int) *bool { + tmp := tea.IntValue(code) + return tea.Bool(tmp >= 500 && tmp < 600) +} + +func Sleep(millisecond *int) error { + ms := tea.IntValue(millisecond) + time.Sleep(time.Duration(ms) * time.Millisecond) + return nil +} + +func ToArray(in interface{}) []map[string]interface{} { + if tea.BoolValue(IsUnset(in)) { + return nil + } + + tmp := make([]map[string]interface{}, 0) + byt, _ := json.Marshal(in) + d := json.NewDecoder(bytes.NewReader(byt)) + d.UseNumber() + err := d.Decode(&tmp) + if err != nil { + return nil + } + return tmp +} diff --git a/vendor/github.com/alibabacloud-go/tea-utils/v2/service/util.go b/vendor/github.com/alibabacloud-go/tea-utils/v2/service/util.go new file mode 100644 index 0000000000..a73cb56008 --- /dev/null +++ b/vendor/github.com/alibabacloud-go/tea-utils/v2/service/util.go @@ -0,0 +1,52 @@ +package service + +import ( + "crypto/md5" + "crypto/rand" + "encoding/hex" + "hash" + rand2 "math/rand" +) + +type UUID [16]byte + +const numBytes = "1234567890" + +func getUUID() (uuidHex string) { + uuid := newUUID() + uuidHex = hex.EncodeToString(uuid[:]) + return +} + +func randStringBytes(n int) string { + b := make([]byte, n) + for i := range b { + b[i] = numBytes[rand2.Intn(len(numBytes))] + } + return string(b) +} + +func newUUID() UUID { + ns := UUID{} + safeRandom(ns[:]) + u := newFromHash(md5.New(), ns, randStringBytes(16)) + u[6] = (u[6] & 0x0f) | (byte(2) << 4) + u[8] = (u[8]&(0xff>>2) | (0x02 << 6)) + + return u +} + +func newFromHash(h hash.Hash, ns UUID, name string) UUID { + u := UUID{} + h.Write(ns[:]) + h.Write([]byte(name)) + copy(u[:], h.Sum(nil)) + + return u +} + +func safeRandom(dest []byte) { + if _, err := rand.Read(dest); err != nil { + panic(err) + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 642ff81f51..9c76400637 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -51,11 +51,18 @@ github.com/alibabacloud-go/alibabacloud-gateway-spi/client # github.com/alibabacloud-go/darabonba-openapi v0.1.18 ## explicit github.com/alibabacloud-go/darabonba-openapi/client +# github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2 +## explicit +github.com/alibabacloud-go/darabonba-openapi/v2/client # github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 github.com/alibabacloud-go/debug/debug +# github.com/alibabacloud-go/dingtalk v1.4.88 +## explicit +github.com/alibabacloud-go/dingtalk/oauth2_1_0 +github.com/alibabacloud-go/dingtalk/workflow_1_0 # github.com/alibabacloud-go/endpoint-util v1.1.0 github.com/alibabacloud-go/endpoint-util/service -# github.com/alibabacloud-go/openapi-util v0.0.11 +# github.com/alibabacloud-go/openapi-util v0.1.0 github.com/alibabacloud-go/openapi-util/service # github.com/alibabacloud-go/rds-20140815/v2 v2.1.0 ## explicit @@ -67,6 +74,9 @@ github.com/alibabacloud-go/tea/utils # github.com/alibabacloud-go/tea-utils v1.4.3 ## explicit github.com/alibabacloud-go/tea-utils/service +# github.com/alibabacloud-go/tea-utils/v2 v2.0.1 +## explicit +github.com/alibabacloud-go/tea-utils/v2/service # github.com/alibabacloud-go/tea-xml v1.1.2 github.com/alibabacloud-go/tea-xml/service # github.com/aliyun/credentials-go v1.1.2 From 7c1a8f75b62226f00f9352ce43cba21bce3d0947 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 15 Dec 2022 16:20:13 +0800 Subject: [PATCH 02/19] user api interface api : add phone field --- sqle/api/controller/v1/user.go | 11 +++++++++++ sqle/model/user.go | 1 + sqle/model/user_list.go | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sqle/api/controller/v1/user.go b/sqle/api/controller/v1/user.go index fdf306fa80..529e1cbd46 100644 --- a/sqle/api/controller/v1/user.go +++ b/sqle/api/controller/v1/user.go @@ -62,6 +62,7 @@ func CreateUser(c echo.Context) error { Name: req.Name, Password: req.Password, Email: req.Email, + Phone: req.Phone, WeChatID: req.WeChatID, } @@ -109,6 +110,11 @@ func UpdateUser(c echo.Context) error { user.Email = *req.Email } + // Phone + if req.Phone != nil { + user.Phone = *req.Phone + } + // WeChatID if req.WeChatID != nil { user.WeChatID = *req.WeChatID @@ -279,6 +285,7 @@ func convertUserToRes(user *model.User, managementPermissionCodes []uint, projec } userResp := UserDetailResV1{ Name: user.Name, + Phone: user.Phone, Email: user.Email, WeChatID: user.WeChatID, LoginType: string(user.UserAuthenticationType), @@ -405,6 +412,9 @@ func UpdateCurrentUser(c echo.Context) error { if req.WeChatID != nil { user.WeChatID = *req.WeChatID } + if req.Phone != nil { + user.Phone = *req.Phone + } err = s.Save(user) if err != nil { return controller.JSONBaseErrorReq(c, err) @@ -526,6 +536,7 @@ func GetUsers(c echo.Context) error { userReq := UserResV1{ Name: user.Name, Email: user.Email, + Phone: user.Phone.String, WeChatID: user.WeChatID.String, LoginType: user.LoginType, IsDisabled: user.IsDisabled(), diff --git a/sqle/model/user.go b/sqle/model/user.go index 43f29826c3..a4c4e0155c 100644 --- a/sqle/model/user.go +++ b/sqle/model/user.go @@ -33,6 +33,7 @@ type User struct { // has created composite index: [id, login_name] by gorm#AddIndex Name string `gorm:"index;column:login_name"` Email string + Phone string `json:"phone" gorm:"column:phone"` WeChatID string `json:"wechat_id" gorm:"column:wechat_id"` Password string `json:"-" gorm:"-"` SecretPassword string `json:"secret_password" gorm:"not null;column:password"` diff --git a/sqle/model/user_list.go b/sqle/model/user_list.go index b346d0a335..db28e7e8db 100644 --- a/sqle/model/user_list.go +++ b/sqle/model/user_list.go @@ -6,6 +6,7 @@ type UserDetail struct { Id int Name string `json:"login_name"` Email string + Phone sql.NullString `json:"phone"` WeChatID sql.NullString `json:"wechat_id"` LoginType string `json:"user_authentication_type"` Stat int `json:"stat"` @@ -18,7 +19,7 @@ func (u *UserDetail) IsDisabled() bool { } var usersQueryTpl = `SELECT -users.id, users.login_name, users.email, users.wechat_id, +users.id, users.login_name, users.email, users.phone, users.wechat_id, users.user_authentication_type, users.stat, GROUP_CONCAT(DISTINCT COALESCE(user_groups.name,'')) AS user_group_names FROM users From 5f64684dde85f76ce711c1c9a3838ec13030afd3 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Wed, 21 Dec 2022 19:24:07 +0800 Subject: [PATCH 03/19] get and update dingTalk interface --- sqle/api/app.go | 2 + sqle/api/controller/v1/configuration.go | 54 ++++++++++++++++++++++++- sqle/model/configuration.go | 27 +++++++++++++ sqle/model/utils.go | 1 + 4 files changed, 82 insertions(+), 2 deletions(-) diff --git a/sqle/api/app.go b/sqle/api/app.go index 1d8620fabb..cd8f185f97 100644 --- a/sqle/api/app.go +++ b/sqle/api/app.go @@ -116,6 +116,8 @@ func StartApi(net *gracenet.Net, exitChan chan struct{}, config config.SqleConfi v1Router.GET("/configurations/wechat", v1.GetWeChatConfiguration, AdminUserAllowed()) v1Router.PATCH("/configurations/wechat", v1.UpdateWeChatConfigurationV1, AdminUserAllowed()) v1Router.POST("/configurations/wechat/test", v1.TestWeChatConfigurationV1, AdminUserAllowed()) + v1Router.GET("/configurations/ding_talk", v1.GetDingTalkConfigurationV1, AdminUserAllowed()) + v1Router.PATCH("/configurations/ding_talk", v1.UpdateDingTalkConfigurationV1, AdminUserAllowed()) v1Router.GET("/configurations/system_variables", v1.GetSystemVariables, AdminUserAllowed()) v1Router.PATCH("/configurations/system_variables", v1.UpdateSystemVariables, AdminUserAllowed()) v1Router.GET("/configurations/license", v1.GetLicense, AdminUserAllowed()) diff --git a/sqle/api/controller/v1/configuration.go b/sqle/api/controller/v1/configuration.go index 347080b878..9b8a5ab63c 100644 --- a/sqle/api/controller/v1/configuration.go +++ b/sqle/api/controller/v1/configuration.go @@ -4,6 +4,8 @@ import ( "fmt" "net/http" + "github.com/actiontech/sqle/sqle/pkg/im" + "github.com/actiontech/sqle/sqle/api/cloudbeaver_wrapper/service" "github.com/actiontech/sqle/sqle/api/controller" "github.com/actiontech/sqle/sqle/config" @@ -224,7 +226,26 @@ type DingTalkConfigurationV1 struct { // @Success 200 {object} v1.GetDingTalkConfigurationResV1 // @router /v1/configurations/ding_talk [get] func GetDingTalkConfigurationV1(c echo.Context) error { - return nil + s := model.GetStorage() + dingTalk, exist, err := s.GetImConfigByType(model.ImTypeDingTalk) + if err != nil { + return controller.JSONBaseErrorReq(c, err) + } + if !exist { + return c.JSON(http.StatusOK, &GetDingTalkConfigurationResV1{ + BaseRes: controller.NewBaseReq(nil), + Data: DingTalkConfigurationV1{}, + }) + } + + return c.JSON(http.StatusOK, &GetDingTalkConfigurationResV1{ + BaseRes: controller.NewBaseReq(nil), + Data: DingTalkConfigurationV1{ + AppKey: dingTalk.AppKey, + AppSecret: dingTalk.AppSecret, + IsEnableDingTalkNotify: dingTalk.IsEnable, + }, + }) } type UpdateDingTalkConfigurationReqV1 struct { @@ -244,7 +265,36 @@ type UpdateDingTalkConfigurationReqV1 struct { // @Success 200 {object} controller.BaseRes // @router /v1/configurations/ding_talk [patch] func UpdateDingTalkConfigurationV1(c echo.Context) error { - return nil + req := new(UpdateDingTalkConfigurationReqV1) + if err := controller.BindAndValidateReq(c, req); err != nil { + return controller.JSONBaseErrorReq(c, err) + } + + s := model.GetStorage() + dingTalk, _, err := s.GetImConfigByType(model.ImTypeDingTalk) + if err != nil { + return controller.JSONBaseErrorReq(c, err) + } + + if req.AppKey != nil { + dingTalk.AppKey = *req.AppKey + } + if req.AppSecret != nil { + dingTalk.AppSecret = *req.AppSecret + } + if req.IsEnableDingTalkNotify != nil { + dingTalk.IsEnable = *req.IsEnableDingTalkNotify + } + + dingTalk.Type = model.ImTypeDingTalk + + if err := s.Save(dingTalk); err != nil { + return controller.JSONBaseErrorReq(c, err) + } + + go im.CreateApprovalTemplate(model.ImTypeDingTalk) + + return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } type UpdateWeChatConfigurationReqV1 struct { diff --git a/sqle/model/configuration.go b/sqle/model/configuration.go index 2658ec1324..578d1373b9 100644 --- a/sqle/model/configuration.go +++ b/sqle/model/configuration.go @@ -331,3 +331,30 @@ func (s *Storage) GetWorkflowExpiredHoursOrDefault() (int64, error) { return 30 * 24, nil } + +const ( + ImTypeDingTalk = "dingTalk" +) + +type IM struct { + Model + AppKey string `json:"app_key" gorm:"column:app_key"` + AppSecret string `json:"app_secret" gorm:"column:app_secret"` + IsEnable bool `json:"is_enable" gorm:"column:is_enable"` + ProcessCode string `json:"process_code" gorm:"column:process_code"` + // 类型唯一 + Type string `json:"type" gorm:"unique"` +} + +func (i *IM) TableName() string { + return fmt.Sprintf("%v_im", globalConfigurationTablePrefix) +} + +func (s *Storage) GetImConfigByType(imType string) (*IM, bool, error) { + im := new(IM) + err := s.db.Where("type = ?", imType).First(&im).Error + if err == gorm.ErrRecordNotFound { + return im, false, nil + } + return im, true, errors.New(errors.ConnectStorageError, err) +} diff --git a/sqle/model/utils.go b/sqle/model/utils.go index 20a1a3bd07..31a79f954b 100644 --- a/sqle/model/utils.go +++ b/sqle/model/utils.go @@ -141,6 +141,7 @@ var autoMigrateList = []interface{}{ &ProjectMemberRole{}, &ProjectMemberGroupRole{}, &ManagementPermission{}, + &IM{}, } func (s *Storage) AutoMigrate() error { From 348d1b6b9a4a881b647683094c77add72288de71 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 10:26:23 +0800 Subject: [PATCH 04/19] sqle im docking standard --- sqle/pkg/im/im.go | 200 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sqle/pkg/im/im.go diff --git a/sqle/pkg/im/im.go b/sqle/pkg/im/im.go new file mode 100644 index 0000000000..162a4ff23f --- /dev/null +++ b/sqle/pkg/im/im.go @@ -0,0 +1,200 @@ +package im + +import ( + "bytes" + "fmt" + + "github.com/actiontech/sqle/sqle/log" + "github.com/actiontech/sqle/sqle/model" + "github.com/actiontech/sqle/sqle/pkg/im/dingding" +) + +func CreateApprovalTemplate(imType string) { + s := model.GetStorage() + ims, err := s.GetAllIMConfig() + if err != nil { + log.NewEntry().Errorf("get im config error: %v", err) + return + } + + imTypeIM := make(map[string]model.IM) + for _, im := range ims { + imTypeIM[im.Type] = im + } + + var im model.IM + var ok bool + if im, ok = imTypeIM[imType]; !ok { + log.NewEntry().Errorf("im type %s not found", imType) + return + } + + switch im.Type { + case model.ImTypeDingTalk: + dingTalk := &dingding.DingTalk{ + Id: im.ID, + AppKey: im.AppKey, + AppSecret: im.AppSecret, + } + + if err := dingTalk.CreateApprovalTemplate(); err != nil { + log.NewEntry().Errorf("create approval template error: %v", err) + return + } + } +} + +func CreateApproveInstance(id string) { + newLog := log.NewEntry() + s := model.GetStorage() + workflow, exist, err := s.GetWorkflowDetailById(id) + if err != nil { + newLog.Error("get workflow detail error: ", err) + return + } + if !exist { + newLog.Error("workflow not exist") + return + } + + var buff bytes.Buffer + for _, record := range workflow.Record.InstanceRecords { + buff.WriteString(fmt.Sprintf("数据源%s:%s\n", record.Instance.Name, record.ExecuteSQL.Content)) + } + + if workflow.CreateUser.Phone == "" { + newLog.Error("create user phone is empty") + return + } + + if len(workflow.Record.Steps) == 1 || workflow.CurrentStep() == workflow.Record.Steps[len(workflow.Record.Steps)-1] { + newLog.Infof("workflow %v only has one approve step or has been approved, no need to create approve instance", workflow.ID) + return + } + + users := workflow.CurrentAssigneeUser() + + ims, err := s.GetAllIMConfig() + if err != nil { + newLog.Errorf("get im config error: %v", err) + return + } + + for _, im := range ims { + switch im.Type { + case model.ImTypeDingTalk: + if !im.IsEnable { + continue + } + + dingTalk := &dingding.DingTalk{ + Id: im.ID, + AppKey: im.AppKey, + AppSecret: im.AppSecret, + ProcessCode: im.ProcessCode, + } + + createUserId, err := dingTalk.GetUserIDByPhone(workflow.CreateUser.Phone) + if err != nil { + newLog.Errorf("get origin user id by phone error: %v", err) + return + } + + var userIds []*string + for _, user := range users { + if user.Phone == "" { + newLog.Infof("user %v phone is empty, skip", user.ID) + continue + } + + userId, err := dingTalk.GetUserIDByPhone(user.Phone) + if err != nil { + newLog.Errorf("get user id by phone error: %v", err) + continue + } + + userIds = append(userIds, userId) + } + + if err := dingTalk.CreateApprovalInstance(workflow.Subject, workflow.ID, workflow.CurrentStep().ID, createUserId, userIds, buff.String()); err != nil { + newLog.Errorf("create dingtalk approval instance error: %v", err) + return + } + default: + newLog.Errorf("im type %s not found", im.Type) + } + } +} + +func UpdateApproveStatus(workflowId, stepId uint, phone, status, reason string) { + newLog := log.NewEntry() + s := model.GetStorage() + + ims, err := s.GetAllIMConfig() + if err != nil { + newLog.Errorf("get im config error: %v", err) + return + } + + for _, im := range ims { + switch im.Type { + case model.ImTypeDingTalk: + dingTalk := &dingding.DingTalk{ + AppKey: im.AppKey, + AppSecret: im.AppSecret, + } + + userID, err := dingTalk.GetUserIDByPhone(phone) + if err != nil { + newLog.Errorf("get user id by phone error: %v", err) + continue + } + + if err := dingTalk.UpdateApprovalStatus(workflowId, stepId, status, *userID, reason); err != nil { + newLog.Errorf("update approval status error: %v", err) + continue + } + } + } +} + +func CancelApproveInstance(workflowID, workflowStepId uint) { + newLog := log.NewEntry() + s := model.GetStorage() + dingTalkInst, exist, err := s.GetDingTalkInstanceByWorkflowStepID(workflowID, workflowStepId) + if err != nil { + newLog.Errorf("get dingtalk instance by workflow step id error: %v", err) + return + } + if !exist { + newLog.Infof("workflow step %v not exist", workflowStepId) + return + } + + ims, err := s.GetAllIMConfig() + if err != nil { + newLog.Errorf("get im config error: %v", err) + return + } + + for _, im := range ims { + switch im.Type { + case model.ImTypeDingTalk: + if !im.IsEnable { + continue + } + + dingTalk := &dingding.DingTalk{ + AppKey: im.AppKey, + AppSecret: im.AppSecret, + } + + if err := dingTalk.CancelApprovalInstance(dingTalkInst.ApproveInstanceCode); err != nil { + newLog.Errorf("cancel dingtalk approval instance error: %v", err) + return + } + default: + newLog.Errorf("im type %s not found", im.Type) + } + } +} From 76902ab9e998404292cc69781cdbe30495799060 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 10:38:33 +0800 Subject: [PATCH 05/19] DingTalk approval open api --- sqle/pkg/im/dingding/dingding.go | 407 +++++++++++++++++++++++++++++++ 1 file changed, 407 insertions(+) create mode 100644 sqle/pkg/im/dingding/dingding.go diff --git a/sqle/pkg/im/dingding/dingding.go b/sqle/pkg/im/dingding/dingding.go new file mode 100644 index 0000000000..ccbad4395e --- /dev/null +++ b/sqle/pkg/im/dingding/dingding.go @@ -0,0 +1,407 @@ +package dingding + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "math/rand" + "net/http" + "strconv" + "time" + + "github.com/actiontech/sqle/sqle/log" + "github.com/actiontech/sqle/sqle/model" + openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" + dingTalkOauth "github.com/alibabacloud-go/dingtalk/oauth2_1_0" + dingTalkWorkflow "github.com/alibabacloud-go/dingtalk/workflow_1_0" + util "github.com/alibabacloud-go/tea-utils/v2/service" + "github.com/alibabacloud-go/tea/tea" +) + +const ( + dingTalkOpenApi = "https://oapi.dingtalk.com/topapi" + timeout = 30 * time.Second + + workflowNameComp = "工单名称" + SqlComp = "SQL语句" +) + +type DingTalk struct { + Id uint + AppKey string + AppSecret string + ProcessCode string +} + +func getToken(key, secret string) (string, error) { + config := &openapi.Config{} + config.Protocol = tea.String("https") + config.RegionId = tea.String("central") + client, err := dingTalkOauth.NewClient(config) + if err != nil { + return "", fmt.Errorf("get dingtalk client error: %v", err) + } + + getAccessTokenRequest := &dingTalkOauth.GetAccessTokenRequest{ + AppKey: tea.String(key), + AppSecret: tea.String(secret), + } + + result, err := client.GetAccessToken(getAccessTokenRequest) + if err != nil { + return "", fmt.Errorf("get dingtalk token error: %v", err) + } + + return *result.Body.AccessToken, nil +} + +// CreateApprovalTemplate +// https://open.dingtalk.com/document/orgapp-server/create-an-approval-form-template +func (d *DingTalk) CreateApprovalTemplate() error { + token, err := getToken(d.AppKey, d.AppSecret) + if err != nil { + return fmt.Errorf("get token error: %v", err) + } + + client, err := newWorkflowClient() + if err != nil { + return fmt.Errorf("get workflow client error: %v", err) + } + + formCreateHeaders := &dingTalkWorkflow.FormCreateHeaders{} + formCreateHeaders.XAcsDingtalkAccessToken = tea.String(token) + + workflowNameComponent := &dingTalkWorkflow.FormComponent{ + ComponentType: tea.String("TextField"), + Props: &dingTalkWorkflow.FormComponentProps{ + ComponentId: tea.String("TextField_17EZKEGSOCTC0"), + Label: tea.String(workflowNameComp), + }, + } + + sqlComponent := &dingTalkWorkflow.FormComponent{ + ComponentType: tea.String("TextField"), + Props: &dingTalkWorkflow.FormComponentProps{ + ComponentId: tea.String("TextField_27EZxEGStCx21"), + Label: tea.String(SqlComp), + }, + } + + formCreateRequest := &dingTalkWorkflow.FormCreateRequest{ + Name: tea.String(fmt.Sprintf("sqle-%s", strconv.Itoa(rand.Int()))), + FormComponents: []*dingTalkWorkflow.FormComponent{workflowNameComponent, sqlComponent}, + } + + resp, err := client.FormCreateWithOptions(formCreateRequest, formCreateHeaders, &util.RuntimeOptions{}) + if err != nil { + return fmt.Errorf("create approval template error: %v", err) + } + + if resp.Body.Result.ProcessCode == nil { + return fmt.Errorf("create approval template error: %v", resp.Body.Result) + } + + s := model.GetStorage() + processCode := *resp.Body.Result.ProcessCode + if err := s.UpdateImConfigById(d.Id, map[string]interface{}{"process_code": processCode}); err != nil { + return fmt.Errorf("update process code error: %v", err) + } + + return nil +} + +// CreateApprovalInstance +// https://open.dingtalk.com/document/orgapp-server/create-an-approval-instance +func (d *DingTalk) CreateApprovalInstance(workflowName string, workflowId, currentStpId uint, originUserId *string, userIds []*string, sqlContent string) error { + token, err := getToken(d.AppKey, d.AppSecret) + if err != nil { + return fmt.Errorf("get token error: %v", err) + } + + client, err := newWorkflowClient() + if err != nil { + return fmt.Errorf("get workflow client error: %v", err) + } + + startProcessInstanceHeaders := &dingTalkWorkflow.StartProcessInstanceHeaders{} + startProcessInstanceHeaders.XAcsDingtalkAccessToken = tea.String(token) + + var startProcessInstanceRequestApprovers []*dingTalkWorkflow.StartProcessInstanceRequestApprovers + startProcessInstanceRequestApprovers = append(startProcessInstanceRequestApprovers, &dingTalkWorkflow.StartProcessInstanceRequestApprovers{ + ActionType: tea.String("NONE"), + UserIds: userIds, + }) + + var startProcessInstanceRequestFormComponentValues []*dingTalkWorkflow.StartProcessInstanceRequestFormComponentValues + startProcessInstanceRequestFormComponentValues = append(startProcessInstanceRequestFormComponentValues, &dingTalkWorkflow.StartProcessInstanceRequestFormComponentValues{ + Name: tea.String(workflowNameComp), + Value: tea.String(workflowName), + }, &dingTalkWorkflow.StartProcessInstanceRequestFormComponentValues{ + Name: tea.String(SqlComp), + Value: tea.String(sqlContent), + }) + + startProcessInstanceRequest := &dingTalkWorkflow.StartProcessInstanceRequest{ + OriginatorUserId: originUserId, + ProcessCode: tea.String(d.ProcessCode), + Approvers: startProcessInstanceRequestApprovers, + FormComponentValues: startProcessInstanceRequestFormComponentValues, + } + + resp, err := client.StartProcessInstanceWithOptions(startProcessInstanceRequest, startProcessInstanceHeaders, &util.RuntimeOptions{}) + if err != nil { + return fmt.Errorf("create approval instance error: %v", err) + } + + approvalDetail, err := d.GetApprovalDetail(*resp.Body.InstanceId) + if err != nil { + return fmt.Errorf("get approval detail error: %v", err) + } + + taskID := *approvalDetail.Tasks[0].TaskId + dingTalkInstance := model.DingTalkInstance{ApproveInstanceCode: *resp.Body.InstanceId, WorkflowId: workflowId, WorkflowStepID: currentStpId, TaskID: int64(uint(taskID))} + s := model.GetStorage() + if err := s.Save(&dingTalkInstance); err != nil { + return fmt.Errorf("save dingtalk instance error: %v", err) + } + + return nil +} + +// UpdateApprovalStatus +// https://open.dingtalk.com/document/orgapp-server/approve-or-reject-the-approval-task +func (d *DingTalk) UpdateApprovalStatus(workflowId, stepId uint, status, userId, reason string) error { + s := model.GetStorage() + dingTalkInstance, exist, err := s.GetDingTalkInstanceByWorkflowStepID(workflowId, stepId) + if err != nil { + return fmt.Errorf("get dingtalk instance error: %v", err) + } + if !exist { + return fmt.Errorf("dingtalk instance not exist,step id: %v", stepId) + } + + token, err := getToken(d.AppKey, d.AppSecret) + if err != nil { + return fmt.Errorf("get token error: %v", err) + } + + client, err := newWorkflowClient() + if err != nil { + return fmt.Errorf("get workflow client error: %v", err) + } + + executeProcessInstanceHeaders := &dingTalkWorkflow.ExecuteProcessInstanceHeaders{} + executeProcessInstanceHeaders.XAcsDingtalkAccessToken = tea.String(token) + + executeProcessInstanceRequest := &dingTalkWorkflow.ExecuteProcessInstanceRequest{ + ProcessInstanceId: tea.String(dingTalkInstance.ApproveInstanceCode), + Result: tea.String(status), + ActionerUserId: tea.String(userId), + TaskId: tea.Int64(dingTalkInstance.TaskID), + } + + if reason != "" { + executeProcessInstanceRequest.Remark = tea.String(reason) + } + + _, err = client.ExecuteProcessInstanceWithOptions(executeProcessInstanceRequest, executeProcessInstanceHeaders, &util.RuntimeOptions{}) + if err != nil { + return fmt.Errorf("update approval status error: %v", err) + } + + dingTalkInstance.Status = status + if err := s.Save(&dingTalkInstance); err != nil { + return fmt.Errorf("save dingtalk instance error: %v", err) + } + + return nil +} + +// GetApprovalDetail +// https://open.dingtalk.com/document/orgapp-server/obtains-the-details-of-a-single-approval-instance-pop +func (d *DingTalk) GetApprovalDetail(approveInstanceCode string) (*dingTalkWorkflow.GetProcessInstanceResponseBodyResult, error) { + token, err := getToken(d.AppKey, d.AppSecret) + if err != nil { + return nil, fmt.Errorf("get token error: %v", err) + } + + client, err := newWorkflowClient() + if err != nil { + return nil, fmt.Errorf("get workflow client error: %v", err) + } + + getProcessInstanceHeaders := &dingTalkWorkflow.GetProcessInstanceHeaders{} + getProcessInstanceHeaders.XAcsDingtalkAccessToken = tea.String(token) + getProcessInstanceRequest := &dingTalkWorkflow.GetProcessInstanceRequest{ + ProcessInstanceId: tea.String(approveInstanceCode), + } + + resp, err := client.GetProcessInstanceWithOptions(getProcessInstanceRequest, getProcessInstanceHeaders, &util.RuntimeOptions{}) + if err != nil { + return nil, fmt.Errorf("get approval status error: %v", err) + } + + return resp.Body.Result, nil +} + +type GetUserIDByPhoneRep struct { + Mobile string `json:"mobile"` +} + +type GetUserIDByPhoneResp struct { + ErrCode int `json:"errcode"` + ErrMsg string `json:"errmsg"` + Result struct { + Userid string `json:"userid"` + } +} + +// GetUserIDByPhone +// https://open.dingtalk.com/document/orgapp-server/query-users-by-phone-number +func (d *DingTalk) GetUserIDByPhone(phone string) (*string, error) { + // todo : token cache + token, err := getToken(d.AppKey, d.AppSecret) + if err != nil { + return nil, fmt.Errorf("get token error: %v", err) + } + + url := fmt.Sprintf("%s/v2/user/getbymobile?access_token=%s", dingTalkOpenApi, token) + + newEntry := log.NewEntry() + + getUserIDByPhoneRep := &GetUserIDByPhoneRep{ + Mobile: phone, + } + + body, err := json.Marshal(getUserIDByPhoneRep) + if err != nil { + return nil, fmt.Errorf("marshal req error: %v", err) + } + + resp, err := Requester(url, http.MethodPost, token, body) + if err != nil { + return nil, fmt.Errorf("get user id by mobile error: %v", err) + } + + var user GetUserIDByPhoneResp + if err := json.Unmarshal(resp, &user); err != nil { + return nil, fmt.Errorf("unmarshal error: %v", err) + } + + if user.ErrCode != 0 { + newEntry.Errorf("get user id by mobile error,code: %v errMsg: %v", user.ErrCode, user.ErrMsg) + } + + return &user.Result.Userid, nil +} + +type GetUserByUserIdReq struct { + UserId string `json:"userid"` +} + +type GetUserByUserIdResp struct { + ErrCode int `json:"errcode"` + ErrMsg string `json:"errmsg"` + Result struct { + Mobile string `json:"mobile"` + } +} + +// GetMobileByUserID +// https://open.dingtalk.com/document/orgapp-server/query-user-details +func (d *DingTalk) GetMobileByUserID(userId string) (string, error) { + token, err := getToken(d.AppKey, d.AppSecret) + if err != nil { + return "", fmt.Errorf("get token error: %v", err) + } + + url := fmt.Sprintf("%s/v2/user/get?access_token=%s", dingTalkOpenApi, token) + + body, err := json.Marshal(&GetUserByUserIdReq{ + UserId: userId, + }) + if err != nil { + return "", fmt.Errorf("marshal req error: %v", err) + } + + resp, err := Requester(url, http.MethodPost, token, body) + if err != nil { + return "", fmt.Errorf("get user by user id error: %v", err) + } + + var user GetUserByUserIdResp + if err := json.Unmarshal(resp, &user); err != nil { + return "", fmt.Errorf("unmarshal error: %v", err) + } + + if user.ErrCode != 0 { + return "", fmt.Errorf("get user by user id error,code: %v errMsg: %v", user.ErrCode, user.ErrMsg) + } + + return user.Result.Mobile, nil +} + +// CancelApprovalInstance +// https://open.dingtalk.com/document/orgapp-server/revoke-an-approval-instance +func (d *DingTalk) CancelApprovalInstance(instanceCode string) error { + token, err := getToken(d.AppKey, d.AppSecret) + if err != nil { + return fmt.Errorf("get token error: %v", err) + } + + client, err := newWorkflowClient() + if err != nil { + return fmt.Errorf("get dingtalk client error: %v", err) + } + + terminateProcessInstanceHeaders := &dingTalkWorkflow.TerminateProcessInstanceHeaders{} + terminateProcessInstanceHeaders.XAcsDingtalkAccessToken = tea.String(token) + terminateProcessInstanceRequest := &dingTalkWorkflow.TerminateProcessInstanceRequest{ + ProcessInstanceId: tea.String(instanceCode), + IsSystem: tea.Bool(true), + Remark: tea.String("工单已关闭"), + } + + _, err = client.TerminateProcessInstanceWithOptions(terminateProcessInstanceRequest, terminateProcessInstanceHeaders, &util.RuntimeOptions{}) + if err != nil { + return fmt.Errorf("cancel approval instance error: %v, instanceCode: %v", err, instanceCode) + } + + return nil +} + +func Requester(url, method, token string, body []byte) ([]byte, error) { + reader := bytes.NewReader(body) + client := &http.Client{Timeout: timeout} + + req, err := http.NewRequest(method, url, reader) + if err != nil { + return nil, err + } + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Authorization", token) + + res, err := client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + + body, err = ioutil.ReadAll(res.Body) + if err != nil { + return nil, err + } + return body, nil +} + +func newWorkflowClient() (*dingTalkWorkflow.Client, error) { + config := &openapi.Config{} + config.Protocol = tea.String("https") + config.RegionId = tea.String("central") + client, err := dingTalkWorkflow.NewClient(config) + if err != nil { + return nil, fmt.Errorf("get dingtalk client error: %v", err) + } + return client, nil +} From e2906223a75818bb12c8ed8040fb165d22106909 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 10:46:15 +0800 Subject: [PATCH 06/19] im and dingTalk model --- sqle/model/configuration.go | 50 +++++++++++++++++++++++++++++++++++++ sqle/model/user.go | 9 +++++++ sqle/model/utils.go | 1 + sqle/model/workflow.go | 5 +++- 4 files changed, 64 insertions(+), 1 deletion(-) diff --git a/sqle/model/configuration.go b/sqle/model/configuration.go index 578d1373b9..12105d123e 100644 --- a/sqle/model/configuration.go +++ b/sqle/model/configuration.go @@ -358,3 +358,53 @@ func (s *Storage) GetImConfigByType(imType string) (*IM, bool, error) { } return im, true, errors.New(errors.ConnectStorageError, err) } + +func (s *Storage) GetAllIMConfig() ([]IM, error) { + var ims []IM + err := s.db.Find(&ims).Error + if err != nil { + return nil, errors.New(errors.ConnectStorageError, err) + } + return ims, nil +} + +func (s *Storage) UpdateImConfigById(id uint, m map[string]interface{}) error { + err := s.db.Model(&IM{}).Where("id = ?", id).Updates(m).Error + if err != nil { + return errors.New(errors.ConnectStorageError, err) + } + return nil +} + +const ( + ApproveStatusInitialized = "initialized" + ApproveStatusAgree = "agree" + ApproveStatusRefuse = "refuse" +) + +type DingTalkInstance struct { + Model + ApproveInstanceCode string `json:"approve_instance" gorm:"column:approve_instance"` + WorkflowId uint `json:"workflow_id" gorm:"column:workflow_id"` + WorkflowStepID uint `json:"workflow_step_id" gorm:"column:workflow_step_id"` + TaskID int64 `json:"task_id" gorm:"column:task_id"` + Status string `json:"status" gorm:"default:\"initialized\""` +} + +func (s *Storage) GetDingTalkInstanceByWorkflowStepID(workflowId, workflowStepID uint) (*DingTalkInstance, bool, error) { + dti := new(DingTalkInstance) + err := s.db.Where("workflow_step_id = ? and workflow_id = ?", workflowStepID, workflowId).First(&dti).Error + if err == gorm.ErrRecordNotFound { + return dti, false, nil + } + return dti, true, errors.New(errors.ConnectStorageError, err) +} + +func (s *Storage) GetDingTalkInstByStatus(status string) ([]DingTalkInstance, error) { + var dingTalkInstances []DingTalkInstance + err := s.db.Where("status = ?", status).Find(&dingTalkInstances).Error + if err != nil { + return nil, err + } + return dingTalkInstances, nil +} diff --git a/sqle/model/user.go b/sqle/model/user.go index a4c4e0155c..f55ecd6cee 100644 --- a/sqle/model/user.go +++ b/sqle/model/user.go @@ -110,6 +110,15 @@ func (s *Storage) GetUserByThirdPartyUserID(thirdPartyUserID string) (*User, boo return t, true, errors.New(errors.ConnectStorageError, err) } +func (s *Storage) GetUserByPhone(phone string) (*User, bool, error) { + user := &User{} + err := s.db.Where("phone = ?", phone).First(user).Error + if err == gorm.ErrRecordNotFound { + return user, false, nil + } + return user, true, errors.New(errors.ConnectStorageError, err) +} + func (s *Storage) GetUserByName(name string) (*User, bool, error) { t := &User{} err := s.db.Where("login_name = ?", name).First(t).Error diff --git a/sqle/model/utils.go b/sqle/model/utils.go index 31a79f954b..5b1e8f6064 100644 --- a/sqle/model/utils.go +++ b/sqle/model/utils.go @@ -142,6 +142,7 @@ var autoMigrateList = []interface{}{ &ProjectMemberGroupRole{}, &ManagementPermission{}, &IM{}, + &DingTalkInstance{}, } func (s *Storage) AutoMigrate() error { diff --git a/sqle/model/workflow.go b/sqle/model/workflow.go index 60add14abb..ff54adb098 100644 --- a/sqle/model/workflow.go +++ b/sqle/model/workflow.go @@ -198,6 +198,9 @@ type WorkflowInstanceRecord struct { // 用于区分工单处于上线步骤时,某个数据源是否已上线,因为数据源可以分批上线 IsSQLExecuted bool ExecutionUserId uint + + Instance *Instance `gorm:"foreignkey:InstanceId"` + ExecuteSQL *ExecuteSQL `gorm:"foreignkey:TaskId"` } func (s *Storage) GetWorkInstanceRecordByTaskId(id string) (instanceRecord WorkflowInstanceRecord, err error) { @@ -609,7 +612,7 @@ func (s *Storage) getWorkflowStepsByRecordIds(ids []uint) ([]*WorkflowStep, erro func (s *Storage) getWorkflowInstanceRecordsByRecordId(id uint) ([]*WorkflowInstanceRecord, error) { instanceRecords := []*WorkflowInstanceRecord{} - err := s.db.Where("workflow_record_id = ?", id). + err := s.db.Preload("Instance").Preload("ExecuteSQL").Where("workflow_record_id = ?", id). Find(&instanceRecords).Error if err != nil { return nil, errors.New(errors.ConnectStorageError, err) From d53798077e46a930d0da4cea4cf336ddc3a74631 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 10:55:22 +0800 Subject: [PATCH 07/19] approval pass, rejected and workflow creation, update , close processing. --- sqle/api/controller/v1/workflow.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/sqle/api/controller/v1/workflow.go b/sqle/api/controller/v1/workflow.go index 1661793baa..2658ab3384 100644 --- a/sqle/api/controller/v1/workflow.go +++ b/sqle/api/controller/v1/workflow.go @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/actiontech/sqle/sqle/pkg/im" + "github.com/actiontech/sqle/sqle/api/controller" "github.com/actiontech/sqle/sqle/driver" "github.com/actiontech/sqle/sqle/errors" @@ -421,6 +423,12 @@ func ApproveWorkflow(c echo.Context) error { } go notification.NotifyWorkflow(workflowIdStr, notification.WorkflowNotifyTypeApprove) + go im.UpdateApproveStatus(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusAgree, "") + + if nextStep.Template.Typ != model.WorkflowStepTypeSQLExecute { + go im.CreateApproveInstance(strconv.Itoa(int(workflow.ID))) + } + return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } @@ -522,6 +530,8 @@ func RejectWorkflow(c echo.Context) error { } go notification.NotifyWorkflow(fmt.Sprintf("%v", workflow.ID), notification.WorkflowNotifyTypeReject) + go im.UpdateApproveStatus(workflow.ID, currentStep.ID, user.Phone, model.ApproveStatusRefuse, req.Reason) + return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } @@ -587,6 +597,9 @@ func CancelWorkflow(c echo.Context) error { if err != nil { return controller.JSONBaseErrorReq(c, err) } + + im.CancelApproveInstance(workflow.ID, workflow.CurrentStep().ID) + return controller.JSONBaseErrorReq(c, nil) } @@ -1076,7 +1089,11 @@ func CreateWorkflowV1(c echo.Context) error { if !exist { return controller.JSONBaseErrorReq(c, errors.New(errors.DataNotExist, fmt.Errorf("should exist at least one workflow after create workflow"))) } - go notification.NotifyWorkflow(fmt.Sprintf("%v", workflow.ID), notification.WorkflowNotifyTypeCreate) + + workFlowId := strconv.Itoa(int(workflow.ID)) + go notification.NotifyWorkflow(workFlowId, notification.WorkflowNotifyTypeCreate) + + go im.CreateApproveInstance(workFlowId) return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } @@ -1436,6 +1453,9 @@ func UpdateWorkflowV1(c echo.Context) error { } go notification.NotifyWorkflow(workflowIdStr, notification.WorkflowNotifyTypeCreate) + workFlowId := strconv.Itoa(int(workflow.ID)) + go im.CreateApproveInstance(workFlowId) + return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } From 2c0521944078fec84af6896e61d663b40652daab Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 10:56:30 +0800 Subject: [PATCH 08/19] Polling to update DingTalk status --- sqle/server/sqled.go | 178 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) diff --git a/sqle/server/sqled.go b/sqle/server/sqled.go index 87868aac28..1a4163be04 100644 --- a/sqle/server/sqled.go +++ b/sqle/server/sqled.go @@ -4,9 +4,14 @@ import ( "context" _errors "errors" "fmt" + "strconv" "sync" "time" + "github.com/actiontech/sqle/sqle/notification" + imPkg "github.com/actiontech/sqle/sqle/pkg/im" + "github.com/actiontech/sqle/sqle/pkg/im/dingding" + "github.com/actiontech/sqle/sqle/driver" _ "github.com/actiontech/sqle/sqle/driver/mysql" "github.com/actiontech/sqle/sqle/errors" @@ -128,9 +133,26 @@ func (s *Sqled) AddTaskWaitResult(taskId string, typ int) (*model.Task, error) { func (s *Sqled) Start() { go s.taskLoop() go s.cleanLoop() + go s.dingTalkLoop() go s.workflowScheduleLoop() } +func (s *Sqled) dingTalkLoop() { + ticker := time.NewTicker(60 * time.Second) + defer ticker.Stop() + + for { + select { + case <-s.exit: + return + case <-ticker.C: + if err := s.dingTalkRotation(); err != nil { + log.NewEntry().Error("dingTalkRotation failed, error:", err) + } + } + } +} + // taskLoop is a task loop used to receive action from queue. func (s *Sqled) taskLoop() { for { @@ -175,6 +197,162 @@ func (s *Sqled) do(action *action) error { return err } +func (s *Sqled) dingTalkRotation() error { + st := model.GetStorage() + + ims, err := st.GetAllIMConfig() + if err != nil { + log.NewEntry().Errorf("get all im config failed, error: %v", err) + } + + for _, im := range ims { + switch im.Type { + case model.ImTypeDingTalk: + d := &dingding.DingTalk{ + AppKey: im.AppKey, + AppSecret: im.AppSecret, + } + + dingTalkInstances, err := st.GetDingTalkInstByStatus(model.ApproveStatusInitialized) + if err != nil { + log.NewEntry().Errorf("get ding talk status error: %v", err) + continue + } + + for _, dingTalkInstance := range dingTalkInstances { + approval, err := d.GetApprovalDetail(dingTalkInstance.ApproveInstanceCode) + if err != nil { + log.NewEntry().Errorf("get ding talk approval detail error: %v", err) + continue + } + + switch *approval.Result { + case model.ApproveStatusAgree: + workflow, exist, err := st.GetWorkflowDetailById(strconv.Itoa(int(dingTalkInstance.WorkflowId))) + if err != nil { + log.NewEntry().Errorf("get workflow detail error: %v", err) + continue + } + if !exist { + log.NewEntry().Errorf("workflow not exist, id: %d", dingTalkInstance.WorkflowId) + continue + } + + currentStep := workflow.CurrentStep() + + if workflow.Record.Status == model.WorkflowStatusWaitForExecution { + log.NewEntry().Warnf("workflow approval is wait for execution, id: %d", dingTalkInstance.WorkflowId) + continue + } + + currentStep.State = model.WorkflowStepStateApprove + now := time.Now() + currentStep.OperateAt = &now + userId := *approval.OperationRecords[1].UserId + + user, err := getUserByUserId(d, userId, st) + if err != nil { + log.NewEntry().Errorf("get user by user id error: %v", err) + continue + } + + currentStep.OperationUserId = user.ID + nextStep := workflow.NextStep() + workflow.Record.CurrentWorkflowStepId = nextStep.ID + if nextStep.Template.Typ == model.WorkflowStepTypeSQLExecute { + workflow.Record.Status = model.WorkflowStatusWaitForExecution + } + + err = st.UpdateWorkflowStatus(workflow, currentStep, nil) + if err != nil { + log.NewEntry().Errorf("update workflow approval error: %v", err) + continue + } + + notification.NotifyWorkflow(strconv.Itoa(int(workflow.ID)), notification.WorkflowNotifyTypeApprove) + + dingTalkInstance.Status = model.ApproveStatusAgree + if err := st.Save(&dingTalkInstance); err != nil { + log.NewEntry().Errorf("save ding talk instance error: %v", err) + continue + } + + if nextStep.Template.Typ != model.WorkflowStepTypeSQLExecute { + imPkg.CreateApproveInstance(strconv.Itoa(int(workflow.ID))) + } + + case model.ApproveStatusRefuse: + workflow, exist, err := st.GetWorkflowDetailById(strconv.Itoa(int(dingTalkInstance.WorkflowId))) + if err != nil { + log.NewEntry().Errorf("get workflow detail error: %v", err) + continue + } + if !exist { + log.NewEntry().Errorf("workflow not exist, id: %d", dingTalkInstance.WorkflowId) + continue + } + + currentStep := workflow.CurrentStep() + currentStep.State = model.WorkflowStepStateReject + + if approval.OperationRecords[1] != nil && approval.OperationRecords[1].Remark != nil { + currentStep.Reason = *approval.OperationRecords[1].Remark + } else { + currentStep.Reason = "审批拒绝" + } + + now := time.Now() + currentStep.OperateAt = &now + + userId := *approval.OperationRecords[1].UserId + user, err := getUserByUserId(d, userId, st) + if err != nil { + log.NewEntry().Errorf("get user by user id error: %v", err) + continue + } + currentStep.OperationUserId = user.ID + + workflow.Record.Status = model.WorkflowStatusReject + workflow.Record.CurrentWorkflowStepId = 0 + + err = st.UpdateWorkflowStatus(workflow, currentStep, nil) + if err != nil { + log.NewEntry().Errorf("update workflow approval error: %v", err) + continue + } + + notification.NotifyWorkflow(fmt.Sprintf("%v", workflow.ID), notification.WorkflowNotifyTypeReject) + + dingTalkInstance.Status = model.ApproveStatusRefuse + if err := st.Save(&dingTalkInstance); err != nil { + log.NewEntry().Errorf("save ding talk instance error: %v", err) + continue + } + } + } + } + } + + return nil +} + +func getUserByUserId(d *dingding.DingTalk, userId string, st *model.Storage) (*model.User, error) { + phone, err := d.GetMobileByUserID(userId) + if err != nil { + return nil, fmt.Errorf("get user mobile error: %v", err) + } + + user, exist, err := st.GetUserByPhone(phone) + if err != nil { + return nil, fmt.Errorf("get user by phone error: %v", err) + } + if !exist { + return nil, fmt.Errorf("user not exist, phone: %s", phone) + } + + return user, nil +} + const ( ActionTypeAudit = iota + 1 ActionTypeExecute From cc13f39b376bcb00b8d82a60fcff31f89582df9b Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 16:41:04 +0800 Subject: [PATCH 09/19] add taskId annotate --- sqle/model/configuration.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sqle/model/configuration.go b/sqle/model/configuration.go index 12105d123e..3335e843d6 100644 --- a/sqle/model/configuration.go +++ b/sqle/model/configuration.go @@ -387,8 +387,9 @@ type DingTalkInstance struct { ApproveInstanceCode string `json:"approve_instance" gorm:"column:approve_instance"` WorkflowId uint `json:"workflow_id" gorm:"column:workflow_id"` WorkflowStepID uint `json:"workflow_step_id" gorm:"column:workflow_step_id"` - TaskID int64 `json:"task_id" gorm:"column:task_id"` - Status string `json:"status" gorm:"default:\"initialized\""` + // 审批实例 taskID + TaskID int64 `json:"task_id" gorm:"column:task_id"` + Status string `json:"status" gorm:"default:\"initialized\""` } func (s *Storage) GetDingTalkInstanceByWorkflowStepID(workflowId, workflowStepID uint) (*DingTalkInstance, bool, error) { From 428c7e0c72d3d96fbd704652beeca6423b89c587 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 19:07:42 +0800 Subject: [PATCH 10/19] extract approve and reject common method --- sqle/api/controller/v1/workflow.go | 43 ++----------- sqle/server/sqled.go | 100 +++++++++++++++++------------ 2 files changed, 64 insertions(+), 79 deletions(-) diff --git a/sqle/api/controller/v1/workflow.go b/sqle/api/controller/v1/workflow.go index 2658ab3384..a131599f60 100644 --- a/sqle/api/controller/v1/workflow.go +++ b/sqle/api/controller/v1/workflow.go @@ -400,32 +400,13 @@ func ApproveWorkflow(c echo.Context) error { return controller.JSONBaseErrorReq(c, errors.New(errors.DataInvalid, err)) } - currentStep := workflow.CurrentStep() - - if workflow.Record.Status == model.WorkflowStatusWaitForExecution { - return controller.JSONBaseErrorReq(c, errors.New(errors.DataInvalid, - fmt.Errorf("workflow has been approved, you should to execute it"))) - } - - currentStep.State = model.WorkflowStepStateApprove - now := time.Now() - currentStep.OperateAt = &now - currentStep.OperationUserId = user.ID - nextStep := workflow.NextStep() - workflow.Record.CurrentWorkflowStepId = nextStep.ID - if nextStep.Template.Typ == model.WorkflowStepTypeSQLExecute { - workflow.Record.Status = model.WorkflowStatusWaitForExecution - } - - err = s.UpdateWorkflowStatus(workflow, currentStep, nil) - if err != nil { - return c.JSON(http.StatusOK, controller.NewBaseReq(err)) + if err := server.ApproveWorkflowProcess(workflow, user, s); err != nil { + return controller.JSONBaseErrorReq(c, err) } - go notification.NotifyWorkflow(workflowIdStr, notification.WorkflowNotifyTypeApprove) go im.UpdateApproveStatus(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusAgree, "") - if nextStep.Template.Typ != model.WorkflowStepTypeSQLExecute { + if workflow.NextStep().Template.Typ != model.WorkflowStepTypeSQLExecute { go im.CreateApproveInstance(strconv.Itoa(int(workflow.ID))) } @@ -514,23 +495,11 @@ func RejectWorkflow(c echo.Context) error { } } - currentStep := workflow.CurrentStep() - currentStep.State = model.WorkflowStepStateReject - currentStep.Reason = req.Reason - now := time.Now() - currentStep.OperateAt = &now - currentStep.OperationUserId = user.ID - - workflow.Record.Status = model.WorkflowStatusReject - workflow.Record.CurrentWorkflowStepId = 0 - - err = s.UpdateWorkflowStatus(workflow, currentStep, nil) - if err != nil { - return c.JSON(http.StatusOK, controller.NewBaseReq(err)) + if err := server.RejectWorkflowProcess(workflow, req.Reason, user, s); err != nil { + return controller.JSONBaseErrorReq(c, err) } - go notification.NotifyWorkflow(fmt.Sprintf("%v", workflow.ID), notification.WorkflowNotifyTypeReject) - go im.UpdateApproveStatus(workflow.ID, currentStep.ID, user.Phone, model.ApproveStatusRefuse, req.Reason) + go im.UpdateApproveStatus(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusRefuse, req.Reason) return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } diff --git a/sqle/server/sqled.go b/sqle/server/sqled.go index 1a4163be04..ec5c62ad87 100644 --- a/sqle/server/sqled.go +++ b/sqle/server/sqled.go @@ -9,6 +9,7 @@ import ( "time" "github.com/actiontech/sqle/sqle/notification" + imPkg "github.com/actiontech/sqle/sqle/pkg/im" "github.com/actiontech/sqle/sqle/pkg/im/dingding" @@ -238,47 +239,26 @@ func (s *Sqled) dingTalkRotation() error { continue } - currentStep := workflow.CurrentStep() - - if workflow.Record.Status == model.WorkflowStatusWaitForExecution { - log.NewEntry().Warnf("workflow approval is wait for execution, id: %d", dingTalkInstance.WorkflowId) - continue - } - - currentStep.State = model.WorkflowStepStateApprove - now := time.Now() - currentStep.OperateAt = &now userId := *approval.OperationRecords[1].UserId - user, err := getUserByUserId(d, userId, st) if err != nil { log.NewEntry().Errorf("get user by user id error: %v", err) continue } - currentStep.OperationUserId = user.ID - nextStep := workflow.NextStep() - workflow.Record.CurrentWorkflowStepId = nextStep.ID - if nextStep.Template.Typ == model.WorkflowStepTypeSQLExecute { - workflow.Record.Status = model.WorkflowStatusWaitForExecution - } - - err = st.UpdateWorkflowStatus(workflow, currentStep, nil) - if err != nil { - log.NewEntry().Errorf("update workflow approval error: %v", err) + if err := ApproveWorkflowProcess(workflow, user, st); err != nil { + log.NewEntry().Errorf("approve workflow process error: %v", err) continue } - notification.NotifyWorkflow(strconv.Itoa(int(workflow.ID)), notification.WorkflowNotifyTypeApprove) - dingTalkInstance.Status = model.ApproveStatusAgree if err := st.Save(&dingTalkInstance); err != nil { log.NewEntry().Errorf("save ding talk instance error: %v", err) continue } - if nextStep.Template.Typ != model.WorkflowStepTypeSQLExecute { - imPkg.CreateApproveInstance(strconv.Itoa(int(workflow.ID))) + if workflow.NextStep().Template.Typ != model.WorkflowStepTypeSQLExecute { + imPkg.CreateApprove(strconv.Itoa(int(workflow.ID))) } case model.ApproveStatusRefuse: @@ -292,37 +272,25 @@ func (s *Sqled) dingTalkRotation() error { continue } - currentStep := workflow.CurrentStep() - currentStep.State = model.WorkflowStepStateReject - + var reason string if approval.OperationRecords[1] != nil && approval.OperationRecords[1].Remark != nil { - currentStep.Reason = *approval.OperationRecords[1].Remark + reason = *approval.OperationRecords[1].Remark } else { - currentStep.Reason = "审批拒绝" + reason = "审批拒绝" } - now := time.Now() - currentStep.OperateAt = &now - userId := *approval.OperationRecords[1].UserId user, err := getUserByUserId(d, userId, st) if err != nil { log.NewEntry().Errorf("get user by user id error: %v", err) continue } - currentStep.OperationUserId = user.ID - workflow.Record.Status = model.WorkflowStatusReject - workflow.Record.CurrentWorkflowStepId = 0 - - err = st.UpdateWorkflowStatus(workflow, currentStep, nil) - if err != nil { - log.NewEntry().Errorf("update workflow approval error: %v", err) + if err := RejectWorkflowProcess(workflow, reason, user, st); err != nil { + log.NewEntry().Errorf("reject workflow process error: %v", err) continue } - notification.NotifyWorkflow(fmt.Sprintf("%v", workflow.ID), notification.WorkflowNotifyTypeReject) - dingTalkInstance.Status = model.ApproveStatusRefuse if err := st.Save(&dingTalkInstance); err != nil { log.NewEntry().Errorf("save ding talk instance error: %v", err) @@ -336,6 +304,54 @@ func (s *Sqled) dingTalkRotation() error { return nil } +func ApproveWorkflowProcess(workflow *model.Workflow, user *model.User, s *model.Storage) error { + currentStep := workflow.CurrentStep() + + if workflow.Record.Status == model.WorkflowStatusWaitForExecution { + return errors.New(errors.DataInvalid, + fmt.Errorf("workflow has been approved, you should to execute it")) + } + + currentStep.State = model.WorkflowStepStateApprove + now := time.Now() + currentStep.OperateAt = &now + currentStep.OperationUserId = user.ID + nextStep := workflow.NextStep() + workflow.Record.CurrentWorkflowStepId = nextStep.ID + if nextStep.Template.Typ == model.WorkflowStepTypeSQLExecute { + workflow.Record.Status = model.WorkflowStatusWaitForExecution + } + + err := s.UpdateWorkflowStatus(workflow, currentStep, nil) + if err != nil { + return fmt.Errorf("update workflow status failed, %v", err) + } + + go notification.NotifyWorkflow(strconv.Itoa(int(workflow.ID)), notification.WorkflowNotifyTypeApprove) + + return nil +} + +func RejectWorkflowProcess(workflow *model.Workflow, reason string, user *model.User, s *model.Storage) error { + currentStep := workflow.CurrentStep() + currentStep.State = model.WorkflowStepStateReject + currentStep.Reason = reason + now := time.Now() + currentStep.OperateAt = &now + currentStep.OperationUserId = user.ID + + workflow.Record.Status = model.WorkflowStatusReject + workflow.Record.CurrentWorkflowStepId = 0 + + if err := s.UpdateWorkflowStatus(workflow, currentStep, nil); err != nil { + return fmt.Errorf("update workflow status failed, %v", err) + } + + go notification.NotifyWorkflow(fmt.Sprintf("%v", workflow.ID), notification.WorkflowNotifyTypeReject) + + return nil +} + func getUserByUserId(d *dingding.DingTalk, userId string, st *model.Storage) (*model.User, error) { phone, err := d.GetMobileByUserID(userId) if err != nil { From 9410dd138d08b6c0808491e91fdd53e4948ae912 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 19:42:29 +0800 Subject: [PATCH 11/19] rename im method --- sqle/api/controller/v1/workflow.go | 12 ++++++------ sqle/pkg/im/im.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sqle/api/controller/v1/workflow.go b/sqle/api/controller/v1/workflow.go index a131599f60..b37aafedca 100644 --- a/sqle/api/controller/v1/workflow.go +++ b/sqle/api/controller/v1/workflow.go @@ -404,10 +404,10 @@ func ApproveWorkflow(c echo.Context) error { return controller.JSONBaseErrorReq(c, err) } - go im.UpdateApproveStatus(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusAgree, "") + go im.UpdateApprove(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusAgree, "") if workflow.NextStep().Template.Typ != model.WorkflowStepTypeSQLExecute { - go im.CreateApproveInstance(strconv.Itoa(int(workflow.ID))) + go im.CreateApprove(strconv.Itoa(int(workflow.ID))) } return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) @@ -499,7 +499,7 @@ func RejectWorkflow(c echo.Context) error { return controller.JSONBaseErrorReq(c, err) } - go im.UpdateApproveStatus(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusRefuse, req.Reason) + go im.UpdateApprove(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusRefuse, req.Reason) return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } @@ -567,7 +567,7 @@ func CancelWorkflow(c echo.Context) error { return controller.JSONBaseErrorReq(c, err) } - im.CancelApproveInstance(workflow.ID, workflow.CurrentStep().ID) + im.CancelApprove(workflow.ID, workflow.CurrentStep().ID) return controller.JSONBaseErrorReq(c, nil) } @@ -1062,7 +1062,7 @@ func CreateWorkflowV1(c echo.Context) error { workFlowId := strconv.Itoa(int(workflow.ID)) go notification.NotifyWorkflow(workFlowId, notification.WorkflowNotifyTypeCreate) - go im.CreateApproveInstance(workFlowId) + go im.CreateApprove(workFlowId) return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } @@ -1423,7 +1423,7 @@ func UpdateWorkflowV1(c echo.Context) error { go notification.NotifyWorkflow(workflowIdStr, notification.WorkflowNotifyTypeCreate) workFlowId := strconv.Itoa(int(workflow.ID)) - go im.CreateApproveInstance(workFlowId) + go im.CreateApprove(workFlowId) return c.JSON(http.StatusOK, controller.NewBaseReq(nil)) } diff --git a/sqle/pkg/im/im.go b/sqle/pkg/im/im.go index 162a4ff23f..9b53078cdf 100644 --- a/sqle/pkg/im/im.go +++ b/sqle/pkg/im/im.go @@ -44,7 +44,7 @@ func CreateApprovalTemplate(imType string) { } } -func CreateApproveInstance(id string) { +func CreateApprove(id string) { newLog := log.NewEntry() s := model.GetStorage() workflow, exist, err := s.GetWorkflowDetailById(id) @@ -126,7 +126,7 @@ func CreateApproveInstance(id string) { } } -func UpdateApproveStatus(workflowId, stepId uint, phone, status, reason string) { +func UpdateApprove(workflowId, stepId uint, phone, status, reason string) { newLog := log.NewEntry() s := model.GetStorage() @@ -158,7 +158,7 @@ func UpdateApproveStatus(workflowId, stepId uint, phone, status, reason string) } } -func CancelApproveInstance(workflowID, workflowStepId uint) { +func CancelApprove(workflowID, workflowStepId uint) { newLog := log.NewEntry() s := model.GetStorage() dingTalkInst, exist, err := s.GetDingTalkInstanceByWorkflowStepID(workflowID, workflowStepId) From bb774009d9e1e5ef768e9f584c89b2bd35d2f366 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 19:57:26 +0800 Subject: [PATCH 12/19] Adjust the approval template and create an approval instance --- sqle/model/workflow.go | 6 +++--- sqle/pkg/im/dingding/dingding.go | 6 +++--- sqle/pkg/im/im.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sqle/model/workflow.go b/sqle/model/workflow.go index ff54adb098..adef727a5e 100644 --- a/sqle/model/workflow.go +++ b/sqle/model/workflow.go @@ -199,8 +199,8 @@ type WorkflowInstanceRecord struct { IsSQLExecuted bool ExecutionUserId uint - Instance *Instance `gorm:"foreignkey:InstanceId"` - ExecuteSQL *ExecuteSQL `gorm:"foreignkey:TaskId"` + Instance *Instance `gorm:"foreignkey:InstanceId"` + Task *Task `gorm:"foreignkey:TaskId"` } func (s *Storage) GetWorkInstanceRecordByTaskId(id string) (instanceRecord WorkflowInstanceRecord, err error) { @@ -612,7 +612,7 @@ func (s *Storage) getWorkflowStepsByRecordIds(ids []uint) ([]*WorkflowStep, erro func (s *Storage) getWorkflowInstanceRecordsByRecordId(id uint) ([]*WorkflowInstanceRecord, error) { instanceRecords := []*WorkflowInstanceRecord{} - err := s.db.Preload("Instance").Preload("ExecuteSQL").Where("workflow_record_id = ?", id). + err := s.db.Preload("Instance").Preload("Task").Where("workflow_record_id = ?", id). Find(&instanceRecords).Error if err != nil { return nil, errors.New(errors.ConnectStorageError, err) diff --git a/sqle/pkg/im/dingding/dingding.go b/sqle/pkg/im/dingding/dingding.go index ccbad4395e..5c5f296458 100644 --- a/sqle/pkg/im/dingding/dingding.go +++ b/sqle/pkg/im/dingding/dingding.go @@ -24,7 +24,7 @@ const ( timeout = 30 * time.Second workflowNameComp = "工单名称" - SqlComp = "SQL语句" + auditResultScore = "审核结果评分" ) type DingTalk struct { @@ -84,7 +84,7 @@ func (d *DingTalk) CreateApprovalTemplate() error { ComponentType: tea.String("TextField"), Props: &dingTalkWorkflow.FormComponentProps{ ComponentId: tea.String("TextField_27EZxEGStCx21"), - Label: tea.String(SqlComp), + Label: tea.String(auditResultScore), }, } @@ -138,7 +138,7 @@ func (d *DingTalk) CreateApprovalInstance(workflowName string, workflowId, curre Name: tea.String(workflowNameComp), Value: tea.String(workflowName), }, &dingTalkWorkflow.StartProcessInstanceRequestFormComponentValues{ - Name: tea.String(SqlComp), + Name: tea.String(auditResultScore), Value: tea.String(sqlContent), }) diff --git a/sqle/pkg/im/im.go b/sqle/pkg/im/im.go index 9b53078cdf..989cb89ce3 100644 --- a/sqle/pkg/im/im.go +++ b/sqle/pkg/im/im.go @@ -59,7 +59,7 @@ func CreateApprove(id string) { var buff bytes.Buffer for _, record := range workflow.Record.InstanceRecords { - buff.WriteString(fmt.Sprintf("数据源%s:%s\n", record.Instance.Name, record.ExecuteSQL.Content)) + buff.WriteString(fmt.Sprintf("数据源%s:%d;", record.Instance.Name, record.Task.Score)) } if workflow.CreateUser.Phone == "" { From 48e5ea949c2a612d8e3b28d5435b50231f2e8ddd Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 20:28:04 +0800 Subject: [PATCH 13/19] Obtain sqle user according to DingTalk userId --- sqle/model/user.go | 9 --------- sqle/server/sqled.go | 18 ++++++++---------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/sqle/model/user.go b/sqle/model/user.go index f55ecd6cee..a4c4e0155c 100644 --- a/sqle/model/user.go +++ b/sqle/model/user.go @@ -110,15 +110,6 @@ func (s *Storage) GetUserByThirdPartyUserID(thirdPartyUserID string) (*User, boo return t, true, errors.New(errors.ConnectStorageError, err) } -func (s *Storage) GetUserByPhone(phone string) (*User, bool, error) { - user := &User{} - err := s.db.Where("phone = ?", phone).First(user).Error - if err == gorm.ErrRecordNotFound { - return user, false, nil - } - return user, true, errors.New(errors.ConnectStorageError, err) -} - func (s *Storage) GetUserByName(name string) (*User, bool, error) { t := &User{} err := s.db.Where("login_name = ?", name).First(t).Error diff --git a/sqle/server/sqled.go b/sqle/server/sqled.go index ec5c62ad87..3de7f7f9c1 100644 --- a/sqle/server/sqled.go +++ b/sqle/server/sqled.go @@ -240,7 +240,7 @@ func (s *Sqled) dingTalkRotation() error { } userId := *approval.OperationRecords[1].UserId - user, err := getUserByUserId(d, userId, st) + user, err := getUserByUserId(d, userId, workflow.CurrentStep().Assignees) if err != nil { log.NewEntry().Errorf("get user by user id error: %v", err) continue @@ -280,7 +280,7 @@ func (s *Sqled) dingTalkRotation() error { } userId := *approval.OperationRecords[1].UserId - user, err := getUserByUserId(d, userId, st) + user, err := getUserByUserId(d, userId, workflow.CurrentStep().Assignees) if err != nil { log.NewEntry().Errorf("get user by user id error: %v", err) continue @@ -352,21 +352,19 @@ func RejectWorkflowProcess(workflow *model.Workflow, reason string, user *model. return nil } -func getUserByUserId(d *dingding.DingTalk, userId string, st *model.Storage) (*model.User, error) { +func getUserByUserId(d *dingding.DingTalk, userId string, assignees []*model.User) (*model.User, error) { phone, err := d.GetMobileByUserID(userId) if err != nil { return nil, fmt.Errorf("get user mobile error: %v", err) } - user, exist, err := st.GetUserByPhone(phone) - if err != nil { - return nil, fmt.Errorf("get user by phone error: %v", err) - } - if !exist { - return nil, fmt.Errorf("user not exist, phone: %s", phone) + for _, assignee := range assignees { + if assignee.Phone == phone { + return assignee, nil + } } - return user, nil + return nil, fmt.Errorf("user not found, phone: %s", phone) } const ( From 219a7236fdb4e3f2ec37a3f2ba36a9e382eb4f1f Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 20:29:39 +0800 Subject: [PATCH 14/19] Fix an address update error caused by update workflow --- sqle/api/controller/v1/workflow.go | 4 +++- sqle/server/sqled.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sqle/api/controller/v1/workflow.go b/sqle/api/controller/v1/workflow.go index b37aafedca..85852599f8 100644 --- a/sqle/api/controller/v1/workflow.go +++ b/sqle/api/controller/v1/workflow.go @@ -395,6 +395,8 @@ func ApproveWorkflow(c echo.Context) error { return controller.JSONBaseErrorReq(c, ErrWorkflowNoAccess) } + nextStep := workflow.NextStep() + err = CheckUserCanOperateStep(user, workflow, stepId) if err != nil { return controller.JSONBaseErrorReq(c, errors.New(errors.DataInvalid, err)) @@ -406,7 +408,7 @@ func ApproveWorkflow(c echo.Context) error { go im.UpdateApprove(workflow.ID, workflow.CurrentStep().ID, user.Phone, model.ApproveStatusAgree, "") - if workflow.NextStep().Template.Typ != model.WorkflowStepTypeSQLExecute { + if nextStep.Template.Typ != model.WorkflowStepTypeSQLExecute { go im.CreateApprove(strconv.Itoa(int(workflow.ID))) } diff --git a/sqle/server/sqled.go b/sqle/server/sqled.go index 3de7f7f9c1..8743084352 100644 --- a/sqle/server/sqled.go +++ b/sqle/server/sqled.go @@ -239,6 +239,8 @@ func (s *Sqled) dingTalkRotation() error { continue } + nextStep := workflow.NextStep() + userId := *approval.OperationRecords[1].UserId user, err := getUserByUserId(d, userId, workflow.CurrentStep().Assignees) if err != nil { @@ -257,7 +259,7 @@ func (s *Sqled) dingTalkRotation() error { continue } - if workflow.NextStep().Template.Typ != model.WorkflowStepTypeSQLExecute { + if nextStep.Template.Typ != model.WorkflowStepTypeSQLExecute { imPkg.CreateApprove(strconv.Itoa(int(workflow.ID))) } From 3291ae69d4d2181de943a3b58a0e01ab6b524d9d Mon Sep 17 00:00:00 2001 From: taolx0 Date: Thu, 22 Dec 2022 20:35:51 +0800 Subject: [PATCH 15/19] optimize audit result score show --- sqle/pkg/im/im.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqle/pkg/im/im.go b/sqle/pkg/im/im.go index 989cb89ce3..2492553598 100644 --- a/sqle/pkg/im/im.go +++ b/sqle/pkg/im/im.go @@ -59,7 +59,7 @@ func CreateApprove(id string) { var buff bytes.Buffer for _, record := range workflow.Record.InstanceRecords { - buff.WriteString(fmt.Sprintf("数据源%s:%d;", record.Instance.Name, record.Task.Score)) + buff.WriteString(fmt.Sprintf("数据源%s审核评分%d;", record.Instance.Name, record.Task.Score)) } if workflow.CreateUser.Phone == "" { From 8f5cf9b78c6c48c0b83ce67f3aebda54eea88e49 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Fri, 23 Dec 2022 13:04:14 +0800 Subject: [PATCH 16/19] add default branch --- sqle/server/sqled.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqle/server/sqled.go b/sqle/server/sqled.go index 8743084352..ad9216c0de 100644 --- a/sqle/server/sqled.go +++ b/sqle/server/sqled.go @@ -298,6 +298,8 @@ func (s *Sqled) dingTalkRotation() error { log.NewEntry().Errorf("save ding talk instance error: %v", err) continue } + default: + log.NewEntry().Info("ding talk rotation, no action") } } } From 9b32faf9cc6217939177dba3e4317e20f10525ec Mon Sep 17 00:00:00 2001 From: taolx0 Date: Fri, 23 Dec 2022 15:01:21 +0800 Subject: [PATCH 17/19] audit result new line --- sqle/pkg/im/dingding/dingding.go | 6 +++--- sqle/pkg/im/im.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sqle/pkg/im/dingding/dingding.go b/sqle/pkg/im/dingding/dingding.go index 5c5f296458..7191501e8d 100644 --- a/sqle/pkg/im/dingding/dingding.go +++ b/sqle/pkg/im/dingding/dingding.go @@ -24,7 +24,7 @@ const ( timeout = 30 * time.Second workflowNameComp = "工单名称" - auditResultScore = "审核结果评分" + auditResultScore = "审核结果" ) type DingTalk struct { @@ -81,9 +81,9 @@ func (d *DingTalk) CreateApprovalTemplate() error { } sqlComponent := &dingTalkWorkflow.FormComponent{ - ComponentType: tea.String("TextField"), + ComponentType: tea.String("TextareaField"), Props: &dingTalkWorkflow.FormComponentProps{ - ComponentId: tea.String("TextField_27EZxEGStCx21"), + ComponentId: tea.String("TextareaField_27EZxEGStCx21"), Label: tea.String(auditResultScore), }, } diff --git a/sqle/pkg/im/im.go b/sqle/pkg/im/im.go index 2492553598..ea1b0b8a8f 100644 --- a/sqle/pkg/im/im.go +++ b/sqle/pkg/im/im.go @@ -59,7 +59,7 @@ func CreateApprove(id string) { var buff bytes.Buffer for _, record := range workflow.Record.InstanceRecords { - buff.WriteString(fmt.Sprintf("数据源%s审核评分%d;", record.Instance.Name, record.Task.Score)) + buff.WriteString(fmt.Sprintf("数据源: %v;审核得分: %v;审核通过率: %v%%;\r\n", record.Instance.Name, record.Task.Score, record.Task.PassRate*100)) } if workflow.CreateUser.Phone == "" { From 5be33a546ee6450520b642ee8e1a1a215cb307f2 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Fri, 23 Dec 2022 15:09:50 +0800 Subject: [PATCH 18/19] Add comments to improve readability --- sqle/server/sqled.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqle/server/sqled.go b/sqle/server/sqled.go index ad9216c0de..93e6d5c137 100644 --- a/sqle/server/sqled.go +++ b/sqle/server/sqled.go @@ -299,7 +299,7 @@ func (s *Sqled) dingTalkRotation() error { continue } default: - log.NewEntry().Info("ding talk rotation, no action") + // ding talk rotation, no action } } } From ed8efdbfd8514e4093cdd9ba0e097e22b909f827 Mon Sep 17 00:00:00 2001 From: taolx0 Date: Fri, 23 Dec 2022 15:39:47 +0800 Subject: [PATCH 19/19] spell check --- spelling_dict.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/spelling_dict.txt b/spelling_dict.txt index be1d4a6da9..af74630ff5 100644 --- a/spelling_dict.txt +++ b/spelling_dict.txt @@ -352,5 +352,15 @@ dbeaver logon alipay oltp -dinghkwuua1gf099mfhl -tug9edq1baq9jilkcvsmtb6vr_a-fhb9zhtcwzdjyptf1ftouphm_5xpckjk0hgn \ No newline at end of file +dingding +oapi +topapi +dingtalk +orgapp +textarea +approvers +actioner +errcode +errmsg +userid +getbymobile