You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dynamix-golang-sdk/pkg/cloudbroker/grid/list_emails.go

38 lines
772 B

package grid
import (
"context"
"encoding/json"
"net/http"
)
// ListEmailsRequest struct for getting list of email addresses of users
type ListEmailsRequest struct {
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// ListEmails returns list of email addresses of users
func (g Grid) ListEmails(ctx context.Context, req ListEmailsRequest) (*ListEmails, error) {
url := "/cloudbroker/grid/listEmails"
res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return nil, err
}
list := ListEmails{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}