1package yundun_bastionhost
2
3//Licensed under the Apache License, Version 2.0 (the "License");
4//you may not use this file except in compliance with the License.
5//You may obtain a copy of the License at
6//
7//http://www.apache.org/licenses/LICENSE-2.0
8//
9//Unless required by applicable law or agreed to in writing, software
10//distributed under the License is distributed on an "AS IS" BASIS,
11//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//See the License for the specific language governing permissions and
13//limitations under the License.
14//
15// Code generated by Alibaba Cloud SDK Code Generator.
16// Changes may cause incorrect behavior and will be lost if the code is regenerated.
17
18import (
19	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
20	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
21	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
22)
23
24// Client is the sdk client struct, each func corresponds to an OpenAPI
25type Client struct {
26	sdk.Client
27}
28
29// NewClient creates a sdk client with environment variables
30// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
31func NewClient() (client *Client, err error) {
32	client = &Client{}
33	err = client.Init()
34	return
35}
36
37// NewClientWithProvider creates a sdk client with providers
38// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
39// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
40func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) {
41	client = &Client{}
42	var pc provider.Provider
43	if len(providers) == 0 {
44		pc = provider.DefaultChain
45	} else {
46		pc = provider.NewProviderChain(providers)
47	}
48	err = client.InitWithProviderChain(regionId, pc)
49	return
50}
51
52// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
53// this is the common api to create a sdk client
54// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
55func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
56	client = &Client{}
57	err = client.InitWithOptions(regionId, config, credential)
58	return
59}
60
61// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
62// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
63// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
64func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
65	client = &Client{}
66	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
67	return
68}
69
70// NewClientWithStsToken is a shortcut to create sdk client with sts token
71// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
72// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
73func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
74	client = &Client{}
75	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
76	return
77}
78
79// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
80// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
81// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
82func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
83	client = &Client{}
84	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
85	return
86}
87
88// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy
89// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
90// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
91func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
92	client = &Client{}
93	err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
94	return
95}
96
97// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
98// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
99// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
100func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
101	client = &Client{}
102	err = client.InitWithEcsRamRole(regionId, roleName)
103	return
104}
105
106// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
107// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
108// Deprecated: Please use github.com/aliyun/alibaba-cloud-sdk-go/services/yundun-bastionhost instead
109func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
110	client = &Client{}
111	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
112	return
113}
114