From 82e1b44b6caec9b24042536cc7454f09eb6cbe99 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 27 Feb 2024 10:34:34 +0000 Subject: [PATCH] feat: OpenAPI spec update via Stainless API --- .stats.yml | 2 +- api.md | 112 ------- radaras112.go | 4 + radaras112_test.go | 1 + radaras112summary.go | 24 ++ radaras112summary_test.go | 6 + radaras112timeseriesgroup.go | 24 ++ radaras112timeseriesgroup_test.go | 6 + radaras112top.go | 16 + radaras112top_test.go | 4 + radarattacklayer3.go | 4 + radarattacklayer3_test.go | 1 + radarattacklayer3summary.go | 24 ++ radarattacklayer3summary_test.go | 6 + radarattacklayer3timeseriesgroup.go | 32 ++ radarattacklayer3timeseriesgroup_test.go | 8 + radarattacklayer3top.go | 12 + radarattacklayer3top_test.go | 3 + radarattacklayer3toplocation.go | 8 + radarattacklayer3toplocation_test.go | 2 + radarattacklayer7.go | 4 + radarattacklayer7_test.go | 1 + radarattacklayer7summary.go | 24 ++ radarattacklayer7summary_test.go | 6 + radarattacklayer7timeseriesgroup.go | 32 ++ radarattacklayer7timeseriesgroup_test.go | 8 + radarattacklayer7top.go | 12 + radarattacklayer7top_test.go | 3 + radarattacklayer7topase.go | 4 + radarattacklayer7topase_test.go | 1 + radarattacklayer7toplocation.go | 8 + radarattacklayer7toplocation_test.go | 2 + radarconnectiontampering.go | 8 + radarconnectiontampering_test.go | 2 + radardnstop.go | 8 + radardnstop_test.go | 2 + radaremailsecuritysummary.go | 133 ++++---- radaremailsecuritysummary_test.go | 139 ++++----- radaremailsecuritytimeseriesgroup.go | 133 ++++---- radaremailsecuritytimeseriesgroup_test.go | 21 +- radaremailsecuritytopase.go | 275 ----------------- radaremailsecuritytopase_test.go | 54 ---- radaremailsecuritytopasearc.go | 275 ----------------- radaremailsecuritytopasearc_test.go | 57 ---- radaremailsecuritytopasedkim.go | 275 ----------------- radaremailsecuritytopasedkim_test.go | 57 ---- radaremailsecuritytopasedmarc.go | 275 ----------------- radaremailsecuritytopasedmarc_test.go | 57 ---- radaremailsecuritytopasemalicious.go | 285 ----------------- radaremailsecuritytopasemalicious_test.go | 58 ---- radaremailsecuritytopasespam.go | 284 ----------------- radaremailsecuritytopasespam_test.go | 58 ---- radaremailsecuritytopasespf.go | 275 ----------------- radaremailsecuritytopasespf_test.go | 57 ---- radaremailsecuritytoplocation.go | 276 ----------------- radaremailsecuritytoplocation_test.go | 54 ---- radaremailsecuritytoplocationarc.go | 276 ----------------- radaremailsecuritytoplocationarc_test.go | 57 ---- radaremailsecuritytoplocationdkim.go | 276 ----------------- radaremailsecuritytoplocationdkim_test.go | 57 ---- radaremailsecuritytoplocationdmarc.go | 276 ----------------- radaremailsecuritytoplocationdmarc_test.go | 57 ---- radaremailsecuritytoplocationmalicious.go | 286 ------------------ ...remailsecuritytoplocationmalicious_test.go | 58 ---- radaremailsecuritytoplocationspam.go | 285 ----------------- radaremailsecuritytoplocationspam_test.go | 58 ---- radaremailsecuritytoplocationspf.go | 276 ----------------- radaremailsecuritytoplocationspf_test.go | 57 ---- radarhttpase.go | 4 + radarhttpase_test.go | 1 + radarhttpasebotclass.go | 4 + radarhttpasebotclass_test.go | 1 + radarhttpasedevicetype.go | 4 + radarhttpasedevicetype_test.go | 1 + radarhttpasehttpmethod.go | 4 + radarhttpasehttpmethod_test.go | 1 + radarhttpasehttpprotocol.go | 4 + radarhttpasehttpprotocol_test.go | 1 + radarhttpaseipversion.go | 4 + radarhttpaseipversion_test.go | 1 + radarhttpaseos.go | 4 + radarhttpaseos_test.go | 1 + radarhttpasetlsversion.go | 4 + radarhttpasetlsversion_test.go | 1 + radarhttplocation.go | 4 + radarhttplocation_test.go | 1 + radarhttplocationbotclass.go | 4 + radarhttplocationbotclass_test.go | 1 + radarhttplocationdevicetype.go | 4 + radarhttplocationdevicetype_test.go | 1 + radarhttplocationhttpmethod.go | 4 + radarhttplocationhttpmethod_test.go | 1 + radarhttplocationhttpprotocol.go | 4 + radarhttplocationhttpprotocol_test.go | 1 + radarhttplocationipversion.go | 4 + radarhttplocationipversion_test.go | 1 + radarhttplocationos.go | 4 + radarhttplocationos_test.go | 1 + radarhttplocationtlsversion.go | 4 + radarhttplocationtlsversion_test.go | 1 + radarhttpsummary.go | 28 ++ radarhttpsummary_test.go | 7 + radarhttptimeseriesgroup.go | 36 +++ radarhttptimeseriesgroup_test.go | 9 + radarhttptop.go | 8 + radarhttptop_test.go | 2 + radarnetflow.go | 4 + radarnetflow_test.go | 1 + radarnetflowtop.go | 8 + radarnetflowtop_test.go | 2 + radarqualityspeed.go | 8 + radarqualityspeed_test.go | 12 +- radarqualityspeedtop.go | 8 + radarqualityspeedtop_test.go | 34 ++- radarverifiedbottop.go | 8 + radarverifiedbottop_test.go | 2 + 116 files changed, 774 insertions(+), 5024 deletions(-) delete mode 100644 radaremailsecuritytopase_test.go delete mode 100644 radaremailsecuritytopasearc_test.go delete mode 100644 radaremailsecuritytopasedkim_test.go delete mode 100644 radaremailsecuritytopasedmarc_test.go delete mode 100644 radaremailsecuritytopasemalicious_test.go delete mode 100644 radaremailsecuritytopasespam_test.go delete mode 100644 radaremailsecuritytopasespf_test.go delete mode 100644 radaremailsecuritytoplocation_test.go delete mode 100644 radaremailsecuritytoplocationarc_test.go delete mode 100644 radaremailsecuritytoplocationdkim_test.go delete mode 100644 radaremailsecuritytoplocationdmarc_test.go delete mode 100644 radaremailsecuritytoplocationmalicious_test.go delete mode 100644 radaremailsecuritytoplocationspam_test.go delete mode 100644 radaremailsecuritytoplocationspf_test.go diff --git a/.stats.yml b/.stats.yml index 0a0068803e8..3336fc55499 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1249 +configured_endpoints: 1235 diff --git a/api.md b/api.md index b0956ace64a..0b2f9fcd981 100644 --- a/api.md +++ b/api.md @@ -5464,144 +5464,32 @@ Methods: ##### Ases -Response Types: - -- cloudflare.RadarEmailSecurityTopAseGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Ases.Get(ctx context.Context, query cloudflare.RadarEmailSecurityTopAseGetParams) (cloudflare.RadarEmailSecurityTopAseGetResponse, error) - ###### ARC -Response Types: - -- cloudflare.RadarEmailSecurityTopAseARCGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Ases.ARC.Get(ctx context.Context, arc cloudflare.RadarEmailSecurityTopAseARCGetParamsARC, query cloudflare.RadarEmailSecurityTopAseARCGetParams) (cloudflare.RadarEmailSecurityTopAseARCGetResponse, error) - ###### DKIM -Response Types: - -- cloudflare.RadarEmailSecurityTopAseDKIMGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Ases.DKIM.Get(ctx context.Context, dkim cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDKIM, query cloudflare.RadarEmailSecurityTopAseDKIMGetParams) (cloudflare.RadarEmailSecurityTopAseDKIMGetResponse, error) - ###### DMARC -Response Types: - -- cloudflare.RadarEmailSecurityTopAseDMARCGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Ases.DMARC.Get(ctx context.Context, dmarc cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDMARC, query cloudflare.RadarEmailSecurityTopAseDMARCGetParams) (cloudflare.RadarEmailSecurityTopAseDMARCGetResponse, error) - ###### Malicious -Response Types: - -- cloudflare.RadarEmailSecurityTopAseMaliciousGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Ases.Malicious.Get(ctx context.Context, malicious cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsMalicious, query cloudflare.RadarEmailSecurityTopAseMaliciousGetParams) (cloudflare.RadarEmailSecurityTopAseMaliciousGetResponse, error) - ###### Spam -Response Types: - -- cloudflare.RadarEmailSecurityTopAseSpamGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Ases.Spam.Get(ctx context.Context, spam cloudflare.RadarEmailSecurityTopAseSpamGetParamsSpam, query cloudflare.RadarEmailSecurityTopAseSpamGetParams) (cloudflare.RadarEmailSecurityTopAseSpamGetResponse, error) - ###### SPF -Response Types: - -- cloudflare.RadarEmailSecurityTopAseSPFGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Ases.SPF.Get(ctx context.Context, spf cloudflare.RadarEmailSecurityTopAseSPFGetParamsSPF, query cloudflare.RadarEmailSecurityTopAseSPFGetParams) (cloudflare.RadarEmailSecurityTopAseSPFGetResponse, error) - ##### Locations -Response Types: - -- cloudflare.RadarEmailSecurityTopLocationGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Locations.Get(ctx context.Context, query cloudflare.RadarEmailSecurityTopLocationGetParams) (cloudflare.RadarEmailSecurityTopLocationGetResponse, error) - ###### ARC -Response Types: - -- cloudflare.RadarEmailSecurityTopLocationARCGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Locations.ARC.Get(ctx context.Context, arc cloudflare.RadarEmailSecurityTopLocationARCGetParamsARC, query cloudflare.RadarEmailSecurityTopLocationARCGetParams) (cloudflare.RadarEmailSecurityTopLocationARCGetResponse, error) - ###### DKIM -Response Types: - -- cloudflare.RadarEmailSecurityTopLocationDKIMGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Locations.DKIM.Get(ctx context.Context, dkim cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDKIM, query cloudflare.RadarEmailSecurityTopLocationDKIMGetParams) (cloudflare.RadarEmailSecurityTopLocationDKIMGetResponse, error) - ###### DMARC -Response Types: - -- cloudflare.RadarEmailSecurityTopLocationDMARCGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Locations.DMARC.Get(ctx context.Context, dmarc cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDMARC, query cloudflare.RadarEmailSecurityTopLocationDMARCGetParams) (cloudflare.RadarEmailSecurityTopLocationDMARCGetResponse, error) - ###### Malicious -Response Types: - -- cloudflare.RadarEmailSecurityTopLocationMaliciousGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Locations.Malicious.Get(ctx context.Context, malicious cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsMalicious, query cloudflare.RadarEmailSecurityTopLocationMaliciousGetParams) (cloudflare.RadarEmailSecurityTopLocationMaliciousGetResponse, error) - ###### Spam -Response Types: - -- cloudflare.RadarEmailSecurityTopLocationSpamGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Locations.Spam.Get(ctx context.Context, spam cloudflare.RadarEmailSecurityTopLocationSpamGetParamsSpam, query cloudflare.RadarEmailSecurityTopLocationSpamGetParams) (cloudflare.RadarEmailSecurityTopLocationSpamGetResponse, error) - ###### SPF -Response Types: - -- cloudflare.RadarEmailSecurityTopLocationSPFGetResponse - -Methods: - -- client.Radar.Email.Security.Top.Locations.SPF.Get(ctx context.Context, spf cloudflare.RadarEmailSecurityTopLocationSPFGetParamsSPF, query cloudflare.RadarEmailSecurityTopLocationSPFGetParams) (cloudflare.RadarEmailSecurityTopLocationSPFGetResponse, error) - #### Summary Response Types: diff --git a/radaras112.go b/radaras112.go index 1cd14087ef9..6f11e1185b1 100644 --- a/radaras112.go +++ b/radaras112.go @@ -191,6 +191,10 @@ type RadarAs112TimeseriesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radaras112_test.go b/radaras112_test.go index 295fc21ce21..83c460a8954 100644 --- a/radaras112_test.go +++ b/radaras112_test.go @@ -33,6 +33,7 @@ func TestRadarAs112TimeseriesWithOptionalParams(t *testing.T) { _, err := client.Radar.As112.Timeseries(context.TODO(), cloudflare.RadarAs112TimeseriesParams{ AggInterval: cloudflare.F(cloudflare.RadarAs112TimeseriesParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TimeseriesParamsDateRange{cloudflare.RadarAs112TimeseriesParamsDateRange1d, cloudflare.RadarAs112TimeseriesParamsDateRange2d, cloudflare.RadarAs112TimeseriesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radaras112summary.go b/radaras112summary.go index fd7217aa13f..aadf6513886 100644 --- a/radaras112summary.go +++ b/radaras112summary.go @@ -909,6 +909,10 @@ type RadarAs112SummaryDNSSECParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -988,6 +992,10 @@ type RadarAs112SummaryEdnsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1067,6 +1075,10 @@ type RadarAs112SummaryIPVersionParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1146,6 +1158,10 @@ type RadarAs112SummaryProtocolParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1225,6 +1241,10 @@ type RadarAs112SummaryQueryTypeParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1304,6 +1324,10 @@ type RadarAs112SummaryResponseCodesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radaras112summary_test.go b/radaras112summary_test.go index fe0b15f7748..94dd86a567d 100644 --- a/radaras112summary_test.go +++ b/radaras112summary_test.go @@ -32,6 +32,7 @@ func TestRadarAs112SummaryDNSSECWithOptionalParams(t *testing.T) { ) _, err := client.Radar.As112.Summary.DNSSEC(context.TODO(), cloudflare.RadarAs112SummaryDNSSECParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112SummaryDNSSECParamsDateRange{cloudflare.RadarAs112SummaryDNSSECParamsDateRange1d, cloudflare.RadarAs112SummaryDNSSECParamsDateRange2d, cloudflare.RadarAs112SummaryDNSSECParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -66,6 +67,7 @@ func TestRadarAs112SummaryEdnsWithOptionalParams(t *testing.T) { ) _, err := client.Radar.As112.Summary.Edns(context.TODO(), cloudflare.RadarAs112SummaryEdnsParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112SummaryEdnsParamsDateRange{cloudflare.RadarAs112SummaryEdnsParamsDateRange1d, cloudflare.RadarAs112SummaryEdnsParamsDateRange2d, cloudflare.RadarAs112SummaryEdnsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -100,6 +102,7 @@ func TestRadarAs112SummaryIPVersionWithOptionalParams(t *testing.T) { ) _, err := client.Radar.As112.Summary.IPVersion(context.TODO(), cloudflare.RadarAs112SummaryIPVersionParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112SummaryIPVersionParamsDateRange{cloudflare.RadarAs112SummaryIPVersionParamsDateRange1d, cloudflare.RadarAs112SummaryIPVersionParamsDateRange2d, cloudflare.RadarAs112SummaryIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -134,6 +137,7 @@ func TestRadarAs112SummaryProtocolWithOptionalParams(t *testing.T) { ) _, err := client.Radar.As112.Summary.Protocol(context.TODO(), cloudflare.RadarAs112SummaryProtocolParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112SummaryProtocolParamsDateRange{cloudflare.RadarAs112SummaryProtocolParamsDateRange1d, cloudflare.RadarAs112SummaryProtocolParamsDateRange2d, cloudflare.RadarAs112SummaryProtocolParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -168,6 +172,7 @@ func TestRadarAs112SummaryQueryTypeWithOptionalParams(t *testing.T) { ) _, err := client.Radar.As112.Summary.QueryType(context.TODO(), cloudflare.RadarAs112SummaryQueryTypeParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112SummaryQueryTypeParamsDateRange{cloudflare.RadarAs112SummaryQueryTypeParamsDateRange1d, cloudflare.RadarAs112SummaryQueryTypeParamsDateRange2d, cloudflare.RadarAs112SummaryQueryTypeParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -202,6 +207,7 @@ func TestRadarAs112SummaryResponseCodesWithOptionalParams(t *testing.T) { ) _, err := client.Radar.As112.Summary.ResponseCodes(context.TODO(), cloudflare.RadarAs112SummaryResponseCodesParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112SummaryResponseCodesParamsDateRange{cloudflare.RadarAs112SummaryResponseCodesParamsDateRange1d, cloudflare.RadarAs112SummaryResponseCodesParamsDateRange2d, cloudflare.RadarAs112SummaryResponseCodesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radaras112timeseriesgroup.go b/radaras112timeseriesgroup.go index 4ec1121e286..6fbc59d5414 100644 --- a/radaras112timeseriesgroup.go +++ b/radaras112timeseriesgroup.go @@ -355,6 +355,10 @@ type RadarAs112TimeseriesGroupDNSSECParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -450,6 +454,10 @@ type RadarAs112TimeseriesGroupEdnsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -545,6 +553,10 @@ type RadarAs112TimeseriesGroupIPVersionParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -640,6 +652,10 @@ type RadarAs112TimeseriesGroupProtocolParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -735,6 +751,10 @@ type RadarAs112TimeseriesGroupQueryTypeParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -830,6 +850,10 @@ type RadarAs112TimeseriesGroupResponseCodesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radaras112timeseriesgroup_test.go b/radaras112timeseriesgroup_test.go index dd3131a7b5b..328111ea3cd 100644 --- a/radaras112timeseriesgroup_test.go +++ b/radaras112timeseriesgroup_test.go @@ -33,6 +33,7 @@ func TestRadarAs112TimeseriesGroupDNSSECWithOptionalParams(t *testing.T) { _, err := client.Radar.As112.TimeseriesGroups.DNSSEC(context.TODO(), cloudflare.RadarAs112TimeseriesGroupDNSSECParams{ AggInterval: cloudflare.F(cloudflare.RadarAs112TimeseriesGroupDNSSECParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TimeseriesGroupDNSSECParamsDateRange{cloudflare.RadarAs112TimeseriesGroupDNSSECParamsDateRange1d, cloudflare.RadarAs112TimeseriesGroupDNSSECParamsDateRange2d, cloudflare.RadarAs112TimeseriesGroupDNSSECParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -68,6 +69,7 @@ func TestRadarAs112TimeseriesGroupEdnsWithOptionalParams(t *testing.T) { _, err := client.Radar.As112.TimeseriesGroups.Edns(context.TODO(), cloudflare.RadarAs112TimeseriesGroupEdnsParams{ AggInterval: cloudflare.F(cloudflare.RadarAs112TimeseriesGroupEdnsParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TimeseriesGroupEdnsParamsDateRange{cloudflare.RadarAs112TimeseriesGroupEdnsParamsDateRange1d, cloudflare.RadarAs112TimeseriesGroupEdnsParamsDateRange2d, cloudflare.RadarAs112TimeseriesGroupEdnsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -103,6 +105,7 @@ func TestRadarAs112TimeseriesGroupIPVersionWithOptionalParams(t *testing.T) { _, err := client.Radar.As112.TimeseriesGroups.IPVersion(context.TODO(), cloudflare.RadarAs112TimeseriesGroupIPVersionParams{ AggInterval: cloudflare.F(cloudflare.RadarAs112TimeseriesGroupIPVersionParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TimeseriesGroupIPVersionParamsDateRange{cloudflare.RadarAs112TimeseriesGroupIPVersionParamsDateRange1d, cloudflare.RadarAs112TimeseriesGroupIPVersionParamsDateRange2d, cloudflare.RadarAs112TimeseriesGroupIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -138,6 +141,7 @@ func TestRadarAs112TimeseriesGroupProtocolWithOptionalParams(t *testing.T) { _, err := client.Radar.As112.TimeseriesGroups.Protocol(context.TODO(), cloudflare.RadarAs112TimeseriesGroupProtocolParams{ AggInterval: cloudflare.F(cloudflare.RadarAs112TimeseriesGroupProtocolParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TimeseriesGroupProtocolParamsDateRange{cloudflare.RadarAs112TimeseriesGroupProtocolParamsDateRange1d, cloudflare.RadarAs112TimeseriesGroupProtocolParamsDateRange2d, cloudflare.RadarAs112TimeseriesGroupProtocolParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -173,6 +177,7 @@ func TestRadarAs112TimeseriesGroupQueryTypeWithOptionalParams(t *testing.T) { _, err := client.Radar.As112.TimeseriesGroups.QueryType(context.TODO(), cloudflare.RadarAs112TimeseriesGroupQueryTypeParams{ AggInterval: cloudflare.F(cloudflare.RadarAs112TimeseriesGroupQueryTypeParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TimeseriesGroupQueryTypeParamsDateRange{cloudflare.RadarAs112TimeseriesGroupQueryTypeParamsDateRange1d, cloudflare.RadarAs112TimeseriesGroupQueryTypeParamsDateRange2d, cloudflare.RadarAs112TimeseriesGroupQueryTypeParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -208,6 +213,7 @@ func TestRadarAs112TimeseriesGroupResponseCodesWithOptionalParams(t *testing.T) _, err := client.Radar.As112.TimeseriesGroups.ResponseCodes(context.TODO(), cloudflare.RadarAs112TimeseriesGroupResponseCodesParams{ AggInterval: cloudflare.F(cloudflare.RadarAs112TimeseriesGroupResponseCodesParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TimeseriesGroupResponseCodesParamsDateRange{cloudflare.RadarAs112TimeseriesGroupResponseCodesParamsDateRange1d, cloudflare.RadarAs112TimeseriesGroupResponseCodesParamsDateRange2d, cloudflare.RadarAs112TimeseriesGroupResponseCodesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radaras112top.go b/radaras112top.go index 4699e471783..bcbd3e8e814 100644 --- a/radaras112top.go +++ b/radaras112top.go @@ -615,6 +615,10 @@ type RadarAs112TopDNSSECParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -704,6 +708,10 @@ type RadarAs112TopEdnsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -793,6 +801,10 @@ type RadarAs112TopIPVersionParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -882,6 +894,10 @@ type RadarAs112TopLocationsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radaras112top_test.go b/radaras112top_test.go index c301384ed51..bb499652fd0 100644 --- a/radaras112top_test.go +++ b/radaras112top_test.go @@ -35,6 +35,7 @@ func TestRadarAs112TopDNSSECWithOptionalParams(t *testing.T) { cloudflare.RadarAs112TopDNSSECParamsDNSSECSupported, cloudflare.RadarAs112TopDNSSECParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TopDNSSECParamsDateRange{cloudflare.RadarAs112TopDNSSECParamsDateRange1d, cloudflare.RadarAs112TopDNSSECParamsDateRange2d, cloudflare.RadarAs112TopDNSSECParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -74,6 +75,7 @@ func TestRadarAs112TopEdnsWithOptionalParams(t *testing.T) { cloudflare.RadarAs112TopEdnsParamsEdnsSupported, cloudflare.RadarAs112TopEdnsParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TopEdnsParamsDateRange{cloudflare.RadarAs112TopEdnsParamsDateRange1d, cloudflare.RadarAs112TopEdnsParamsDateRange2d, cloudflare.RadarAs112TopEdnsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -113,6 +115,7 @@ func TestRadarAs112TopIPVersionWithOptionalParams(t *testing.T) { cloudflare.RadarAs112TopIPVersionParamsIPVersionIPv4, cloudflare.RadarAs112TopIPVersionParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TopIPVersionParamsDateRange{cloudflare.RadarAs112TopIPVersionParamsDateRange1d, cloudflare.RadarAs112TopIPVersionParamsDateRange2d, cloudflare.RadarAs112TopIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -149,6 +152,7 @@ func TestRadarAs112TopLocationsWithOptionalParams(t *testing.T) { ) _, err := client.Radar.As112.Top.Locations(context.TODO(), cloudflare.RadarAs112TopLocationsParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAs112TopLocationsParamsDateRange{cloudflare.RadarAs112TopLocationsParamsDateRange1d, cloudflare.RadarAs112TopLocationsParamsDateRange2d, cloudflare.RadarAs112TopLocationsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer3.go b/radarattacklayer3.go index 79572ad64c5..1b8ef22f93a 100644 --- a/radarattacklayer3.go +++ b/radarattacklayer3.go @@ -99,6 +99,10 @@ type RadarAttackLayer3TimeseriesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer3_test.go b/radarattacklayer3_test.go index e4e0db50faf..6d6ba1b748d 100644 --- a/radarattacklayer3_test.go +++ b/radarattacklayer3_test.go @@ -33,6 +33,7 @@ func TestRadarAttackLayer3TimeseriesWithOptionalParams(t *testing.T) { _, err := client.Radar.Attacks.Layer3.Timeseries(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer3summary.go b/radarattacklayer3summary.go index ab15f3be1c8..2ee2ed3c164 100644 --- a/radarattacklayer3summary.go +++ b/radarattacklayer3summary.go @@ -903,6 +903,10 @@ func (r *RadarAttackLayer3SummaryVectorResponseMetaConfidenceInfoAnnotation) Unm } type RadarAttackLayer3SummaryBitrateParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1010,6 +1014,10 @@ func (r *RadarAttackLayer3SummaryBitrateResponseEnvelope) UnmarshalJSON(data []b } type RadarAttackLayer3SummaryDurationParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1121,6 +1129,10 @@ type RadarAttackLayer3SummaryGetParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1196,6 +1208,10 @@ func (r *RadarAttackLayer3SummaryGetResponseEnvelope) UnmarshalJSON(data []byte) } type RadarAttackLayer3SummaryIPVersionParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1294,6 +1310,10 @@ func (r *RadarAttackLayer3SummaryIPVersionResponseEnvelope) UnmarshalJSON(data [ } type RadarAttackLayer3SummaryProtocolParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1390,6 +1410,10 @@ func (r *RadarAttackLayer3SummaryProtocolResponseEnvelope) UnmarshalJSON(data [] } type RadarAttackLayer3SummaryVectorParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer3summary_test.go b/radarattacklayer3summary_test.go index 10aa86e9b24..f5de10cbb0e 100644 --- a/radarattacklayer3summary_test.go +++ b/radarattacklayer3summary_test.go @@ -31,6 +31,7 @@ func TestRadarAttackLayer3SummaryBitrateWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Summary.Bitrate(context.TODO(), cloudflare.RadarAttackLayer3SummaryBitrateParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryBitrateParamsDateRange{cloudflare.RadarAttackLayer3SummaryBitrateParamsDateRange1d, cloudflare.RadarAttackLayer3SummaryBitrateParamsDateRange2d, cloudflare.RadarAttackLayer3SummaryBitrateParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -67,6 +68,7 @@ func TestRadarAttackLayer3SummaryDurationWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Summary.Duration(context.TODO(), cloudflare.RadarAttackLayer3SummaryDurationParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryDurationParamsDateRange{cloudflare.RadarAttackLayer3SummaryDurationParamsDateRange1d, cloudflare.RadarAttackLayer3SummaryDurationParamsDateRange2d, cloudflare.RadarAttackLayer3SummaryDurationParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -104,6 +106,7 @@ func TestRadarAttackLayer3SummaryGetWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer3.Summary.Get(context.TODO(), cloudflare.RadarAttackLayer3SummaryGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryGetParamsDateRange{cloudflare.RadarAttackLayer3SummaryGetParamsDateRange1d, cloudflare.RadarAttackLayer3SummaryGetParamsDateRange2d, cloudflare.RadarAttackLayer3SummaryGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -137,6 +140,7 @@ func TestRadarAttackLayer3SummaryIPVersionWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Summary.IPVersion(context.TODO(), cloudflare.RadarAttackLayer3SummaryIPVersionParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryIPVersionParamsDateRange{cloudflare.RadarAttackLayer3SummaryIPVersionParamsDateRange1d, cloudflare.RadarAttackLayer3SummaryIPVersionParamsDateRange2d, cloudflare.RadarAttackLayer3SummaryIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -172,6 +176,7 @@ func TestRadarAttackLayer3SummaryProtocolWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Summary.Protocol(context.TODO(), cloudflare.RadarAttackLayer3SummaryProtocolParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryProtocolParamsDateRange{cloudflare.RadarAttackLayer3SummaryProtocolParamsDateRange1d, cloudflare.RadarAttackLayer3SummaryProtocolParamsDateRange2d, cloudflare.RadarAttackLayer3SummaryProtocolParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -207,6 +212,7 @@ func TestRadarAttackLayer3SummaryVectorWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Summary.Vector(context.TODO(), cloudflare.RadarAttackLayer3SummaryVectorParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3SummaryVectorParamsDateRange{cloudflare.RadarAttackLayer3SummaryVectorParamsDateRange1d, cloudflare.RadarAttackLayer3SummaryVectorParamsDateRange2d, cloudflare.RadarAttackLayer3SummaryVectorParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer3timeseriesgroup.go b/radarattacklayer3timeseriesgroup.go index 0123974220e..7bbf799a586 100644 --- a/radarattacklayer3timeseriesgroup.go +++ b/radarattacklayer3timeseriesgroup.go @@ -572,6 +572,10 @@ type RadarAttackLayer3TimeseriesGroupBitrateParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval] `query:"aggInterval"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -708,6 +712,10 @@ type RadarAttackLayer3TimeseriesGroupDurationParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval] `query:"aggInterval"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -848,6 +856,10 @@ type RadarAttackLayer3TimeseriesGroupGetParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -939,6 +951,10 @@ type RadarAttackLayer3TimeseriesGroupIndustryParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval] `query:"aggInterval"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1067,6 +1083,10 @@ type RadarAttackLayer3TimeseriesGroupIPVersionParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval] `query:"aggInterval"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1194,6 +1214,10 @@ type RadarAttackLayer3TimeseriesGroupProtocolParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval] `query:"aggInterval"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1319,6 +1343,10 @@ type RadarAttackLayer3TimeseriesGroupVectorParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval] `query:"aggInterval"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1457,6 +1485,10 @@ type RadarAttackLayer3TimeseriesGroupVerticalParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval] `query:"aggInterval"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer3timeseriesgroup_test.go b/radarattacklayer3timeseriesgroup_test.go index 35e052ee87b..d0940b3cdfe 100644 --- a/radarattacklayer3timeseriesgroup_test.go +++ b/radarattacklayer3timeseriesgroup_test.go @@ -32,6 +32,7 @@ func TestRadarAttackLayer3TimeseriesGroupBitrateWithOptionalParams(t *testing.T) ) _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Bitrate(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsAggInterval1h), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupBitrateParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -70,6 +71,7 @@ func TestRadarAttackLayer3TimeseriesGroupDurationWithOptionalParams(t *testing.T ) _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Duration(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupDurationParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsAggInterval1h), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupDurationParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -109,6 +111,7 @@ func TestRadarAttackLayer3TimeseriesGroupGetWithOptionalParams(t *testing.T) { _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Get(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupGetParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupGetParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupGetParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupGetParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupGetParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -143,6 +146,7 @@ func TestRadarAttackLayer3TimeseriesGroupIndustryWithOptionalParams(t *testing.T ) _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Industry(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsAggInterval1h), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupIndustryParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -181,6 +185,7 @@ func TestRadarAttackLayer3TimeseriesGroupIPVersionWithOptionalParams(t *testing. ) _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.IPVersion(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsAggInterval1h), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -218,6 +223,7 @@ func TestRadarAttackLayer3TimeseriesGroupProtocolWithOptionalParams(t *testing.T ) _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Protocol(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsAggInterval1h), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupProtocolParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -255,6 +261,7 @@ func TestRadarAttackLayer3TimeseriesGroupVectorWithOptionalParams(t *testing.T) ) _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Vector(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupVectorParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsAggInterval1h), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupVectorParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -294,6 +301,7 @@ func TestRadarAttackLayer3TimeseriesGroupVerticalWithOptionalParams(t *testing.T ) _, err := client.Radar.Attacks.Layer3.TimeseriesGroups.Vertical(context.TODO(), cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsAggInterval1h), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange{cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange1d, cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange2d, cloudflare.RadarAttackLayer3TimeseriesGroupVerticalParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer3top.go b/radarattacklayer3top.go index 294f44a2c1f..b87205086ba 100644 --- a/radarattacklayer3top.go +++ b/radarattacklayer3top.go @@ -467,6 +467,10 @@ func (r *RadarAttackLayer3TopVerticalResponseTop0) UnmarshalJSON(data []byte) (e } type RadarAttackLayer3TopAttacksParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -581,6 +585,10 @@ func (r *RadarAttackLayer3TopAttacksResponseEnvelope) UnmarshalJSON(data []byte) } type RadarAttackLayer3TopIndustryParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -678,6 +686,10 @@ func (r *RadarAttackLayer3TopIndustryResponseEnvelope) UnmarshalJSON(data []byte } type RadarAttackLayer3TopVerticalParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer3top_test.go b/radarattacklayer3top_test.go index d905f5b788b..5bfa18ab6a1 100644 --- a/radarattacklayer3top_test.go +++ b/radarattacklayer3top_test.go @@ -31,6 +31,7 @@ func TestRadarAttackLayer3TopAttacksWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Top.Attacks(context.TODO(), cloudflare.RadarAttackLayer3TopAttacksParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TopAttacksParamsDateRange{cloudflare.RadarAttackLayer3TopAttacksParamsDateRange1d, cloudflare.RadarAttackLayer3TopAttacksParamsDateRange2d, cloudflare.RadarAttackLayer3TopAttacksParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -69,6 +70,7 @@ func TestRadarAttackLayer3TopIndustryWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Top.Industry(context.TODO(), cloudflare.RadarAttackLayer3TopIndustryParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TopIndustryParamsDateRange{cloudflare.RadarAttackLayer3TopIndustryParamsDateRange1d, cloudflare.RadarAttackLayer3TopIndustryParamsDateRange2d, cloudflare.RadarAttackLayer3TopIndustryParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -105,6 +107,7 @@ func TestRadarAttackLayer3TopVerticalWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Top.Vertical(context.TODO(), cloudflare.RadarAttackLayer3TopVerticalParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TopVerticalParamsDateRange{cloudflare.RadarAttackLayer3TopVerticalParamsDateRange1d, cloudflare.RadarAttackLayer3TopVerticalParamsDateRange2d, cloudflare.RadarAttackLayer3TopVerticalParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer3toplocation.go b/radarattacklayer3toplocation.go index a8fbf2ddd7f..a63440bde56 100644 --- a/radarattacklayer3toplocation.go +++ b/radarattacklayer3toplocation.go @@ -330,6 +330,10 @@ func (r *RadarAttackLayer3TopLocationTargetResponseTop0) UnmarshalJSON(data []by } type RadarAttackLayer3TopLocationOriginParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -427,6 +431,10 @@ func (r *RadarAttackLayer3TopLocationOriginResponseEnvelope) UnmarshalJSON(data } type RadarAttackLayer3TopLocationTargetParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer3toplocation_test.go b/radarattacklayer3toplocation_test.go index 8be25dbaec2..11167149eb1 100644 --- a/radarattacklayer3toplocation_test.go +++ b/radarattacklayer3toplocation_test.go @@ -31,6 +31,7 @@ func TestRadarAttackLayer3TopLocationOriginWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Top.Locations.Origin(context.TODO(), cloudflare.RadarAttackLayer3TopLocationOriginParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TopLocationOriginParamsDateRange{cloudflare.RadarAttackLayer3TopLocationOriginParamsDateRange1d, cloudflare.RadarAttackLayer3TopLocationOriginParamsDateRange2d, cloudflare.RadarAttackLayer3TopLocationOriginParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -67,6 +68,7 @@ func TestRadarAttackLayer3TopLocationTargetWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer3.Top.Locations.Target(context.TODO(), cloudflare.RadarAttackLayer3TopLocationTargetParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer3TopLocationTargetParamsDateRange{cloudflare.RadarAttackLayer3TopLocationTargetParamsDateRange1d, cloudflare.RadarAttackLayer3TopLocationTargetParamsDateRange2d, cloudflare.RadarAttackLayer3TopLocationTargetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer7.go b/radarattacklayer7.go index 06059d6a0be..80d3dc07479 100644 --- a/radarattacklayer7.go +++ b/radarattacklayer7.go @@ -195,6 +195,10 @@ type RadarAttackLayer7TimeseriesParams struct { ASN param.Field[[]string] `query:"asn"` // Array of L7 attack types. Attack param.Field[[]RadarAttackLayer7TimeseriesParamsAttack] `query:"attack"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer7_test.go b/radarattacklayer7_test.go index af6a2b5de3d..2e152fae649 100644 --- a/radarattacklayer7_test.go +++ b/radarattacklayer7_test.go @@ -34,6 +34,7 @@ func TestRadarAttackLayer7TimeseriesWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), Attack: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesParamsAttack{cloudflare.RadarAttackLayer7TimeseriesParamsAttackDDOS, cloudflare.RadarAttackLayer7TimeseriesParamsAttackWAF, cloudflare.RadarAttackLayer7TimeseriesParamsAttackBotManagement}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer7summary.go b/radarattacklayer7summary.go index d63bc31ceeb..46ecd3df67f 100644 --- a/radarattacklayer7summary.go +++ b/radarattacklayer7summary.go @@ -920,6 +920,10 @@ type RadarAttackLayer7SummaryGetParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -999,6 +1003,10 @@ type RadarAttackLayer7SummaryHTTPMethodParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1111,6 +1119,10 @@ type RadarAttackLayer7SummaryHTTPVersionParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1266,6 +1278,10 @@ type RadarAttackLayer7SummaryIPVersionParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1422,6 +1438,10 @@ type RadarAttackLayer7SummaryManagedRulesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1587,6 +1607,10 @@ type RadarAttackLayer7SummaryMitigationProductParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer7summary_test.go b/radarattacklayer7summary_test.go index 6e1ba126c9b..735d009d12d 100644 --- a/radarattacklayer7summary_test.go +++ b/radarattacklayer7summary_test.go @@ -32,6 +32,7 @@ func TestRadarAttackLayer7SummaryGetWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Summary.Get(context.TODO(), cloudflare.RadarAttackLayer7SummaryGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryGetParamsDateRange{cloudflare.RadarAttackLayer7SummaryGetParamsDateRange1d, cloudflare.RadarAttackLayer7SummaryGetParamsDateRange2d, cloudflare.RadarAttackLayer7SummaryGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -66,6 +67,7 @@ func TestRadarAttackLayer7SummaryHTTPMethodWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Summary.HTTPMethod(context.TODO(), cloudflare.RadarAttackLayer7SummaryHTTPMethodParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsDateRange{cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsDateRange1d, cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsDateRange2d, cloudflare.RadarAttackLayer7SummaryHTTPMethodParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -103,6 +105,7 @@ func TestRadarAttackLayer7SummaryHTTPVersionWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Summary.HTTPVersion(context.TODO(), cloudflare.RadarAttackLayer7SummaryHTTPVersionParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsDateRange{cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsDateRange1d, cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsDateRange2d, cloudflare.RadarAttackLayer7SummaryHTTPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -140,6 +143,7 @@ func TestRadarAttackLayer7SummaryIPVersionWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Summary.IPVersion(context.TODO(), cloudflare.RadarAttackLayer7SummaryIPVersionParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryIPVersionParamsDateRange{cloudflare.RadarAttackLayer7SummaryIPVersionParamsDateRange1d, cloudflare.RadarAttackLayer7SummaryIPVersionParamsDateRange2d, cloudflare.RadarAttackLayer7SummaryIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -177,6 +181,7 @@ func TestRadarAttackLayer7SummaryManagedRulesWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Summary.ManagedRules(context.TODO(), cloudflare.RadarAttackLayer7SummaryManagedRulesParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryManagedRulesParamsDateRange{cloudflare.RadarAttackLayer7SummaryManagedRulesParamsDateRange1d, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsDateRange2d, cloudflare.RadarAttackLayer7SummaryManagedRulesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -215,6 +220,7 @@ func TestRadarAttackLayer7SummaryMitigationProductWithOptionalParams(t *testing. ) _, err := client.Radar.Attacks.Layer7.Summary.MitigationProduct(context.TODO(), cloudflare.RadarAttackLayer7SummaryMitigationProductParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7SummaryMitigationProductParamsDateRange{cloudflare.RadarAttackLayer7SummaryMitigationProductParamsDateRange1d, cloudflare.RadarAttackLayer7SummaryMitigationProductParamsDateRange2d, cloudflare.RadarAttackLayer7SummaryMitigationProductParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer7timeseriesgroup.go b/radarattacklayer7timeseriesgroup.go index 355882b30b0..a56a9d6dbc3 100644 --- a/radarattacklayer7timeseriesgroup.go +++ b/radarattacklayer7timeseriesgroup.go @@ -564,6 +564,10 @@ type RadarAttackLayer7TimeseriesGroupGetParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -659,6 +663,10 @@ type RadarAttackLayer7TimeseriesGroupHTTPMethodParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -800,6 +808,10 @@ type RadarAttackLayer7TimeseriesGroupHTTPVersionParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -984,6 +996,10 @@ type RadarAttackLayer7TimeseriesGroupIndustryParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1181,6 +1197,10 @@ type RadarAttackLayer7TimeseriesGroupIPVersionParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1366,6 +1386,10 @@ type RadarAttackLayer7TimeseriesGroupManagedRulesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1560,6 +1584,10 @@ type RadarAttackLayer7TimeseriesGroupMitigationProductParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1740,6 +1768,10 @@ type RadarAttackLayer7TimeseriesGroupVerticalParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer7timeseriesgroup_test.go b/radarattacklayer7timeseriesgroup_test.go index 2bd125fadcb..17da21e099e 100644 --- a/radarattacklayer7timeseriesgroup_test.go +++ b/radarattacklayer7timeseriesgroup_test.go @@ -33,6 +33,7 @@ func TestRadarAttackLayer7TimeseriesGroupGetWithOptionalParams(t *testing.T) { _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.Get(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupGetParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupGetParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupGetParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupGetParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupGetParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -68,6 +69,7 @@ func TestRadarAttackLayer7TimeseriesGroupHTTPMethodWithOptionalParams(t *testing _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPMethod(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPMethodParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -107,6 +109,7 @@ func TestRadarAttackLayer7TimeseriesGroupHTTPVersionWithOptionalParams(t *testin _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.HTTPVersion(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupHTTPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -146,6 +149,7 @@ func TestRadarAttackLayer7TimeseriesGroupIndustryWithOptionalParams(t *testing.T _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.Industry(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupIndustryParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -187,6 +191,7 @@ func TestRadarAttackLayer7TimeseriesGroupIPVersionWithOptionalParams(t *testing. _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.IPVersion(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -226,6 +231,7 @@ func TestRadarAttackLayer7TimeseriesGroupManagedRulesWithOptionalParams(t *testi _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.ManagedRules(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupManagedRulesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -266,6 +272,7 @@ func TestRadarAttackLayer7TimeseriesGroupMitigationProductWithOptionalParams(t * _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.MitigationProduct(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupMitigationProductParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -305,6 +312,7 @@ func TestRadarAttackLayer7TimeseriesGroupVerticalWithOptionalParams(t *testing.T _, err := client.Radar.Attacks.Layer7.TimeseriesGroups.Vertical(context.TODO(), cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParams{ AggInterval: cloudflare.F(cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange{cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange1d, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange2d, cloudflare.RadarAttackLayer7TimeseriesGroupVerticalParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer7top.go b/radarattacklayer7top.go index 364d38deb63..7016a85f945 100644 --- a/radarattacklayer7top.go +++ b/radarattacklayer7top.go @@ -478,6 +478,10 @@ type RadarAttackLayer7TopAttacksParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -588,6 +592,10 @@ type RadarAttackLayer7TopIndustryParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -669,6 +677,10 @@ type RadarAttackLayer7TopVerticalParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer7top_test.go b/radarattacklayer7top_test.go index 563de03f905..e24ca8f488b 100644 --- a/radarattacklayer7top_test.go +++ b/radarattacklayer7top_test.go @@ -32,6 +32,7 @@ func TestRadarAttackLayer7TopAttacksWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Top.Attacks(context.TODO(), cloudflare.RadarAttackLayer7TopAttacksParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TopAttacksParamsDateRange{cloudflare.RadarAttackLayer7TopAttacksParamsDateRange1d, cloudflare.RadarAttackLayer7TopAttacksParamsDateRange2d, cloudflare.RadarAttackLayer7TopAttacksParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -70,6 +71,7 @@ func TestRadarAttackLayer7TopIndustryWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Top.Industry(context.TODO(), cloudflare.RadarAttackLayer7TopIndustryParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TopIndustryParamsDateRange{cloudflare.RadarAttackLayer7TopIndustryParamsDateRange1d, cloudflare.RadarAttackLayer7TopIndustryParamsDateRange2d, cloudflare.RadarAttackLayer7TopIndustryParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -105,6 +107,7 @@ func TestRadarAttackLayer7TopVerticalWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Top.Vertical(context.TODO(), cloudflare.RadarAttackLayer7TopVerticalParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TopVerticalParamsDateRange{cloudflare.RadarAttackLayer7TopVerticalParamsDateRange1d, cloudflare.RadarAttackLayer7TopVerticalParamsDateRange2d, cloudflare.RadarAttackLayer7TopVerticalParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer7topase.go b/radarattacklayer7topase.go index 320460716cc..3fe2fb95424 100644 --- a/radarattacklayer7topase.go +++ b/radarattacklayer7topase.go @@ -183,6 +183,10 @@ func (r *RadarAttackLayer7TopAseOriginResponseTop0) UnmarshalJSON(data []byte) ( } type RadarAttackLayer7TopAseOriginParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer7topase_test.go b/radarattacklayer7topase_test.go index 4f630c6ec52..7d82539a694 100644 --- a/radarattacklayer7topase_test.go +++ b/radarattacklayer7topase_test.go @@ -31,6 +31,7 @@ func TestRadarAttackLayer7TopAseOriginWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer7.Top.Ases.Origin(context.TODO(), cloudflare.RadarAttackLayer7TopAseOriginParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TopAseOriginParamsDateRange{cloudflare.RadarAttackLayer7TopAseOriginParamsDateRange1d, cloudflare.RadarAttackLayer7TopAseOriginParamsDateRange2d, cloudflare.RadarAttackLayer7TopAseOriginParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarattacklayer7toplocation.go b/radarattacklayer7toplocation.go index ba57e367608..bde6f29f605 100644 --- a/radarattacklayer7toplocation.go +++ b/radarattacklayer7toplocation.go @@ -338,6 +338,10 @@ type RadarAttackLayer7TopLocationOriginParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -411,6 +415,10 @@ func (r *RadarAttackLayer7TopLocationOriginResponseEnvelope) UnmarshalJSON(data } type RadarAttackLayer7TopLocationTargetParams struct { + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarattacklayer7toplocation_test.go b/radarattacklayer7toplocation_test.go index ea86169c473..b7bba8f2a52 100644 --- a/radarattacklayer7toplocation_test.go +++ b/radarattacklayer7toplocation_test.go @@ -32,6 +32,7 @@ func TestRadarAttackLayer7TopLocationOriginWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Attacks.Layer7.Top.Locations.Origin(context.TODO(), cloudflare.RadarAttackLayer7TopLocationOriginParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TopLocationOriginParamsDateRange{cloudflare.RadarAttackLayer7TopLocationOriginParamsDateRange1d, cloudflare.RadarAttackLayer7TopLocationOriginParamsDateRange2d, cloudflare.RadarAttackLayer7TopLocationOriginParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -65,6 +66,7 @@ func TestRadarAttackLayer7TopLocationTargetWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Attacks.Layer7.Top.Locations.Target(context.TODO(), cloudflare.RadarAttackLayer7TopLocationTargetParams{ + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarAttackLayer7TopLocationTargetParamsDateRange{cloudflare.RadarAttackLayer7TopLocationTargetParamsDateRange1d, cloudflare.RadarAttackLayer7TopLocationTargetParamsDateRange2d, cloudflare.RadarAttackLayer7TopLocationTargetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarconnectiontampering.go b/radarconnectiontampering.go index ec5627b7467..01f09e0746f 100644 --- a/radarconnectiontampering.go +++ b/radarconnectiontampering.go @@ -359,6 +359,10 @@ type RadarConnectionTamperingSummaryParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -442,6 +446,10 @@ type RadarConnectionTamperingTimeseriesGroupsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarconnectiontampering_test.go b/radarconnectiontampering_test.go index eb22bdd05f7..5a6546ed747 100644 --- a/radarconnectiontampering_test.go +++ b/radarconnectiontampering_test.go @@ -32,6 +32,7 @@ func TestRadarConnectionTamperingSummaryWithOptionalParams(t *testing.T) { ) _, err := client.Radar.ConnectionTampering.Summary(context.TODO(), cloudflare.RadarConnectionTamperingSummaryParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarConnectionTamperingSummaryParamsDateRange{cloudflare.RadarConnectionTamperingSummaryParamsDateRange1d, cloudflare.RadarConnectionTamperingSummaryParamsDateRange2d, cloudflare.RadarConnectionTamperingSummaryParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -67,6 +68,7 @@ func TestRadarConnectionTamperingTimeseriesGroupsWithOptionalParams(t *testing.T _, err := client.Radar.ConnectionTampering.TimeseriesGroups(context.TODO(), cloudflare.RadarConnectionTamperingTimeseriesGroupsParams{ AggInterval: cloudflare.F(cloudflare.RadarConnectionTamperingTimeseriesGroupsParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarConnectionTamperingTimeseriesGroupsParamsDateRange{cloudflare.RadarConnectionTamperingTimeseriesGroupsParamsDateRange1d, cloudflare.RadarConnectionTamperingTimeseriesGroupsParamsDateRange2d, cloudflare.RadarConnectionTamperingTimeseriesGroupsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radardnstop.go b/radardnstop.go index 0b05b8fd5ae..a3e791514cb 100644 --- a/radardnstop.go +++ b/radardnstop.go @@ -324,6 +324,10 @@ type RadarDNSTopAsesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -406,6 +410,10 @@ type RadarDNSTopLocationsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radardnstop_test.go b/radardnstop_test.go index 8a4454efadc..8f4750727af 100644 --- a/radardnstop_test.go +++ b/radardnstop_test.go @@ -33,6 +33,7 @@ func TestRadarDNSTopAsesWithOptionalParams(t *testing.T) { _, err := client.Radar.DNS.Top.Ases(context.TODO(), cloudflare.RadarDNSTopAsesParams{ Domain: cloudflare.F([]string{"string", "string", "string"}), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarDNSTopAsesParamsDateRange{cloudflare.RadarDNSTopAsesParamsDateRange1d, cloudflare.RadarDNSTopAsesParamsDateRange2d, cloudflare.RadarDNSTopAsesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -69,6 +70,7 @@ func TestRadarDNSTopLocationsWithOptionalParams(t *testing.T) { _, err := client.Radar.DNS.Top.Locations(context.TODO(), cloudflare.RadarDNSTopLocationsParams{ Domain: cloudflare.F([]string{"string", "string", "string"}), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarDNSTopLocationsParamsDateRange{cloudflare.RadarDNSTopLocationsParamsDateRange1d, cloudflare.RadarDNSTopLocationsParamsDateRange2d, cloudflare.RadarDNSTopLocationsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radaremailsecuritysummary.go b/radaremailsecuritysummary.go index b586719a610..03e9e23ebc8 100644 --- a/radaremailsecuritysummary.go +++ b/radaremailsecuritysummary.go @@ -1062,10 +1062,6 @@ func (r *RadarEmailSecuritySummaryThreatCategoryResponseSummary0) UnmarshalJSON( } type RadarEmailSecuritySummaryARCParams 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1080,14 +1076,12 @@ type RadarEmailSecuritySummaryARCParams struct { DMARC param.Field[[]RadarEmailSecuritySummaryARCParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecuritySummaryARCParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecuritySummaryARCParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecuritySummaryARCParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecuritySummaryARCParams]'s query parameters as @@ -1151,6 +1145,15 @@ const ( RadarEmailSecuritySummaryARCParamsSPFFail RadarEmailSecuritySummaryARCParamsSPF = "FAIL" ) +type RadarEmailSecuritySummaryARCParamsTLSVersion string + +const ( + RadarEmailSecuritySummaryARCParamsTLSVersionTlSv1_0 RadarEmailSecuritySummaryARCParamsTLSVersion = "TLSv1_0" + RadarEmailSecuritySummaryARCParamsTLSVersionTlSv1_1 RadarEmailSecuritySummaryARCParamsTLSVersion = "TLSv1_1" + RadarEmailSecuritySummaryARCParamsTLSVersionTlSv1_2 RadarEmailSecuritySummaryARCParamsTLSVersion = "TLSv1_2" + RadarEmailSecuritySummaryARCParamsTLSVersionTlSv1_3 RadarEmailSecuritySummaryARCParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecuritySummaryARCResponseEnvelope struct { Result RadarEmailSecuritySummaryARCResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1173,10 +1176,6 @@ func (r *RadarEmailSecuritySummaryARCResponseEnvelope) UnmarshalJSON(data []byte type RadarEmailSecuritySummaryDKIMParams struct { // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecuritySummaryDKIMParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1189,14 +1188,12 @@ type RadarEmailSecuritySummaryDKIMParams struct { DMARC param.Field[[]RadarEmailSecuritySummaryDKIMParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecuritySummaryDKIMParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecuritySummaryDKIMParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecuritySummaryDKIMParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecuritySummaryDKIMParams]'s query parameters as @@ -1260,6 +1257,15 @@ const ( RadarEmailSecuritySummaryDKIMParamsSPFFail RadarEmailSecuritySummaryDKIMParamsSPF = "FAIL" ) +type RadarEmailSecuritySummaryDKIMParamsTLSVersion string + +const ( + RadarEmailSecuritySummaryDKIMParamsTLSVersionTlSv1_0 RadarEmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_0" + RadarEmailSecuritySummaryDKIMParamsTLSVersionTlSv1_1 RadarEmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_1" + RadarEmailSecuritySummaryDKIMParamsTLSVersionTlSv1_2 RadarEmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_2" + RadarEmailSecuritySummaryDKIMParamsTLSVersionTlSv1_3 RadarEmailSecuritySummaryDKIMParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecuritySummaryDKIMResponseEnvelope struct { Result RadarEmailSecuritySummaryDKIMResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1282,10 +1288,6 @@ func (r *RadarEmailSecuritySummaryDKIMResponseEnvelope) UnmarshalJSON(data []byt type RadarEmailSecuritySummaryDMARCParams struct { // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecuritySummaryDMARCParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1298,14 +1300,12 @@ type RadarEmailSecuritySummaryDMARCParams struct { DKIM param.Field[[]RadarEmailSecuritySummaryDMARCParamsDKIM] `query:"dkim"` // Format results are returned in. Format param.Field[RadarEmailSecuritySummaryDMARCParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecuritySummaryDMARCParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecuritySummaryDMARCParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecuritySummaryDMARCParams]'s query parameters as @@ -1369,6 +1369,15 @@ const ( RadarEmailSecuritySummaryDMARCParamsSPFFail RadarEmailSecuritySummaryDMARCParamsSPF = "FAIL" ) +type RadarEmailSecuritySummaryDMARCParamsTLSVersion string + +const ( + RadarEmailSecuritySummaryDMARCParamsTLSVersionTlSv1_0 RadarEmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_0" + RadarEmailSecuritySummaryDMARCParamsTLSVersionTlSv1_1 RadarEmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_1" + RadarEmailSecuritySummaryDMARCParamsTLSVersionTlSv1_2 RadarEmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_2" + RadarEmailSecuritySummaryDMARCParamsTLSVersionTlSv1_3 RadarEmailSecuritySummaryDMARCParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecuritySummaryDMARCResponseEnvelope struct { Result RadarEmailSecuritySummaryDMARCResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1391,10 +1400,6 @@ func (r *RadarEmailSecuritySummaryDMARCResponseEnvelope) UnmarshalJSON(data []by type RadarEmailSecuritySummaryMaliciousParams struct { // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecuritySummaryMaliciousParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1409,14 +1414,12 @@ type RadarEmailSecuritySummaryMaliciousParams struct { DMARC param.Field[[]RadarEmailSecuritySummaryMaliciousParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecuritySummaryMaliciousParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecuritySummaryMaliciousParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecuritySummaryMaliciousParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecuritySummaryMaliciousParams]'s query @@ -1488,6 +1491,15 @@ const ( RadarEmailSecuritySummaryMaliciousParamsSPFFail RadarEmailSecuritySummaryMaliciousParamsSPF = "FAIL" ) +type RadarEmailSecuritySummaryMaliciousParamsTLSVersion string + +const ( + RadarEmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_0 RadarEmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_0" + RadarEmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_1 RadarEmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_1" + RadarEmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_2 RadarEmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_2" + RadarEmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_3 RadarEmailSecuritySummaryMaliciousParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecuritySummaryMaliciousResponseEnvelope struct { Result RadarEmailSecuritySummaryMaliciousResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1510,10 +1522,6 @@ func (r *RadarEmailSecuritySummaryMaliciousResponseEnvelope) UnmarshalJSON(data type RadarEmailSecuritySummarySpamParams struct { // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecuritySummarySpamParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1528,14 +1536,12 @@ type RadarEmailSecuritySummarySpamParams struct { DMARC param.Field[[]RadarEmailSecuritySummarySpamParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecuritySummarySpamParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecuritySummarySpamParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecuritySummarySpamParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecuritySummarySpamParams]'s query parameters as @@ -1607,6 +1613,15 @@ const ( RadarEmailSecuritySummarySpamParamsSPFFail RadarEmailSecuritySummarySpamParamsSPF = "FAIL" ) +type RadarEmailSecuritySummarySpamParamsTLSVersion string + +const ( + RadarEmailSecuritySummarySpamParamsTLSVersionTlSv1_0 RadarEmailSecuritySummarySpamParamsTLSVersion = "TLSv1_0" + RadarEmailSecuritySummarySpamParamsTLSVersionTlSv1_1 RadarEmailSecuritySummarySpamParamsTLSVersion = "TLSv1_1" + RadarEmailSecuritySummarySpamParamsTLSVersionTlSv1_2 RadarEmailSecuritySummarySpamParamsTLSVersion = "TLSv1_2" + RadarEmailSecuritySummarySpamParamsTLSVersionTlSv1_3 RadarEmailSecuritySummarySpamParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecuritySummarySpamResponseEnvelope struct { Result RadarEmailSecuritySummarySpamResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1629,10 +1644,6 @@ func (r *RadarEmailSecuritySummarySpamResponseEnvelope) UnmarshalJSON(data []byt type RadarEmailSecuritySummarySPFParams struct { // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecuritySummarySPFParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1647,12 +1658,10 @@ type RadarEmailSecuritySummarySPFParams struct { DMARC param.Field[[]RadarEmailSecuritySummarySPFParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecuritySummarySPFParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecuritySummarySPFParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecuritySummarySPFParams]'s query parameters as @@ -1716,6 +1725,15 @@ const ( RadarEmailSecuritySummarySPFParamsFormatCsv RadarEmailSecuritySummarySPFParamsFormat = "CSV" ) +type RadarEmailSecuritySummarySPFParamsTLSVersion string + +const ( + RadarEmailSecuritySummarySPFParamsTLSVersionTlSv1_0 RadarEmailSecuritySummarySPFParamsTLSVersion = "TLSv1_0" + RadarEmailSecuritySummarySPFParamsTLSVersionTlSv1_1 RadarEmailSecuritySummarySPFParamsTLSVersion = "TLSv1_1" + RadarEmailSecuritySummarySPFParamsTLSVersionTlSv1_2 RadarEmailSecuritySummarySPFParamsTLSVersion = "TLSv1_2" + RadarEmailSecuritySummarySPFParamsTLSVersionTlSv1_3 RadarEmailSecuritySummarySPFParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecuritySummarySPFResponseEnvelope struct { Result RadarEmailSecuritySummarySPFResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1738,10 +1756,6 @@ func (r *RadarEmailSecuritySummarySPFResponseEnvelope) UnmarshalJSON(data []byte type RadarEmailSecuritySummaryThreatCategoryParams struct { // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecuritySummaryThreatCategoryParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1756,14 +1770,12 @@ type RadarEmailSecuritySummaryThreatCategoryParams struct { DMARC param.Field[[]RadarEmailSecuritySummaryThreatCategoryParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecuritySummaryThreatCategoryParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecuritySummaryThreatCategoryParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecuritySummaryThreatCategoryParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecuritySummaryThreatCategoryParams]'s query @@ -1835,6 +1847,15 @@ const ( RadarEmailSecuritySummaryThreatCategoryParamsSPFFail RadarEmailSecuritySummaryThreatCategoryParamsSPF = "FAIL" ) +type RadarEmailSecuritySummaryThreatCategoryParamsTLSVersion string + +const ( + RadarEmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_0 RadarEmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_0" + RadarEmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_1 RadarEmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_1" + RadarEmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_2 RadarEmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_2" + RadarEmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_3 RadarEmailSecuritySummaryThreatCategoryParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecuritySummaryThreatCategoryResponseEnvelope struct { Result RadarEmailSecuritySummaryThreatCategoryResponse `json:"result,required"` Success bool `json:"success,required"` diff --git a/radaremailsecuritysummary_test.go b/radaremailsecuritysummary_test.go index bd4256faae9..4daaf6bcedd 100644 --- a/radaremailsecuritysummary_test.go +++ b/radaremailsecuritysummary_test.go @@ -31,16 +31,15 @@ func TestRadarEmailSecuritySummaryARCWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Email.Security.Summary.ARC(context.TODO(), cloudflare.RadarEmailSecuritySummaryARCParams{ - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsDateRange{cloudflare.RadarEmailSecuritySummaryARCParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryARCParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryARCParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsDKIM{cloudflare.RadarEmailSecuritySummaryARCParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryARCParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryARCParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsDMARC{cloudflare.RadarEmailSecuritySummaryARCParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryARCParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryARCParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryARCParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsSPF{cloudflare.RadarEmailSecuritySummaryARCParamsSPFPass, cloudflare.RadarEmailSecuritySummaryARCParamsSPFNone, cloudflare.RadarEmailSecuritySummaryARCParamsSPFFail}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsDateRange{cloudflare.RadarEmailSecuritySummaryARCParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryARCParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryARCParamsDateRange7d}), + DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsDKIM{cloudflare.RadarEmailSecuritySummaryARCParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryARCParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryARCParamsDKIMFail}), + DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsDMARC{cloudflare.RadarEmailSecuritySummaryARCParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryARCParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryARCParamsDMARCFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryARCParamsFormatJson), + Name: cloudflare.F([]string{"string", "string", "string"}), + SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsSPF{cloudflare.RadarEmailSecuritySummaryARCParamsSPFPass, cloudflare.RadarEmailSecuritySummaryARCParamsSPFNone, cloudflare.RadarEmailSecuritySummaryARCParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryARCParamsTLSVersion{cloudflare.RadarEmailSecuritySummaryARCParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummaryARCParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummaryARCParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -68,16 +67,15 @@ func TestRadarEmailSecuritySummaryDKIMWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Email.Security.Summary.DKIM(context.TODO(), cloudflare.RadarEmailSecuritySummaryDKIMParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsARC{cloudflare.RadarEmailSecuritySummaryDKIMParamsARCPass, cloudflare.RadarEmailSecuritySummaryDKIMParamsARCNone, cloudflare.RadarEmailSecuritySummaryDKIMParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange{cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARC{cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryDKIMParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsSPF{cloudflare.RadarEmailSecuritySummaryDKIMParamsSPFPass, cloudflare.RadarEmailSecuritySummaryDKIMParamsSPFNone, cloudflare.RadarEmailSecuritySummaryDKIMParamsSPFFail}), + ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsARC{cloudflare.RadarEmailSecuritySummaryDKIMParamsARCPass, cloudflare.RadarEmailSecuritySummaryDKIMParamsARCNone, cloudflare.RadarEmailSecuritySummaryDKIMParamsARCFail}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange{cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryDKIMParamsDateRange7d}), + DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARC{cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryDKIMParamsDMARCFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryDKIMParamsFormatJson), + Name: cloudflare.F([]string{"string", "string", "string"}), + SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsSPF{cloudflare.RadarEmailSecuritySummaryDKIMParamsSPFPass, cloudflare.RadarEmailSecuritySummaryDKIMParamsSPFNone, cloudflare.RadarEmailSecuritySummaryDKIMParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDKIMParamsTLSVersion{cloudflare.RadarEmailSecuritySummaryDKIMParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummaryDKIMParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummaryDKIMParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -105,16 +103,15 @@ func TestRadarEmailSecuritySummaryDMARCWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Email.Security.Summary.DMARC(context.TODO(), cloudflare.RadarEmailSecuritySummaryDMARCParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsARC{cloudflare.RadarEmailSecuritySummaryDMARCParamsARCPass, cloudflare.RadarEmailSecuritySummaryDMARCParamsARCNone, cloudflare.RadarEmailSecuritySummaryDMARCParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange{cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIM{cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIMFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryDMARCParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsSPF{cloudflare.RadarEmailSecuritySummaryDMARCParamsSPFPass, cloudflare.RadarEmailSecuritySummaryDMARCParamsSPFNone, cloudflare.RadarEmailSecuritySummaryDMARCParamsSPFFail}), + ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsARC{cloudflare.RadarEmailSecuritySummaryDMARCParamsARCPass, cloudflare.RadarEmailSecuritySummaryDMARCParamsARCNone, cloudflare.RadarEmailSecuritySummaryDMARCParamsARCFail}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange{cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryDMARCParamsDateRange7d}), + DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIM{cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryDMARCParamsDKIMFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryDMARCParamsFormatJson), + Name: cloudflare.F([]string{"string", "string", "string"}), + SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsSPF{cloudflare.RadarEmailSecuritySummaryDMARCParamsSPFPass, cloudflare.RadarEmailSecuritySummaryDMARCParamsSPFNone, cloudflare.RadarEmailSecuritySummaryDMARCParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryDMARCParamsTLSVersion{cloudflare.RadarEmailSecuritySummaryDMARCParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummaryDMARCParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummaryDMARCParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -142,17 +139,16 @@ func TestRadarEmailSecuritySummaryMaliciousWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Email.Security.Summary.Malicious(context.TODO(), cloudflare.RadarEmailSecuritySummaryMaliciousParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsARC{cloudflare.RadarEmailSecuritySummaryMaliciousParamsARCPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsARCNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange{cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIM{cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARC{cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryMaliciousParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPF{cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPFPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPFNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPFFail}), + ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsARC{cloudflare.RadarEmailSecuritySummaryMaliciousParamsARCPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsARCNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsARCFail}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange{cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDateRange7d}), + DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIM{cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDKIMFail}), + DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARC{cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsDMARCFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryMaliciousParamsFormatJson), + Name: cloudflare.F([]string{"string", "string", "string"}), + SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPF{cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPFPass, cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPFNone, cloudflare.RadarEmailSecuritySummaryMaliciousParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryMaliciousParamsTLSVersion{cloudflare.RadarEmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummaryMaliciousParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -180,17 +176,16 @@ func TestRadarEmailSecuritySummarySpamWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Email.Security.Summary.Spam(context.TODO(), cloudflare.RadarEmailSecuritySummarySpamParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsARC{cloudflare.RadarEmailSecuritySummarySpamParamsARCPass, cloudflare.RadarEmailSecuritySummarySpamParamsARCNone, cloudflare.RadarEmailSecuritySummarySpamParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsDateRange{cloudflare.RadarEmailSecuritySummarySpamParamsDateRange1d, cloudflare.RadarEmailSecuritySummarySpamParamsDateRange2d, cloudflare.RadarEmailSecuritySummarySpamParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsDKIM{cloudflare.RadarEmailSecuritySummarySpamParamsDKIMPass, cloudflare.RadarEmailSecuritySummarySpamParamsDKIMNone, cloudflare.RadarEmailSecuritySummarySpamParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsDMARC{cloudflare.RadarEmailSecuritySummarySpamParamsDMARCPass, cloudflare.RadarEmailSecuritySummarySpamParamsDMARCNone, cloudflare.RadarEmailSecuritySummarySpamParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummarySpamParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsSPF{cloudflare.RadarEmailSecuritySummarySpamParamsSPFPass, cloudflare.RadarEmailSecuritySummarySpamParamsSPFNone, cloudflare.RadarEmailSecuritySummarySpamParamsSPFFail}), + ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsARC{cloudflare.RadarEmailSecuritySummarySpamParamsARCPass, cloudflare.RadarEmailSecuritySummarySpamParamsARCNone, cloudflare.RadarEmailSecuritySummarySpamParamsARCFail}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsDateRange{cloudflare.RadarEmailSecuritySummarySpamParamsDateRange1d, cloudflare.RadarEmailSecuritySummarySpamParamsDateRange2d, cloudflare.RadarEmailSecuritySummarySpamParamsDateRange7d}), + DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsDKIM{cloudflare.RadarEmailSecuritySummarySpamParamsDKIMPass, cloudflare.RadarEmailSecuritySummarySpamParamsDKIMNone, cloudflare.RadarEmailSecuritySummarySpamParamsDKIMFail}), + DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsDMARC{cloudflare.RadarEmailSecuritySummarySpamParamsDMARCPass, cloudflare.RadarEmailSecuritySummarySpamParamsDMARCNone, cloudflare.RadarEmailSecuritySummarySpamParamsDMARCFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummarySpamParamsFormatJson), + Name: cloudflare.F([]string{"string", "string", "string"}), + SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsSPF{cloudflare.RadarEmailSecuritySummarySpamParamsSPFPass, cloudflare.RadarEmailSecuritySummarySpamParamsSPFNone, cloudflare.RadarEmailSecuritySummarySpamParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySpamParamsTLSVersion{cloudflare.RadarEmailSecuritySummarySpamParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummarySpamParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummarySpamParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -218,16 +213,15 @@ func TestRadarEmailSecuritySummarySPFWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Email.Security.Summary.SPF(context.TODO(), cloudflare.RadarEmailSecuritySummarySPFParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsARC{cloudflare.RadarEmailSecuritySummarySPFParamsARCPass, cloudflare.RadarEmailSecuritySummarySPFParamsARCNone, cloudflare.RadarEmailSecuritySummarySPFParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsDateRange{cloudflare.RadarEmailSecuritySummarySPFParamsDateRange1d, cloudflare.RadarEmailSecuritySummarySPFParamsDateRange2d, cloudflare.RadarEmailSecuritySummarySPFParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsDKIM{cloudflare.RadarEmailSecuritySummarySPFParamsDKIMPass, cloudflare.RadarEmailSecuritySummarySPFParamsDKIMNone, cloudflare.RadarEmailSecuritySummarySPFParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsDMARC{cloudflare.RadarEmailSecuritySummarySPFParamsDMARCPass, cloudflare.RadarEmailSecuritySummarySPFParamsDMARCNone, cloudflare.RadarEmailSecuritySummarySPFParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummarySPFParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), + ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsARC{cloudflare.RadarEmailSecuritySummarySPFParamsARCPass, cloudflare.RadarEmailSecuritySummarySPFParamsARCNone, cloudflare.RadarEmailSecuritySummarySPFParamsARCFail}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsDateRange{cloudflare.RadarEmailSecuritySummarySPFParamsDateRange1d, cloudflare.RadarEmailSecuritySummarySPFParamsDateRange2d, cloudflare.RadarEmailSecuritySummarySPFParamsDateRange7d}), + DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsDKIM{cloudflare.RadarEmailSecuritySummarySPFParamsDKIMPass, cloudflare.RadarEmailSecuritySummarySPFParamsDKIMNone, cloudflare.RadarEmailSecuritySummarySPFParamsDKIMFail}), + DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsDMARC{cloudflare.RadarEmailSecuritySummarySPFParamsDMARCPass, cloudflare.RadarEmailSecuritySummarySPFParamsDMARCNone, cloudflare.RadarEmailSecuritySummarySPFParamsDMARCFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummarySPFParamsFormatJson), + Name: cloudflare.F([]string{"string", "string", "string"}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummarySPFParamsTLSVersion{cloudflare.RadarEmailSecuritySummarySPFParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummarySPFParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummarySPFParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -255,17 +249,16 @@ func TestRadarEmailSecuritySummaryThreatCategoryWithOptionalParams(t *testing.T) option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Email.Security.Summary.ThreatCategory(context.TODO(), cloudflare.RadarEmailSecuritySummaryThreatCategoryParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARC{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARCPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARCNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIM{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARC{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPF{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPFPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPFNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPFFail}), + ARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARC{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARCPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARCNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsARCFail}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DateRange: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange1d, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange2d, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDateRange7d}), + DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + DKIM: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIM{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIMPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIMNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDKIMFail}), + DMARC: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARC{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARCPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARCNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsDMARCFail}), + Format: cloudflare.F(cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsFormatJson), + Name: cloudflare.F([]string{"string", "string", "string"}), + SPF: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPF{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPFPass, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPFNone, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsTLSVersion{cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecuritySummaryThreatCategoryParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error diff --git a/radaremailsecuritytimeseriesgroup.go b/radaremailsecuritytimeseriesgroup.go index ef189e30c68..b83bbbbf6bd 100644 --- a/radaremailsecuritytimeseriesgroup.go +++ b/radaremailsecuritytimeseriesgroup.go @@ -410,10 +410,6 @@ type RadarEmailSecurityTimeseriesGroupARCParams struct { // or 1 hour intervals). Refer to // [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). AggInterval param.Field[RadarEmailSecurityTimeseriesGroupARCParamsAggInterval] `query:"aggInterval"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -428,14 +424,12 @@ type RadarEmailSecurityTimeseriesGroupARCParams struct { DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupARCParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecurityTimeseriesGroupARCParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecurityTimeseriesGroupARCParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupARCParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecurityTimeseriesGroupARCParams]'s query @@ -511,6 +505,15 @@ const ( RadarEmailSecurityTimeseriesGroupARCParamsSPFFail RadarEmailSecurityTimeseriesGroupARCParamsSPF = "FAIL" ) +type RadarEmailSecurityTimeseriesGroupARCParamsTLSVersion string + +const ( + RadarEmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_0" + RadarEmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_1" + RadarEmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_2" + RadarEmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupARCParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecurityTimeseriesGroupARCResponseEnvelope struct { Result RadarEmailSecurityTimeseriesGroupARCResponse `json:"result,required"` Success bool `json:"success,required"` @@ -537,10 +540,6 @@ type RadarEmailSecurityTimeseriesGroupDKIMParams struct { AggInterval param.Field[RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval] `query:"aggInterval"` // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecurityTimeseriesGroupDKIMParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -553,14 +552,12 @@ type RadarEmailSecurityTimeseriesGroupDKIMParams struct { DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupDKIMParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecurityTimeseriesGroupDKIMParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecurityTimeseriesGroupDKIMParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecurityTimeseriesGroupDKIMParams]'s query @@ -636,6 +633,15 @@ const ( RadarEmailSecurityTimeseriesGroupDKIMParamsSPFFail RadarEmailSecurityTimeseriesGroupDKIMParamsSPF = "FAIL" ) +type RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersion string + +const ( + RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_0" + RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_1" + RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_2" + RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecurityTimeseriesGroupDKIMResponseEnvelope struct { Result RadarEmailSecurityTimeseriesGroupDKIMResponse `json:"result,required"` Success bool `json:"success,required"` @@ -662,10 +668,6 @@ type RadarEmailSecurityTimeseriesGroupDMARCParams struct { AggInterval param.Field[RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval] `query:"aggInterval"` // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecurityTimeseriesGroupDMARCParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -678,14 +680,12 @@ type RadarEmailSecurityTimeseriesGroupDMARCParams struct { DKIM param.Field[[]RadarEmailSecurityTimeseriesGroupDMARCParamsDKIM] `query:"dkim"` // Format results are returned in. Format param.Field[RadarEmailSecurityTimeseriesGroupDMARCParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecurityTimeseriesGroupDMARCParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecurityTimeseriesGroupDMARCParams]'s query @@ -761,6 +761,15 @@ const ( RadarEmailSecurityTimeseriesGroupDMARCParamsSPFFail RadarEmailSecurityTimeseriesGroupDMARCParamsSPF = "FAIL" ) +type RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersion string + +const ( + RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_0" + RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_1" + RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_2" + RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecurityTimeseriesGroupDMARCResponseEnvelope struct { Result RadarEmailSecurityTimeseriesGroupDMARCResponse `json:"result,required"` Success bool `json:"success,required"` @@ -787,10 +796,6 @@ type RadarEmailSecurityTimeseriesGroupMaliciousParams struct { AggInterval param.Field[RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval] `query:"aggInterval"` // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -805,14 +810,12 @@ type RadarEmailSecurityTimeseriesGroupMaliciousParams struct { DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecurityTimeseriesGroupMaliciousParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecurityTimeseriesGroupMaliciousParams]'s query @@ -896,6 +899,15 @@ const ( RadarEmailSecurityTimeseriesGroupMaliciousParamsSPFFail RadarEmailSecurityTimeseriesGroupMaliciousParamsSPF = "FAIL" ) +type RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersion string + +const ( + RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_0" + RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_1" + RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_2" + RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecurityTimeseriesGroupMaliciousResponseEnvelope struct { Result RadarEmailSecurityTimeseriesGroupMaliciousResponse `json:"result,required"` Success bool `json:"success,required"` @@ -923,10 +935,6 @@ type RadarEmailSecurityTimeseriesGroupSpamParams struct { AggInterval param.Field[RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval] `query:"aggInterval"` // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecurityTimeseriesGroupSpamParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -941,14 +949,12 @@ type RadarEmailSecurityTimeseriesGroupSpamParams struct { DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupSpamParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecurityTimeseriesGroupSpamParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecurityTimeseriesGroupSpamParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecurityTimeseriesGroupSpamParams]'s query @@ -1032,6 +1038,15 @@ const ( RadarEmailSecurityTimeseriesGroupSpamParamsSPFFail RadarEmailSecurityTimeseriesGroupSpamParamsSPF = "FAIL" ) +type RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersion string + +const ( + RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_0" + RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_1" + RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_2" + RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecurityTimeseriesGroupSpamResponseEnvelope struct { Result RadarEmailSecurityTimeseriesGroupSpamResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1058,10 +1073,6 @@ type RadarEmailSecurityTimeseriesGroupSPFParams struct { AggInterval param.Field[RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval] `query:"aggInterval"` // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecurityTimeseriesGroupSPFParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1076,12 +1087,10 @@ type RadarEmailSecurityTimeseriesGroupSPFParams struct { DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupSPFParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecurityTimeseriesGroupSPFParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecurityTimeseriesGroupSPFParams]'s query @@ -1157,6 +1166,15 @@ const ( RadarEmailSecurityTimeseriesGroupSPFParamsFormatCsv RadarEmailSecurityTimeseriesGroupSPFParamsFormat = "CSV" ) +type RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersion string + +const ( + RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_0" + RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_1" + RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_2" + RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecurityTimeseriesGroupSPFResponseEnvelope struct { Result RadarEmailSecurityTimeseriesGroupSPFResponse `json:"result,required"` Success bool `json:"success,required"` @@ -1183,10 +1201,6 @@ type RadarEmailSecurityTimeseriesGroupThreatCategoryParams struct { AggInterval param.Field[RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval] `query:"aggInterval"` // Filter for arc (Authenticated Received Chain). ARC param.Field[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1201,14 +1215,12 @@ type RadarEmailSecurityTimeseriesGroupThreatCategoryParams struct { DMARC param.Field[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARC] `query:"dmarc"` // Format results are returned in. Format param.Field[RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormat] `query:"format"` - // 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. - Location param.Field[[]string] `query:"location"` // Array of names that will be used to name the series in responses. Name param.Field[[]string] `query:"name"` // Filter for spf. SPF param.Field[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPF] `query:"spf"` + // Filter for tls version. + TLSVersion param.Field[[]RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion] `query:"tlsVersion"` } // URLQuery serializes [RadarEmailSecurityTimeseriesGroupThreatCategoryParams]'s @@ -1292,6 +1304,15 @@ const ( RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPFFail RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPF = "FAIL" ) +type RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion string + +const ( + RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_0 RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_0" + RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_1 RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_1" + RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_2 RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_2" + RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_3 RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion = "TLSv1_3" +) + type RadarEmailSecurityTimeseriesGroupThreatCategoryResponseEnvelope struct { Result RadarEmailSecurityTimeseriesGroupThreatCategoryResponse `json:"result,required"` Success bool `json:"success,required"` diff --git a/radaremailsecuritytimeseriesgroup_test.go b/radaremailsecuritytimeseriesgroup_test.go index ce6d4578821..3455a8ded15 100644 --- a/radaremailsecuritytimeseriesgroup_test.go +++ b/radaremailsecuritytimeseriesgroup_test.go @@ -32,16 +32,15 @@ func TestRadarEmailSecurityTimeseriesGroupARCWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Email.Security.TimeseriesGroups.ARC(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupARCParams{ AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsAggInterval1h), - ASN: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDKIMFail}), DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsDMARCFail}), Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupARCParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -71,15 +70,14 @@ func TestRadarEmailSecurityTimeseriesGroupDKIMWithOptionalParams(t *testing.T) { _, err := client.Radar.Email.Security.TimeseriesGroups.DKIM(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParams{ AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsAggInterval1h), ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsDMARCFail}), Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupDKIMParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -109,15 +107,14 @@ func TestRadarEmailSecurityTimeseriesGroupDMARCWithOptionalParams(t *testing.T) _, err := client.Radar.Email.Security.TimeseriesGroups.DMARC(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParams{ AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsAggInterval1h), ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsDKIMFail}), Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupDMARCParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -147,16 +144,15 @@ func TestRadarEmailSecurityTimeseriesGroupMaliciousWithOptionalParams(t *testing _, err := client.Radar.Email.Security.TimeseriesGroups.Malicious(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParams{ AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsAggInterval1h), ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDKIMFail}), DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsDMARCFail}), Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupMaliciousParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -186,16 +182,15 @@ func TestRadarEmailSecurityTimeseriesGroupSpamWithOptionalParams(t *testing.T) { _, err := client.Radar.Email.Security.TimeseriesGroups.Spam(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupSpamParams{ AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsAggInterval1h), ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDKIMFail}), DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsDMARCFail}), Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupSpamParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -225,15 +220,14 @@ func TestRadarEmailSecurityTimeseriesGroupSPFWithOptionalParams(t *testing.T) { _, err := client.Radar.Email.Security.TimeseriesGroups.SPF(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupSPFParams{ AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsAggInterval1h), ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDKIMFail}), DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsDMARCFail}), Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupSPFParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error @@ -263,16 +257,15 @@ func TestRadarEmailSecurityTimeseriesGroupThreatCategoryWithOptionalParams(t *te _, err := client.Radar.Email.Security.TimeseriesGroups.ThreatCategory(context.TODO(), cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParams{ AggInterval: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsAggInterval1h), ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARC{cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange{cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange1d, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange2d, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIM{cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIMPass, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIMNone, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDKIMFail}), DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARC{cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARCPass, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARCNone, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsDMARCFail}), Format: cloudflare.F(cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), Name: cloudflare.F([]string{"string", "string", "string"}), SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPF{cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPFPass, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPFNone, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsSPFFail}), + TLSVersion: cloudflare.F([]cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersion{cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_0, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_1, cloudflare.RadarEmailSecurityTimeseriesGroupThreatCategoryParamsTLSVersionTlSv1_2}), }) if err != nil { var apierr *cloudflare.Error diff --git a/radaremailsecuritytopase.go b/radaremailsecuritytopase.go index 5bd0316e9bb..d6c7f863a53 100644 --- a/radaremailsecuritytopase.go +++ b/radaremailsecuritytopase.go @@ -3,15 +3,6 @@ package cloudflare import ( - "context" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -44,269 +35,3 @@ func NewRadarEmailSecurityTopAseService(opts ...option.RequestOption) (r *RadarE r.SPF = NewRadarEmailSecurityTopAseSPFService(opts...) return } - -// Get the top autonomous systems (AS) by email messages. Values are a percentage -// out of the total emails. -func (r *RadarEmailSecurityTopAseService) Get(ctx context.Context, query RadarEmailSecurityTopAseGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopAseGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopAseGetResponseEnvelope - path := "radar/email/security/top/ases" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopAseGetResponse struct { - Meta RadarEmailSecurityTopAseGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopAseGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopAseGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopAseGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseGetResponse] -type radarEmailSecurityTopAseGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseGetResponseMeta struct { - DateRange []RadarEmailSecurityTopAseGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopAseGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopAseGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopAseGetResponseMetaJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseGetResponseMeta] -type radarEmailSecurityTopAseGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopAseGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopAseGetResponseMetaDateRangeJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseGetResponseMetaDateRange] -type radarEmailSecurityTopAseGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopAseGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopAseGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopAseGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopAseGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopAseGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopAseGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopAseGetResponseMetaConfidenceInfoAnnotationJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopAseGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopAseGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseGetResponseTop0 struct { - ClientASN int64 `json:"clientASN,required"` - ClientAsName string `json:"clientASName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopAseGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopAseGetResponseTop0JSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseGetResponseTop0] -type radarEmailSecurityTopAseGetResponseTop0JSON struct { - ClientASN apijson.Field - ClientAsName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopAseGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopAseGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopAseGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopAseGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopAseGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopAseGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopAseGetParams]'s query parameters as -// `url.Values`. -func (r RadarEmailSecurityTopAseGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type RadarEmailSecurityTopAseGetParamsARC string - -const ( - RadarEmailSecurityTopAseGetParamsARCPass RadarEmailSecurityTopAseGetParamsARC = "PASS" - RadarEmailSecurityTopAseGetParamsARCNone RadarEmailSecurityTopAseGetParamsARC = "NONE" - RadarEmailSecurityTopAseGetParamsARCFail RadarEmailSecurityTopAseGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopAseGetParamsDateRange string - -const ( - RadarEmailSecurityTopAseGetParamsDateRange1d RadarEmailSecurityTopAseGetParamsDateRange = "1d" - RadarEmailSecurityTopAseGetParamsDateRange2d RadarEmailSecurityTopAseGetParamsDateRange = "2d" - RadarEmailSecurityTopAseGetParamsDateRange7d RadarEmailSecurityTopAseGetParamsDateRange = "7d" - RadarEmailSecurityTopAseGetParamsDateRange14d RadarEmailSecurityTopAseGetParamsDateRange = "14d" - RadarEmailSecurityTopAseGetParamsDateRange28d RadarEmailSecurityTopAseGetParamsDateRange = "28d" - RadarEmailSecurityTopAseGetParamsDateRange12w RadarEmailSecurityTopAseGetParamsDateRange = "12w" - RadarEmailSecurityTopAseGetParamsDateRange24w RadarEmailSecurityTopAseGetParamsDateRange = "24w" - RadarEmailSecurityTopAseGetParamsDateRange52w RadarEmailSecurityTopAseGetParamsDateRange = "52w" - RadarEmailSecurityTopAseGetParamsDateRange1dControl RadarEmailSecurityTopAseGetParamsDateRange = "1dControl" - RadarEmailSecurityTopAseGetParamsDateRange2dControl RadarEmailSecurityTopAseGetParamsDateRange = "2dControl" - RadarEmailSecurityTopAseGetParamsDateRange7dControl RadarEmailSecurityTopAseGetParamsDateRange = "7dControl" - RadarEmailSecurityTopAseGetParamsDateRange14dControl RadarEmailSecurityTopAseGetParamsDateRange = "14dControl" - RadarEmailSecurityTopAseGetParamsDateRange28dControl RadarEmailSecurityTopAseGetParamsDateRange = "28dControl" - RadarEmailSecurityTopAseGetParamsDateRange12wControl RadarEmailSecurityTopAseGetParamsDateRange = "12wControl" - RadarEmailSecurityTopAseGetParamsDateRange24wControl RadarEmailSecurityTopAseGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopAseGetParamsDKIM string - -const ( - RadarEmailSecurityTopAseGetParamsDKIMPass RadarEmailSecurityTopAseGetParamsDKIM = "PASS" - RadarEmailSecurityTopAseGetParamsDKIMNone RadarEmailSecurityTopAseGetParamsDKIM = "NONE" - RadarEmailSecurityTopAseGetParamsDKIMFail RadarEmailSecurityTopAseGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopAseGetParamsDMARC string - -const ( - RadarEmailSecurityTopAseGetParamsDMARCPass RadarEmailSecurityTopAseGetParamsDMARC = "PASS" - RadarEmailSecurityTopAseGetParamsDMARCNone RadarEmailSecurityTopAseGetParamsDMARC = "NONE" - RadarEmailSecurityTopAseGetParamsDMARCFail RadarEmailSecurityTopAseGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopAseGetParamsFormat string - -const ( - RadarEmailSecurityTopAseGetParamsFormatJson RadarEmailSecurityTopAseGetParamsFormat = "JSON" - RadarEmailSecurityTopAseGetParamsFormatCsv RadarEmailSecurityTopAseGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopAseGetParamsSPF string - -const ( - RadarEmailSecurityTopAseGetParamsSPFPass RadarEmailSecurityTopAseGetParamsSPF = "PASS" - RadarEmailSecurityTopAseGetParamsSPFNone RadarEmailSecurityTopAseGetParamsSPF = "NONE" - RadarEmailSecurityTopAseGetParamsSPFFail RadarEmailSecurityTopAseGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopAseGetResponseEnvelope struct { - Result RadarEmailSecurityTopAseGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopAseGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopAseGetResponseEnvelopeJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseGetResponseEnvelope] -type radarEmailSecurityTopAseGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytopase_test.go b/radaremailsecuritytopase_test.go deleted file mode 100644 index ddfca948916..00000000000 --- a/radaremailsecuritytopase_test.go +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopAseGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Ases.Get(context.TODO(), cloudflare.RadarEmailSecurityTopAseGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseGetParamsARC{cloudflare.RadarEmailSecurityTopAseGetParamsARCPass, cloudflare.RadarEmailSecurityTopAseGetParamsARCNone, cloudflare.RadarEmailSecurityTopAseGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseGetParamsDateRange{cloudflare.RadarEmailSecurityTopAseGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopAseGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopAseGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseGetParamsDKIM{cloudflare.RadarEmailSecurityTopAseGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopAseGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopAseGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseGetParamsDMARC{cloudflare.RadarEmailSecurityTopAseGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopAseGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopAseGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopAseGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseGetParamsSPF{cloudflare.RadarEmailSecurityTopAseGetParamsSPFPass, cloudflare.RadarEmailSecurityTopAseGetParamsSPFNone, cloudflare.RadarEmailSecurityTopAseGetParamsSPFFail}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytopasearc.go b/radaremailsecuritytopasearc.go index 20ffb3c1303..d193bb891a2 100644 --- a/radaremailsecuritytopasearc.go +++ b/radaremailsecuritytopasearc.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,268 +23,3 @@ func NewRadarEmailSecurityTopAseARCService(opts ...option.RequestOption) (r *Rad r.Options = opts return } - -// Get the top autonomous systems (AS) by emails ARC validation. -func (r *RadarEmailSecurityTopAseARCService) Get(ctx context.Context, arc RadarEmailSecurityTopAseARCGetParamsARC, query RadarEmailSecurityTopAseARCGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopAseARCGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopAseARCGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/ases/arc/%v", arc) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopAseARCGetResponse struct { - Meta RadarEmailSecurityTopAseARCGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopAseARCGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopAseARCGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopAseARCGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseARCGetResponse] -type radarEmailSecurityTopAseARCGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseARCGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseARCGetResponseMeta struct { - DateRange []RadarEmailSecurityTopAseARCGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopAseARCGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopAseARCGetResponseMetaJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseARCGetResponseMeta] -type radarEmailSecurityTopAseARCGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseARCGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseARCGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopAseARCGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopAseARCGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopAseARCGetResponseMetaDateRange] -type radarEmailSecurityTopAseARCGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseARCGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoAnnotationJSON contains -// the JSON metadata for the struct -// [RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseARCGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseARCGetResponseTop0 struct { - ClientASN int64 `json:"clientASN,required"` - ClientAsName string `json:"clientASName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopAseARCGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopAseARCGetResponseTop0JSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseARCGetResponseTop0] -type radarEmailSecurityTopAseARCGetResponseTop0JSON struct { - ClientASN apijson.Field - ClientAsName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseARCGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseARCGetParams 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopAseARCGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopAseARCGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopAseARCGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopAseARCGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopAseARCGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopAseARCGetParams]'s query parameters as -// `url.Values`. -func (r RadarEmailSecurityTopAseARCGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// ARC. -type RadarEmailSecurityTopAseARCGetParamsARC string - -const ( - RadarEmailSecurityTopAseARCGetParamsARCPass RadarEmailSecurityTopAseARCGetParamsARC = "PASS" - RadarEmailSecurityTopAseARCGetParamsARCNone RadarEmailSecurityTopAseARCGetParamsARC = "NONE" - RadarEmailSecurityTopAseARCGetParamsARCFail RadarEmailSecurityTopAseARCGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopAseARCGetParamsDateRange string - -const ( - RadarEmailSecurityTopAseARCGetParamsDateRange1d RadarEmailSecurityTopAseARCGetParamsDateRange = "1d" - RadarEmailSecurityTopAseARCGetParamsDateRange2d RadarEmailSecurityTopAseARCGetParamsDateRange = "2d" - RadarEmailSecurityTopAseARCGetParamsDateRange7d RadarEmailSecurityTopAseARCGetParamsDateRange = "7d" - RadarEmailSecurityTopAseARCGetParamsDateRange14d RadarEmailSecurityTopAseARCGetParamsDateRange = "14d" - RadarEmailSecurityTopAseARCGetParamsDateRange28d RadarEmailSecurityTopAseARCGetParamsDateRange = "28d" - RadarEmailSecurityTopAseARCGetParamsDateRange12w RadarEmailSecurityTopAseARCGetParamsDateRange = "12w" - RadarEmailSecurityTopAseARCGetParamsDateRange24w RadarEmailSecurityTopAseARCGetParamsDateRange = "24w" - RadarEmailSecurityTopAseARCGetParamsDateRange52w RadarEmailSecurityTopAseARCGetParamsDateRange = "52w" - RadarEmailSecurityTopAseARCGetParamsDateRange1dControl RadarEmailSecurityTopAseARCGetParamsDateRange = "1dControl" - RadarEmailSecurityTopAseARCGetParamsDateRange2dControl RadarEmailSecurityTopAseARCGetParamsDateRange = "2dControl" - RadarEmailSecurityTopAseARCGetParamsDateRange7dControl RadarEmailSecurityTopAseARCGetParamsDateRange = "7dControl" - RadarEmailSecurityTopAseARCGetParamsDateRange14dControl RadarEmailSecurityTopAseARCGetParamsDateRange = "14dControl" - RadarEmailSecurityTopAseARCGetParamsDateRange28dControl RadarEmailSecurityTopAseARCGetParamsDateRange = "28dControl" - RadarEmailSecurityTopAseARCGetParamsDateRange12wControl RadarEmailSecurityTopAseARCGetParamsDateRange = "12wControl" - RadarEmailSecurityTopAseARCGetParamsDateRange24wControl RadarEmailSecurityTopAseARCGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopAseARCGetParamsDKIM string - -const ( - RadarEmailSecurityTopAseARCGetParamsDKIMPass RadarEmailSecurityTopAseARCGetParamsDKIM = "PASS" - RadarEmailSecurityTopAseARCGetParamsDKIMNone RadarEmailSecurityTopAseARCGetParamsDKIM = "NONE" - RadarEmailSecurityTopAseARCGetParamsDKIMFail RadarEmailSecurityTopAseARCGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopAseARCGetParamsDMARC string - -const ( - RadarEmailSecurityTopAseARCGetParamsDMARCPass RadarEmailSecurityTopAseARCGetParamsDMARC = "PASS" - RadarEmailSecurityTopAseARCGetParamsDMARCNone RadarEmailSecurityTopAseARCGetParamsDMARC = "NONE" - RadarEmailSecurityTopAseARCGetParamsDMARCFail RadarEmailSecurityTopAseARCGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopAseARCGetParamsFormat string - -const ( - RadarEmailSecurityTopAseARCGetParamsFormatJson RadarEmailSecurityTopAseARCGetParamsFormat = "JSON" - RadarEmailSecurityTopAseARCGetParamsFormatCsv RadarEmailSecurityTopAseARCGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopAseARCGetParamsSPF string - -const ( - RadarEmailSecurityTopAseARCGetParamsSPFPass RadarEmailSecurityTopAseARCGetParamsSPF = "PASS" - RadarEmailSecurityTopAseARCGetParamsSPFNone RadarEmailSecurityTopAseARCGetParamsSPF = "NONE" - RadarEmailSecurityTopAseARCGetParamsSPFFail RadarEmailSecurityTopAseARCGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopAseARCGetResponseEnvelope struct { - Result RadarEmailSecurityTopAseARCGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopAseARCGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopAseARCGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseARCGetResponseEnvelope] -type radarEmailSecurityTopAseARCGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseARCGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytopasearc_test.go b/radaremailsecuritytopasearc_test.go deleted file mode 100644 index 416ac16f110..00000000000 --- a/radaremailsecuritytopasearc_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopAseARCGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Ases.ARC.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopAseARCGetParamsARCPass, - cloudflare.RadarEmailSecurityTopAseARCGetParams{ - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseARCGetParamsDateRange{cloudflare.RadarEmailSecurityTopAseARCGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopAseARCGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopAseARCGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseARCGetParamsDKIM{cloudflare.RadarEmailSecurityTopAseARCGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopAseARCGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopAseARCGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseARCGetParamsDMARC{cloudflare.RadarEmailSecurityTopAseARCGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopAseARCGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopAseARCGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopAseARCGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseARCGetParamsSPF{cloudflare.RadarEmailSecurityTopAseARCGetParamsSPFPass, cloudflare.RadarEmailSecurityTopAseARCGetParamsSPFNone, cloudflare.RadarEmailSecurityTopAseARCGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytopasedkim.go b/radaremailsecuritytopasedkim.go index 4c06507dfea..101839272bf 100644 --- a/radaremailsecuritytopasedkim.go +++ b/radaremailsecuritytopasedkim.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,268 +23,3 @@ func NewRadarEmailSecurityTopAseDKIMService(opts ...option.RequestOption) (r *Ra r.Options = opts return } - -// Get the top autonomous systems (AS), by email DKIM validation. -func (r *RadarEmailSecurityTopAseDKIMService) Get(ctx context.Context, dkim RadarEmailSecurityTopAseDKIMGetParamsDKIM, query RadarEmailSecurityTopAseDKIMGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopAseDKIMGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopAseDKIMGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/ases/dkim/%v", dkim) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopAseDKIMGetResponse struct { - Meta RadarEmailSecurityTopAseDKIMGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopAseDKIMGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopAseDKIMGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopAseDKIMGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseDKIMGetResponse] -type radarEmailSecurityTopAseDKIMGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDKIMGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDKIMGetResponseMeta struct { - DateRange []RadarEmailSecurityTopAseDKIMGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopAseDKIMGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopAseDKIMGetResponseMetaJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseDKIMGetResponseMeta] -type radarEmailSecurityTopAseDKIMGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDKIMGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDKIMGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopAseDKIMGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopAseDKIMGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopAseDKIMGetResponseMetaDateRange] -type radarEmailSecurityTopAseDKIMGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDKIMGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoAnnotationJSON contains -// the JSON metadata for the struct -// [RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDKIMGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDKIMGetResponseTop0 struct { - ClientASN int64 `json:"clientASN,required"` - ClientAsName string `json:"clientASName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopAseDKIMGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopAseDKIMGetResponseTop0JSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseDKIMGetResponseTop0] -type radarEmailSecurityTopAseDKIMGetResponseTop0JSON struct { - ClientASN apijson.Field - ClientAsName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDKIMGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDKIMGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopAseDKIMGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopAseDKIMGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopAseDKIMGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopAseDKIMGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopAseDKIMGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopAseDKIMGetParams]'s query parameters -// as `url.Values`. -func (r RadarEmailSecurityTopAseDKIMGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// DKIM. -type RadarEmailSecurityTopAseDKIMGetParamsDKIM string - -const ( - RadarEmailSecurityTopAseDKIMGetParamsDKIMPass RadarEmailSecurityTopAseDKIMGetParamsDKIM = "PASS" - RadarEmailSecurityTopAseDKIMGetParamsDKIMNone RadarEmailSecurityTopAseDKIMGetParamsDKIM = "NONE" - RadarEmailSecurityTopAseDKIMGetParamsDKIMFail RadarEmailSecurityTopAseDKIMGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopAseDKIMGetParamsARC string - -const ( - RadarEmailSecurityTopAseDKIMGetParamsARCPass RadarEmailSecurityTopAseDKIMGetParamsARC = "PASS" - RadarEmailSecurityTopAseDKIMGetParamsARCNone RadarEmailSecurityTopAseDKIMGetParamsARC = "NONE" - RadarEmailSecurityTopAseDKIMGetParamsARCFail RadarEmailSecurityTopAseDKIMGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopAseDKIMGetParamsDateRange string - -const ( - RadarEmailSecurityTopAseDKIMGetParamsDateRange1d RadarEmailSecurityTopAseDKIMGetParamsDateRange = "1d" - RadarEmailSecurityTopAseDKIMGetParamsDateRange2d RadarEmailSecurityTopAseDKIMGetParamsDateRange = "2d" - RadarEmailSecurityTopAseDKIMGetParamsDateRange7d RadarEmailSecurityTopAseDKIMGetParamsDateRange = "7d" - RadarEmailSecurityTopAseDKIMGetParamsDateRange14d RadarEmailSecurityTopAseDKIMGetParamsDateRange = "14d" - RadarEmailSecurityTopAseDKIMGetParamsDateRange28d RadarEmailSecurityTopAseDKIMGetParamsDateRange = "28d" - RadarEmailSecurityTopAseDKIMGetParamsDateRange12w RadarEmailSecurityTopAseDKIMGetParamsDateRange = "12w" - RadarEmailSecurityTopAseDKIMGetParamsDateRange24w RadarEmailSecurityTopAseDKIMGetParamsDateRange = "24w" - RadarEmailSecurityTopAseDKIMGetParamsDateRange52w RadarEmailSecurityTopAseDKIMGetParamsDateRange = "52w" - RadarEmailSecurityTopAseDKIMGetParamsDateRange1dControl RadarEmailSecurityTopAseDKIMGetParamsDateRange = "1dControl" - RadarEmailSecurityTopAseDKIMGetParamsDateRange2dControl RadarEmailSecurityTopAseDKIMGetParamsDateRange = "2dControl" - RadarEmailSecurityTopAseDKIMGetParamsDateRange7dControl RadarEmailSecurityTopAseDKIMGetParamsDateRange = "7dControl" - RadarEmailSecurityTopAseDKIMGetParamsDateRange14dControl RadarEmailSecurityTopAseDKIMGetParamsDateRange = "14dControl" - RadarEmailSecurityTopAseDKIMGetParamsDateRange28dControl RadarEmailSecurityTopAseDKIMGetParamsDateRange = "28dControl" - RadarEmailSecurityTopAseDKIMGetParamsDateRange12wControl RadarEmailSecurityTopAseDKIMGetParamsDateRange = "12wControl" - RadarEmailSecurityTopAseDKIMGetParamsDateRange24wControl RadarEmailSecurityTopAseDKIMGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopAseDKIMGetParamsDMARC string - -const ( - RadarEmailSecurityTopAseDKIMGetParamsDMARCPass RadarEmailSecurityTopAseDKIMGetParamsDMARC = "PASS" - RadarEmailSecurityTopAseDKIMGetParamsDMARCNone RadarEmailSecurityTopAseDKIMGetParamsDMARC = "NONE" - RadarEmailSecurityTopAseDKIMGetParamsDMARCFail RadarEmailSecurityTopAseDKIMGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopAseDKIMGetParamsFormat string - -const ( - RadarEmailSecurityTopAseDKIMGetParamsFormatJson RadarEmailSecurityTopAseDKIMGetParamsFormat = "JSON" - RadarEmailSecurityTopAseDKIMGetParamsFormatCsv RadarEmailSecurityTopAseDKIMGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopAseDKIMGetParamsSPF string - -const ( - RadarEmailSecurityTopAseDKIMGetParamsSPFPass RadarEmailSecurityTopAseDKIMGetParamsSPF = "PASS" - RadarEmailSecurityTopAseDKIMGetParamsSPFNone RadarEmailSecurityTopAseDKIMGetParamsSPF = "NONE" - RadarEmailSecurityTopAseDKIMGetParamsSPFFail RadarEmailSecurityTopAseDKIMGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopAseDKIMGetResponseEnvelope struct { - Result RadarEmailSecurityTopAseDKIMGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopAseDKIMGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopAseDKIMGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseDKIMGetResponseEnvelope] -type radarEmailSecurityTopAseDKIMGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDKIMGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytopasedkim_test.go b/radaremailsecuritytopasedkim_test.go deleted file mode 100644 index 35cfe7776d2..00000000000 --- a/radaremailsecuritytopasedkim_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopAseDKIMGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Ases.DKIM.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDKIMPass, - cloudflare.RadarEmailSecurityTopAseDKIMGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDKIMGetParamsARC{cloudflare.RadarEmailSecurityTopAseDKIMGetParamsARCPass, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsARCNone, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDateRange{cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDMARC{cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopAseDKIMGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDKIMGetParamsSPF{cloudflare.RadarEmailSecurityTopAseDKIMGetParamsSPFPass, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsSPFNone, cloudflare.RadarEmailSecurityTopAseDKIMGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytopasedmarc.go b/radaremailsecuritytopasedmarc.go index c36579e2d00..065c58a0213 100644 --- a/radaremailsecuritytopasedmarc.go +++ b/radaremailsecuritytopasedmarc.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,268 +23,3 @@ func NewRadarEmailSecurityTopAseDMARCService(opts ...option.RequestOption) (r *R r.Options = opts return } - -// Get the top autonomous systems (AS) by emails DMARC validation. -func (r *RadarEmailSecurityTopAseDMARCService) Get(ctx context.Context, dmarc RadarEmailSecurityTopAseDMARCGetParamsDMARC, query RadarEmailSecurityTopAseDMARCGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopAseDMARCGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopAseDMARCGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/ases/dmarc/%v", dmarc) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopAseDMARCGetResponse struct { - Meta RadarEmailSecurityTopAseDMARCGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopAseDMARCGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopAseDMARCGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopAseDMARCGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseDMARCGetResponse] -type radarEmailSecurityTopAseDMARCGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDMARCGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDMARCGetResponseMeta struct { - DateRange []RadarEmailSecurityTopAseDMARCGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopAseDMARCGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopAseDMARCGetResponseMetaJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseDMARCGetResponseMeta] -type radarEmailSecurityTopAseDMARCGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDMARCGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDMARCGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopAseDMARCGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopAseDMARCGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopAseDMARCGetResponseMetaDateRange] -type radarEmailSecurityTopAseDMARCGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDMARCGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDMARCGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDMARCGetResponseTop0 struct { - ClientASN int64 `json:"clientASN,required"` - ClientAsName string `json:"clientASName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopAseDMARCGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopAseDMARCGetResponseTop0JSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseDMARCGetResponseTop0] -type radarEmailSecurityTopAseDMARCGetResponseTop0JSON struct { - ClientASN apijson.Field - ClientAsName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDMARCGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseDMARCGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopAseDMARCGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopAseDMARCGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopAseDMARCGetParamsDKIM] `query:"dkim"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopAseDMARCGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopAseDMARCGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopAseDMARCGetParams]'s query parameters -// as `url.Values`. -func (r RadarEmailSecurityTopAseDMARCGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// DMARC. -type RadarEmailSecurityTopAseDMARCGetParamsDMARC string - -const ( - RadarEmailSecurityTopAseDMARCGetParamsDMARCPass RadarEmailSecurityTopAseDMARCGetParamsDMARC = "PASS" - RadarEmailSecurityTopAseDMARCGetParamsDMARCNone RadarEmailSecurityTopAseDMARCGetParamsDMARC = "NONE" - RadarEmailSecurityTopAseDMARCGetParamsDMARCFail RadarEmailSecurityTopAseDMARCGetParamsDMARC = "FAIL" -) - -type RadarEmailSecurityTopAseDMARCGetParamsARC string - -const ( - RadarEmailSecurityTopAseDMARCGetParamsARCPass RadarEmailSecurityTopAseDMARCGetParamsARC = "PASS" - RadarEmailSecurityTopAseDMARCGetParamsARCNone RadarEmailSecurityTopAseDMARCGetParamsARC = "NONE" - RadarEmailSecurityTopAseDMARCGetParamsARCFail RadarEmailSecurityTopAseDMARCGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopAseDMARCGetParamsDateRange string - -const ( - RadarEmailSecurityTopAseDMARCGetParamsDateRange1d RadarEmailSecurityTopAseDMARCGetParamsDateRange = "1d" - RadarEmailSecurityTopAseDMARCGetParamsDateRange2d RadarEmailSecurityTopAseDMARCGetParamsDateRange = "2d" - RadarEmailSecurityTopAseDMARCGetParamsDateRange7d RadarEmailSecurityTopAseDMARCGetParamsDateRange = "7d" - RadarEmailSecurityTopAseDMARCGetParamsDateRange14d RadarEmailSecurityTopAseDMARCGetParamsDateRange = "14d" - RadarEmailSecurityTopAseDMARCGetParamsDateRange28d RadarEmailSecurityTopAseDMARCGetParamsDateRange = "28d" - RadarEmailSecurityTopAseDMARCGetParamsDateRange12w RadarEmailSecurityTopAseDMARCGetParamsDateRange = "12w" - RadarEmailSecurityTopAseDMARCGetParamsDateRange24w RadarEmailSecurityTopAseDMARCGetParamsDateRange = "24w" - RadarEmailSecurityTopAseDMARCGetParamsDateRange52w RadarEmailSecurityTopAseDMARCGetParamsDateRange = "52w" - RadarEmailSecurityTopAseDMARCGetParamsDateRange1dControl RadarEmailSecurityTopAseDMARCGetParamsDateRange = "1dControl" - RadarEmailSecurityTopAseDMARCGetParamsDateRange2dControl RadarEmailSecurityTopAseDMARCGetParamsDateRange = "2dControl" - RadarEmailSecurityTopAseDMARCGetParamsDateRange7dControl RadarEmailSecurityTopAseDMARCGetParamsDateRange = "7dControl" - RadarEmailSecurityTopAseDMARCGetParamsDateRange14dControl RadarEmailSecurityTopAseDMARCGetParamsDateRange = "14dControl" - RadarEmailSecurityTopAseDMARCGetParamsDateRange28dControl RadarEmailSecurityTopAseDMARCGetParamsDateRange = "28dControl" - RadarEmailSecurityTopAseDMARCGetParamsDateRange12wControl RadarEmailSecurityTopAseDMARCGetParamsDateRange = "12wControl" - RadarEmailSecurityTopAseDMARCGetParamsDateRange24wControl RadarEmailSecurityTopAseDMARCGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopAseDMARCGetParamsDKIM string - -const ( - RadarEmailSecurityTopAseDMARCGetParamsDKIMPass RadarEmailSecurityTopAseDMARCGetParamsDKIM = "PASS" - RadarEmailSecurityTopAseDMARCGetParamsDKIMNone RadarEmailSecurityTopAseDMARCGetParamsDKIM = "NONE" - RadarEmailSecurityTopAseDMARCGetParamsDKIMFail RadarEmailSecurityTopAseDMARCGetParamsDKIM = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopAseDMARCGetParamsFormat string - -const ( - RadarEmailSecurityTopAseDMARCGetParamsFormatJson RadarEmailSecurityTopAseDMARCGetParamsFormat = "JSON" - RadarEmailSecurityTopAseDMARCGetParamsFormatCsv RadarEmailSecurityTopAseDMARCGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopAseDMARCGetParamsSPF string - -const ( - RadarEmailSecurityTopAseDMARCGetParamsSPFPass RadarEmailSecurityTopAseDMARCGetParamsSPF = "PASS" - RadarEmailSecurityTopAseDMARCGetParamsSPFNone RadarEmailSecurityTopAseDMARCGetParamsSPF = "NONE" - RadarEmailSecurityTopAseDMARCGetParamsSPFFail RadarEmailSecurityTopAseDMARCGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopAseDMARCGetResponseEnvelope struct { - Result RadarEmailSecurityTopAseDMARCGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopAseDMARCGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopAseDMARCGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseDMARCGetResponseEnvelope] -type radarEmailSecurityTopAseDMARCGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseDMARCGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytopasedmarc_test.go b/radaremailsecuritytopasedmarc_test.go deleted file mode 100644 index e650e9f57bb..00000000000 --- a/radaremailsecuritytopasedmarc_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopAseDMARCGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Ases.DMARC.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDMARCPass, - cloudflare.RadarEmailSecurityTopAseDMARCGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDMARCGetParamsARC{cloudflare.RadarEmailSecurityTopAseDMARCGetParamsARCPass, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsARCNone, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDateRange{cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDKIM{cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsDKIMFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopAseDMARCGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseDMARCGetParamsSPF{cloudflare.RadarEmailSecurityTopAseDMARCGetParamsSPFPass, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsSPFNone, cloudflare.RadarEmailSecurityTopAseDMARCGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytopasemalicious.go b/radaremailsecuritytopasemalicious.go index acc50bb8064..25e4772ad9e 100644 --- a/radaremailsecuritytopasemalicious.go +++ b/radaremailsecuritytopasemalicious.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,278 +23,3 @@ func NewRadarEmailSecurityTopAseMaliciousService(opts ...option.RequestOption) ( r.Options = opts return } - -// Get the top autonomous systems (AS), by emails classified as Malicious or not. -func (r *RadarEmailSecurityTopAseMaliciousService) Get(ctx context.Context, malicious RadarEmailSecurityTopAseMaliciousGetParamsMalicious, query RadarEmailSecurityTopAseMaliciousGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopAseMaliciousGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopAseMaliciousGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/ases/malicious/%v", malicious) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopAseMaliciousGetResponse struct { - Meta RadarEmailSecurityTopAseMaliciousGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopAseMaliciousGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopAseMaliciousGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopAseMaliciousGetResponseJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseMaliciousGetResponse] -type radarEmailSecurityTopAseMaliciousGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseMaliciousGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseMaliciousGetResponseMeta struct { - DateRange []RadarEmailSecurityTopAseMaliciousGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopAseMaliciousGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopAseMaliciousGetResponseMetaJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseMaliciousGetResponseMeta] -type radarEmailSecurityTopAseMaliciousGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseMaliciousGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseMaliciousGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopAseMaliciousGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopAseMaliciousGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopAseMaliciousGetResponseMetaDateRange] -type radarEmailSecurityTopAseMaliciousGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseMaliciousGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseMaliciousGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseMaliciousGetResponseTop0 struct { - ClientASN int64 `json:"clientASN,required"` - ClientAsName string `json:"clientASName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopAseMaliciousGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopAseMaliciousGetResponseTop0JSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseMaliciousGetResponseTop0] -type radarEmailSecurityTopAseMaliciousGetResponseTop0JSON struct { - ClientASN apijson.Field - ClientAsName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseMaliciousGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseMaliciousGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopAseMaliciousGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopAseMaliciousGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopAseMaliciousGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopAseMaliciousGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopAseMaliciousGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopAseMaliciousGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopAseMaliciousGetParams]'s query -// parameters as `url.Values`. -func (r RadarEmailSecurityTopAseMaliciousGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Malicious. -type RadarEmailSecurityTopAseMaliciousGetParamsMalicious string - -const ( - RadarEmailSecurityTopAseMaliciousGetParamsMaliciousMalicious RadarEmailSecurityTopAseMaliciousGetParamsMalicious = "MALICIOUS" - RadarEmailSecurityTopAseMaliciousGetParamsMaliciousNotMalicious RadarEmailSecurityTopAseMaliciousGetParamsMalicious = "NOT_MALICIOUS" -) - -type RadarEmailSecurityTopAseMaliciousGetParamsARC string - -const ( - RadarEmailSecurityTopAseMaliciousGetParamsARCPass RadarEmailSecurityTopAseMaliciousGetParamsARC = "PASS" - RadarEmailSecurityTopAseMaliciousGetParamsARCNone RadarEmailSecurityTopAseMaliciousGetParamsARC = "NONE" - RadarEmailSecurityTopAseMaliciousGetParamsARCFail RadarEmailSecurityTopAseMaliciousGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopAseMaliciousGetParamsDateRange string - -const ( - RadarEmailSecurityTopAseMaliciousGetParamsDateRange1d RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "1d" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange2d RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "2d" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange7d RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "7d" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange14d RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "14d" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange28d RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "28d" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange12w RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "12w" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange24w RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "24w" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange52w RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "52w" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange1dControl RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "1dControl" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange2dControl RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "2dControl" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange7dControl RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "7dControl" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange14dControl RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "14dControl" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange28dControl RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "28dControl" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange12wControl RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "12wControl" - RadarEmailSecurityTopAseMaliciousGetParamsDateRange24wControl RadarEmailSecurityTopAseMaliciousGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopAseMaliciousGetParamsDKIM string - -const ( - RadarEmailSecurityTopAseMaliciousGetParamsDKIMPass RadarEmailSecurityTopAseMaliciousGetParamsDKIM = "PASS" - RadarEmailSecurityTopAseMaliciousGetParamsDKIMNone RadarEmailSecurityTopAseMaliciousGetParamsDKIM = "NONE" - RadarEmailSecurityTopAseMaliciousGetParamsDKIMFail RadarEmailSecurityTopAseMaliciousGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopAseMaliciousGetParamsDMARC string - -const ( - RadarEmailSecurityTopAseMaliciousGetParamsDMARCPass RadarEmailSecurityTopAseMaliciousGetParamsDMARC = "PASS" - RadarEmailSecurityTopAseMaliciousGetParamsDMARCNone RadarEmailSecurityTopAseMaliciousGetParamsDMARC = "NONE" - RadarEmailSecurityTopAseMaliciousGetParamsDMARCFail RadarEmailSecurityTopAseMaliciousGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopAseMaliciousGetParamsFormat string - -const ( - RadarEmailSecurityTopAseMaliciousGetParamsFormatJson RadarEmailSecurityTopAseMaliciousGetParamsFormat = "JSON" - RadarEmailSecurityTopAseMaliciousGetParamsFormatCsv RadarEmailSecurityTopAseMaliciousGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopAseMaliciousGetParamsSPF string - -const ( - RadarEmailSecurityTopAseMaliciousGetParamsSPFPass RadarEmailSecurityTopAseMaliciousGetParamsSPF = "PASS" - RadarEmailSecurityTopAseMaliciousGetParamsSPFNone RadarEmailSecurityTopAseMaliciousGetParamsSPF = "NONE" - RadarEmailSecurityTopAseMaliciousGetParamsSPFFail RadarEmailSecurityTopAseMaliciousGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopAseMaliciousGetResponseEnvelope struct { - Result RadarEmailSecurityTopAseMaliciousGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopAseMaliciousGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopAseMaliciousGetResponseEnvelopeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopAseMaliciousGetResponseEnvelope] -type radarEmailSecurityTopAseMaliciousGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseMaliciousGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytopasemalicious_test.go b/radaremailsecuritytopasemalicious_test.go deleted file mode 100644 index b75d9355f89..00000000000 --- a/radaremailsecuritytopasemalicious_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopAseMaliciousGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Ases.Malicious.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsMaliciousMalicious, - cloudflare.RadarEmailSecurityTopAseMaliciousGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsARC{cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsARCPass, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsARCNone, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDateRange{cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDKIM{cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDMARC{cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsSPF{cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsSPFPass, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsSPFNone, cloudflare.RadarEmailSecurityTopAseMaliciousGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytopasespam.go b/radaremailsecuritytopasespam.go index 8ca8bcd34b2..6446e83e9e4 100644 --- a/radaremailsecuritytopasespam.go +++ b/radaremailsecuritytopasespam.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,277 +23,3 @@ func NewRadarEmailSecurityTopAseSpamService(opts ...option.RequestOption) (r *Ra r.Options = opts return } - -// Get the top autonomous systems (AS), by emails classified, of Spam validations. -func (r *RadarEmailSecurityTopAseSpamService) Get(ctx context.Context, spam RadarEmailSecurityTopAseSpamGetParamsSpam, query RadarEmailSecurityTopAseSpamGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopAseSpamGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopAseSpamGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/ases/spam/%v", spam) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopAseSpamGetResponse struct { - Meta RadarEmailSecurityTopAseSpamGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopAseSpamGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopAseSpamGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopAseSpamGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseSpamGetResponse] -type radarEmailSecurityTopAseSpamGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSpamGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSpamGetResponseMeta struct { - DateRange []RadarEmailSecurityTopAseSpamGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopAseSpamGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopAseSpamGetResponseMetaJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseSpamGetResponseMeta] -type radarEmailSecurityTopAseSpamGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSpamGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSpamGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopAseSpamGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopAseSpamGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopAseSpamGetResponseMetaDateRange] -type radarEmailSecurityTopAseSpamGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSpamGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoAnnotationJSON contains -// the JSON metadata for the struct -// [RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSpamGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSpamGetResponseTop0 struct { - ClientASN int64 `json:"clientASN,required"` - ClientAsName string `json:"clientASName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopAseSpamGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopAseSpamGetResponseTop0JSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseSpamGetResponseTop0] -type radarEmailSecurityTopAseSpamGetResponseTop0JSON struct { - ClientASN apijson.Field - ClientAsName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSpamGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSpamGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopAseSpamGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopAseSpamGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopAseSpamGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopAseSpamGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopAseSpamGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopAseSpamGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopAseSpamGetParams]'s query parameters -// as `url.Values`. -func (r RadarEmailSecurityTopAseSpamGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Spam. -type RadarEmailSecurityTopAseSpamGetParamsSpam string - -const ( - RadarEmailSecurityTopAseSpamGetParamsSpamSpam RadarEmailSecurityTopAseSpamGetParamsSpam = "SPAM" - RadarEmailSecurityTopAseSpamGetParamsSpamNotSpam RadarEmailSecurityTopAseSpamGetParamsSpam = "NOT_SPAM" -) - -type RadarEmailSecurityTopAseSpamGetParamsARC string - -const ( - RadarEmailSecurityTopAseSpamGetParamsARCPass RadarEmailSecurityTopAseSpamGetParamsARC = "PASS" - RadarEmailSecurityTopAseSpamGetParamsARCNone RadarEmailSecurityTopAseSpamGetParamsARC = "NONE" - RadarEmailSecurityTopAseSpamGetParamsARCFail RadarEmailSecurityTopAseSpamGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopAseSpamGetParamsDateRange string - -const ( - RadarEmailSecurityTopAseSpamGetParamsDateRange1d RadarEmailSecurityTopAseSpamGetParamsDateRange = "1d" - RadarEmailSecurityTopAseSpamGetParamsDateRange2d RadarEmailSecurityTopAseSpamGetParamsDateRange = "2d" - RadarEmailSecurityTopAseSpamGetParamsDateRange7d RadarEmailSecurityTopAseSpamGetParamsDateRange = "7d" - RadarEmailSecurityTopAseSpamGetParamsDateRange14d RadarEmailSecurityTopAseSpamGetParamsDateRange = "14d" - RadarEmailSecurityTopAseSpamGetParamsDateRange28d RadarEmailSecurityTopAseSpamGetParamsDateRange = "28d" - RadarEmailSecurityTopAseSpamGetParamsDateRange12w RadarEmailSecurityTopAseSpamGetParamsDateRange = "12w" - RadarEmailSecurityTopAseSpamGetParamsDateRange24w RadarEmailSecurityTopAseSpamGetParamsDateRange = "24w" - RadarEmailSecurityTopAseSpamGetParamsDateRange52w RadarEmailSecurityTopAseSpamGetParamsDateRange = "52w" - RadarEmailSecurityTopAseSpamGetParamsDateRange1dControl RadarEmailSecurityTopAseSpamGetParamsDateRange = "1dControl" - RadarEmailSecurityTopAseSpamGetParamsDateRange2dControl RadarEmailSecurityTopAseSpamGetParamsDateRange = "2dControl" - RadarEmailSecurityTopAseSpamGetParamsDateRange7dControl RadarEmailSecurityTopAseSpamGetParamsDateRange = "7dControl" - RadarEmailSecurityTopAseSpamGetParamsDateRange14dControl RadarEmailSecurityTopAseSpamGetParamsDateRange = "14dControl" - RadarEmailSecurityTopAseSpamGetParamsDateRange28dControl RadarEmailSecurityTopAseSpamGetParamsDateRange = "28dControl" - RadarEmailSecurityTopAseSpamGetParamsDateRange12wControl RadarEmailSecurityTopAseSpamGetParamsDateRange = "12wControl" - RadarEmailSecurityTopAseSpamGetParamsDateRange24wControl RadarEmailSecurityTopAseSpamGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopAseSpamGetParamsDKIM string - -const ( - RadarEmailSecurityTopAseSpamGetParamsDKIMPass RadarEmailSecurityTopAseSpamGetParamsDKIM = "PASS" - RadarEmailSecurityTopAseSpamGetParamsDKIMNone RadarEmailSecurityTopAseSpamGetParamsDKIM = "NONE" - RadarEmailSecurityTopAseSpamGetParamsDKIMFail RadarEmailSecurityTopAseSpamGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopAseSpamGetParamsDMARC string - -const ( - RadarEmailSecurityTopAseSpamGetParamsDMARCPass RadarEmailSecurityTopAseSpamGetParamsDMARC = "PASS" - RadarEmailSecurityTopAseSpamGetParamsDMARCNone RadarEmailSecurityTopAseSpamGetParamsDMARC = "NONE" - RadarEmailSecurityTopAseSpamGetParamsDMARCFail RadarEmailSecurityTopAseSpamGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopAseSpamGetParamsFormat string - -const ( - RadarEmailSecurityTopAseSpamGetParamsFormatJson RadarEmailSecurityTopAseSpamGetParamsFormat = "JSON" - RadarEmailSecurityTopAseSpamGetParamsFormatCsv RadarEmailSecurityTopAseSpamGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopAseSpamGetParamsSPF string - -const ( - RadarEmailSecurityTopAseSpamGetParamsSPFPass RadarEmailSecurityTopAseSpamGetParamsSPF = "PASS" - RadarEmailSecurityTopAseSpamGetParamsSPFNone RadarEmailSecurityTopAseSpamGetParamsSPF = "NONE" - RadarEmailSecurityTopAseSpamGetParamsSPFFail RadarEmailSecurityTopAseSpamGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopAseSpamGetResponseEnvelope struct { - Result RadarEmailSecurityTopAseSpamGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopAseSpamGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopAseSpamGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseSpamGetResponseEnvelope] -type radarEmailSecurityTopAseSpamGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSpamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytopasespam_test.go b/radaremailsecuritytopasespam_test.go deleted file mode 100644 index 4d63054b3cd..00000000000 --- a/radaremailsecuritytopasespam_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopAseSpamGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Ases.Spam.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopAseSpamGetParamsSpamSpam, - cloudflare.RadarEmailSecurityTopAseSpamGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSpamGetParamsARC{cloudflare.RadarEmailSecurityTopAseSpamGetParamsARCPass, cloudflare.RadarEmailSecurityTopAseSpamGetParamsARCNone, cloudflare.RadarEmailSecurityTopAseSpamGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSpamGetParamsDateRange{cloudflare.RadarEmailSecurityTopAseSpamGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopAseSpamGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopAseSpamGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSpamGetParamsDKIM{cloudflare.RadarEmailSecurityTopAseSpamGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopAseSpamGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopAseSpamGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSpamGetParamsDMARC{cloudflare.RadarEmailSecurityTopAseSpamGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopAseSpamGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopAseSpamGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopAseSpamGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSpamGetParamsSPF{cloudflare.RadarEmailSecurityTopAseSpamGetParamsSPFPass, cloudflare.RadarEmailSecurityTopAseSpamGetParamsSPFNone, cloudflare.RadarEmailSecurityTopAseSpamGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytopasespf.go b/radaremailsecuritytopasespf.go index e6f27a9169f..7d064167ce2 100644 --- a/radaremailsecuritytopasespf.go +++ b/radaremailsecuritytopasespf.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,268 +23,3 @@ func NewRadarEmailSecurityTopAseSPFService(opts ...option.RequestOption) (r *Rad r.Options = opts return } - -// Get the top autonomous systems (AS) by email SPF validation. -func (r *RadarEmailSecurityTopAseSPFService) Get(ctx context.Context, spf RadarEmailSecurityTopAseSPFGetParamsSPF, query RadarEmailSecurityTopAseSPFGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopAseSPFGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopAseSPFGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/ases/spf/%v", spf) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopAseSPFGetResponse struct { - Meta RadarEmailSecurityTopAseSPFGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopAseSPFGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopAseSPFGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopAseSPFGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopAseSPFGetResponse] -type radarEmailSecurityTopAseSPFGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSPFGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSPFGetResponseMeta struct { - DateRange []RadarEmailSecurityTopAseSPFGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopAseSPFGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopAseSPFGetResponseMetaJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseSPFGetResponseMeta] -type radarEmailSecurityTopAseSPFGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSPFGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSPFGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopAseSPFGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopAseSPFGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopAseSPFGetResponseMetaDateRange] -type radarEmailSecurityTopAseSPFGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSPFGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoAnnotationJSON contains -// the JSON metadata for the struct -// [RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSPFGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSPFGetResponseTop0 struct { - ClientASN int64 `json:"clientASN,required"` - ClientAsName string `json:"clientASName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopAseSPFGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopAseSPFGetResponseTop0JSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopAseSPFGetResponseTop0] -type radarEmailSecurityTopAseSPFGetResponseTop0JSON struct { - ClientASN apijson.Field - ClientAsName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSPFGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopAseSPFGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopAseSPFGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopAseSPFGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopAseSPFGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopAseSPFGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopAseSPFGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` -} - -// URLQuery serializes [RadarEmailSecurityTopAseSPFGetParams]'s query parameters as -// `url.Values`. -func (r RadarEmailSecurityTopAseSPFGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// SPF. -type RadarEmailSecurityTopAseSPFGetParamsSPF string - -const ( - RadarEmailSecurityTopAseSPFGetParamsSPFPass RadarEmailSecurityTopAseSPFGetParamsSPF = "PASS" - RadarEmailSecurityTopAseSPFGetParamsSPFNone RadarEmailSecurityTopAseSPFGetParamsSPF = "NONE" - RadarEmailSecurityTopAseSPFGetParamsSPFFail RadarEmailSecurityTopAseSPFGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopAseSPFGetParamsARC string - -const ( - RadarEmailSecurityTopAseSPFGetParamsARCPass RadarEmailSecurityTopAseSPFGetParamsARC = "PASS" - RadarEmailSecurityTopAseSPFGetParamsARCNone RadarEmailSecurityTopAseSPFGetParamsARC = "NONE" - RadarEmailSecurityTopAseSPFGetParamsARCFail RadarEmailSecurityTopAseSPFGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopAseSPFGetParamsDateRange string - -const ( - RadarEmailSecurityTopAseSPFGetParamsDateRange1d RadarEmailSecurityTopAseSPFGetParamsDateRange = "1d" - RadarEmailSecurityTopAseSPFGetParamsDateRange2d RadarEmailSecurityTopAseSPFGetParamsDateRange = "2d" - RadarEmailSecurityTopAseSPFGetParamsDateRange7d RadarEmailSecurityTopAseSPFGetParamsDateRange = "7d" - RadarEmailSecurityTopAseSPFGetParamsDateRange14d RadarEmailSecurityTopAseSPFGetParamsDateRange = "14d" - RadarEmailSecurityTopAseSPFGetParamsDateRange28d RadarEmailSecurityTopAseSPFGetParamsDateRange = "28d" - RadarEmailSecurityTopAseSPFGetParamsDateRange12w RadarEmailSecurityTopAseSPFGetParamsDateRange = "12w" - RadarEmailSecurityTopAseSPFGetParamsDateRange24w RadarEmailSecurityTopAseSPFGetParamsDateRange = "24w" - RadarEmailSecurityTopAseSPFGetParamsDateRange52w RadarEmailSecurityTopAseSPFGetParamsDateRange = "52w" - RadarEmailSecurityTopAseSPFGetParamsDateRange1dControl RadarEmailSecurityTopAseSPFGetParamsDateRange = "1dControl" - RadarEmailSecurityTopAseSPFGetParamsDateRange2dControl RadarEmailSecurityTopAseSPFGetParamsDateRange = "2dControl" - RadarEmailSecurityTopAseSPFGetParamsDateRange7dControl RadarEmailSecurityTopAseSPFGetParamsDateRange = "7dControl" - RadarEmailSecurityTopAseSPFGetParamsDateRange14dControl RadarEmailSecurityTopAseSPFGetParamsDateRange = "14dControl" - RadarEmailSecurityTopAseSPFGetParamsDateRange28dControl RadarEmailSecurityTopAseSPFGetParamsDateRange = "28dControl" - RadarEmailSecurityTopAseSPFGetParamsDateRange12wControl RadarEmailSecurityTopAseSPFGetParamsDateRange = "12wControl" - RadarEmailSecurityTopAseSPFGetParamsDateRange24wControl RadarEmailSecurityTopAseSPFGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopAseSPFGetParamsDKIM string - -const ( - RadarEmailSecurityTopAseSPFGetParamsDKIMPass RadarEmailSecurityTopAseSPFGetParamsDKIM = "PASS" - RadarEmailSecurityTopAseSPFGetParamsDKIMNone RadarEmailSecurityTopAseSPFGetParamsDKIM = "NONE" - RadarEmailSecurityTopAseSPFGetParamsDKIMFail RadarEmailSecurityTopAseSPFGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopAseSPFGetParamsDMARC string - -const ( - RadarEmailSecurityTopAseSPFGetParamsDMARCPass RadarEmailSecurityTopAseSPFGetParamsDMARC = "PASS" - RadarEmailSecurityTopAseSPFGetParamsDMARCNone RadarEmailSecurityTopAseSPFGetParamsDMARC = "NONE" - RadarEmailSecurityTopAseSPFGetParamsDMARCFail RadarEmailSecurityTopAseSPFGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopAseSPFGetParamsFormat string - -const ( - RadarEmailSecurityTopAseSPFGetParamsFormatJson RadarEmailSecurityTopAseSPFGetParamsFormat = "JSON" - RadarEmailSecurityTopAseSPFGetParamsFormatCsv RadarEmailSecurityTopAseSPFGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopAseSPFGetResponseEnvelope struct { - Result RadarEmailSecurityTopAseSPFGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopAseSPFGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopAseSPFGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopAseSPFGetResponseEnvelope] -type radarEmailSecurityTopAseSPFGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopAseSPFGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytopasespf_test.go b/radaremailsecuritytopasespf_test.go deleted file mode 100644 index f5aefbc166f..00000000000 --- a/radaremailsecuritytopasespf_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopAseSPFGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Ases.SPF.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopAseSPFGetParamsSPFPass, - cloudflare.RadarEmailSecurityTopAseSPFGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSPFGetParamsARC{cloudflare.RadarEmailSecurityTopAseSPFGetParamsARCPass, cloudflare.RadarEmailSecurityTopAseSPFGetParamsARCNone, cloudflare.RadarEmailSecurityTopAseSPFGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSPFGetParamsDateRange{cloudflare.RadarEmailSecurityTopAseSPFGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopAseSPFGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopAseSPFGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSPFGetParamsDKIM{cloudflare.RadarEmailSecurityTopAseSPFGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopAseSPFGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopAseSPFGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopAseSPFGetParamsDMARC{cloudflare.RadarEmailSecurityTopAseSPFGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopAseSPFGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopAseSPFGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopAseSPFGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytoplocation.go b/radaremailsecuritytoplocation.go index 318262ee0d5..b79e9689054 100644 --- a/radaremailsecuritytoplocation.go +++ b/radaremailsecuritytoplocation.go @@ -3,15 +3,6 @@ package cloudflare import ( - "context" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -44,270 +35,3 @@ func NewRadarEmailSecurityTopLocationService(opts ...option.RequestOption) (r *R r.SPF = NewRadarEmailSecurityTopLocationSPFService(opts...) return } - -// Get the top locations by email messages. Values are a percentage out of the -// total emails. -func (r *RadarEmailSecurityTopLocationService) Get(ctx context.Context, query RadarEmailSecurityTopLocationGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopLocationGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopLocationGetResponseEnvelope - path := "radar/email/security/top/locations" - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopLocationGetResponse struct { - Meta RadarEmailSecurityTopLocationGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopLocationGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopLocationGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopLocationGetResponseJSON contains the JSON metadata for the -// struct [RadarEmailSecurityTopLocationGetResponse] -type radarEmailSecurityTopLocationGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationGetResponseMeta struct { - DateRange []RadarEmailSecurityTopLocationGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopLocationGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopLocationGetResponseMetaJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopLocationGetResponseMeta] -type radarEmailSecurityTopLocationGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopLocationGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationGetResponseMetaDateRange] -type radarEmailSecurityTopLocationGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopLocationGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopLocationGetResponseMetaConfidenceInfoJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopLocationGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopLocationGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopLocationGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopLocationGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationGetResponseTop0 struct { - ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"` - ClientCountryName string `json:"clientCountryName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopLocationGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopLocationGetResponseTop0JSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopLocationGetResponseTop0] -type radarEmailSecurityTopLocationGetResponseTop0JSON struct { - ClientCountryAlpha2 apijson.Field - ClientCountryName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopLocationGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopLocationGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopLocationGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopLocationGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopLocationGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopLocationGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopLocationGetParams]'s query parameters -// as `url.Values`. -func (r RadarEmailSecurityTopLocationGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -type RadarEmailSecurityTopLocationGetParamsARC string - -const ( - RadarEmailSecurityTopLocationGetParamsARCPass RadarEmailSecurityTopLocationGetParamsARC = "PASS" - RadarEmailSecurityTopLocationGetParamsARCNone RadarEmailSecurityTopLocationGetParamsARC = "NONE" - RadarEmailSecurityTopLocationGetParamsARCFail RadarEmailSecurityTopLocationGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopLocationGetParamsDateRange string - -const ( - RadarEmailSecurityTopLocationGetParamsDateRange1d RadarEmailSecurityTopLocationGetParamsDateRange = "1d" - RadarEmailSecurityTopLocationGetParamsDateRange2d RadarEmailSecurityTopLocationGetParamsDateRange = "2d" - RadarEmailSecurityTopLocationGetParamsDateRange7d RadarEmailSecurityTopLocationGetParamsDateRange = "7d" - RadarEmailSecurityTopLocationGetParamsDateRange14d RadarEmailSecurityTopLocationGetParamsDateRange = "14d" - RadarEmailSecurityTopLocationGetParamsDateRange28d RadarEmailSecurityTopLocationGetParamsDateRange = "28d" - RadarEmailSecurityTopLocationGetParamsDateRange12w RadarEmailSecurityTopLocationGetParamsDateRange = "12w" - RadarEmailSecurityTopLocationGetParamsDateRange24w RadarEmailSecurityTopLocationGetParamsDateRange = "24w" - RadarEmailSecurityTopLocationGetParamsDateRange52w RadarEmailSecurityTopLocationGetParamsDateRange = "52w" - RadarEmailSecurityTopLocationGetParamsDateRange1dControl RadarEmailSecurityTopLocationGetParamsDateRange = "1dControl" - RadarEmailSecurityTopLocationGetParamsDateRange2dControl RadarEmailSecurityTopLocationGetParamsDateRange = "2dControl" - RadarEmailSecurityTopLocationGetParamsDateRange7dControl RadarEmailSecurityTopLocationGetParamsDateRange = "7dControl" - RadarEmailSecurityTopLocationGetParamsDateRange14dControl RadarEmailSecurityTopLocationGetParamsDateRange = "14dControl" - RadarEmailSecurityTopLocationGetParamsDateRange28dControl RadarEmailSecurityTopLocationGetParamsDateRange = "28dControl" - RadarEmailSecurityTopLocationGetParamsDateRange12wControl RadarEmailSecurityTopLocationGetParamsDateRange = "12wControl" - RadarEmailSecurityTopLocationGetParamsDateRange24wControl RadarEmailSecurityTopLocationGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopLocationGetParamsDKIM string - -const ( - RadarEmailSecurityTopLocationGetParamsDKIMPass RadarEmailSecurityTopLocationGetParamsDKIM = "PASS" - RadarEmailSecurityTopLocationGetParamsDKIMNone RadarEmailSecurityTopLocationGetParamsDKIM = "NONE" - RadarEmailSecurityTopLocationGetParamsDKIMFail RadarEmailSecurityTopLocationGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopLocationGetParamsDMARC string - -const ( - RadarEmailSecurityTopLocationGetParamsDMARCPass RadarEmailSecurityTopLocationGetParamsDMARC = "PASS" - RadarEmailSecurityTopLocationGetParamsDMARCNone RadarEmailSecurityTopLocationGetParamsDMARC = "NONE" - RadarEmailSecurityTopLocationGetParamsDMARCFail RadarEmailSecurityTopLocationGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopLocationGetParamsFormat string - -const ( - RadarEmailSecurityTopLocationGetParamsFormatJson RadarEmailSecurityTopLocationGetParamsFormat = "JSON" - RadarEmailSecurityTopLocationGetParamsFormatCsv RadarEmailSecurityTopLocationGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopLocationGetParamsSPF string - -const ( - RadarEmailSecurityTopLocationGetParamsSPFPass RadarEmailSecurityTopLocationGetParamsSPF = "PASS" - RadarEmailSecurityTopLocationGetParamsSPFNone RadarEmailSecurityTopLocationGetParamsSPF = "NONE" - RadarEmailSecurityTopLocationGetParamsSPFFail RadarEmailSecurityTopLocationGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopLocationGetResponseEnvelope struct { - Result RadarEmailSecurityTopLocationGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopLocationGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationGetResponseEnvelopeJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationGetResponseEnvelope] -type radarEmailSecurityTopLocationGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytoplocation_test.go b/radaremailsecuritytoplocation_test.go deleted file mode 100644 index 36d067b9f66..00000000000 --- a/radaremailsecuritytoplocation_test.go +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopLocationGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Locations.Get(context.TODO(), cloudflare.RadarEmailSecurityTopLocationGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationGetParamsARC{cloudflare.RadarEmailSecurityTopLocationGetParamsARCPass, cloudflare.RadarEmailSecurityTopLocationGetParamsARCNone, cloudflare.RadarEmailSecurityTopLocationGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationGetParamsDateRange{cloudflare.RadarEmailSecurityTopLocationGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopLocationGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopLocationGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationGetParamsDKIM{cloudflare.RadarEmailSecurityTopLocationGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopLocationGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopLocationGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationGetParamsDMARC{cloudflare.RadarEmailSecurityTopLocationGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopLocationGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopLocationGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopLocationGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationGetParamsSPF{cloudflare.RadarEmailSecurityTopLocationGetParamsSPFPass, cloudflare.RadarEmailSecurityTopLocationGetParamsSPFNone, cloudflare.RadarEmailSecurityTopLocationGetParamsSPFFail}), - }) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytoplocationarc.go b/radaremailsecuritytoplocationarc.go index 4ed7d949517..30fb76bd179 100644 --- a/radaremailsecuritytoplocationarc.go +++ b/radaremailsecuritytoplocationarc.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,269 +23,3 @@ func NewRadarEmailSecurityTopLocationARCService(opts ...option.RequestOption) (r r.Options = opts return } - -// Get the locations, by emails ARC validation. -func (r *RadarEmailSecurityTopLocationARCService) Get(ctx context.Context, arc RadarEmailSecurityTopLocationARCGetParamsARC, query RadarEmailSecurityTopLocationARCGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopLocationARCGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopLocationARCGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/locations/arc/%v", arc) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopLocationARCGetResponse struct { - Meta RadarEmailSecurityTopLocationARCGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopLocationARCGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopLocationARCGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopLocationARCGetResponseJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopLocationARCGetResponse] -type radarEmailSecurityTopLocationARCGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationARCGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationARCGetResponseMeta struct { - DateRange []RadarEmailSecurityTopLocationARCGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopLocationARCGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopLocationARCGetResponseMetaJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationARCGetResponseMeta] -type radarEmailSecurityTopLocationARCGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationARCGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationARCGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopLocationARCGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationARCGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopLocationARCGetResponseMetaDateRange] -type radarEmailSecurityTopLocationARCGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationARCGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationARCGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationARCGetResponseTop0 struct { - ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"` - ClientCountryName string `json:"clientCountryName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopLocationARCGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopLocationARCGetResponseTop0JSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationARCGetResponseTop0] -type radarEmailSecurityTopLocationARCGetResponseTop0JSON struct { - ClientCountryAlpha2 apijson.Field - ClientCountryName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationARCGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationARCGetParams 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopLocationARCGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopLocationARCGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopLocationARCGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopLocationARCGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopLocationARCGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopLocationARCGetParams]'s query -// parameters as `url.Values`. -func (r RadarEmailSecurityTopLocationARCGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// ARC. -type RadarEmailSecurityTopLocationARCGetParamsARC string - -const ( - RadarEmailSecurityTopLocationARCGetParamsARCPass RadarEmailSecurityTopLocationARCGetParamsARC = "PASS" - RadarEmailSecurityTopLocationARCGetParamsARCNone RadarEmailSecurityTopLocationARCGetParamsARC = "NONE" - RadarEmailSecurityTopLocationARCGetParamsARCFail RadarEmailSecurityTopLocationARCGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopLocationARCGetParamsDateRange string - -const ( - RadarEmailSecurityTopLocationARCGetParamsDateRange1d RadarEmailSecurityTopLocationARCGetParamsDateRange = "1d" - RadarEmailSecurityTopLocationARCGetParamsDateRange2d RadarEmailSecurityTopLocationARCGetParamsDateRange = "2d" - RadarEmailSecurityTopLocationARCGetParamsDateRange7d RadarEmailSecurityTopLocationARCGetParamsDateRange = "7d" - RadarEmailSecurityTopLocationARCGetParamsDateRange14d RadarEmailSecurityTopLocationARCGetParamsDateRange = "14d" - RadarEmailSecurityTopLocationARCGetParamsDateRange28d RadarEmailSecurityTopLocationARCGetParamsDateRange = "28d" - RadarEmailSecurityTopLocationARCGetParamsDateRange12w RadarEmailSecurityTopLocationARCGetParamsDateRange = "12w" - RadarEmailSecurityTopLocationARCGetParamsDateRange24w RadarEmailSecurityTopLocationARCGetParamsDateRange = "24w" - RadarEmailSecurityTopLocationARCGetParamsDateRange52w RadarEmailSecurityTopLocationARCGetParamsDateRange = "52w" - RadarEmailSecurityTopLocationARCGetParamsDateRange1dControl RadarEmailSecurityTopLocationARCGetParamsDateRange = "1dControl" - RadarEmailSecurityTopLocationARCGetParamsDateRange2dControl RadarEmailSecurityTopLocationARCGetParamsDateRange = "2dControl" - RadarEmailSecurityTopLocationARCGetParamsDateRange7dControl RadarEmailSecurityTopLocationARCGetParamsDateRange = "7dControl" - RadarEmailSecurityTopLocationARCGetParamsDateRange14dControl RadarEmailSecurityTopLocationARCGetParamsDateRange = "14dControl" - RadarEmailSecurityTopLocationARCGetParamsDateRange28dControl RadarEmailSecurityTopLocationARCGetParamsDateRange = "28dControl" - RadarEmailSecurityTopLocationARCGetParamsDateRange12wControl RadarEmailSecurityTopLocationARCGetParamsDateRange = "12wControl" - RadarEmailSecurityTopLocationARCGetParamsDateRange24wControl RadarEmailSecurityTopLocationARCGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopLocationARCGetParamsDKIM string - -const ( - RadarEmailSecurityTopLocationARCGetParamsDKIMPass RadarEmailSecurityTopLocationARCGetParamsDKIM = "PASS" - RadarEmailSecurityTopLocationARCGetParamsDKIMNone RadarEmailSecurityTopLocationARCGetParamsDKIM = "NONE" - RadarEmailSecurityTopLocationARCGetParamsDKIMFail RadarEmailSecurityTopLocationARCGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopLocationARCGetParamsDMARC string - -const ( - RadarEmailSecurityTopLocationARCGetParamsDMARCPass RadarEmailSecurityTopLocationARCGetParamsDMARC = "PASS" - RadarEmailSecurityTopLocationARCGetParamsDMARCNone RadarEmailSecurityTopLocationARCGetParamsDMARC = "NONE" - RadarEmailSecurityTopLocationARCGetParamsDMARCFail RadarEmailSecurityTopLocationARCGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopLocationARCGetParamsFormat string - -const ( - RadarEmailSecurityTopLocationARCGetParamsFormatJson RadarEmailSecurityTopLocationARCGetParamsFormat = "JSON" - RadarEmailSecurityTopLocationARCGetParamsFormatCsv RadarEmailSecurityTopLocationARCGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopLocationARCGetParamsSPF string - -const ( - RadarEmailSecurityTopLocationARCGetParamsSPFPass RadarEmailSecurityTopLocationARCGetParamsSPF = "PASS" - RadarEmailSecurityTopLocationARCGetParamsSPFNone RadarEmailSecurityTopLocationARCGetParamsSPF = "NONE" - RadarEmailSecurityTopLocationARCGetParamsSPFFail RadarEmailSecurityTopLocationARCGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopLocationARCGetResponseEnvelope struct { - Result RadarEmailSecurityTopLocationARCGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopLocationARCGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationARCGetResponseEnvelopeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationARCGetResponseEnvelope] -type radarEmailSecurityTopLocationARCGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationARCGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytoplocationarc_test.go b/radaremailsecuritytoplocationarc_test.go deleted file mode 100644 index 7c47cbb33b8..00000000000 --- a/radaremailsecuritytoplocationarc_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopLocationARCGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Locations.ARC.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopLocationARCGetParamsARCPass, - cloudflare.RadarEmailSecurityTopLocationARCGetParams{ - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationARCGetParamsDateRange{cloudflare.RadarEmailSecurityTopLocationARCGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopLocationARCGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopLocationARCGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationARCGetParamsDKIM{cloudflare.RadarEmailSecurityTopLocationARCGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopLocationARCGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopLocationARCGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationARCGetParamsDMARC{cloudflare.RadarEmailSecurityTopLocationARCGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopLocationARCGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopLocationARCGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopLocationARCGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationARCGetParamsSPF{cloudflare.RadarEmailSecurityTopLocationARCGetParamsSPFPass, cloudflare.RadarEmailSecurityTopLocationARCGetParamsSPFNone, cloudflare.RadarEmailSecurityTopLocationARCGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytoplocationdkim.go b/radaremailsecuritytoplocationdkim.go index c35fcbaa309..aeaabd76c45 100644 --- a/radaremailsecuritytoplocationdkim.go +++ b/radaremailsecuritytoplocationdkim.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,269 +23,3 @@ func NewRadarEmailSecurityTopLocationDKIMService(opts ...option.RequestOption) ( r.Options = opts return } - -// Get the locations, by email DKIM validation. -func (r *RadarEmailSecurityTopLocationDKIMService) Get(ctx context.Context, dkim RadarEmailSecurityTopLocationDKIMGetParamsDKIM, query RadarEmailSecurityTopLocationDKIMGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopLocationDKIMGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopLocationDKIMGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/locations/dkim/%v", dkim) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopLocationDKIMGetResponse struct { - Meta RadarEmailSecurityTopLocationDKIMGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopLocationDKIMGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopLocationDKIMGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDKIMGetResponseJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopLocationDKIMGetResponse] -type radarEmailSecurityTopLocationDKIMGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDKIMGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDKIMGetResponseMeta struct { - DateRange []RadarEmailSecurityTopLocationDKIMGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopLocationDKIMGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDKIMGetResponseMetaJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationDKIMGetResponseMeta] -type radarEmailSecurityTopLocationDKIMGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDKIMGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDKIMGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopLocationDKIMGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDKIMGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopLocationDKIMGetResponseMetaDateRange] -type radarEmailSecurityTopLocationDKIMGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDKIMGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDKIMGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDKIMGetResponseTop0 struct { - ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"` - ClientCountryName string `json:"clientCountryName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopLocationDKIMGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopLocationDKIMGetResponseTop0JSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationDKIMGetResponseTop0] -type radarEmailSecurityTopLocationDKIMGetResponseTop0JSON struct { - ClientCountryAlpha2 apijson.Field - ClientCountryName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDKIMGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDKIMGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopLocationDKIMGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopLocationDKIMGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopLocationDKIMGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopLocationDKIMGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopLocationDKIMGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopLocationDKIMGetParams]'s query -// parameters as `url.Values`. -func (r RadarEmailSecurityTopLocationDKIMGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// DKIM. -type RadarEmailSecurityTopLocationDKIMGetParamsDKIM string - -const ( - RadarEmailSecurityTopLocationDKIMGetParamsDKIMPass RadarEmailSecurityTopLocationDKIMGetParamsDKIM = "PASS" - RadarEmailSecurityTopLocationDKIMGetParamsDKIMNone RadarEmailSecurityTopLocationDKIMGetParamsDKIM = "NONE" - RadarEmailSecurityTopLocationDKIMGetParamsDKIMFail RadarEmailSecurityTopLocationDKIMGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopLocationDKIMGetParamsARC string - -const ( - RadarEmailSecurityTopLocationDKIMGetParamsARCPass RadarEmailSecurityTopLocationDKIMGetParamsARC = "PASS" - RadarEmailSecurityTopLocationDKIMGetParamsARCNone RadarEmailSecurityTopLocationDKIMGetParamsARC = "NONE" - RadarEmailSecurityTopLocationDKIMGetParamsARCFail RadarEmailSecurityTopLocationDKIMGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopLocationDKIMGetParamsDateRange string - -const ( - RadarEmailSecurityTopLocationDKIMGetParamsDateRange1d RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "1d" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange2d RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "2d" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange7d RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "7d" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange14d RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "14d" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange28d RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "28d" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange12w RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "12w" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange24w RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "24w" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange52w RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "52w" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange1dControl RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "1dControl" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange2dControl RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "2dControl" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange7dControl RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "7dControl" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange14dControl RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "14dControl" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange28dControl RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "28dControl" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange12wControl RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "12wControl" - RadarEmailSecurityTopLocationDKIMGetParamsDateRange24wControl RadarEmailSecurityTopLocationDKIMGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopLocationDKIMGetParamsDMARC string - -const ( - RadarEmailSecurityTopLocationDKIMGetParamsDMARCPass RadarEmailSecurityTopLocationDKIMGetParamsDMARC = "PASS" - RadarEmailSecurityTopLocationDKIMGetParamsDMARCNone RadarEmailSecurityTopLocationDKIMGetParamsDMARC = "NONE" - RadarEmailSecurityTopLocationDKIMGetParamsDMARCFail RadarEmailSecurityTopLocationDKIMGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopLocationDKIMGetParamsFormat string - -const ( - RadarEmailSecurityTopLocationDKIMGetParamsFormatJson RadarEmailSecurityTopLocationDKIMGetParamsFormat = "JSON" - RadarEmailSecurityTopLocationDKIMGetParamsFormatCsv RadarEmailSecurityTopLocationDKIMGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopLocationDKIMGetParamsSPF string - -const ( - RadarEmailSecurityTopLocationDKIMGetParamsSPFPass RadarEmailSecurityTopLocationDKIMGetParamsSPF = "PASS" - RadarEmailSecurityTopLocationDKIMGetParamsSPFNone RadarEmailSecurityTopLocationDKIMGetParamsSPF = "NONE" - RadarEmailSecurityTopLocationDKIMGetParamsSPFFail RadarEmailSecurityTopLocationDKIMGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopLocationDKIMGetResponseEnvelope struct { - Result RadarEmailSecurityTopLocationDKIMGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopLocationDKIMGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDKIMGetResponseEnvelopeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationDKIMGetResponseEnvelope] -type radarEmailSecurityTopLocationDKIMGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDKIMGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytoplocationdkim_test.go b/radaremailsecuritytoplocationdkim_test.go deleted file mode 100644 index 01919cb84b3..00000000000 --- a/radaremailsecuritytoplocationdkim_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopLocationDKIMGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Locations.DKIM.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDKIMPass, - cloudflare.RadarEmailSecurityTopLocationDKIMGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsARC{cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsARCPass, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsARCNone, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDateRange{cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDMARC{cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsSPF{cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsSPFPass, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsSPFNone, cloudflare.RadarEmailSecurityTopLocationDKIMGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytoplocationdmarc.go b/radaremailsecuritytoplocationdmarc.go index 455ca552656..844887654c1 100644 --- a/radaremailsecuritytoplocationdmarc.go +++ b/radaremailsecuritytoplocationdmarc.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -34,269 +24,3 @@ func NewRadarEmailSecurityTopLocationDMARCService(opts ...option.RequestOption) r.Options = opts return } - -// Get the locations by email DMARC validation. -func (r *RadarEmailSecurityTopLocationDMARCService) Get(ctx context.Context, dmarc RadarEmailSecurityTopLocationDMARCGetParamsDMARC, query RadarEmailSecurityTopLocationDMARCGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopLocationDMARCGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopLocationDMARCGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/locations/dmarc/%v", dmarc) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopLocationDMARCGetResponse struct { - Meta RadarEmailSecurityTopLocationDMARCGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopLocationDMARCGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopLocationDMARCGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDMARCGetResponseJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopLocationDMARCGetResponse] -type radarEmailSecurityTopLocationDMARCGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDMARCGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDMARCGetResponseMeta struct { - DateRange []RadarEmailSecurityTopLocationDMARCGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopLocationDMARCGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDMARCGetResponseMetaJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationDMARCGetResponseMeta] -type radarEmailSecurityTopLocationDMARCGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDMARCGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDMARCGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopLocationDMARCGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDMARCGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopLocationDMARCGetResponseMetaDateRange] -type radarEmailSecurityTopLocationDMARCGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDMARCGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDMARCGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDMARCGetResponseTop0 struct { - ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"` - ClientCountryName string `json:"clientCountryName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopLocationDMARCGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopLocationDMARCGetResponseTop0JSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationDMARCGetResponseTop0] -type radarEmailSecurityTopLocationDMARCGetResponseTop0JSON struct { - ClientCountryAlpha2 apijson.Field - ClientCountryName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDMARCGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationDMARCGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopLocationDMARCGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopLocationDMARCGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopLocationDMARCGetParamsDKIM] `query:"dkim"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopLocationDMARCGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopLocationDMARCGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopLocationDMARCGetParams]'s query -// parameters as `url.Values`. -func (r RadarEmailSecurityTopLocationDMARCGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// DMARC. -type RadarEmailSecurityTopLocationDMARCGetParamsDMARC string - -const ( - RadarEmailSecurityTopLocationDMARCGetParamsDMARCPass RadarEmailSecurityTopLocationDMARCGetParamsDMARC = "PASS" - RadarEmailSecurityTopLocationDMARCGetParamsDMARCNone RadarEmailSecurityTopLocationDMARCGetParamsDMARC = "NONE" - RadarEmailSecurityTopLocationDMARCGetParamsDMARCFail RadarEmailSecurityTopLocationDMARCGetParamsDMARC = "FAIL" -) - -type RadarEmailSecurityTopLocationDMARCGetParamsARC string - -const ( - RadarEmailSecurityTopLocationDMARCGetParamsARCPass RadarEmailSecurityTopLocationDMARCGetParamsARC = "PASS" - RadarEmailSecurityTopLocationDMARCGetParamsARCNone RadarEmailSecurityTopLocationDMARCGetParamsARC = "NONE" - RadarEmailSecurityTopLocationDMARCGetParamsARCFail RadarEmailSecurityTopLocationDMARCGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopLocationDMARCGetParamsDateRange string - -const ( - RadarEmailSecurityTopLocationDMARCGetParamsDateRange1d RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "1d" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange2d RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "2d" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange7d RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "7d" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange14d RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "14d" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange28d RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "28d" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange12w RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "12w" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange24w RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "24w" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange52w RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "52w" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange1dControl RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "1dControl" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange2dControl RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "2dControl" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange7dControl RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "7dControl" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange14dControl RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "14dControl" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange28dControl RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "28dControl" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange12wControl RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "12wControl" - RadarEmailSecurityTopLocationDMARCGetParamsDateRange24wControl RadarEmailSecurityTopLocationDMARCGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopLocationDMARCGetParamsDKIM string - -const ( - RadarEmailSecurityTopLocationDMARCGetParamsDKIMPass RadarEmailSecurityTopLocationDMARCGetParamsDKIM = "PASS" - RadarEmailSecurityTopLocationDMARCGetParamsDKIMNone RadarEmailSecurityTopLocationDMARCGetParamsDKIM = "NONE" - RadarEmailSecurityTopLocationDMARCGetParamsDKIMFail RadarEmailSecurityTopLocationDMARCGetParamsDKIM = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopLocationDMARCGetParamsFormat string - -const ( - RadarEmailSecurityTopLocationDMARCGetParamsFormatJson RadarEmailSecurityTopLocationDMARCGetParamsFormat = "JSON" - RadarEmailSecurityTopLocationDMARCGetParamsFormatCsv RadarEmailSecurityTopLocationDMARCGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopLocationDMARCGetParamsSPF string - -const ( - RadarEmailSecurityTopLocationDMARCGetParamsSPFPass RadarEmailSecurityTopLocationDMARCGetParamsSPF = "PASS" - RadarEmailSecurityTopLocationDMARCGetParamsSPFNone RadarEmailSecurityTopLocationDMARCGetParamsSPF = "NONE" - RadarEmailSecurityTopLocationDMARCGetParamsSPFFail RadarEmailSecurityTopLocationDMARCGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopLocationDMARCGetResponseEnvelope struct { - Result RadarEmailSecurityTopLocationDMARCGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopLocationDMARCGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationDMARCGetResponseEnvelopeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationDMARCGetResponseEnvelope] -type radarEmailSecurityTopLocationDMARCGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationDMARCGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytoplocationdmarc_test.go b/radaremailsecuritytoplocationdmarc_test.go deleted file mode 100644 index cc3ba24c008..00000000000 --- a/radaremailsecuritytoplocationdmarc_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopLocationDMARCGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Locations.DMARC.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDMARCPass, - cloudflare.RadarEmailSecurityTopLocationDMARCGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsARC{cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsARCPass, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsARCNone, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDateRange{cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDKIM{cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsDKIMFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsSPF{cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsSPFPass, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsSPFNone, cloudflare.RadarEmailSecurityTopLocationDMARCGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytoplocationmalicious.go b/radaremailsecuritytoplocationmalicious.go index 05b5e2dd57e..d8af936bfb5 100644 --- a/radaremailsecuritytoplocationmalicious.go +++ b/radaremailsecuritytoplocationmalicious.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -34,279 +24,3 @@ func NewRadarEmailSecurityTopLocationMaliciousService(opts ...option.RequestOpti r.Options = opts return } - -// Get the locations by emails classified as malicious or not. -func (r *RadarEmailSecurityTopLocationMaliciousService) Get(ctx context.Context, malicious RadarEmailSecurityTopLocationMaliciousGetParamsMalicious, query RadarEmailSecurityTopLocationMaliciousGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopLocationMaliciousGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopLocationMaliciousGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/locations/malicious/%v", malicious) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopLocationMaliciousGetResponse struct { - Meta RadarEmailSecurityTopLocationMaliciousGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopLocationMaliciousGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopLocationMaliciousGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopLocationMaliciousGetResponseJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationMaliciousGetResponse] -type radarEmailSecurityTopLocationMaliciousGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationMaliciousGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationMaliciousGetResponseMeta struct { - DateRange []RadarEmailSecurityTopLocationMaliciousGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopLocationMaliciousGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopLocationMaliciousGetResponseMetaJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationMaliciousGetResponseMeta] -type radarEmailSecurityTopLocationMaliciousGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationMaliciousGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationMaliciousGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopLocationMaliciousGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationMaliciousGetResponseMetaDateRangeJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopLocationMaliciousGetResponseMetaDateRange] -type radarEmailSecurityTopLocationMaliciousGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationMaliciousGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoJSON contains -// the JSON metadata for the struct -// [RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationMaliciousGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationMaliciousGetResponseTop0 struct { - ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"` - ClientCountryName string `json:"clientCountryName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopLocationMaliciousGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopLocationMaliciousGetResponseTop0JSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationMaliciousGetResponseTop0] -type radarEmailSecurityTopLocationMaliciousGetResponseTop0JSON struct { - ClientCountryAlpha2 apijson.Field - ClientCountryName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationMaliciousGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationMaliciousGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopLocationMaliciousGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopLocationMaliciousGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopLocationMaliciousGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopLocationMaliciousGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopLocationMaliciousGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopLocationMaliciousGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopLocationMaliciousGetParams]'s query -// parameters as `url.Values`. -func (r RadarEmailSecurityTopLocationMaliciousGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Malicious. -type RadarEmailSecurityTopLocationMaliciousGetParamsMalicious string - -const ( - RadarEmailSecurityTopLocationMaliciousGetParamsMaliciousMalicious RadarEmailSecurityTopLocationMaliciousGetParamsMalicious = "MALICIOUS" - RadarEmailSecurityTopLocationMaliciousGetParamsMaliciousNotMalicious RadarEmailSecurityTopLocationMaliciousGetParamsMalicious = "NOT_MALICIOUS" -) - -type RadarEmailSecurityTopLocationMaliciousGetParamsARC string - -const ( - RadarEmailSecurityTopLocationMaliciousGetParamsARCPass RadarEmailSecurityTopLocationMaliciousGetParamsARC = "PASS" - RadarEmailSecurityTopLocationMaliciousGetParamsARCNone RadarEmailSecurityTopLocationMaliciousGetParamsARC = "NONE" - RadarEmailSecurityTopLocationMaliciousGetParamsARCFail RadarEmailSecurityTopLocationMaliciousGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopLocationMaliciousGetParamsDateRange string - -const ( - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange1d RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "1d" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange2d RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "2d" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange7d RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "7d" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange14d RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "14d" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange28d RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "28d" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange12w RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "12w" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange24w RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "24w" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange52w RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "52w" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange1dControl RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "1dControl" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange2dControl RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "2dControl" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange7dControl RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "7dControl" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange14dControl RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "14dControl" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange28dControl RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "28dControl" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange12wControl RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "12wControl" - RadarEmailSecurityTopLocationMaliciousGetParamsDateRange24wControl RadarEmailSecurityTopLocationMaliciousGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopLocationMaliciousGetParamsDKIM string - -const ( - RadarEmailSecurityTopLocationMaliciousGetParamsDKIMPass RadarEmailSecurityTopLocationMaliciousGetParamsDKIM = "PASS" - RadarEmailSecurityTopLocationMaliciousGetParamsDKIMNone RadarEmailSecurityTopLocationMaliciousGetParamsDKIM = "NONE" - RadarEmailSecurityTopLocationMaliciousGetParamsDKIMFail RadarEmailSecurityTopLocationMaliciousGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopLocationMaliciousGetParamsDMARC string - -const ( - RadarEmailSecurityTopLocationMaliciousGetParamsDMARCPass RadarEmailSecurityTopLocationMaliciousGetParamsDMARC = "PASS" - RadarEmailSecurityTopLocationMaliciousGetParamsDMARCNone RadarEmailSecurityTopLocationMaliciousGetParamsDMARC = "NONE" - RadarEmailSecurityTopLocationMaliciousGetParamsDMARCFail RadarEmailSecurityTopLocationMaliciousGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopLocationMaliciousGetParamsFormat string - -const ( - RadarEmailSecurityTopLocationMaliciousGetParamsFormatJson RadarEmailSecurityTopLocationMaliciousGetParamsFormat = "JSON" - RadarEmailSecurityTopLocationMaliciousGetParamsFormatCsv RadarEmailSecurityTopLocationMaliciousGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopLocationMaliciousGetParamsSPF string - -const ( - RadarEmailSecurityTopLocationMaliciousGetParamsSPFPass RadarEmailSecurityTopLocationMaliciousGetParamsSPF = "PASS" - RadarEmailSecurityTopLocationMaliciousGetParamsSPFNone RadarEmailSecurityTopLocationMaliciousGetParamsSPF = "NONE" - RadarEmailSecurityTopLocationMaliciousGetParamsSPFFail RadarEmailSecurityTopLocationMaliciousGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopLocationMaliciousGetResponseEnvelope struct { - Result RadarEmailSecurityTopLocationMaliciousGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopLocationMaliciousGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationMaliciousGetResponseEnvelopeJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopLocationMaliciousGetResponseEnvelope] -type radarEmailSecurityTopLocationMaliciousGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationMaliciousGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytoplocationmalicious_test.go b/radaremailsecuritytoplocationmalicious_test.go deleted file mode 100644 index 83cdf5ab0b2..00000000000 --- a/radaremailsecuritytoplocationmalicious_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopLocationMaliciousGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Locations.Malicious.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsMaliciousMalicious, - cloudflare.RadarEmailSecurityTopLocationMaliciousGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsARC{cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsARCPass, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsARCNone, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDateRange{cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDKIM{cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDMARC{cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsSPF{cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsSPFPass, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsSPFNone, cloudflare.RadarEmailSecurityTopLocationMaliciousGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytoplocationspam.go b/radaremailsecuritytoplocationspam.go index ca283264662..fbe6d171c26 100644 --- a/radaremailsecuritytoplocationspam.go +++ b/radaremailsecuritytoplocationspam.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,278 +23,3 @@ func NewRadarEmailSecurityTopLocationSpamService(opts ...option.RequestOption) ( r.Options = opts return } - -// Get the top locations by emails classified as Spam or not. -func (r *RadarEmailSecurityTopLocationSpamService) Get(ctx context.Context, spam RadarEmailSecurityTopLocationSpamGetParamsSpam, query RadarEmailSecurityTopLocationSpamGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopLocationSpamGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopLocationSpamGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/locations/spam/%v", spam) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopLocationSpamGetResponse struct { - Meta RadarEmailSecurityTopLocationSpamGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopLocationSpamGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopLocationSpamGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSpamGetResponseJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopLocationSpamGetResponse] -type radarEmailSecurityTopLocationSpamGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSpamGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSpamGetResponseMeta struct { - DateRange []RadarEmailSecurityTopLocationSpamGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopLocationSpamGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSpamGetResponseMetaJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationSpamGetResponseMeta] -type radarEmailSecurityTopLocationSpamGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSpamGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSpamGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopLocationSpamGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSpamGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopLocationSpamGetResponseMetaDateRange] -type radarEmailSecurityTopLocationSpamGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSpamGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSpamGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSpamGetResponseTop0 struct { - ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"` - ClientCountryName string `json:"clientCountryName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopLocationSpamGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopLocationSpamGetResponseTop0JSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationSpamGetResponseTop0] -type radarEmailSecurityTopLocationSpamGetResponseTop0JSON struct { - ClientCountryAlpha2 apijson.Field - ClientCountryName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSpamGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSpamGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopLocationSpamGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopLocationSpamGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopLocationSpamGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopLocationSpamGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopLocationSpamGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` - // Filter for spf. - SPF param.Field[[]RadarEmailSecurityTopLocationSpamGetParamsSPF] `query:"spf"` -} - -// URLQuery serializes [RadarEmailSecurityTopLocationSpamGetParams]'s query -// parameters as `url.Values`. -func (r RadarEmailSecurityTopLocationSpamGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// Spam. -type RadarEmailSecurityTopLocationSpamGetParamsSpam string - -const ( - RadarEmailSecurityTopLocationSpamGetParamsSpamSpam RadarEmailSecurityTopLocationSpamGetParamsSpam = "SPAM" - RadarEmailSecurityTopLocationSpamGetParamsSpamNotSpam RadarEmailSecurityTopLocationSpamGetParamsSpam = "NOT_SPAM" -) - -type RadarEmailSecurityTopLocationSpamGetParamsARC string - -const ( - RadarEmailSecurityTopLocationSpamGetParamsARCPass RadarEmailSecurityTopLocationSpamGetParamsARC = "PASS" - RadarEmailSecurityTopLocationSpamGetParamsARCNone RadarEmailSecurityTopLocationSpamGetParamsARC = "NONE" - RadarEmailSecurityTopLocationSpamGetParamsARCFail RadarEmailSecurityTopLocationSpamGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopLocationSpamGetParamsDateRange string - -const ( - RadarEmailSecurityTopLocationSpamGetParamsDateRange1d RadarEmailSecurityTopLocationSpamGetParamsDateRange = "1d" - RadarEmailSecurityTopLocationSpamGetParamsDateRange2d RadarEmailSecurityTopLocationSpamGetParamsDateRange = "2d" - RadarEmailSecurityTopLocationSpamGetParamsDateRange7d RadarEmailSecurityTopLocationSpamGetParamsDateRange = "7d" - RadarEmailSecurityTopLocationSpamGetParamsDateRange14d RadarEmailSecurityTopLocationSpamGetParamsDateRange = "14d" - RadarEmailSecurityTopLocationSpamGetParamsDateRange28d RadarEmailSecurityTopLocationSpamGetParamsDateRange = "28d" - RadarEmailSecurityTopLocationSpamGetParamsDateRange12w RadarEmailSecurityTopLocationSpamGetParamsDateRange = "12w" - RadarEmailSecurityTopLocationSpamGetParamsDateRange24w RadarEmailSecurityTopLocationSpamGetParamsDateRange = "24w" - RadarEmailSecurityTopLocationSpamGetParamsDateRange52w RadarEmailSecurityTopLocationSpamGetParamsDateRange = "52w" - RadarEmailSecurityTopLocationSpamGetParamsDateRange1dControl RadarEmailSecurityTopLocationSpamGetParamsDateRange = "1dControl" - RadarEmailSecurityTopLocationSpamGetParamsDateRange2dControl RadarEmailSecurityTopLocationSpamGetParamsDateRange = "2dControl" - RadarEmailSecurityTopLocationSpamGetParamsDateRange7dControl RadarEmailSecurityTopLocationSpamGetParamsDateRange = "7dControl" - RadarEmailSecurityTopLocationSpamGetParamsDateRange14dControl RadarEmailSecurityTopLocationSpamGetParamsDateRange = "14dControl" - RadarEmailSecurityTopLocationSpamGetParamsDateRange28dControl RadarEmailSecurityTopLocationSpamGetParamsDateRange = "28dControl" - RadarEmailSecurityTopLocationSpamGetParamsDateRange12wControl RadarEmailSecurityTopLocationSpamGetParamsDateRange = "12wControl" - RadarEmailSecurityTopLocationSpamGetParamsDateRange24wControl RadarEmailSecurityTopLocationSpamGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopLocationSpamGetParamsDKIM string - -const ( - RadarEmailSecurityTopLocationSpamGetParamsDKIMPass RadarEmailSecurityTopLocationSpamGetParamsDKIM = "PASS" - RadarEmailSecurityTopLocationSpamGetParamsDKIMNone RadarEmailSecurityTopLocationSpamGetParamsDKIM = "NONE" - RadarEmailSecurityTopLocationSpamGetParamsDKIMFail RadarEmailSecurityTopLocationSpamGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopLocationSpamGetParamsDMARC string - -const ( - RadarEmailSecurityTopLocationSpamGetParamsDMARCPass RadarEmailSecurityTopLocationSpamGetParamsDMARC = "PASS" - RadarEmailSecurityTopLocationSpamGetParamsDMARCNone RadarEmailSecurityTopLocationSpamGetParamsDMARC = "NONE" - RadarEmailSecurityTopLocationSpamGetParamsDMARCFail RadarEmailSecurityTopLocationSpamGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopLocationSpamGetParamsFormat string - -const ( - RadarEmailSecurityTopLocationSpamGetParamsFormatJson RadarEmailSecurityTopLocationSpamGetParamsFormat = "JSON" - RadarEmailSecurityTopLocationSpamGetParamsFormatCsv RadarEmailSecurityTopLocationSpamGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopLocationSpamGetParamsSPF string - -const ( - RadarEmailSecurityTopLocationSpamGetParamsSPFPass RadarEmailSecurityTopLocationSpamGetParamsSPF = "PASS" - RadarEmailSecurityTopLocationSpamGetParamsSPFNone RadarEmailSecurityTopLocationSpamGetParamsSPF = "NONE" - RadarEmailSecurityTopLocationSpamGetParamsSPFFail RadarEmailSecurityTopLocationSpamGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopLocationSpamGetResponseEnvelope struct { - Result RadarEmailSecurityTopLocationSpamGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopLocationSpamGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSpamGetResponseEnvelopeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationSpamGetResponseEnvelope] -type radarEmailSecurityTopLocationSpamGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSpamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytoplocationspam_test.go b/radaremailsecuritytoplocationspam_test.go deleted file mode 100644 index 1e0b473e8a8..00000000000 --- a/radaremailsecuritytoplocationspam_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopLocationSpamGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Locations.Spam.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopLocationSpamGetParamsSpamSpam, - cloudflare.RadarEmailSecurityTopLocationSpamGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSpamGetParamsARC{cloudflare.RadarEmailSecurityTopLocationSpamGetParamsARCPass, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsARCNone, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDateRange{cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDKIM{cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDMARC{cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopLocationSpamGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - SPF: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSpamGetParamsSPF{cloudflare.RadarEmailSecurityTopLocationSpamGetParamsSPFPass, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsSPFNone, cloudflare.RadarEmailSecurityTopLocationSpamGetParamsSPFFail}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radaremailsecuritytoplocationspf.go b/radaremailsecuritytoplocationspf.go index 466a5d1636f..f47b8cf19ff 100644 --- a/radaremailsecuritytoplocationspf.go +++ b/radaremailsecuritytoplocationspf.go @@ -3,16 +3,6 @@ package cloudflare import ( - "context" - "fmt" - "net/http" - "net/url" - "time" - - "github.com/cloudflare/cloudflare-sdk-go/internal/apijson" - "github.com/cloudflare/cloudflare-sdk-go/internal/apiquery" - "github.com/cloudflare/cloudflare-sdk-go/internal/param" - "github.com/cloudflare/cloudflare-sdk-go/internal/requestconfig" "github.com/cloudflare/cloudflare-sdk-go/option" ) @@ -33,269 +23,3 @@ func NewRadarEmailSecurityTopLocationSPFService(opts ...option.RequestOption) (r r.Options = opts return } - -// Get the top locations by email SPF validation. -func (r *RadarEmailSecurityTopLocationSPFService) Get(ctx context.Context, spf RadarEmailSecurityTopLocationSPFGetParamsSPF, query RadarEmailSecurityTopLocationSPFGetParams, opts ...option.RequestOption) (res *RadarEmailSecurityTopLocationSPFGetResponse, err error) { - opts = append(r.Options[:], opts...) - var env RadarEmailSecurityTopLocationSPFGetResponseEnvelope - path := fmt.Sprintf("radar/email/security/top/locations/spf/%v", spf) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type RadarEmailSecurityTopLocationSPFGetResponse struct { - Meta RadarEmailSecurityTopLocationSPFGetResponseMeta `json:"meta,required"` - Top0 []RadarEmailSecurityTopLocationSPFGetResponseTop0 `json:"top_0,required"` - JSON radarEmailSecurityTopLocationSPFGetResponseJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSPFGetResponseJSON contains the JSON metadata for -// the struct [RadarEmailSecurityTopLocationSPFGetResponse] -type radarEmailSecurityTopLocationSPFGetResponseJSON struct { - Meta apijson.Field - Top0 apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSPFGetResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSPFGetResponseMeta struct { - DateRange []RadarEmailSecurityTopLocationSPFGetResponseMetaDateRange `json:"dateRange,required"` - LastUpdated string `json:"lastUpdated,required"` - ConfidenceInfo RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfo `json:"confidenceInfo"` - JSON radarEmailSecurityTopLocationSPFGetResponseMetaJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSPFGetResponseMetaJSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationSPFGetResponseMeta] -type radarEmailSecurityTopLocationSPFGetResponseMetaJSON struct { - DateRange apijson.Field - LastUpdated apijson.Field - ConfidenceInfo apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSPFGetResponseMeta) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSPFGetResponseMetaDateRange struct { - // Adjusted end of date range. - EndTime time.Time `json:"endTime,required" format:"date-time"` - // Adjusted start of date range. - StartTime time.Time `json:"startTime,required" format:"date-time"` - JSON radarEmailSecurityTopLocationSPFGetResponseMetaDateRangeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSPFGetResponseMetaDateRangeJSON contains the JSON -// metadata for the struct -// [RadarEmailSecurityTopLocationSPFGetResponseMetaDateRange] -type radarEmailSecurityTopLocationSPFGetResponseMetaDateRangeJSON struct { - EndTime apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSPFGetResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfo struct { - Annotations []RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoAnnotation `json:"annotations"` - Level int64 `json:"level"` - JSON radarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoJSON contains the -// JSON metadata for the struct -// [RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfo] -type radarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoJSON struct { - Annotations apijson.Field - Level apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoAnnotation struct { - DataSource string `json:"dataSource,required"` - Description string `json:"description,required"` - EventType string `json:"eventType,required"` - IsInstantaneous interface{} `json:"isInstantaneous,required"` - EndTime time.Time `json:"endTime" format:"date-time"` - LinkedURL string `json:"linkedUrl"` - StartTime time.Time `json:"startTime" format:"date-time"` - JSON radarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoAnnotationJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoAnnotationJSON -// contains the JSON metadata for the struct -// [RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoAnnotation] -type radarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoAnnotationJSON struct { - DataSource apijson.Field - Description apijson.Field - EventType apijson.Field - IsInstantaneous apijson.Field - EndTime apijson.Field - LinkedURL apijson.Field - StartTime apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSPFGetResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSPFGetResponseTop0 struct { - ClientCountryAlpha2 string `json:"clientCountryAlpha2,required"` - ClientCountryName string `json:"clientCountryName,required"` - Value string `json:"value,required"` - JSON radarEmailSecurityTopLocationSPFGetResponseTop0JSON `json:"-"` -} - -// radarEmailSecurityTopLocationSPFGetResponseTop0JSON contains the JSON metadata -// for the struct [RadarEmailSecurityTopLocationSPFGetResponseTop0] -type radarEmailSecurityTopLocationSPFGetResponseTop0JSON struct { - ClientCountryAlpha2 apijson.Field - ClientCountryName apijson.Field - Value apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSPFGetResponseTop0) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -type RadarEmailSecurityTopLocationSPFGetParams struct { - // Filter for arc (Authenticated Received Chain). - ARC param.Field[[]RadarEmailSecurityTopLocationSPFGetParamsARC] `query:"arc"` - // 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 - // AS3356. - ASN param.Field[[]string] `query:"asn"` - // End of the date range (inclusive). - DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` - // For example, use `7d` and `7dControl` to compare this week with the previous - // week. Use this parameter or set specific start and end dates (`dateStart` and - // `dateEnd` parameters). - DateRange param.Field[[]RadarEmailSecurityTopLocationSPFGetParamsDateRange] `query:"dateRange"` - // Array of datetimes to filter the start of a series. - DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"` - // Filter for dkim. - DKIM param.Field[[]RadarEmailSecurityTopLocationSPFGetParamsDKIM] `query:"dkim"` - // Filter for dmarc. - DMARC param.Field[[]RadarEmailSecurityTopLocationSPFGetParamsDMARC] `query:"dmarc"` - // Format results are returned in. - Format param.Field[RadarEmailSecurityTopLocationSPFGetParamsFormat] `query:"format"` - // Limit the number of objects in the response. - Limit param.Field[int64] `query:"limit"` - // 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. - Location param.Field[[]string] `query:"location"` - // Array of names that will be used to name the series in responses. - Name param.Field[[]string] `query:"name"` -} - -// URLQuery serializes [RadarEmailSecurityTopLocationSPFGetParams]'s query -// parameters as `url.Values`. -func (r RadarEmailSecurityTopLocationSPFGetParams) URLQuery() (v url.Values) { - return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ - ArrayFormat: apiquery.ArrayQueryFormatComma, - NestedFormat: apiquery.NestedQueryFormatBrackets, - }) -} - -// SPF. -type RadarEmailSecurityTopLocationSPFGetParamsSPF string - -const ( - RadarEmailSecurityTopLocationSPFGetParamsSPFPass RadarEmailSecurityTopLocationSPFGetParamsSPF = "PASS" - RadarEmailSecurityTopLocationSPFGetParamsSPFNone RadarEmailSecurityTopLocationSPFGetParamsSPF = "NONE" - RadarEmailSecurityTopLocationSPFGetParamsSPFFail RadarEmailSecurityTopLocationSPFGetParamsSPF = "FAIL" -) - -type RadarEmailSecurityTopLocationSPFGetParamsARC string - -const ( - RadarEmailSecurityTopLocationSPFGetParamsARCPass RadarEmailSecurityTopLocationSPFGetParamsARC = "PASS" - RadarEmailSecurityTopLocationSPFGetParamsARCNone RadarEmailSecurityTopLocationSPFGetParamsARC = "NONE" - RadarEmailSecurityTopLocationSPFGetParamsARCFail RadarEmailSecurityTopLocationSPFGetParamsARC = "FAIL" -) - -type RadarEmailSecurityTopLocationSPFGetParamsDateRange string - -const ( - RadarEmailSecurityTopLocationSPFGetParamsDateRange1d RadarEmailSecurityTopLocationSPFGetParamsDateRange = "1d" - RadarEmailSecurityTopLocationSPFGetParamsDateRange2d RadarEmailSecurityTopLocationSPFGetParamsDateRange = "2d" - RadarEmailSecurityTopLocationSPFGetParamsDateRange7d RadarEmailSecurityTopLocationSPFGetParamsDateRange = "7d" - RadarEmailSecurityTopLocationSPFGetParamsDateRange14d RadarEmailSecurityTopLocationSPFGetParamsDateRange = "14d" - RadarEmailSecurityTopLocationSPFGetParamsDateRange28d RadarEmailSecurityTopLocationSPFGetParamsDateRange = "28d" - RadarEmailSecurityTopLocationSPFGetParamsDateRange12w RadarEmailSecurityTopLocationSPFGetParamsDateRange = "12w" - RadarEmailSecurityTopLocationSPFGetParamsDateRange24w RadarEmailSecurityTopLocationSPFGetParamsDateRange = "24w" - RadarEmailSecurityTopLocationSPFGetParamsDateRange52w RadarEmailSecurityTopLocationSPFGetParamsDateRange = "52w" - RadarEmailSecurityTopLocationSPFGetParamsDateRange1dControl RadarEmailSecurityTopLocationSPFGetParamsDateRange = "1dControl" - RadarEmailSecurityTopLocationSPFGetParamsDateRange2dControl RadarEmailSecurityTopLocationSPFGetParamsDateRange = "2dControl" - RadarEmailSecurityTopLocationSPFGetParamsDateRange7dControl RadarEmailSecurityTopLocationSPFGetParamsDateRange = "7dControl" - RadarEmailSecurityTopLocationSPFGetParamsDateRange14dControl RadarEmailSecurityTopLocationSPFGetParamsDateRange = "14dControl" - RadarEmailSecurityTopLocationSPFGetParamsDateRange28dControl RadarEmailSecurityTopLocationSPFGetParamsDateRange = "28dControl" - RadarEmailSecurityTopLocationSPFGetParamsDateRange12wControl RadarEmailSecurityTopLocationSPFGetParamsDateRange = "12wControl" - RadarEmailSecurityTopLocationSPFGetParamsDateRange24wControl RadarEmailSecurityTopLocationSPFGetParamsDateRange = "24wControl" -) - -type RadarEmailSecurityTopLocationSPFGetParamsDKIM string - -const ( - RadarEmailSecurityTopLocationSPFGetParamsDKIMPass RadarEmailSecurityTopLocationSPFGetParamsDKIM = "PASS" - RadarEmailSecurityTopLocationSPFGetParamsDKIMNone RadarEmailSecurityTopLocationSPFGetParamsDKIM = "NONE" - RadarEmailSecurityTopLocationSPFGetParamsDKIMFail RadarEmailSecurityTopLocationSPFGetParamsDKIM = "FAIL" -) - -type RadarEmailSecurityTopLocationSPFGetParamsDMARC string - -const ( - RadarEmailSecurityTopLocationSPFGetParamsDMARCPass RadarEmailSecurityTopLocationSPFGetParamsDMARC = "PASS" - RadarEmailSecurityTopLocationSPFGetParamsDMARCNone RadarEmailSecurityTopLocationSPFGetParamsDMARC = "NONE" - RadarEmailSecurityTopLocationSPFGetParamsDMARCFail RadarEmailSecurityTopLocationSPFGetParamsDMARC = "FAIL" -) - -// Format results are returned in. -type RadarEmailSecurityTopLocationSPFGetParamsFormat string - -const ( - RadarEmailSecurityTopLocationSPFGetParamsFormatJson RadarEmailSecurityTopLocationSPFGetParamsFormat = "JSON" - RadarEmailSecurityTopLocationSPFGetParamsFormatCsv RadarEmailSecurityTopLocationSPFGetParamsFormat = "CSV" -) - -type RadarEmailSecurityTopLocationSPFGetResponseEnvelope struct { - Result RadarEmailSecurityTopLocationSPFGetResponse `json:"result,required"` - Success bool `json:"success,required"` - JSON radarEmailSecurityTopLocationSPFGetResponseEnvelopeJSON `json:"-"` -} - -// radarEmailSecurityTopLocationSPFGetResponseEnvelopeJSON contains the JSON -// metadata for the struct [RadarEmailSecurityTopLocationSPFGetResponseEnvelope] -type radarEmailSecurityTopLocationSPFGetResponseEnvelopeJSON struct { - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *RadarEmailSecurityTopLocationSPFGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} diff --git a/radaremailsecuritytoplocationspf_test.go b/radaremailsecuritytoplocationspf_test.go deleted file mode 100644 index 9716cc37730..00000000000 --- a/radaremailsecuritytoplocationspf_test.go +++ /dev/null @@ -1,57 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package cloudflare_test - -import ( - "context" - "errors" - "os" - "testing" - "time" - - "github.com/cloudflare/cloudflare-sdk-go" - "github.com/cloudflare/cloudflare-sdk-go/internal/testutil" - "github.com/cloudflare/cloudflare-sdk-go/option" -) - -func TestRadarEmailSecurityTopLocationSPFGetWithOptionalParams(t *testing.T) { - t.Skip("skipped: tests are disabled for the time being") - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), - option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), - ) - _, err := client.Radar.Email.Security.Top.Locations.SPF.Get( - context.TODO(), - cloudflare.RadarEmailSecurityTopLocationSPFGetParamsSPFPass, - cloudflare.RadarEmailSecurityTopLocationSPFGetParams{ - ARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSPFGetParamsARC{cloudflare.RadarEmailSecurityTopLocationSPFGetParamsARCPass, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsARCNone, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsARCFail}), - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DateRange: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDateRange{cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDateRange1d, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDateRange2d, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDateRange7d}), - DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - DKIM: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDKIM{cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDKIMPass, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDKIMNone, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDKIMFail}), - DMARC: cloudflare.F([]cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDMARC{cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDMARCPass, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDMARCNone, cloudflare.RadarEmailSecurityTopLocationSPFGetParamsDMARCFail}), - Format: cloudflare.F(cloudflare.RadarEmailSecurityTopLocationSPFGetParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/radarhttpase.go b/radarhttpase.go index 2f3cdd5f9f6..fcee334d72d 100644 --- a/radarhttpase.go +++ b/radarhttpase.go @@ -199,6 +199,10 @@ type RadarHTTPAseGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPAseGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpase_test.go b/radarhttpase_test.go index 17c91d10a8f..8598a55e5b6 100644 --- a/radarhttpase_test.go +++ b/radarhttpase_test.go @@ -33,6 +33,7 @@ func TestRadarHTTPAseGetWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Ases.Get(context.TODO(), cloudflare.RadarHTTPAseGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsBotClass{cloudflare.RadarHTTPAseGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseGetParamsDateRange{cloudflare.RadarHTTPAseGetParamsDateRange1d, cloudflare.RadarHTTPAseGetParamsDateRange2d, cloudflare.RadarHTTPAseGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpasebotclass.go b/radarhttpasebotclass.go index ae4f922a8ca..2f509ff6958 100644 --- a/radarhttpasebotclass.go +++ b/radarhttpasebotclass.go @@ -186,6 +186,10 @@ type RadarHTTPAseBotClassGetParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpasebotclass_test.go b/radarhttpasebotclass_test.go index 48b00ba0d70..92cbae34705 100644 --- a/radarhttpasebotclass_test.go +++ b/radarhttpasebotclass_test.go @@ -35,6 +35,7 @@ func TestRadarHTTPAseBotClassGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPAseBotClassGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseBotClassGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseBotClassGetParamsDateRange{cloudflare.RadarHTTPAseBotClassGetParamsDateRange1d, cloudflare.RadarHTTPAseBotClassGetParamsDateRange2d, cloudflare.RadarHTTPAseBotClassGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpasedevicetype.go b/radarhttpasedevicetype.go index 5d85ef745eb..34a6ad924c8 100644 --- a/radarhttpasedevicetype.go +++ b/radarhttpasedevicetype.go @@ -187,6 +187,10 @@ type RadarHTTPAseDeviceTypeGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPAseDeviceTypeGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpasedevicetype_test.go b/radarhttpasedevicetype_test.go index 06326457d3a..79c622b2beb 100644 --- a/radarhttpasedevicetype_test.go +++ b/radarhttpasedevicetype_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPAseDeviceTypeGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPAseDeviceTypeGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPAseDeviceTypeGetParamsBotClass{cloudflare.RadarHTTPAseDeviceTypeGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseDeviceTypeGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseDeviceTypeGetParamsDateRange{cloudflare.RadarHTTPAseDeviceTypeGetParamsDateRange1d, cloudflare.RadarHTTPAseDeviceTypeGetParamsDateRange2d, cloudflare.RadarHTTPAseDeviceTypeGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpasehttpmethod.go b/radarhttpasehttpmethod.go index b3bb7c56c1b..7a936af2ba8 100644 --- a/radarhttpasehttpmethod.go +++ b/radarhttpasehttpmethod.go @@ -187,6 +187,10 @@ type RadarHTTPAseHTTPMethodGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPAseHTTPMethodGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpasehttpmethod_test.go b/radarhttpasehttpmethod_test.go index a14e1145efc..e8779ba55a3 100644 --- a/radarhttpasehttpmethod_test.go +++ b/radarhttpasehttpmethod_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPAseHTTPMethodGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPAseHTTPMethodGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPAseHTTPMethodGetParamsBotClass{cloudflare.RadarHTTPAseHTTPMethodGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseHTTPMethodGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseHTTPMethodGetParamsDateRange{cloudflare.RadarHTTPAseHTTPMethodGetParamsDateRange1d, cloudflare.RadarHTTPAseHTTPMethodGetParamsDateRange2d, cloudflare.RadarHTTPAseHTTPMethodGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpasehttpprotocol.go b/radarhttpasehttpprotocol.go index 788d17e2e0f..605900f4dce 100644 --- a/radarhttpasehttpprotocol.go +++ b/radarhttpasehttpprotocol.go @@ -187,6 +187,10 @@ type RadarHTTPAseHTTPProtocolGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPAseHTTPProtocolGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpasehttpprotocol_test.go b/radarhttpasehttpprotocol_test.go index c94c0b15fa0..f100265eca3 100644 --- a/radarhttpasehttpprotocol_test.go +++ b/radarhttpasehttpprotocol_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPAseHTTPProtocolGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPAseHTTPProtocolGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPAseHTTPProtocolGetParamsBotClass{cloudflare.RadarHTTPAseHTTPProtocolGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseHTTPProtocolGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseHTTPProtocolGetParamsDateRange{cloudflare.RadarHTTPAseHTTPProtocolGetParamsDateRange1d, cloudflare.RadarHTTPAseHTTPProtocolGetParamsDateRange2d, cloudflare.RadarHTTPAseHTTPProtocolGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpaseipversion.go b/radarhttpaseipversion.go index 1f207190d6d..97c2b482647 100644 --- a/radarhttpaseipversion.go +++ b/radarhttpaseipversion.go @@ -187,6 +187,10 @@ type RadarHTTPAseIPVersionGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPAseIPVersionGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpaseipversion_test.go b/radarhttpaseipversion_test.go index 8e46ee4ad8a..e5e789c5c73 100644 --- a/radarhttpaseipversion_test.go +++ b/radarhttpaseipversion_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPAseIPVersionGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPAseIPVersionGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPAseIPVersionGetParamsBotClass{cloudflare.RadarHTTPAseIPVersionGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseIPVersionGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseIPVersionGetParamsDateRange{cloudflare.RadarHTTPAseIPVersionGetParamsDateRange1d, cloudflare.RadarHTTPAseIPVersionGetParamsDateRange2d, cloudflare.RadarHTTPAseIPVersionGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpaseos.go b/radarhttpaseos.go index 929df3b163a..19984b0182c 100644 --- a/radarhttpaseos.go +++ b/radarhttpaseos.go @@ -186,6 +186,10 @@ type RadarHTTPAseOSGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPAseOSGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpaseos_test.go b/radarhttpaseos_test.go index 6363f9e355d..de88313215b 100644 --- a/radarhttpaseos_test.go +++ b/radarhttpaseos_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPAseOSGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPAseOSGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPAseOSGetParamsBotClass{cloudflare.RadarHTTPAseOSGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseOSGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseOSGetParamsDateRange{cloudflare.RadarHTTPAseOSGetParamsDateRange1d, cloudflare.RadarHTTPAseOSGetParamsDateRange2d, cloudflare.RadarHTTPAseOSGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpasetlsversion.go b/radarhttpasetlsversion.go index 4c6e775c256..42bba0d3b78 100644 --- a/radarhttpasetlsversion.go +++ b/radarhttpasetlsversion.go @@ -187,6 +187,10 @@ type RadarHTTPAseTLSVersionGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPAseTLSVersionGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpasetlsversion_test.go b/radarhttpasetlsversion_test.go index c19b047fab1..1f08c7aa6c4 100644 --- a/radarhttpasetlsversion_test.go +++ b/radarhttpasetlsversion_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPAseTLSVersionGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPAseTLSVersionGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPAseTLSVersionGetParamsBotClass{cloudflare.RadarHTTPAseTLSVersionGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPAseTLSVersionGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPAseTLSVersionGetParamsDateRange{cloudflare.RadarHTTPAseTLSVersionGetParamsDateRange1d, cloudflare.RadarHTTPAseTLSVersionGetParamsDateRange2d, cloudflare.RadarHTTPAseTLSVersionGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocation.go b/radarhttplocation.go index c5e8bbb982a..2ab0887abf5 100644 --- a/radarhttplocation.go +++ b/radarhttplocation.go @@ -200,6 +200,10 @@ type RadarHTTPLocationGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPLocationGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocation_test.go b/radarhttplocation_test.go index 45c634c54af..fbaa62d1af3 100644 --- a/radarhttplocation_test.go +++ b/radarhttplocation_test.go @@ -33,6 +33,7 @@ func TestRadarHTTPLocationGetWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Locations.Get(context.TODO(), cloudflare.RadarHTTPLocationGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsBotClass{cloudflare.RadarHTTPLocationGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationGetParamsDateRange{cloudflare.RadarHTTPLocationGetParamsDateRange1d, cloudflare.RadarHTTPLocationGetParamsDateRange2d, cloudflare.RadarHTTPLocationGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocationbotclass.go b/radarhttplocationbotclass.go index f6b1446cb66..9438d58513d 100644 --- a/radarhttplocationbotclass.go +++ b/radarhttplocationbotclass.go @@ -186,6 +186,10 @@ type RadarHTTPLocationBotClassGetParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocationbotclass_test.go b/radarhttplocationbotclass_test.go index 8d3871b397b..95ae83a81f7 100644 --- a/radarhttplocationbotclass_test.go +++ b/radarhttplocationbotclass_test.go @@ -35,6 +35,7 @@ func TestRadarHTTPLocationBotClassGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPLocationBotClassGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationBotClassGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationBotClassGetParamsDateRange{cloudflare.RadarHTTPLocationBotClassGetParamsDateRange1d, cloudflare.RadarHTTPLocationBotClassGetParamsDateRange2d, cloudflare.RadarHTTPLocationBotClassGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocationdevicetype.go b/radarhttplocationdevicetype.go index 74fd5d51f3e..91bd176a49b 100644 --- a/radarhttplocationdevicetype.go +++ b/radarhttplocationdevicetype.go @@ -188,6 +188,10 @@ type RadarHTTPLocationDeviceTypeGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPLocationDeviceTypeGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocationdevicetype_test.go b/radarhttplocationdevicetype_test.go index 315fa0bb239..f99f1fceeca 100644 --- a/radarhttplocationdevicetype_test.go +++ b/radarhttplocationdevicetype_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPLocationDeviceTypeGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPLocationDeviceTypeGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPLocationDeviceTypeGetParamsBotClass{cloudflare.RadarHTTPLocationDeviceTypeGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationDeviceTypeGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationDeviceTypeGetParamsDateRange{cloudflare.RadarHTTPLocationDeviceTypeGetParamsDateRange1d, cloudflare.RadarHTTPLocationDeviceTypeGetParamsDateRange2d, cloudflare.RadarHTTPLocationDeviceTypeGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocationhttpmethod.go b/radarhttplocationhttpmethod.go index c90da2e1a98..9727baca4c2 100644 --- a/radarhttplocationhttpmethod.go +++ b/radarhttplocationhttpmethod.go @@ -188,6 +188,10 @@ type RadarHTTPLocationHTTPMethodGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPLocationHTTPMethodGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocationhttpmethod_test.go b/radarhttplocationhttpmethod_test.go index 5b46508aea0..be564327a43 100644 --- a/radarhttplocationhttpmethod_test.go +++ b/radarhttplocationhttpmethod_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPLocationHTTPMethodGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPLocationHTTPMethodGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPMethodGetParamsBotClass{cloudflare.RadarHTTPLocationHTTPMethodGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationHTTPMethodGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPMethodGetParamsDateRange{cloudflare.RadarHTTPLocationHTTPMethodGetParamsDateRange1d, cloudflare.RadarHTTPLocationHTTPMethodGetParamsDateRange2d, cloudflare.RadarHTTPLocationHTTPMethodGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocationhttpprotocol.go b/radarhttplocationhttpprotocol.go index 20c82eebcb5..c0ed79a0585 100644 --- a/radarhttplocationhttpprotocol.go +++ b/radarhttplocationhttpprotocol.go @@ -188,6 +188,10 @@ type RadarHTTPLocationHTTPProtocolGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPLocationHTTPProtocolGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocationhttpprotocol_test.go b/radarhttplocationhttpprotocol_test.go index c3ecdee0e95..df8f8844042 100644 --- a/radarhttplocationhttpprotocol_test.go +++ b/radarhttplocationhttpprotocol_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPLocationHTTPProtocolGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPLocationHTTPProtocolGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPProtocolGetParamsBotClass{cloudflare.RadarHTTPLocationHTTPProtocolGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDateRange{cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDateRange1d, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDateRange2d, cloudflare.RadarHTTPLocationHTTPProtocolGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocationipversion.go b/radarhttplocationipversion.go index 0dedb98948d..933ccfb1700 100644 --- a/radarhttplocationipversion.go +++ b/radarhttplocationipversion.go @@ -188,6 +188,10 @@ type RadarHTTPLocationIPVersionGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPLocationIPVersionGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocationipversion_test.go b/radarhttplocationipversion_test.go index dd86eba68f4..cc61067cee3 100644 --- a/radarhttplocationipversion_test.go +++ b/radarhttplocationipversion_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPLocationIPVersionGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPLocationIPVersionGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPLocationIPVersionGetParamsBotClass{cloudflare.RadarHTTPLocationIPVersionGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationIPVersionGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationIPVersionGetParamsDateRange{cloudflare.RadarHTTPLocationIPVersionGetParamsDateRange1d, cloudflare.RadarHTTPLocationIPVersionGetParamsDateRange2d, cloudflare.RadarHTTPLocationIPVersionGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocationos.go b/radarhttplocationos.go index d4dece21bba..98313451373 100644 --- a/radarhttplocationos.go +++ b/radarhttplocationos.go @@ -187,6 +187,10 @@ type RadarHTTPLocationOSGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPLocationOSGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocationos_test.go b/radarhttplocationos_test.go index 4206909fa50..3188236987f 100644 --- a/radarhttplocationos_test.go +++ b/radarhttplocationos_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPLocationOSGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPLocationOSGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPLocationOSGetParamsBotClass{cloudflare.RadarHTTPLocationOSGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationOSGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationOSGetParamsDateRange{cloudflare.RadarHTTPLocationOSGetParamsDateRange1d, cloudflare.RadarHTTPLocationOSGetParamsDateRange2d, cloudflare.RadarHTTPLocationOSGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttplocationtlsversion.go b/radarhttplocationtlsversion.go index f87f165b98c..d4dd70b151f 100644 --- a/radarhttplocationtlsversion.go +++ b/radarhttplocationtlsversion.go @@ -188,6 +188,10 @@ type RadarHTTPLocationTLSVersionGetParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPLocationTLSVersionGetParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttplocationtlsversion_test.go b/radarhttplocationtlsversion_test.go index 57a67483d4b..bbd70dc4708 100644 --- a/radarhttplocationtlsversion_test.go +++ b/radarhttplocationtlsversion_test.go @@ -36,6 +36,7 @@ func TestRadarHTTPLocationTLSVersionGetWithOptionalParams(t *testing.T) { cloudflare.RadarHTTPLocationTLSVersionGetParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPLocationTLSVersionGetParamsBotClass{cloudflare.RadarHTTPLocationTLSVersionGetParamsBotClassLikelyAutomated, cloudflare.RadarHTTPLocationTLSVersionGetParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPLocationTLSVersionGetParamsDateRange{cloudflare.RadarHTTPLocationTLSVersionGetParamsDateRange1d, cloudflare.RadarHTTPLocationTLSVersionGetParamsDateRange2d, cloudflare.RadarHTTPLocationTLSVersionGetParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttpsummary.go b/radarhttpsummary.go index e4dffeba219..df6ed26690a 100644 --- a/radarhttpsummary.go +++ b/radarhttpsummary.go @@ -1063,6 +1063,10 @@ type RadarHTTPSummaryBotClassParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1209,6 +1213,10 @@ type RadarHTTPSummaryDeviceTypeParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPSummaryDeviceTypeParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1352,6 +1360,10 @@ type RadarHTTPSummaryHTTPProtocolParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPSummaryHTTPProtocolParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1496,6 +1508,10 @@ type RadarHTTPSummaryHTTPVersionParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPSummaryHTTPVersionParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1639,6 +1655,10 @@ type RadarHTTPSummaryIPVersionParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPSummaryIPVersionParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1783,6 +1803,10 @@ type RadarHTTPSummaryOSParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPSummaryOSParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1922,6 +1946,10 @@ type RadarHTTPSummaryTLSVersionParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPSummaryTLSVersionParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttpsummary_test.go b/radarhttpsummary_test.go index 2405f960c0e..60f54ce6b40 100644 --- a/radarhttpsummary_test.go +++ b/radarhttpsummary_test.go @@ -32,6 +32,7 @@ func TestRadarHTTPSummaryBotClassWithOptionalParams(t *testing.T) { ) _, err := client.Radar.HTTP.Summary.BotClass(context.TODO(), cloudflare.RadarHTTPSummaryBotClassParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPSummaryBotClassParamsDateRange{cloudflare.RadarHTTPSummaryBotClassParamsDateRange1d, cloudflare.RadarHTTPSummaryBotClassParamsDateRange2d, cloudflare.RadarHTTPSummaryBotClassParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -73,6 +74,7 @@ func TestRadarHTTPSummaryDeviceTypeWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Summary.DeviceType(context.TODO(), cloudflare.RadarHTTPSummaryDeviceTypeParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPSummaryDeviceTypeParamsBotClass{cloudflare.RadarHTTPSummaryDeviceTypeParamsBotClassLikelyAutomated, cloudflare.RadarHTTPSummaryDeviceTypeParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPSummaryDeviceTypeParamsDateRange{cloudflare.RadarHTTPSummaryDeviceTypeParamsDateRange1d, cloudflare.RadarHTTPSummaryDeviceTypeParamsDateRange2d, cloudflare.RadarHTTPSummaryDeviceTypeParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -113,6 +115,7 @@ func TestRadarHTTPSummaryHTTPProtocolWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Summary.HTTPProtocol(context.TODO(), cloudflare.RadarHTTPSummaryHTTPProtocolParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPProtocolParamsBotClass{cloudflare.RadarHTTPSummaryHTTPProtocolParamsBotClassLikelyAutomated, cloudflare.RadarHTTPSummaryHTTPProtocolParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPProtocolParamsDateRange{cloudflare.RadarHTTPSummaryHTTPProtocolParamsDateRange1d, cloudflare.RadarHTTPSummaryHTTPProtocolParamsDateRange2d, cloudflare.RadarHTTPSummaryHTTPProtocolParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -153,6 +156,7 @@ func TestRadarHTTPSummaryHTTPVersionWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Summary.HTTPVersion(context.TODO(), cloudflare.RadarHTTPSummaryHTTPVersionParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPVersionParamsBotClass{cloudflare.RadarHTTPSummaryHTTPVersionParamsBotClassLikelyAutomated, cloudflare.RadarHTTPSummaryHTTPVersionParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPSummaryHTTPVersionParamsDateRange{cloudflare.RadarHTTPSummaryHTTPVersionParamsDateRange1d, cloudflare.RadarHTTPSummaryHTTPVersionParamsDateRange2d, cloudflare.RadarHTTPSummaryHTTPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -193,6 +197,7 @@ func TestRadarHTTPSummaryIPVersionWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Summary.IPVersion(context.TODO(), cloudflare.RadarHTTPSummaryIPVersionParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPSummaryIPVersionParamsBotClass{cloudflare.RadarHTTPSummaryIPVersionParamsBotClassLikelyAutomated, cloudflare.RadarHTTPSummaryIPVersionParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPSummaryIPVersionParamsDateRange{cloudflare.RadarHTTPSummaryIPVersionParamsDateRange1d, cloudflare.RadarHTTPSummaryIPVersionParamsDateRange2d, cloudflare.RadarHTTPSummaryIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -233,6 +238,7 @@ func TestRadarHTTPSummaryOSWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Summary.OS(context.TODO(), cloudflare.RadarHTTPSummaryOSParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPSummaryOSParamsBotClass{cloudflare.RadarHTTPSummaryOSParamsBotClassLikelyAutomated, cloudflare.RadarHTTPSummaryOSParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPSummaryOSParamsDateRange{cloudflare.RadarHTTPSummaryOSParamsDateRange1d, cloudflare.RadarHTTPSummaryOSParamsDateRange2d, cloudflare.RadarHTTPSummaryOSParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -273,6 +279,7 @@ func TestRadarHTTPSummaryTLSVersionWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Summary.TLSVersion(context.TODO(), cloudflare.RadarHTTPSummaryTLSVersionParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPSummaryTLSVersionParamsBotClass{cloudflare.RadarHTTPSummaryTLSVersionParamsBotClassLikelyAutomated, cloudflare.RadarHTTPSummaryTLSVersionParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPSummaryTLSVersionParamsDateRange{cloudflare.RadarHTTPSummaryTLSVersionParamsDateRange1d, cloudflare.RadarHTTPSummaryTLSVersionParamsDateRange2d, cloudflare.RadarHTTPSummaryTLSVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttptimeseriesgroup.go b/radarhttptimeseriesgroup.go index d7dec9df4a8..8bcafec47c3 100644 --- a/radarhttptimeseriesgroup.go +++ b/radarhttptimeseriesgroup.go @@ -529,6 +529,10 @@ type RadarHTTPTimeseriesGroupBotClassParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -691,6 +695,10 @@ type RadarHTTPTimeseriesGroupBrowserParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupBrowserParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -863,6 +871,10 @@ type RadarHTTPTimeseriesGroupBrowserFamilyParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1032,6 +1044,10 @@ type RadarHTTPTimeseriesGroupDeviceTypeParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupDeviceTypeParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1191,6 +1207,10 @@ type RadarHTTPTimeseriesGroupHTTPProtocolParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1351,6 +1371,10 @@ type RadarHTTPTimeseriesGroupHTTPVersionParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupHTTPVersionParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1510,6 +1534,10 @@ type RadarHTTPTimeseriesGroupIPVersionParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupIPVersionParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1670,6 +1698,10 @@ type RadarHTTPTimeseriesGroupOSParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupOSParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -1825,6 +1857,10 @@ type RadarHTTPTimeseriesGroupTLSVersionParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTimeseriesGroupTLSVersionParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttptimeseriesgroup_test.go b/radarhttptimeseriesgroup_test.go index 0836405a813..bd7d2fdd44e 100644 --- a/radarhttptimeseriesgroup_test.go +++ b/radarhttptimeseriesgroup_test.go @@ -33,6 +33,7 @@ func TestRadarHTTPTimeseriesGroupBotClassWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.TimeseriesGroups.BotClass(context.TODO(), cloudflare.RadarHTTPTimeseriesGroupBotClassParams{ AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupBotClassParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupBotClassParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -75,6 +76,7 @@ func TestRadarHTTPTimeseriesGroupBrowserWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupBrowserParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupBrowserParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -118,6 +120,7 @@ func TestRadarHTTPTimeseriesGroupBrowserFamilyWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupBrowserFamilyParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -160,6 +163,7 @@ func TestRadarHTTPTimeseriesGroupDeviceTypeWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupDeviceTypeParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -201,6 +205,7 @@ func TestRadarHTTPTimeseriesGroupHTTPProtocolWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupHTTPProtocolParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -242,6 +247,7 @@ func TestRadarHTTPTimeseriesGroupHTTPVersionWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupHTTPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -283,6 +289,7 @@ func TestRadarHTTPTimeseriesGroupIPVersionWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupIPVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -324,6 +331,7 @@ func TestRadarHTTPTimeseriesGroupOSWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupOSParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupOSParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupOSParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupOSParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupOSParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupOSParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupOSParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupOSParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -365,6 +373,7 @@ func TestRadarHTTPTimeseriesGroupTLSVersionWithOptionalParams(t *testing.T) { AggInterval: cloudflare.F(cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsBotClass{cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDateRange{cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDateRange1d, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDateRange2d, cloudflare.RadarHTTPTimeseriesGroupTLSVersionParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarhttptop.go b/radarhttptop.go index 9aeb38a404d..edcc3ca6124 100644 --- a/radarhttptop.go +++ b/radarhttptop.go @@ -327,6 +327,10 @@ type RadarHTTPTopBrowserFamiliesParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTopBrowserFamiliesParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -482,6 +486,10 @@ type RadarHTTPTopBrowsersParams struct { // Filter for bot class. Refer to // [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). BotClass param.Field[[]RadarHTTPTopBrowsersParamsBotClass] `query:"botClass"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarhttptop_test.go b/radarhttptop_test.go index be431cb1b99..d465a3a90a8 100644 --- a/radarhttptop_test.go +++ b/radarhttptop_test.go @@ -33,6 +33,7 @@ func TestRadarHTTPTopBrowserFamiliesWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Top.BrowserFamilies(context.TODO(), cloudflare.RadarHTTPTopBrowserFamiliesParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsBotClass{cloudflare.RadarHTTPTopBrowserFamiliesParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTopBrowserFamiliesParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTopBrowserFamiliesParamsDateRange{cloudflare.RadarHTTPTopBrowserFamiliesParamsDateRange1d, cloudflare.RadarHTTPTopBrowserFamiliesParamsDateRange2d, cloudflare.RadarHTTPTopBrowserFamiliesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -75,6 +76,7 @@ func TestRadarHTTPTopBrowsersWithOptionalParams(t *testing.T) { _, err := client.Radar.HTTP.Top.Browsers(context.TODO(), cloudflare.RadarHTTPTopBrowsersParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BotClass: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsBotClass{cloudflare.RadarHTTPTopBrowsersParamsBotClassLikelyAutomated, cloudflare.RadarHTTPTopBrowsersParamsBotClassLikelyHuman}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarHTTPTopBrowsersParamsDateRange{cloudflare.RadarHTTPTopBrowsersParamsDateRange1d, cloudflare.RadarHTTPTopBrowsersParamsDateRange2d, cloudflare.RadarHTTPTopBrowsersParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarnetflow.go b/radarnetflow.go index d88b236727f..e5f7fdf61d6 100644 --- a/radarnetflow.go +++ b/radarnetflow.go @@ -189,6 +189,10 @@ type RadarNetflowTimeseriesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarnetflow_test.go b/radarnetflow_test.go index 3895f2fbc4c..156e7907014 100644 --- a/radarnetflow_test.go +++ b/radarnetflow_test.go @@ -33,6 +33,7 @@ func TestRadarNetflowTimeseriesWithOptionalParams(t *testing.T) { _, err := client.Radar.Netflows.Timeseries(context.TODO(), cloudflare.RadarNetflowTimeseriesParams{ AggInterval: cloudflare.F(cloudflare.RadarNetflowTimeseriesParamsAggInterval1h), ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarNetflowTimeseriesParamsDateRange{cloudflare.RadarNetflowTimeseriesParamsDateRange1d, cloudflare.RadarNetflowTimeseriesParamsDateRange2d, cloudflare.RadarNetflowTimeseriesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarnetflowtop.go b/radarnetflowtop.go index 8841c525969..8f48bd5c308 100644 --- a/radarnetflowtop.go +++ b/radarnetflowtop.go @@ -142,6 +142,10 @@ type RadarNetflowTopAsesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -223,6 +227,10 @@ type RadarNetflowTopLocationsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarnetflowtop_test.go b/radarnetflowtop_test.go index a677bd70462..06e6a197c61 100644 --- a/radarnetflowtop_test.go +++ b/radarnetflowtop_test.go @@ -32,6 +32,7 @@ func TestRadarNetflowTopAsesWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Netflows.Top.Ases(context.TODO(), cloudflare.RadarNetflowTopAsesParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarNetflowTopAsesParamsDateRange{cloudflare.RadarNetflowTopAsesParamsDateRange1d, cloudflare.RadarNetflowTopAsesParamsDateRange2d, cloudflare.RadarNetflowTopAsesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -67,6 +68,7 @@ func TestRadarNetflowTopLocationsWithOptionalParams(t *testing.T) { ) _, err := client.Radar.Netflows.Top.Locations(context.TODO(), cloudflare.RadarNetflowTopLocationsParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarNetflowTopLocationsParamsDateRange{cloudflare.RadarNetflowTopLocationsParamsDateRange1d, cloudflare.RadarNetflowTopLocationsParamsDateRange2d, cloudflare.RadarNetflowTopLocationsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), diff --git a/radarqualityspeed.go b/radarqualityspeed.go index 48abb7cbd2e..21509f3eee8 100644 --- a/radarqualityspeed.go +++ b/radarqualityspeed.go @@ -251,6 +251,10 @@ type RadarQualitySpeedHistogramParams struct { ASN param.Field[[]string] `query:"asn"` // The width for every bucket in the histogram. BucketSize param.Field[int64] `query:"bucketSize"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // Format results are returned in. @@ -315,6 +319,10 @@ type RadarQualitySpeedSummaryParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // Format results are returned in. diff --git a/radarqualityspeed_test.go b/radarqualityspeed_test.go index 6eb255cdd7e..fdfe73875b1 100644 --- a/radarqualityspeed_test.go +++ b/radarqualityspeed_test.go @@ -33,6 +33,7 @@ func TestRadarQualitySpeedHistogramWithOptionalParams(t *testing.T) { _, err := client.Radar.Quality.Speed.Histogram(context.TODO(), cloudflare.RadarQualitySpeedHistogramParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), BucketSize: cloudflare.F(int64(0)), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), Format: cloudflare.F(cloudflare.RadarQualitySpeedHistogramParamsFormatJson), Location: cloudflare.F([]string{"string", "string", "string"}), @@ -65,11 +66,12 @@ func TestRadarQualitySpeedSummaryWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Quality.Speed.Summary(context.TODO(), cloudflare.RadarQualitySpeedSummaryParams{ - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarQualitySpeedSummaryParamsFormatJson), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), + ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + Format: cloudflare.F(cloudflare.RadarQualitySpeedSummaryParamsFormatJson), + Location: cloudflare.F([]string{"string", "string", "string"}), + Name: cloudflare.F([]string{"string", "string", "string"}), }) if err != nil { var apierr *cloudflare.Error diff --git a/radarqualityspeedtop.go b/radarqualityspeedtop.go index bb4d4cdde55..032bedffe99 100644 --- a/radarqualityspeedtop.go +++ b/radarqualityspeedtop.go @@ -357,6 +357,10 @@ type RadarQualitySpeedTopAsesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // Format results are returned in. @@ -428,6 +432,10 @@ type RadarQualitySpeedTopLocationsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // Format results are returned in. diff --git a/radarqualityspeedtop_test.go b/radarqualityspeedtop_test.go index 2364a66b80b..c62a2ee9cd7 100644 --- a/radarqualityspeedtop_test.go +++ b/radarqualityspeedtop_test.go @@ -31,14 +31,15 @@ func TestRadarQualitySpeedTopAsesWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Quality.Speed.Top.Ases(context.TODO(), cloudflare.RadarQualitySpeedTopAsesParams{ - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarQualitySpeedTopAsesParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - OrderBy: cloudflare.F(cloudflare.RadarQualitySpeedTopAsesParamsOrderByBandwidthDownload), - Reverse: cloudflare.F(true), + ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + Format: cloudflare.F(cloudflare.RadarQualitySpeedTopAsesParamsFormatJson), + Limit: cloudflare.F(int64(5)), + Location: cloudflare.F([]string{"string", "string", "string"}), + Name: cloudflare.F([]string{"string", "string", "string"}), + OrderBy: cloudflare.F(cloudflare.RadarQualitySpeedTopAsesParamsOrderByBandwidthDownload), + Reverse: cloudflare.F(true), }) if err != nil { var apierr *cloudflare.Error @@ -66,14 +67,15 @@ func TestRadarQualitySpeedTopLocationsWithOptionalParams(t *testing.T) { option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"), ) _, err := client.Radar.Quality.Speed.Top.Locations(context.TODO(), cloudflare.RadarQualitySpeedTopLocationsParams{ - ASN: cloudflare.F([]string{"string", "string", "string"}), - DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), - Format: cloudflare.F(cloudflare.RadarQualitySpeedTopLocationsParamsFormatJson), - Limit: cloudflare.F(int64(5)), - Location: cloudflare.F([]string{"string", "string", "string"}), - Name: cloudflare.F([]string{"string", "string", "string"}), - OrderBy: cloudflare.F(cloudflare.RadarQualitySpeedTopLocationsParamsOrderByBandwidthDownload), - Reverse: cloudflare.F(true), + ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), + DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), + Format: cloudflare.F(cloudflare.RadarQualitySpeedTopLocationsParamsFormatJson), + Limit: cloudflare.F(int64(5)), + Location: cloudflare.F([]string{"string", "string", "string"}), + Name: cloudflare.F([]string{"string", "string", "string"}), + OrderBy: cloudflare.F(cloudflare.RadarQualitySpeedTopLocationsParamsOrderByBandwidthDownload), + Reverse: cloudflare.F(true), }) if err != nil { var apierr *cloudflare.Error diff --git a/radarverifiedbottop.go b/radarverifiedbottop.go index d0a0a0cc4c3..ec06b5b61c8 100644 --- a/radarverifiedbottop.go +++ b/radarverifiedbottop.go @@ -324,6 +324,10 @@ type RadarVerifiedBotTopBotsParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous @@ -405,6 +409,10 @@ type RadarVerifiedBotTopCategoriesParams struct { // For example, `-174, 3356` excludes results from AS174, but includes results from // AS3356. ASN param.Field[[]string] `query:"asn"` + // Array of comma separated list of continents (alpha-2 continent codes). Start + // with `-` to exclude from results. For example, `-EU,NA` excludes results from + // Europe, but includes results from North America. + Continent param.Field[[]string] `query:"continent"` // End of the date range (inclusive). DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"` // For example, use `7d` and `7dControl` to compare this week with the previous diff --git a/radarverifiedbottop_test.go b/radarverifiedbottop_test.go index 45eeb9f1237..d9beec7c16d 100644 --- a/radarverifiedbottop_test.go +++ b/radarverifiedbottop_test.go @@ -32,6 +32,7 @@ func TestRadarVerifiedBotTopBotsWithOptionalParams(t *testing.T) { ) _, err := client.Radar.VerifiedBots.Top.Bots(context.TODO(), cloudflare.RadarVerifiedBotTopBotsParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarVerifiedBotTopBotsParamsDateRange{cloudflare.RadarVerifiedBotTopBotsParamsDateRange1d, cloudflare.RadarVerifiedBotTopBotsParamsDateRange2d, cloudflare.RadarVerifiedBotTopBotsParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), @@ -67,6 +68,7 @@ func TestRadarVerifiedBotTopCategoriesWithOptionalParams(t *testing.T) { ) _, err := client.Radar.VerifiedBots.Top.Categories(context.TODO(), cloudflare.RadarVerifiedBotTopCategoriesParams{ ASN: cloudflare.F([]string{"string", "string", "string"}), + Continent: cloudflare.F([]string{"string", "string", "string"}), DateEnd: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}), DateRange: cloudflare.F([]cloudflare.RadarVerifiedBotTopCategoriesParamsDateRange{cloudflare.RadarVerifiedBotTopCategoriesParamsDateRange1d, cloudflare.RadarVerifiedBotTopCategoriesParamsDateRange2d, cloudflare.RadarVerifiedBotTopCategoriesParamsDateRange7d}), DateStart: cloudflare.F([]time.Time{time.Now(), time.Now(), time.Now()}),