Skip to content

Commit

Permalink
feat(api): api update (#3603)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 14, 2024
1 parent eca1540 commit fc33831
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 1,2 @@
configured_endpoints: 1417
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-238bdc2301e165198e92ece05a86c3b80aa6653c5cd7334b3dc59fd9d687acce.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-1c64fbec9a1e17ca560abf251c26a4adb4d60123dbe3f7dcc10819494cd97a6f.yml
49 changes: 23 additions & 26 deletions email_security/investigate.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 38,7 @@ func NewInvestigateService(opts ...option.RequestOption) (r *InvestigateService)
return
}

// This endpoint returns information for each email that matches the search
// parameter(s).
// Returns information for each email that matches the search parameter(s).
func (r *InvestigateService) List(ctx context.Context, params InvestigateListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[InvestigateListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
Expand All @@ -61,14 60,13 @@ func (r *InvestigateService) List(ctx context.Context, params InvestigateListPar
return res, nil
}

// This endpoint returns information for each email that matches the search
// parameter(s).
// Returns information for each email that matches the search parameter(s).
func (r *InvestigateService) ListAutoPaging(ctx context.Context, params InvestigateListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[InvestigateListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}

// For emails that have a detection, this endpoint returns detection details such
// as threat categories, sender information, and links.
// Returns detection details such as threat categories and sender information for
// non-benign messages.
func (r *InvestigateService) Detections(ctx context.Context, postfixID string, query InvestigateDetectionsParams, opts ...option.RequestOption) (res *InvestigateDetectionsResponse, err error) {
var env InvestigateDetectionsResponseEnvelope
opts = append(r.Options[:], opts...)
Expand Down Expand Up @@ -110,8 108,8 @@ func (r *InvestigateService) Get(ctx context.Context, postfixID string, query In
return
}

// For emails that have a detection, this endpoint returns a preview of the message
// body as a base64 encoded PNG image.
// Returns a preview of the message body as a base64 encoded PNG image for
// non-benign messages.
func (r *InvestigateService) Preview(ctx context.Context, postfixID string, query InvestigatePreviewParams, opts ...option.RequestOption) (res *InvestigatePreviewResponse, err error) {
var env InvestigatePreviewResponseEnvelope
opts = append(r.Options[:], opts...)
Expand All @@ -132,8 130,7 @@ func (r *InvestigateService) Preview(ctx context.Context, postfixID string, quer
return
}

// For emails that have a detection, this endpoint returns the raw email as an EML
// file.
// Returns the raw eml of any non-benign message.
func (r *InvestigateService) Raw(ctx context.Context, postfixID string, query InvestigateRawParams, opts ...option.RequestOption) (res *InvestigateRawResponse, err error) {
var env InvestigateRawResponseEnvelope
opts = append(r.Options[:], opts...)
Expand Down Expand Up @@ -182,7 179,7 @@ type InvestigateListResponse struct {
DetectionReasons []string `json:"detection_reasons,required"`
IsPhishSubmission bool `json:"is_phish_submission,required"`
IsQuarantined bool `json:"is_quarantined,required"`
// Message identifier
// The identifier of the message.
PostfixID string `json:"postfix_id,required"`
Ts string `json:"ts,required"`
AlertID string `json:"alert_id,nullable"`
Expand Down Expand Up @@ -499,9 496,9 @@ func (r investigateDetectionsResponseLinkJSON) RawJSON() string {
}

type InvestigateDetectionsResponseSenderInfo struct {
// Name of the autonomous system
// The name of the autonomous system.
AsName string `json:"as_name,nullable"`
// Number of the autonomous system
// The number of the autonomous system.
AsNumber int64 `json:"as_number,nullable"`
Geo string `json:"geo,nullable"`
IP string `json:"ip,nullable"`
Expand Down Expand Up @@ -665,7 662,7 @@ type InvestigateGetResponse struct {
DetectionReasons []string `json:"detection_reasons,required"`
IsPhishSubmission bool `json:"is_phish_submission,required"`
IsQuarantined bool `json:"is_quarantined,required"`
// Message identifier
// The identifier of the message.
PostfixID string `json:"postfix_id,required"`
Ts string `json:"ts,required"`
AlertID string `json:"alert_id,nullable"`
Expand Down Expand Up @@ -849,7 846,7 @@ func (r InvestigateGetResponseValidationSPF) IsKnown() bool {
}

type InvestigatePreviewResponse struct {
// Base64 encoded PNG image
// A base64 encoded PNG image of the email.
Screenshot string `json:"screenshot,required"`
JSON investigatePreviewResponseJSON `json:"-"`
}
Expand All @@ -871,7 868,7 @@ func (r investigatePreviewResponseJSON) RawJSON() string {
}

type InvestigateRawResponse struct {
// UTF-8 encoded eml file
// A UTF-8 encoded eml file of the email.
Raw string `json:"raw,required"`
JSON investigateRawResponseJSON `json:"-"`
}
Expand Down Expand Up @@ -1010,26 1007,26 @@ func (r investigateTraceResponseOutboundLineJSON) RawJSON() string {
type InvestigateListParams struct {
// Account Identifier
AccountID param.Field[string] `path:"account_id,required"`
// Controls whether the message action log in included in the response.
// Determines if the message action log is included in the response.
ActionLog param.Field[bool] `query:"action_log"`
AlertID param.Field[string] `query:"alert_id"`
// If `false`, the search includes non-detections.
// Determines if the search results will include detections or not.
DetectionsOnly param.Field[bool] `query:"detections_only"`
// Filter by the sender domain
// The sender domains the search filters by.
Domain param.Field[string] `query:"domain"`
// The end of the search date range. Defaults to `now`.
End param.Field[time.Time] `query:"end" format:"date-time"`
// Filter messages by the provided disposition.
// The dispositions the search filters by.
FinalDisposition param.Field[InvestigateListParamsFinalDisposition] `query:"final_disposition"`
// Filter messages by actions applied to them
// The message actions the search filters by.
MessageAction param.Field[InvestigateListParamsMessageAction] `query:"message_action"`
MessageID param.Field[string] `query:"message_id"`
Metric param.Field[string] `query:"metric"`
// Page number of paginated results.
// The page number of paginated results.
Page param.Field[int64] `query:"page"`
// Number of results to display.
// The number of results per page.
PerPage param.Field[int64] `query:"per_page"`
// Space delimited query term(s). The search is case-insensitive.
// The space-delimited term used in the query. The search is case-insensitive.
//
// The content of the following email metadata fields are searched:
//
Expand Down Expand Up @@ -1068,7 1065,7 @@ func (r InvestigateListParams) URLQuery() (v url.Values) {
})
}

// Filter messages by the provided disposition.
// The dispositions the search filters by.
type InvestigateListParamsFinalDisposition string

const (
Expand All @@ -1087,7 1084,7 @@ func (r InvestigateListParamsFinalDisposition) IsKnown() bool {
return false
}

// Filter messages by actions applied to them
// The message actions the search filters by.
type InvestigateListParamsMessageAction string

const (
Expand Down
8 changes: 4 additions & 4 deletions email_security/settingallowpattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 57,7 @@ func (r *SettingAllowPatternService) New(ctx context.Context, params SettingAllo
return
}

// List, search, and sort an accounts's email allow patterns.
// Lists, searches, and sorts an account’s email allow patterns.
func (r *SettingAllowPatternService) List(ctx context.Context, params SettingAllowPatternListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[SettingAllowPatternListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
Expand All @@ -79,7 79,7 @@ func (r *SettingAllowPatternService) List(ctx context.Context, params SettingAll
return res, nil
}

// List, search, and sort an accounts's email allow patterns.
// Lists, searches, and sorts an account’s email allow patterns.
func (r *SettingAllowPatternService) ListAutoPaging(ctx context.Context, params SettingAllowPatternListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[SettingAllowPatternListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}
Expand Down Expand Up @@ -571,10 571,10 @@ type SettingAllowPatternListParams struct {
IsSpoof param.Field[bool] `query:"is_spoof"`
// The field to sort by.
Order param.Field[SettingAllowPatternListParamsOrder] `query:"order"`
// Page number of paginated results.
// The page number of paginated results.
Page param.Field[int64] `query:"page"`
PatternType param.Field[SettingAllowPatternListParamsPatternType] `query:"pattern_type"`
// Number of results to display.
// The number of results per page.
PerPage param.Field[int64] `query:"per_page"`
// Allows searching in multiple properties of a record simultaneously. This
// parameter is intended for human users, not automation. Its exact behavior is
Expand Down
4 changes: 2 additions & 2 deletions email_security/settingblocksender.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 524,10 @@ type SettingBlockSenderListParams struct {
Direction param.Field[SettingBlockSenderListParamsDirection] `query:"direction"`
// The field to sort by.
Order param.Field[SettingBlockSenderListParamsOrder] `query:"order"`
// Page number of paginated results.
// The page number of paginated results.
Page param.Field[int64] `query:"page"`
PatternType param.Field[SettingBlockSenderListParamsPatternType] `query:"pattern_type"`
// Number of results to display.
// The number of results per page.
PerPage param.Field[int64] `query:"per_page"`
// Allows searching in multiple properties of a record simultaneously. This
// parameter is intended for human users, not automation. Its exact behavior is
Expand Down
21 changes: 10 additions & 11 deletions email_security/settingdomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 38,7 @@ func NewSettingDomainService(opts ...option.RequestOption) (r *SettingDomainServ
return
}

// List, search, and sort an account's email domains.
// Lists, searches, and sorts an accounts email domains.
func (r *SettingDomainService) List(ctx context.Context, params SettingDomainListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[SettingDomainListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
Expand All @@ -60,7 60,7 @@ func (r *SettingDomainService) List(ctx context.Context, params SettingDomainLis
return res, nil
}

// List, search, and sort an account's email domains.
// Lists, searches, and sorts an accounts email domains.
func (r *SettingDomainService) ListAutoPaging(ctx context.Context, params SettingDomainListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[SettingDomainListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}
Expand Down Expand Up @@ -100,7 100,7 @@ func (r *SettingDomainService) Edit(ctx context.Context, domainID int64, params
}

type SettingDomainListResponse struct {
// Unique domain identifier
// The unique identifier for the domain.
ID int64 `json:"id,required"`
AllowedDeliveryModes []SettingDomainListResponseAllowedDeliveryMode `json:"allowed_delivery_modes,required"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Expand Down Expand Up @@ -171,7 171,7 @@ func (r SettingDomainListResponseFolder) IsKnown() bool {
}

type SettingDomainDeleteResponse struct {
// Unique domain identifier
// The unique identifier for the domain.
ID int64 `json:"id,required"`
JSON settingDomainDeleteResponseJSON `json:"-"`
}
Expand All @@ -193,7 193,7 @@ func (r settingDomainDeleteResponseJSON) RawJSON() string {
}

type SettingDomainEditResponse struct {
// Unique domain identifier
// The unique identifier for the domain.
ID int64 `json:"id,required"`
AllowedDeliveryModes []SettingDomainEditResponseAllowedDeliveryMode `json:"allowed_delivery_modes,required"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
Expand Down Expand Up @@ -266,18 266,17 @@ func (r SettingDomainEditResponseFolder) IsKnown() bool {
type SettingDomainListParams struct {
// Account Identifier
AccountID param.Field[string] `path:"account_id,required"`
// If present, the response contains only domains with the provided delivery mode.
// Filters response to domains with the provided delivery mode.
AllowedDeliveryMode param.Field[SettingDomainListParamsAllowedDeliveryMode] `query:"allowed_delivery_mode"`
// The sorting direction.
Direction param.Field[SettingDomainListParamsDirection] `query:"direction"`
// Filter result by the provided domains. Allows for multiple occurrences, e.g.,
// `domain=example.com&domain=example.xyz`.
// Filters results by the provided domains, allowing for multiple occurrences.
Domain param.Field[[]string] `query:"domain"`
// The field to sort by.
Order param.Field[SettingDomainListParamsOrder] `query:"order"`
// Page number of paginated results.
// The page number of paginated results.
Page param.Field[int64] `query:"page"`
// Number of results to display.
// The number of results per page.
PerPage param.Field[int64] `query:"per_page"`
// Allows searching in multiple properties of a record simultaneously. This
// parameter is intended for human users, not automation. Its exact behavior is
Expand All @@ -294,7 293,7 @@ func (r SettingDomainListParams) URLQuery() (v url.Values) {
})
}

// If present, the response contains only domains with the provided delivery mode.
// Filters response to domains with the provided delivery mode.
type SettingDomainListParamsAllowedDeliveryMode string

const (
Expand Down
8 changes: 4 additions & 4 deletions email_security/settingimpersonationregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 57,7 @@ func (r *SettingImpersonationRegistryService) New(ctx context.Context, params Se
return
}

// List, search, and sort entries in impersonation registry.
// Lists, searches, and sorts entries in the impersonation registry.
func (r *SettingImpersonationRegistryService) List(ctx context.Context, params SettingImpersonationRegistryListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[SettingImpersonationRegistryListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
Expand All @@ -79,7 79,7 @@ func (r *SettingImpersonationRegistryService) List(ctx context.Context, params S
return res, nil
}

// List, search, and sort entries in impersonation registry.
// Lists, searches, and sorts entries in the impersonation registry.
func (r *SettingImpersonationRegistryService) ListAutoPaging(ctx context.Context, params SettingImpersonationRegistryListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[SettingImpersonationRegistryListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}
Expand Down Expand Up @@ -461,9 461,9 @@ type SettingImpersonationRegistryListParams struct {
Direction param.Field[SettingImpersonationRegistryListParamsDirection] `query:"direction"`
// The field to sort by.
Order param.Field[SettingImpersonationRegistryListParamsOrder] `query:"order"`
// Page number of paginated results.
// The page number of paginated results.
Page param.Field[int64] `query:"page"`
// Number of results to display.
// The number of results per page.
PerPage param.Field[int64] `query:"per_page"`
Provenance param.Field[SettingImpersonationRegistryListParamsProvenance] `query:"provenance"`
// Allows searching in multiple properties of a record simultaneously. This
Expand Down
8 changes: 4 additions & 4 deletions email_security/settingtrusteddomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 57,7 @@ func (r *SettingTrustedDomainService) New(ctx context.Context, params SettingTru
return
}

// List, search, and sort an account's trusted email domains.
// Lists, searches, and sorts an accounts trusted email domains.
func (r *SettingTrustedDomainService) List(ctx context.Context, params SettingTrustedDomainListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[SettingTrustedDomainListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
Expand All @@ -79,7 79,7 @@ func (r *SettingTrustedDomainService) List(ctx context.Context, params SettingTr
return res, nil
}

// List, search, and sort an account's trusted email domains.
// Lists, searches, and sorts an accounts trusted email domains.
func (r *SettingTrustedDomainService) ListAutoPaging(ctx context.Context, params SettingTrustedDomainListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[SettingTrustedDomainListResponse] {
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, params, opts...))
}
Expand Down Expand Up @@ -435,9 435,9 @@ type SettingTrustedDomainListParams struct {
IsSimilarity param.Field[bool] `query:"is_similarity"`
// The field to sort by.
Order param.Field[SettingTrustedDomainListParamsOrder] `query:"order"`
// Page number of paginated results.
// The page number of paginated results.
Page param.Field[int64] `query:"page"`
// Number of results to display.
// The number of results per page.
PerPage param.Field[int64] `query:"per_page"`
// Allows searching in multiple properties of a record simultaneously. This
// parameter is intended for human users, not automation. Its exact behavior is
Expand Down

0 comments on commit fc33831

Please sign in to comment.