summaryrefslogtreecommitdiff
path: root/vendor/github.com/mitchellh/packer/vendor/github.com/denverdino/aliyungo/ram/profile.go
blob: fb82761932452219a92d9eadf3741b4e65ee8578 (plain)
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
52
53
54
55
56
package ram

/*
	CreateLoginProfile()
	GetLoginProfile()
	DeleteLoginProfile()
	UpdateLoginProfile()
*/

type ProfileRequest struct {
	UserName              string
	Password              string
	PasswordResetRequired bool
	MFABindRequired       bool
}

type ProfileResponse struct {
	RamCommonResponse
	LoginProfile LoginProfile
}

func (client *RamClient) CreateLoginProfile(req ProfileRequest) (ProfileResponse, error) {
	var resp ProfileResponse
	err := client.Invoke("CreateLoginProfile", req, &resp)
	if err != nil {
		return ProfileResponse{}, err
	}
	return resp, nil
}

func (client *RamClient) GetLoginProfile(req UserQueryRequest) (ProfileResponse, error) {
	var resp ProfileResponse
	err := client.Invoke("GetLoginProfile", req, &resp)
	if err != nil {
		return ProfileResponse{}, err
	}
	return resp, nil
}

func (client *RamClient) DeleteLoginProfile(req UserQueryRequest) (RamCommonResponse, error) {
	var resp RamCommonResponse
	err := client.Invoke("DeleteLoginProfile", req, &resp)
	if err != nil {
		return RamCommonResponse{}, err
	}
	return resp, nil
}

func (client *RamClient) UpdateLoginProfile(req ProfileRequest) (ProfileResponse, error) {
	var resp ProfileResponse
	err := client.Invoke("UpdateLoginProfile", req, &resp)
	if err != nil {
		return ProfileResponse{}, err
	}
	return resp, nil
}