-
Notifications
You must be signed in to change notification settings - Fork 3
/
kms_runtime_options.go
51 lines (47 loc) · 1.39 KB
/
kms_runtime_options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package models
import (
teautil "github.com/alibabacloud-go/tea-utils/v2/service"
"github.com/alibabacloud-go/tea/tea"
dkmsutil "github.com/aliyun/alibabacloud-dkms-gcs-go-sdk/openapi-util"
)
type KmsRuntimeOptions struct {
*teautil.RuntimeOptions
IsUseKmsShareGateway *bool
Encoding *string
}
func TransferKmsRuntimeOptions(runtime interface{}) (*KmsRuntimeOptions, error) {
kmsRuntime := &KmsRuntimeOptions{}
switch r := runtime.(type) {
case *KmsRuntimeOptions:
kmsRuntime = r
case KmsRuntimeOptions:
kmsRuntime = &r
case *teautil.RuntimeOptions:
kmsRuntime.RuntimeOptions = r
case teautil.RuntimeOptions:
kmsRuntime.RuntimeOptions = &r
default:
return nil, tea.NewSDKError(map[string]interface{}{
"message": "Not support runtime param type.",
})
}
return kmsRuntime, nil
}
func (kro *KmsRuntimeOptions) ToDKmsRuntimeOptions() *dkmsutil.RuntimeOptions {
return &dkmsutil.RuntimeOptions{
Autoretry: kro.Autoretry,
IgnoreSSL: kro.IgnoreSSL,
MaxAttempts: kro.MaxAttempts,
BackoffPolicy: kro.BackoffPolicy,
BackoffPeriod: kro.BackoffPeriod,
ReadTimeout: kro.ReadTimeout,
ConnectTimeout: kro.ConnectTimeout,
HttpProxy: kro.HttpProxy,
HttpsProxy: kro.HttpsProxy,
NoProxy: kro.NoProxy,
MaxIdleConns: kro.MaxIdleConns,
Socks5Proxy: kro.Socks5Proxy,
Socks5NetWork: kro.Socks5NetWork,
Verify: kro.Ca,
}
}