mirror of
https://github.com/hanzokms/terraform-provider.git
synced 2026-10-30 20:29:45 +00:00
31 lines
733 B
Go
31 lines
733 B
Go
package kmsclient
|
|
|
|
import (
|
|
"github.com/hanzokms/terraform-provider/internal/errors"
|
|
)
|
|
|
|
const (
|
|
operationGetIdentityDetails = "CallGetIdentityDetails"
|
|
)
|
|
|
|
func (client Client) GetIdentityDetails() (GetIdentityDetailsResponse, error) {
|
|
var body GetIdentityDetailsResponse
|
|
|
|
httpRequest := client.Config.HttpClient.
|
|
R().
|
|
SetResult(&body).
|
|
SetHeader("User-Agent", USER_AGENT)
|
|
|
|
response, err := httpRequest.Get("api/v1/identities/details")
|
|
|
|
if err != nil {
|
|
return GetIdentityDetailsResponse{}, errors.NewGenericRequestError(operationGetIdentityDetails, err)
|
|
}
|
|
|
|
if response.IsError() {
|
|
return GetIdentityDetailsResponse{}, errors.NewAPIErrorWithResponse(operationGetIdentityDetails, response, nil)
|
|
}
|
|
|
|
return body, nil
|
|
}
|