Skip to content

Commit

Permalink
feat(api): api update (#3782)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 6, 2025
1 parent 3e9c173 commit ef35231
Show file tree
Hide file tree
Showing 22 changed files with 184 additions and 232 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: 1490
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b46e31e5f69309fc518f386002c3df2afeb03c0361127704253f9197d52d11d9.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-85569f0482730af4e8c6afc9b33c7ba894e47b2d8fa36a3e013daf5390adb647.yml
5 changes: 4 additions & 1 deletion radar/aibotsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (r *AIBotSummaryService) UserAgent(ctx context.Context, query AIBotSummaryU

type AIBotSummaryUserAgentResponse struct {
Meta AIBotSummaryUserAgentResponseMeta `json:"meta,required"`
Summary0 map[string][]string `json:"summary_0,required"`
Summary0 map[string]string `json:"summary_0,required"`
JSON aiBotSummaryUserAgentResponseJSON `json:"-"`
}

Expand Down Expand Up @@ -199,6 +199,9 @@ type AIBotSummaryUserAgentParams struct {
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
// Format results are returned in.
Format param.Field[AIBotSummaryUserAgentParamsFormat] `query:"format"`
// Limit the number of objects (eg browsers, verticals, etc) to the top items over
// the time range.
LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Expand Down
17 changes: 9 additions & 8 deletions radar/aibotsummary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ func TestAIBotSummaryUserAgentWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Radar.AI.Bots.Summary.UserAgent(context.TODO(), radar.AIBotSummaryUserAgentParams{
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AIBotSummaryUserAgentParamsFormatJson),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AIBotSummaryUserAgentParamsFormatJson),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
})
if err != nil {
var apierr *cloudflare.Error
Expand Down
2 changes: 1 addition & 1 deletion radar/aitimeseriesgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestAITimeseriesGroupUserAgentWithOptionalParams(t *testing.T) {
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AITimeseriesGroupUserAgentParamsFormatJson),
LimitPerGroup: cloudflare.F(int64(4)),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
})
Expand Down
70 changes: 12 additions & 58 deletions radar/as112summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,9 @@ func (r as112SummaryProtocolResponseSummary0JSON) RawJSON() string {
}

type AS112SummaryQueryTypeResponse struct {
Meta AS112SummaryQueryTypeResponseMeta `json:"meta,required"`
Summary0 AS112SummaryQueryTypeResponseSummary0 `json:"summary_0,required"`
JSON as112SummaryQueryTypeResponseJSON `json:"-"`
Meta AS112SummaryQueryTypeResponseMeta `json:"meta,required"`
Summary0 map[string]string `json:"summary_0,required"`
JSON as112SummaryQueryTypeResponseJSON `json:"-"`
}

// as112SummaryQueryTypeResponseJSON contains the JSON metadata for the struct
Expand Down Expand Up @@ -862,39 +862,10 @@ func (r as112SummaryQueryTypeResponseMetaConfidenceInfoAnnotationJSON) RawJSON()
return r.raw
}

type AS112SummaryQueryTypeResponseSummary0 struct {
A string `json:"A,required"`
AAAA string `json:"AAAA,required"`
PTR string `json:"PTR,required"`
SOA string `json:"SOA,required"`
SRV string `json:"SRV,required"`
JSON as112SummaryQueryTypeResponseSummary0JSON `json:"-"`
}

// as112SummaryQueryTypeResponseSummary0JSON contains the JSON metadata for the
// struct [AS112SummaryQueryTypeResponseSummary0]
type as112SummaryQueryTypeResponseSummary0JSON struct {
A apijson.Field
AAAA apijson.Field
PTR apijson.Field
SOA apijson.Field
SRV apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *AS112SummaryQueryTypeResponseSummary0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r as112SummaryQueryTypeResponseSummary0JSON) RawJSON() string {
return r.raw
}

type AS112SummaryResponseCodesResponse struct {
Meta AS112SummaryResponseCodesResponseMeta `json:"meta,required"`
Summary0 AS112SummaryResponseCodesResponseSummary0 `json:"summary_0,required"`
JSON as112SummaryResponseCodesResponseJSON `json:"-"`
Meta AS112SummaryResponseCodesResponseMeta `json:"meta,required"`
Summary0 map[string]string `json:"summary_0,required"`
JSON as112SummaryResponseCodesResponseJSON `json:"-"`
}

// as112SummaryResponseCodesResponseJSON contains the JSON metadata for the struct
Expand Down Expand Up @@ -1023,29 +994,6 @@ func (r as112SummaryResponseCodesResponseMetaConfidenceInfoAnnotationJSON) RawJS
return r.raw
}

