Пример #1
0
func (client *Client) GetUser(userName string) (user *User, e error) {
	raw, e := client.DoSignedRequest("GET", ENDPOINT, aws.QueryPrefix(API_VERSION, "GetUser"), nil)
	if e != nil {
		return user, e
	}
	rsp := &GetUserResponse{}
	e = xml.Unmarshal(raw.Content, rsp)
	if e != nil {
		return user, e
	}
	return rsp.User, nil
}
Пример #2
0
func (client *Client) ListAccountAliases() (aliases *ListAccountAliasesResponse, e error) {
	raw, e := client.DoSignedRequest("GET", ENDPOINT, aws.QueryPrefix(API_VERSION, "ListAccountAliases"), nil)
	if e != nil {
		return aliases, e
	}
	rsp := &ListAccountAliasesResponse{}
	e = xml.Unmarshal(raw.Content, rsp)
	if e != nil {
		return rsp, e
	}
	return rsp, nil
}
Пример #3
0
func (client *Client) GetAccountSummary() (m *SummaryMap, e error) {
	raw, e := client.DoSignedRequest("GET", ENDPOINT, aws.QueryPrefix(API_VERSION, "GetAccountSummary"), nil)
	if e != nil {
		return m, e
	}
	rsp := &GetAccountSummaryResponse{}
	if e := aws.ExtractError(raw.Content); e != nil {
		return nil, e
	}
	e = xml.Unmarshal(raw.Content, rsp)
	if e != nil {
		return m, e
	}
	return rsp.SummaryMap, nil
}
Пример #4
0
func (client *Client) ListMFADevices(username string) (*ListMFADevicesResponse, error) {
	params := map[string]string{"UserName": username}
	raw, err := client.DoSignedRequest(
		"GET", ENDPOINT,
		aws.QueryPrefix(API_VERSION, "ListMFADevices"),
		params)
	if err != nil {
		return nil, err
	}
	rsp := &ListMFADevicesResponse{}
	err = xml.Unmarshal(raw.Content, rsp)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}