Skip to content

Commit d7739aa

Browse files
authored
feat(TEM): return/filter emails subject and add ToS when create a domain (#1585)
1 parent 0bae521 commit d7739aa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

api/tem/v1alpha1/tem_sdk.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ type Email struct {
234234
// RcptType: type of the recipient.
235235
// Default value: unknown_rcpt_type
236236
RcptType EmailRcptType `json:"rcpt_type"`
237+
// Subject: subject of the email.
238+
Subject string `json:"subject"`
237239
// CreatedAt: creation date of the email object.
238240
CreatedAt *time.Time `json:"created_at"`
239241
// UpdatedAt: last update time of the email object.
@@ -425,6 +427,8 @@ type ListEmailsRequest struct {
425427
MailTo *string `json:"-"`
426428
// Statuses: optional, list emails having any of this status.
427429
Statuses []EmailStatus `json:"-"`
430+
// Subject: optional, list emails having this subject.
431+
Subject *string `json:"-"`
428432
}
429433

430434
// ListEmails: list emails sent from a domain and/or for a project and/or for an organization.
@@ -452,6 +456,7 @@ func (s *API) ListEmails(req *ListEmailsRequest, opts ...scw.RequestOption) (*Li
452456
parameter.AddToQuery(query, "mail_from", req.MailFrom)
453457
parameter.AddToQuery(query, "mail_to", req.MailTo)
454458
parameter.AddToQuery(query, "statuses", req.Statuses)
459+
parameter.AddToQuery(query, "subject", req.Subject)
455460

456461
if fmt.Sprint(req.Region) == "" {
457462
return nil, errors.New("field Region cannot be empty in request")
@@ -571,10 +576,12 @@ func (s *API) CancelEmail(req *CancelEmailRequest, opts ...scw.RequestOption) (*
571576
type CreateDomainRequest struct {
572577
// Region: region to target. If none is passed will use default region from the config.
573578
Region scw.Region `json:"-"`
574-
579+
// ProjectID: ID of the project to which the domain belongs.
575580
ProjectID string `json:"project_id"`
576-
581+
// DomainName: fully qualified domain dame.
577582
DomainName string `json:"domain_name"`
583+
// AcceptTos: accept the Scaleway Terms of Service.
584+
AcceptTos bool `json:"accept_tos"`
578585
}
579586

580587
// CreateDomain: register a domain in a project.

0 commit comments

Comments
 (0)