type AS112SummaryResponseCodesResponseSummary0 struct {
Noerror string `json:"NOERROR,required"`
Nxdomain string `json:"NXDOMAIN,required"`
JSON as112SummaryResponseCodesResponseSummary0JSON `json:"-"`
}

// as112SummaryResponseCodesResponseSummary0JSON contains the JSON metadata for the
// struct [AS112SummaryResponseCodesResponseSummary0]
type as112SummaryResponseCodesResponseSummary0JSON struct {
Noerror apijson.Field
Nxdomain apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *AS112SummaryResponseCodesResponseSummary0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r as112SummaryResponseCodesResponseSummary0JSON) RawJSON() string {
return r.raw
}

type AS112SummaryDNSSECParams struct {
// Array of comma separated list of ASNs, start with `-` to exclude from results.
// For example, `-174, 3356` excludes results from AS174, but includes results from
Expand Down Expand Up @@ -1364,6 +1312,9 @@ type AS112SummaryQueryTypeParams struct {
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
// Format results are returned in.
Format param.Field[AS112SummaryQueryTypeParamsFormat] `query:"format"`
// Limit the number of objects (eg browsers, verticals, etc) to the top items over
// the time range.
LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Expand Down Expand Up @@ -1439,6 +1390,9 @@ type AS112SummaryResponseCodesParams struct {
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
// Format results are returned in.
Format param.Field[AS112SummaryResponseCodesParamsFormat] `query:"format"`
// Limit the number of objects (eg browsers, verticals, etc) to the top items over
// the time range.
LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Expand Down
34 changes: 18 additions & 16 deletions radar/as112summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,15 @@ func TestAS112SummaryQueryTypeWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Radar.AS112.Summary.QueryType(context.TODO(), radar.AS112SummaryQueryTypeParams{
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112SummaryQueryTypeParamsFormatJson),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112SummaryQueryTypeParamsFormatJson),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
})
if err != nil {
var apierr *cloudflare.Error
Expand All @@ -189,14 +190,15 @@ func TestAS112SummaryResponseCodesWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Radar.AS112.Summary.ResponseCodes(context.TODO(), radar.AS112SummaryResponseCodesParams{
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112SummaryResponseCodesParamsFormatJson),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112SummaryResponseCodesParamsFormatJson),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
})
if err != nil {
var apierr *cloudflare.Error
Expand Down
6 changes: 6 additions & 0 deletions radar/as112timeseriesgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@ type AS112TimeseriesGroupQueryTypeParams struct {
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
// Format results are returned in.
Format param.Field[AS112TimeseriesGroupQueryTypeParamsFormat] `query:"format"`
// Limit the number of objects (eg browsers, verticals, etc) to the top items over
// the time range.
LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Expand Down Expand Up @@ -913,6 +916,9 @@ type AS112TimeseriesGroupResponseCodesParams struct {
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
// Format results are returned in.
Format param.Field[AS112TimeseriesGroupResponseCodesParamsFormat] `query:"format"`
// Limit the number of objects (eg browsers, verticals, etc) to the top items over
// the time range.
LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Expand Down
38 changes: 20 additions & 18 deletions radar/as112timeseriesgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,16 @@ func TestAS112TimeseriesGroupQueryTypeWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Radar.AS112.TimeseriesGroups.QueryType(context.TODO(), radar.AS112TimeseriesGroupQueryTypeParams{
AggInterval: cloudflare.F(radar.AS112TimeseriesGroupQueryTypeParamsAggInterval15m),
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112TimeseriesGroupQueryTypeParamsFormatJson),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
AggInterval: cloudflare.F(radar.AS112TimeseriesGroupQueryTypeParamsAggInterval15m),
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112TimeseriesGroupQueryTypeParamsFormatJson),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
})
if err != nil {
var apierr *cloudflare.Error
Expand All @@ -194,15 +195,16 @@ func TestAS112TimeseriesGroupResponseCodesWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Radar.AS112.TimeseriesGroups.ResponseCodes(context.TODO(), radar.AS112TimeseriesGroupResponseCodesParams{
AggInterval: cloudflare.F(radar.AS112TimeseriesGroupResponseCodesParamsAggInterval15m),
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112TimeseriesGroupResponseCodesParamsFormatJson),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
AggInterval: cloudflare.F(radar.AS112TimeseriesGroupResponseCodesParamsAggInterval15m),
ASN: cloudflare.F([]string{"string"}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Format: cloudflare.F(radar.AS112TimeseriesGroupResponseCodesParamsFormatJson),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
})
if err != nil {
var apierr *cloudflare.Error
Expand Down
5 changes: 4 additions & 1 deletion radar/attacklayer3summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ func (r attackLayer3SummaryProtocolResponseSummary0JSON) RawJSON() string {

type AttackLayer3SummaryVectorResponse struct {
Meta AttackLayer3SummaryVectorResponseMeta `json:"meta,required"`
Summary0 map[string][]string `json:"summary_0,required"`
Summary0 map[string]string `json:"summary_0,required"`
JSON attackLayer3SummaryVectorResponseJSON `json:"-"`
}

Expand Down Expand Up @@ -1605,6 +1605,9 @@ type AttackLayer3SummaryVectorParams struct {
Format param.Field[AttackLayer3SummaryVectorParamsFormat] `query:"format"`
// Filter for ip version.
IPVersion param.Field[[]AttackLayer3SummaryVectorParamsIPVersion] `query:"ipVersion"`
// Limit the number of objects (eg browsers, verticals, etc) to the top items over
// the time range.
LimitPerGroup param.Field[int64] `query:"limitPerGroup"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Expand Down
21 changes: 11 additions & 10 deletions radar/attacklayer3summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,17 @@ func TestAttackLayer3SummaryVectorWithOptionalParams(t *testing.T) {
option.WithAPIEmail("user@example.com"),
)
_, err := client.Radar.Attacks.Layer3.Summary.Vector(context.TODO(), radar.AttackLayer3SummaryVectorParams{
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Direction: cloudflare.F(radar.AttackLayer3SummaryVectorParamsDirectionOrigin),
Format: cloudflare.F(radar.AttackLayer3SummaryVectorParamsFormatJson),
IPVersion: cloudflare.F([]radar.AttackLayer3SummaryVectorParamsIPVersion{radar.AttackLayer3SummaryVectorParamsIPVersionIPv4}),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
Protocol: cloudflare.F([]radar.AttackLayer3SummaryVectorParamsProtocol{radar.AttackLayer3SummaryVectorParamsProtocolUdp}),
Continent: cloudflare.F([]string{"string"}),
DateEnd: cloudflare.F([]time.Time{time.Now()}),
DateRange: cloudflare.F([]string{"7d"}),
DateStart: cloudflare.F([]time.Time{time.Now()}),
Direction: cloudflare.F(radar.AttackLayer3SummaryVectorParamsDirectionOrigin),
Format: cloudflare.F(radar.AttackLayer3SummaryVectorParamsFormatJson),
IPVersion: cloudflare.F([]radar.AttackLayer3SummaryVectorParamsIPVersion{radar.AttackLayer3SummaryVectorParamsIPVersionIPv4}),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
Protocol: cloudflare.F([]radar.AttackLayer3SummaryVectorParamsProtocol{radar.AttackLayer3SummaryVectorParamsProtocolUdp}),
})
if err != nil {
var apierr *cloudflare.Error
Expand Down
6 changes: 3 additions & 3 deletions radar/attacklayer3timeseriesgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestAttackLayer3TimeseriesGroupIndustryWithOptionalParams(t *testing.T) {
Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupIndustryParamsDirectionOrigin),
Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupIndustryParamsFormatJson),
IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupIndustryParamsIPVersion{radar.AttackLayer3TimeseriesGroupIndustryParamsIPVersionIPv4}),
LimitPerGroup: cloudflare.F(int64(4)),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupIndustryParamsNormalizationPercentage),
Expand Down Expand Up @@ -249,7 +249,7 @@ func TestAttackLayer3TimeseriesGroupVectorWithOptionalParams(t *testing.T) {
Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupVectorParamsDirectionOrigin),
Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupVectorParamsFormatJson),
IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupVectorParamsIPVersion{radar.AttackLayer3TimeseriesGroupVectorParamsIPVersionIPv4}),
LimitPerGroup: cloudflare.F(int64(4)),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupVectorParamsNormalizationPercentage),
Expand Down Expand Up @@ -286,7 +286,7 @@ func TestAttackLayer3TimeseriesGroupVerticalWithOptionalParams(t *testing.T) {
Direction: cloudflare.F(radar.AttackLayer3TimeseriesGroupVerticalParamsDirectionOrigin),
Format: cloudflare.F(radar.AttackLayer3TimeseriesGroupVerticalParamsFormatJson),
IPVersion: cloudflare.F([]radar.AttackLayer3TimeseriesGroupVerticalParamsIPVersion{radar.AttackLayer3TimeseriesGroupVerticalParamsIPVersionIPv4}),
LimitPerGroup: cloudflare.F(int64(4)),
LimitPerGroup: cloudflare.F(int64(10)),
Location: cloudflare.F([]string{"string"}),
Name: cloudflare.F([]string{"string"}),
Normalization: cloudflare.F(radar.AttackLayer3TimeseriesGroupVerticalParamsNormalizationPercentage),
Expand Down
Loading

0 comments on commit ef35231

Please sign in to comment.